#help-development

1 messages · Page 419 of 1

ivory sleet
#

Ofc lol

buoyant viper
#

do Sets just store their data willynilly then?

young knoll
#

For example a hash set is backed by a hashmap, and hashmap aren’t ordered

lost matrix
#

A set could look like this
(1, 3, 2)
Then you remove '2' and add '2' and it could look like this
(2, 3, 1)

brave sparrow
#

Sets have no guaranteed order

ivory sleet
#

AsynchronousSynchronousNonBlockingBlockingCollectionQueueSet (:

brave sparrow
#

Some of them may have an order due to implementation but they are not guaranteed to do so

young knoll
#

You can technically be really janky and access by index though like

buoyant viper
#

java.util.HashList when? /j

young knoll
#

toArray or an iterator

brave sparrow
young knoll
#

But there is no guarantee as to what’ll happen if you do

brave sparrow
#

If it has an order then the hash does nothing

sullen marlin
buoyant viper
#

no duplicates AbsoluteHalal

buoyant viper
worldly ingot
#

I was gonna say. LinkedHashSet would like a word lol

brave sparrow
#

Yeah that’s a thing lol

#

I thought you meant on top of that

keen horizon
#

how do i make something only happen when shifting

lost matrix
#

Sets are per definition unordered. Some have an order because of their implementation
but this has to be explicitly stated.

brave sparrow
#

^

brave sparrow
keen horizon
#

how

brave sparrow
#

Player#isSneaking

buoyant viper
#

thank u for reiterating what alex said a solid 2 minutes ago

lost matrix
lost matrix
worldly ingot
keen horizon
buoyant viper
#

its not

brave sparrow
keen horizon
#

no

brave sparrow
#

?learnjava

undone axleBOT
buoyant viper
#

then that's why its gibberish

brave sparrow
#

Gonna have to learn the language before you can program a plugin in it

keen horizon
#

ye ik i just want this one thing done so me and my friend can play

chrome beacon
#

?services

undone axleBOT
worldly ingot
#

you can be sneaking without holding shift

buoyant viper
#

yeah, i sneak with Left Alt

brave sparrow
worldly ingot
#

😄

keen horizon
#

i meant sneaking

brave sparrow
#

anyone who doesn’t have sneak bound to shift is a dirty savage though

buoyant viper
#

i sprint with shift

buoyant viper
#

like what most games do

brave sparrow
#

I reiterate

#

Dirty savage

buoyant viper
brave sparrow
#

You either need to learn or find someone to do it for you

worldly ingot
#

Well no I more meant that you don't have to be holding the key to be sneaking 😛

lost matrix
#

"Mum drive me to the mall"

tardy delta
#

better didnt say that

lost matrix
#

Does you mum know how to code?

keen horizon
worldly ingot
#

Say you're under a half slab

#

& the server doesn't know what buttons you're holding

young knoll
#

Heck yeah, choco learn assembly for me

brave sparrow
#

That sounds like dirty 1.9+ behavior

tardy delta
#

is there a reason stuff isnt immutable, ive seen the same thing on minestom and im wondering why

young knoll
#

What does the server think if you are forced into the crawling state

#

Does it consider you swimming or gliding

keen horizon
worldly ingot
young knoll
#

It was worth a try

brave sparrow
remote swallow
keen horizon
#

do u not know how?

brave sparrow
lost matrix
young knoll
#

Dynamic recipe outputs

brave sparrow
keen horizon
tardy delta
#

im wondering what for, cuz does changing it have to resend the update recipes packet?

worldly ingot
#

I'm trying to win on technicality here lol

brave sparrow
worldly ingot
#

Terminology

worldly ingot
#

EXACTLY

tardy delta
#

i could probably just have an abstract getResult method instead of having a common field which isnt used anyways when overriding it 🤓

keen horizon
#

can anyone here do some simple codingfor me pls its not a lot its just checking if they sneakin to do the thing in the plugin

tardy delta
#

?services

undone axleBOT
remote swallow
#

?services

undone axleBOT
tardy delta
#

mf

#

hehe i found my sources to steal borrow code from uwu

worldly ingot
#

I mean... I wouldn't necessarily recommend basing your stuff on CB

#

The CraftInventory stuff is scary

tardy delta
#

just need some impl details

young knoll
worldly ingot
#

The impl details are a little sketch too as Minecraft has evolved. null vs AIR constants in 1.14 for instance

young knoll
#

When do we get a PDCRecipeChoice?

remote swallow
#

what would that even be

buoyant viper
tardy delta
#

we have air returning on minestom uwu

young knoll
#

The pdc of the ingredient and the item you’re using have to match

tardy delta
#

kinda weird to do Arrays.fill(stacks, Material.AIR)

remote swallow
#

how would minecraft render that

young knoll
#

Well, more specially a single key must match

brave sparrow
#

I remember having to do a binary search in ARM for homework, such a PITA

young knoll
#

But I mean, is ExactChoice shown any differently from just a regular material?

remote swallow
#

dont think so

#

i think if you had pdc, you would need to also pass a List materials

#

so cb could tell the server what to render

young knoll
#

The recipe book just renders a ghost of an item, right?

tardy delta
#

who thought it was a good idea to only have light mode on stash

young knoll
#

Not the tooltips or anything

tardy delta
#

cmon man its 1 am

remote swallow
#

ratio?

young knoll
#

Not everyone uses dark reader

#

Or whatever it’s called

remote swallow
#

well

#

they should

remote swallow
#

we need a stonecutter api update

#

@worldly ingot when

young knoll
#

What would it do

tardy delta
#

what api

worldly ingot
#

For?

#

Stonecutters are kinda featureless on the server side

remote swallow
#

specify the stone cutting options of an item

young knoll
#

You can already add recipes to it I believe

#

And it has a single slot

buoyant viper
#

woodchopper block when?

worldly ingot
#

Yeah that's done via addRecipe() iirc

remote swallow
#

ah

tardy delta
#

messed up stonecutter

worldly ingot
#

I think we have a StonecutterRecipe?

young knoll
#

Yeah stonecutters are just a crafting table basically

tardy delta
#

yas sir

young knoll
#

But with a fancy UI and the ability to castrate you

tardy delta
#

im kinda triggered to abstract away stuff today

#

while i shouldnt

buoyant viper
young knoll
#

Minecraft gender reassignment surgery plugin

buoyant viper
#

minecraft BOOBS plugin

remote swallow
tardy delta
#

its 2023 man

young knoll
#

No that’s the less demonic version of a furby

#

Well, debatably

tardy delta
#

im probably making some stupid decisions now which i'll regret later

#

uh oh craftbukkit doesnt have the group field in the recipe class either :(

#

am i the only one waiting for c++ style default args in java?

young knoll
#

I doubt it’ll happen

tardy delta
#

same

young knoll
#

Java just uses overloading for the sameish result

tardy delta
#

but atleast we got string interpolation now

young knoll
#

Do we?

tardy delta
#

or whatever its called

#

probably going to be implemented

#

well i hope so

young knoll
#

Nice

#

That’s a feature I miss from C#

tardy delta
#

all the companies i went are using c# lol

#

🥹

young knoll
buoyant viper
young knoll
#

Looks like we’ll have it in preview soon

tardy delta
#

what does that one do? ive seen so many pattern matching for switch previews

young knoll
#

static String formatterPatternSwitch(Object obj) {
    return switch (obj) {
        case Integer i -> String.format("int %d", i);
        case Long l    -> String.format("long %d", l);
        case Double d  -> String.format("double %f", d);
        case String s  -> String.format("String %s", s);
        default        -> obj.toString();
    };
}
remote swallow
#

is that not in 21 preview

#

bc 21 dev builds are out

tardy delta
#

i have that in java 17 preview afaik

young knoll
#

It’s gone through 4 previews

#

17,18,19,20

remote swallow
#

and 21 is lts so we might be getting a java update in 1.20 or 1.21

tardy delta
#

i also remember that "when" thing

#

i dont wanne be the one implementing it

young knoll
#

Stuff being in preview 700 times is pain

#

:(

young knoll
tardy delta
#

go visit conclure

remote swallow
#

yeah

tardy delta
#

or is that another country

remote swallow
#

both are sweden

tardy delta
#

i better go to sleep bruh

#

before i throw my pc out of the windows cuz some dude sealed his interface i was planning to use

young knoll
#

I mean idk if Mojang will have any reason to push java forward even more

remote swallow
#

latest support

young knoll
#

Most companies don’t bother

remote swallow
#

were on 17 atm arent we?

young knoll
#

Yes but I assume they wanted something from 16

remote swallow
#

17 is supported until 2026 and extended supoprt til 2029

young knoll
#

Most companies don’t see the new features being worth the effort

remote swallow
#

so are we jumping to next lts in 2026 or 2029

young knoll
#

Granted, for Mojang they don’t have to update a bunch of live software

#

So it’s somewhat different

hazy parrot
acoustic falcon
#

Hi i have a question about hikariCP what is the best way to get the connection in a Dao for example? if you need more explaining let me know!

vocal cloud
#

In a decentralized autonomous organization?

acoustic falcon
#

actualy doesn't matter where you get it

hazy parrot
#

TIL this is called dao pattern lol

subtle light
#

aynone know the name of the plun that when you get hit out of spawn area you cant run back in and it stopps u

vocal cloud
#

Yeah, it's a very complicated method of doing things. I find that kind of pattern is only useful if I'm scaling a large application

hazy parrot
#

that impression i got from fast look over that page

vocal cloud
#

Correct

#

It's for use with multiple backends and such

#

Useful for decoupling

acoustic falcon
real shuttle
#

anyone got experience with spawners in servers

static ingot
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

real shuttle
#

well i cant get wither-skeleton, iron-golem, cave-spider spawners to work they are just pig spawners when you place them have tried mineable spawners plugin and slik spawners all other spawners work just the ones with two words

echo basalt
tender shard
weak meteor
#

Someone can explainme how to differentiate inventories in inventoryview.gettopinventory()?

#

like, yes i know it will get the upper inv

#

but i dont want to make my listener confuse

#

u know?

#

So how its supposed to differentiate x inv from y inv?

tender shard
#

by using == or equals

lost matrix
weak meteor
#

I just need to listen to 3 invs

lost matrix
#

Well then create those 3 invs and check if(clickedInv == yourInv)

weak meteor
#

it doesnt matter if i click in the player inv or in the custom inv lets say a diamond sword will make the samething

#

im actually doing this for verification if (e.getClickedInventory().equals(inventoryView.getTopInventory()))

#

but i know that wont work

#

because will listen to all the upper inv

#

not the one i want

#

there's where my question is

lost matrix
remote swallow
#

that should be an instance of your inventory

lost matrix
# weak meteor there's where my question is

If you want == to be true then you can only create your inventory once
And exactly this inventory needs to be opened by players.
Every time you call Bukkit.createInventory() it will create a completely different
inventory and == wont be true anymore.

weak meteor
#

Hmm

#

this is my code for another listener if (inventory.equals(resultInventory) && player.getOpenInventory().getTopInventory().equals(resultInventory))are you thinking that?

lost matrix
#

No im thinking

if(event.getClickedInventory() == yourCustomInventory) {

}
weak meteor
#

k

#

lemme try

weak meteor
#

hmm

#

thats tricky

#

what i normally will use

#

a github

#

for every project

#

Never tried that

#

Github isnt a bad option tho

analog thicket
#

Onedrive, i think that takes files from your desktop and puts them in there

#

cant remember tho

lost matrix
#

100% use git

weak meteor
#

But youll need to be in the same network, right?

#

Hey, 7smile7

#

Look a this code

remote swallow
#

onedrive is cloud

weak meteor
#
 @EventHandler
    public void onResultadoClose(InventoryCloseEvent event){
        Inventory inventory = event.getInventory();
        Player player = (Player) event.getPlayer();



        // Check if closed inventory is named "Resultado" and is top inventory of player
        if (inventory.equals(enchanterMenu)) {
            if (player.getOpenInventory().getTopInventory().equals(enchanterMenu)){
                UUID playerUUID = player.getUniqueId();

                // Check if the UUID of the player who closed the inventory matches the stored UUID
                if (playerUUID.equals(storedUUID)) {
                    // Drop the item in the player's spot or inventory
                    player.getWorld().dropItem(player.getLocation(), item);
                }
           }
        }
    }````
#

I just wanna drop the item if the player closes the inv

#

but is not work

#

Just use the desktop app

lost matrix
#

First of all. This line of code is useless:

lost matrix
#

Next: Where is this "item" coming from?

weak meteor
#

Just a enchantment thing

#

Yes i know you can enchant with the anvil

#

i just making a favor for a friend

lost matrix
#

So its a field in your class.
Then this wont work. If multiple players have this inventory open
then they will overwrite each others items

weak meteor
#

I thought that

lost matrix
#

Huh?

weak meteor
#

the same thing

#

but uuid cant repeat

#

thats why i use it, just security

lost matrix
#

No what he needs is a proper GUI setup.
He needs to create one separate inventory for every player.

lost matrix
#

Use a GUI library

#

There are plenty out there

weak meteor
#

i thought of that, that should cover that problem?

lost matrix
#

If you want to write your own then follow my tutorial.
You just need to sit down and learn some more java for that.

weak meteor
#

Hmm

#

yes thats right

remote swallow
#

imo if you dont want to use a lib, you want a class that implements Listner, constructor with JavaPlugin to register the listener, Save the inventory to a class variable and check if the inventory is the same

lost matrix
#

Controlling the events is the easy part. Your listener should not be bigger than this:

remote swallow
#

abstract class

weak meteor
lost matrix
remote swallow
#

text + images is better imo

weak meteor
#

Map inventories to their handler

#

this

#

not the image

lost matrix
#

Your key is the vanilla inventory and your value is any implementation of the InventoryHandler interface.

#

This is an example for some implementation

#

You can just follow the tutorial step by step and change what you need to change honestly.

weak meteor
#

Okay

#

Thanks

weak meteor
native gale
#

I already asked this question before, but seems like nobody noticed so I'll ask again. Given that I know for sure that a block at a given Location is a bed, how do I get the Location of the second half of that bed?

#

Some people on the Internet suggest to just check what part of bed it is, and check in all directions where is the another part

#

But this solution would fail 75% times in cases like this

sullen marlin
#

Idk check how vanilla does it

static ingot
#

So just get the block in the direction that the bed part you have is facing

#

assuming both parts face inwards anyway.. i'm not sure if that is really the case. it's still easy to work out either way

wet breach
#

I believe both parts face the same way

#

so you if you get the head part you need to get the opposite direction

#

if I recall

native gale
native gale
static ingot
#

Does TextComponent support line breaks?

rough ibex
#

Try it and see

#

In titles, no

#

The client will display it as [LF]

static ingot
halcyon hemlock
#

hey guys, how do I undo a paste on FAWE(FastAsyncWorldEdit)

drowsy helm
#

with api?

halcyon hemlock
#

yes

#
    public static void pasteSchematic(String schematicName, Location l) {
        File file = new File(getInstance().getDataFolder() + "\\schems\\dungeons\\" + schematicName + ".schem");
        ClipboardFormat format = ClipboardFormats.findByFile(file);
        try (ClipboardReader reader = format.getReader(new FileInputStream(file))) {
            clipboard = reader.read();
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        EditSession editSession = WorldEdit.getInstance().newEditSession(BukkitAdapter.adapt(l.getWorld()));
        try (editSession) {
            // Saves our operation and builds the paste - ready to be completed.
            Operation operation = new ClipboardHolder(clipboard).createPaste(editSession)
                    .to(BlockVector3.at(l.getX(), l.getY(), l.getZ()))
                    .ignoreAirBlocks(true)
                    .build();


            try { // This simply completes our paste and then cleans up.
                Operations.complete(operation);
                editSession.close();
            } catch (WorldEditException e) { // If worldedit generated an exception it will go here
                System.out.println(ChatColor.RED + "OOPS! Something went wrong, please contact an administrator");
                e.printStackTrace();
            }
        }
    }```
#

this is my code to paste a schematic right now

#

I have no clue how to use FAWE/World Edit

drowsy helm
#

editSession has an undo method

#

im not sure if you can undo after you close the session though

halcyon hemlock
#

editSession.undo(editSession)?

drowsy helm
#

yeah

halcyon hemlock
#

could I do something like this?

    public static void undoLastEditSession() {
        EditSession editSession = latestEdits.get(latestEdits.size() - 1);
        EditSession undoSession = WorldEdit.getInstance().newEditSession(editSession.getWorld());
        editSession.undo(undoSession);
    }
drowsy helm
#

the docs fucking suck

#

i found this

halcyon hemlock
#

let me try this

#

ok this works

#

also for the paste method, where does it paste from

#

which x,y,z

drowsy helm
#

if youre using ClipboardHolder theres a .to(x,y,z) method

#

you can append

#

oh you have it in ur code

halcyon hemlock
#

yeah, I think it pastes from where I copied it

#

i will copy it from top right corner so its easier to paste it

halcyon hemlock
#

it works ok

sterile token
#

Okay what the fuck the issue in having, is really stupid. The code is not being executed if i remove a sout(), but if the sout() all the code works pefect

#

🤡

#

Is that even possible? 🤔

remote swallow
#

i saw something like that happen to someone else, the sysout was delaying the follow stuff just enough for it to work

sterile token
azure wedge
#

Hi, noob with java but not with programming at all. I'm used to use VS. Just a simple question: How do i find all available EventHandlers? for example there is a tuto that implements "onJoin" which is when a player joins the server but i can't seem to find that event is called or even more when it's defined. Thanks. PD: using intellij

sterile token
wraith star
#

why does translateAlternateColorCodes suddenly not work

#

like

sterile token
river oracle
#

it doesn't just "not work" so your are doing something incorrectly

wraith star
#
package club.crestmc.neptunediscordlink.util;

import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import org.jetbrains.annotations.NotNull;

public class ChatUtil {

    public static BaseComponent[] translate(@NotNull String text) {
        return new ComponentBuilder(ChatColor.translateAlternateColorCodes('&', text)).create();
    }

}
worldly ingot
#

👏 Don't 👏 use 👏 legacy 👏 symbols 👏 in 👏 components 👏

wraith star
#

wdym

#

what legacy symbol am i using

worldly ingot
#

&f, etc. = legacy

river oracle
wraith star
#

yeah

#

thats not what i came here for

worldly ingot
#

rn you don't

#

No I'm saying don't because you can't

wraith star
#

im pissed off because i spent the past 3 hours trying to fix this error

#

i could literally punch someone right now

river oracle
wraith star
#

where you just send a string?

river oracle
#

ewww

#

he is using paper api

#

nah go ask paper

wraith star
#

i'm using bungeecord

#

for this

river oracle
#

oh then yeah just use the deprecated option

sterile token
# worldly ingot rn you don't

What can cause a code of block not being executed when i remove a system out? Because its happening that on my code, and its really weird

river oracle
#

and supress it

eternal oxide
#

Use String, eff paper, this is Spigot

river oracle
wraith star
#

but what doesnt make sense

eternal oxide
#

ah, then learn bungee 🙂

wraith star
#

is whenever i run the following command it throws an error related to translateAlternateColorCodes ```java
package club.crestmc.neptunediscordlink.commands.defined;

import club.crestmc.neptunediscordlink.NeptuneDiscordLink;
import club.crestmc.neptunediscordlink.commands.CommandBase;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;

public class DumbCommand extends CommandBase {
public DumbCommand(NeptuneDiscordLink plugin) {
super(plugin, "dumb");
}

@Override
public void dispatch(CommandSender sender, String[] args) {
    ProxiedPlayer p = (ProxiedPlayer) sender;
    p.sendMessage("dumb");
}

}

#

its not referenced ANYWHERE

worldly ingot
sterile token
eternal oxide
#

Its usually when you synchronize on two different objects

#

different places in your code

sterile token
azure wedge
eternal oxide
#

one locks the other out

undone axleBOT
sterile token
eternal oxide
#

do you use the synchrnoized keyword anywhere?

azure wedge
wraith star
#

im going to freak the fuck out

#

theres no reason this shouldnt be working

undone axleBOT
river oracle
#

learn java before using spigot

eternal oxide
#

?paste your code then

undone axleBOT
river oracle
sterile token
#

Its really simple what im doing but i cant make it work- haha

eternal oxide
#

and whats the exact issue? I see nothign in there that shoudl be problematic

sterile token
#

Im confused too, because some debug messages are not dispayed and some yes

#

I just invalidated IDE cache, because i thought it was something there can cause this

#

okay the issue is the next, my code acts like the event wasnt distpached

worldly ingot
sterile token
river oracle
eternal oxide
sterile token
eternal oxide
#

should be

sterile token
#

Those are the output while executing, but if you see carefully my arrive data debug (a sout, is not displayed)

#

while its making me think, that the message is not being published

eternal oxide
#

are you doing the send and recieve in the same thread?

sterile token
#

no

#

Im an executor by default in case you dont privde your own

#

So you can have an idea

eternal oxide
#

get client? shoudl you not be using your own pool there?

#

I've not used redis but that looks wrong

sterile token
#

What? You mixed me there with the question

#

Im already using JedisPool if thats your question

eternal oxide
#

yes you shoudl be calling getResource() on your jedis pool

#

from what I'm seeing

sterile token
#

Yes

#

Im doing there on the 2nd picture

#

Inside of try because its auto closed the resource, so then its availabile for next usage

eternal oxide
#

lastly, are you creating a new subscription? or just using one?

sterile token
#

when you initialize the lib, im passing the next params, then interally im subscribing to each serve from the servers you given, plus an extra channel named as: plugin-sync:global, in this case

eternal oxide
#

If you are not renewing your subscriber then I see nothing wrong. You'll probably want to wait for 7smile7 as he's a redis guru

sterile token
#

Now i need to fix the part which allows you to forwards message to a specific server

sterile token
#

Now the messages are received as they want, like if my conditions where insibles 💀

eternal oxide
#

received as they want? Do you mean they are arriving out of order?

quaint mantle
#

hey, i have a problem.

#

The IDE won't highlight syntax.

remote swallow
#

intellij?

quaint mantle
#

probably because the power went out right as I was starting up the IDE, my whole pc had shut off.

eternal oxide
#

clean cache

quaint mantle
#

how?

eternal oxide
#

what IDE?

quaint mantle
#

intellij.

#

what most people use probably.

eternal oxide
#

I use Eclipse 😉

quaint mantle
#

oh.

#

okay.

remote swallow
#

intellij :

file -> invalidate caches

quaint mantle
#

its not working.

river oracle
#

Restart your pc

quaint mantle
#

i just booted up my pc.

river oracle
#

IntelliJ moment

#

VSCode baby 💪

quaint mantle
#

i use vscode for a few other projects in other languages but not java most of the time.

#

i would probably prefer to not have a headache.

#

um

#

how do i fix this, if anyone knows?

eternal oxide
#

I would guess a file corruption

wet breach
quaint mantle
#

somebody might have tripped breaker or something right as i was doing that.

wet breach
#

ok and?

quaint mantle
#

i am so annoyed today.

#

sorry, about that, i just feel kind of stressed out right now.

sterile token
wet breach
#

invest in a power back up unit

quaint mantle
#

ok the IDE syntax highlighting and autocompletions issues seem to be fixed now.

#

that aside though.

#

i am trying to implement an anvil GUI.

#

how do i get the two slots in the anvil for putting items/enchanted books to combine?

eternal oxide
#

slot 0 and 1

quaint mantle
#

thanks.

#

should a PreparedStatment be created in an async thread or is it just okay to create one in the main game thread?

#

not using one, just creating one.

ornate parcel
#

Hey guys! where can i see the tutorial on how to install the plug-in?

buoyant viper
#

you just drag and drop the plugin jar into the servers plugins folder

rough ibex
#

and then restart the server, if it's still running

buoyant viper
#

spigot plugin hotswap when? /j

ornate parcel
#

thanks!🫶🏻

quaint mantle
#

how do i get the contents of the textfield of an anvil GUI?

remote swallow
#

if you have an AnvilInventory it should be getRenameText()

quaint mantle
#

do i just cast it to an AnvilInventory?

#

i tried doing that earlier but it seemed to throw an Exception.

remote swallow
#

you could probably do an instanceof, depends where you need to get the text

quaint mantle
#

this.inventory = (AnvilInventory) Bukkit.createInventory(null, InventoryType.ANVIL, "[Change Name]");

#

is that looking right?

remote swallow
#

just googled some stuff online and for anvil guis you need nms, i found a lib that might work https://github.com/WesJD/AnvilGUI or a class that might also work https://gist.github.com/Scarsz/2524d755fa3e3adddb5dc46890e340f8

GitHub

AnvilGUI is a library to capture user input in Minecraft through an anvil inventory - GitHub - WesJD/AnvilGUI: AnvilGUI is a library to capture user input in Minecraft through an anvil inventory

Gist

Anvil Menu. GitHub Gist: instantly share code, notes, and snippets.

#

the latter is for 1.8 obsfucated nms so idk easy that would be to update

quaint mantle
#

its just a simple GUI, dont really wanna use another library.

icy beacon
#

come on you don't need to reinvent the wheel

#

plus anvilgui is maintained and multiversional

quaint mantle
#

public class RenamingInventoryGUI {

    private AnvilInventory inventory;

    public RenamingInventoryGUI (Chunk chunk) throws Exception {
        this.inventory = (AnvilInventory) Bukkit.createInventory(null, InventoryType.ANVIL, "[Change Name]");
    }
}```
quaint mantle
#

there does not seem to be one for 1.19.3.

remote swallow
#

im pretty sure 1_19_R2 will be 1.19.3

quaint mantle
#

there is also a 1_19_1_R1.

remote swallow
#

nms versioning is weird, just checked the pom and 1_19_R2 should™️ supoprt 1.19.3

quaint mantle
#

could probably be easier if i can just get the AnvilInventory object.

quaint mantle
#

so, um, how do i add it to my project?

remote swallow
#

maven?

quaint mantle
#

yep.

remote swallow
#

add xml <repository> <id>codemc-snapshots</id> <url>https://repo.codemc.io/repository/maven-snapshots/</url> </repository> to the repositories tag and ```xml
<dependency>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId>
<version>1.6.3-SNAPSHOT</version>
</dependency>

quaint mantle
#
<repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>codemc-snapshots</id>
            <url>https://repo.codemc.io/repository/maven-snapshots/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.19.3-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.xerial</groupId>
            <artifactId>sqlite-jdbc</artifactId>
            <version>3.40.0.0</version>
        </dependency>

        <dependency>
            <groupId>net.wesjd</groupId>
            <artifactId>anvilgui</artifactId>
            <version>1.6.3-SNAPSHOT</version>
        </dependency>
    </dependencies>```
#

is this looking right?

remote swallow
#

yep, top right you should see a M with a reload looking button

#

hit that

quaint mantle
#

do i need to do anything else to specify that it is for 1.19.3?

remote swallow
#

shouldnt need to, im guessing it grabs the version from server ver

quaint mantle
#

ok.

#

You should setup some shading for compiled dependencies

#

In order to avoid conflicts

#

um, how do i get these red underlines to go away?

static ingot
#

ye. if you just get the itemmeta and null check it then the compiler warning goes away

quaint mantle
#

i dont really use third-party libraries all the time.

sterile token
#

Also tried moving !hasCustomModel() return; to an if under that one, but same shity warning

static ingot
wet breach
#

depending on what you are doing or how the code is setup, sometimes the IDE can't always tell if something isn't actually null

#

however ide warnings are not compile errors

static ingot
#

yea, the IDE can't tell when it comes to methods like #hasItemMeta

wet breach
#

different things

sterile token
static ingot
#

there's some exceptions tho like Optional#isPresent/isEmpty

sterile token
#

I mean spigot api is weird they use @Nulleable and @urban grotto hen they shouldnt use them, but when you need them to be on they dont exists

static ingot
#

they mark it nullable because it is nullable

#

¯_(ツ)_/¯

sterile token
#

I will try invalidating cache

#

whats the textfrield? Its smth newer?

wet breach
#

I always do null checks on stuff that is outside of my programming

#

because you just never know

#

but the IDE is only so smart

static ingot
quaint mantle
#

uh.

#
new AnvilGUI.Builder()
                .itemLeft(createItem(Material.RED_STAINED_GLASS_PANE, 1, "[Cancel]"))
                .itemOutput(createItem(Material.GREEN_STAINED_GLASS_PANE, 1, "[Proceed]"))
                .onLeftInputClick(player -> {
                    player.closeInventory();
                })
                .interactableSlots(AnvilGUI.Slot.INPUT_LEFT)
                .interactableSlots(AnvilGUI.Slot.OUTPUT)
                .title("[Change Name]")
                .text("")
                .onComplete(completion -> {
                    player.sendMessage(completion.getText());
                    return Arrays.asList(AnvilGUI.ResponseAction.replaceInputText(""));
                })
                .plugin(ChunkClaimsPlugin.getThisPlugin())
                .open(this.player);```
#

how do i prevent the player from taking the item out?

#

and why is the item in the output slot not displaying?

#

also, the textfield is not empty.

#

i might not be able to get it working properly.

quaint mantle
# quaint mantle uh.

Remove interactable slots, those make the player able to interact with them and for so able to take them.

#

If you want to allow the player put the item but not take the modified item, remove the interactableSlots(AnvilGUI.Slot.OUTPUT)

#

Btw, Interactable slots seems to be an array, so instead of calling it multiple times, you can directly put the slots separated by coma

sage patio
#

what i did wrong?

kind hatch
# sage patio what i did wrong?

You're iterating over a list and trying to remove elements from said list while still iterating. Hence the ConcurrentModificationException error.

#

Take a closer look at the lines variable you have and what you are doing with it.

sage patio
#

thanks

regal geyser
#

does this code make sense or is it complicated comparing to its functionality

buoyant viper
# regal geyser

Kotlin, the only language that will still make u use nullsafe indicators when you already make sure its not null, nice.

#

anyways seems fine

buoyant viper
#

could probably make a method like fun giveBow(player: Player) so u dont need to repeat the .addItem code

#

but just nitpicking

regal geyser
buoyant viper
#

yeah instead of copypasting the 2 calls to addItem

#

like a really really really small and unimportant nitpick

regal geyser
#

makes sense

#

ill do it, Thanks xD

rotund ravine
#

Player.giveBow() smh

buoyant viper
rotund ravine
#

Kotlin extension functions nub

buoyant viper
#

true

#

but why limit it to just Kt or Scala?

rotund ravine
#

True

quaint mantle
#

the library might be broken.

#

i just need the text from the anvil GUI textfield, how do i get it?

regal geyser
#

how to fix this

sage patio
#

how i can override a command? (/help)

#

like this?

#

it seems EssentialsX is overriding my command

tawny remnant
#

Yo what do i put there

hazy parrot
#

And it makes sense, because === translates to == in java

remote swallow
#

thats bungee

#

iirc to override you need to register after

sage patio
#

after EssentialsX?

buoyant viper
#

like after ess yeah

remote swallow
#

yeah

sage patio
#

nice, how?

remote swallow
#

scheduler

sage patio
#

waiting for ess to get enabled?

buoyant viper
#

make ur plugin load after essentials ezpz

remote swallow
#

soft depend and/or delay stuff by a few ticks

buoyant viper
#

theres a load-order or load-priority u can set in plugin yml too isnt there

#

xd

eternal oxide
#

depend controls load order, softdepend doesn't

quaint mantle
#

That way if the server doesn't use essentials but other similar, it will still override the /help command

sage patio
#

after registering help in plugin.yml my command overrides Essentials /help command

buoyant viper
#

of course

#

we all collectively overlooked the simple problem

quaint mantle
#

Happens a lot actually

buoyant viper
#

yea

rough drift
#

is there a way to batch spawn particles rather than sending a packet for each when using World#spawnParticle

quaint mantle
hard lion
#

I'm trying to remove an ArmorStand entity using remove() but it doesn't work. I know armorstands are kinda wacky but like...

ArmorStand armorStand = loc.getWorld().spawn(loc, ArmorStand.class);
armorStand.setSilent(true); 
armorStand.setSmall(true);
armorStand.setVisible(false);
armorStand.getEquipment().setHelmet(eye);
mob.setPassenger(armorStand);```


In the event where its vehicle (the mob) dies:
``entity.getPassenger().remove();``
tacit drift
#

get the armorstand from there and remove it that way

hard lion
#

so using for(Armostand ... : entity.getPassengers()) should work?

quaint mantle
tacit drift
#

that's smart too

hard lion
#

it's interesting that it doesn't work only on that specific stand
on other types of them it's fine

quaint mantle
#

Try adding some debug to your code, and see if it's actually being run

quaint mantle
#

?paste

undone axleBOT
quaint mantle
remote swallow
#

your modifying the map while in a loop

quaint mantle
#

can i not do that?

remote swallow
#

need to use an iterator if you need to do stuff to all entries

quaint mantle
#

like this?

for (Map.Entry<String, Integer> entry : cooldowns.entrySet()) {
                if(entry.getValue() > 0) {
                    entry.setValue(entry.getValue()-1);
                }

                if(entry.getValue() <= 0) {
                    cooldowns.remove(entry.getKey());
                }
            }
hazy parrot
#

need to use an iterator if you need to do stuff to all entries

sage patio
#

how i can put this:

ConfigurationSection:
  FieldOne: 50
  FieldTwo: 100
  ...
  FieldSixtyNine: 3450

in this?

HashMap<String, Integer> map = new HashMap<>();
quaint mantle
hazy parrot
sage patio
#

right, thanks

remote swallow
#

can you ConfigurationSection.getValues() and cast the object or use Integer.valueOf

quaint mantle
quaint mantle
#
for (String key : cooldowns.keySet()) {
                cooldowns.replace(key, cooldowns.get(key) - 1);
                if (cooldowns.get(key) <= 0) {
                    cooldowns.remove(key);
                }
            }
quaint mantle
#

alright

errant narwhal
#

hi i need help how to covect CustomNPC extends EntityPlayer class to bukkit Player?

eternal oxide
#

getBukkitEntity() (if you spawned it)

quaint mantle
#

Hi there! Is there any chance someone can guide me through plugin development? I have a great idea and need some direction. I have followed tutorials and all led to errors that could only be diagnosed by someone who has java skills.

#

for the people that still use 1.8:
How on earth do i make items unbreakable on bukkit?

errant narwhal
#

can someone help i want make player summon an entity will have all them item like armor , sword and shield can someone help

#

but when i use "player.getInventory().setContents(p.getInventory().getContents());
player.getInventory().setArmorContents(p.getInventory().getArmorContents());"
an entity not wearing armor just put them into inventory someone help please

patent socket
hazy parrot
#

Use overload which have consumer as arg instead of runnable

patent socket
#

Not runnable

#

Anyways how do I do that?

noble crown
#

hi, does setVisibleByDefault work on players?

undone axleBOT
hazy parrot
#

change it to consumer

#

its void functional interface with no arg, consumer is same but takes one arg

#

and that one arg is BukkitTask

#

which you can cancel

tardy delta
#

kinda sucks that you cant modify a map within the callback of computeIfAbsent

hazy parrot
#

i mean point of computeIfAbsent is to put something if it isn't present

#

how would you modify it

tardy delta
#

i forgot what my usecase was but it was smth with removing data related to eachother

hazy parrot
tardy delta
#

like transitive dependencies within the same map

quaint mantle
#

is there an event for players trading with villagers?

quaint mantle
#

ok.

lost matrix
#

Ugh the spam..

#

?paste

undone axleBOT
lost matrix
# patent socket I'm using scheduler

Using this is now as simple as

  @Override
  public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if (args.length == 0 || args[0].length() > 0 && args[1].length() == 0) {
      sender.sendMessage(ChatColor.RED.toString() + "You need to provide both a selector and text.");
      return false;
    } else {
      if(sender instanceof Player player) {
        UUID ownerId = player.getUniqueId();
        DialogueTask task = new DialogueTask(args[1], ownerId);
        task.runTaskTimer(plugin, task, 4, 4);
      }
    }
    return true;
  }
ivory sleet
#

(I mean still possible, but discouraged)

lost matrix
quaint mantle
#

question, how do i get the location of the merchant from the TradeSelectEvent?

lost matrix
#

After getting the merchant

quaint mantle
#

there is no function like that i found.

lost matrix
#
if(event.getMerchant() instanceof AbstractVillage villager) {
  villager.getLocation();
}
quaint mantle
#

why not just Villager?

lost matrix
#

Because WanderingTrader is also a Merchant

quaint mantle
#

ok.

lost matrix
#

And both are AbstractVillagers

tardy delta
#

loadTag mutates the tags thats why

patent socket
regal geyser
lost matrix
# regal geyser

Dont use lateinit if you are not 101% sure that you are initializing the value at the right time

regal geyser
#

even the lateinit got it form the web

lost matrix
#

Dont use lateinit for now

regal geyser
#

i am using it so i can access the class in another class, got any other way to do that?

quaint mantle
#

it does not seem to be working.

#

how do i prevent players from doing villager trading?

#

what event do i use?

tall dragon
#

you could probably just cancel the PlayerInteractAtEntityEvent so the menu wont pop up

#

not sure tho

quaint mantle
#

probably gonna do that.

#

this chat is kind of dead today or maybe not.

undone axleBOT
regal geyser
#

whats that

lost matrix
lost matrix
#

Look at the link

vital sandal
#

is there anyway to get a player device info ?

#

I seen this in bedrock plugin development so how about java?

quaint mantle
#

might get this to work though.

#

ok it works.

#

is there an event for player killing a mob?

tall dragon
#

i ussually use EntityDamageByEntity for that and check if the mob will die by the damage done in that event

hazy parrot
lost matrix
onyx fjord
#

how do u work with nms in gradle multi module project?

#

im slowly getting tired of it

young knoll
#

Personally I use paperweight userdev

#

hides

onyx fjord
lost matrix
#

for gradle -> same

young knoll
#

Works great for me

onyx fjord
#

do u have any public repo using it

young knoll
#

No

#

?paste

undone axleBOT
young knoll
#

That’s the main build file

#

That’s one of the NMS modules

quaint mantle
#

is there an event for lava spreading or fire spreading?

lost matrix
#

BlockFromToEvent for Lava and BlockIgniteEvent for fire
Second one is a guess

young knoll
#

BlockFromToEvent for lava

#

And yeah BlockIgniteEvent

quaint mantle
quaint mantle
#

i mean fire spread.

#

not fire ignition.

lost matrix
#

If fire spreads then it ignites nearby blocks

quaint mantle
#

hm.

#

ok.

#

another question.

#

does event.getToBlock(); return the block that was there prior to the event occuring or after the event occuring?

onyx fjord
lost matrix
dry beacon
#

is the PlayerTeleportEvent Class triggered before or after the player enters a teleport command?

lost matrix
dry beacon
#

makes perfect sense, could have figured out that one on my own, thank you!

weak meteor
#

Hey @lost matrix i have a question, where should i make all the processes for getting the button lets say and stuff?

#

MainGUI?

#
public class MainGUI implements InventoryHandler{
    @Override
    public void onClick(InventoryClickEvent e) {
        int slot = e.getSlot();
        Player p = (Player) e.getWhoClicked();

    }

    @Override
    public void onOpen(InventoryOpenEvent e) {
        e.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', "&f> &aOpened Anvil GUI"));
    }

    @Override
    public void onClose(InventoryCloseEvent e) {
        e.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', "&f> &cClosed Anvil GUI"));
    }
}
weak meteor
#

ye some guis

#

yesterday he told me my code would bug if multiple players are in the same inv

#

so i did his tutorial but im trying to understand whats going on

sterile token
#

Yes guis are not so easy as they seen to be

weak meteor
#

yep

sterile token
#

Which tutorial?

weak meteor
sterile token
#

Can i get it, because i will in some weeks recode my menu api (which im doing public maybe)

#

So then if you want you can give a try once i recode it

#

Thanks i appreciate it a lot

tribal rivet
#

Hello i am wondering why i am getting a error message in my code "public void onPlayerRightClick(PlayerInteractEvent e) {
Player p = (Player);
Location loc = p.getLocation();

    Player player = e.getPlayer();
    if (e.getAction().isRightClick()) {
        if (!e.getItem().getType().equals(Material.FIRE_CHARGE)){
            {
                p.getWorld().spawnEntity(loc, EntityType.FIREBALL);
            }
        }
    }
}

}"

paper viper
#

Player p = (Player);

#

you didnt cast on anything

tribal rivet
#

Wdym? sorry if im dumb im new to coding

paper viper
#

you dont need it either

sterile token
paper viper
#

just delete that line

tribal rivet
paper viper
tribal rivet
#

because otherwise i get this error:

#

Location loc = p.getLocation();

#

it doesnt understand what p is

sterile token
tribal rivet
#

and i want the p do be player

dry beacon
#

replace Player p = (Player); with Player p = (Player) sender;

oblique falcon
#

some hacking clients are able to detect which potion effects player have. how do they do this?

paper viper
paper viper
#

you dont need a sender

tribal rivet
#

yeah i have done that @dry beacon

#

but it doesnt work

hazy parrot
#

you don't have sender

tribal rivet
#

the sender is in the colour red

static ingot
#

it's an event listener method, there is no sender

dry beacon
#

my bad, didn't see that, yeah, you don't need that since it's not a command ;-;

static ingot
#

use e.getPlayer()

#

You don't need to cast it, so just Player p = e.getPlayer()

tribal rivet
#

so i should replace the p with e

sterile token
static ingot
#

no, e is the name of your event and is already defined

tribal rivet
oblique falcon
hazy parrot
#

?learnjava

undone axleBOT
sterile token
# hazy parrot ?learnjava

What i said from the start - haha, i said not being rude, but if you are new, you should learn java before coding

lost matrix
tribal rivet
oblique falcon
#

some hacking clients are detecting other players potions and showing on screen. how do they do this?

tribal rivet
#

Location loc = p.getLocation(); it eoesnt understnmad what the p means in this statement

torn shuttle
lost matrix
static ingot
tribal rivet
static ingot
#

then do that

hazy parrot
static ingot
#

¯_(ツ)_/¯

tribal rivet
#

sorry

lost matrix
#
  1. Never use single letter variables like "e" or "p"
  2. You really need to learn the very basics first. Do yourself a favour,
hazy parrot
#

Sorry, not trying to be rude, but you don't even know concept of variable

tribal rivet
#

it was my own stupidity

#

thanks

sterile token
lost matrix
sterile token
#

So i have the next channel pattern: <identifier>:global for all servers data and <identifier>:<server> for each server data

lost matrix
#

Show some code of your publisher and subscriber

sterile token
#

right

weak meteor
# lost matrix Sry i dont understand what that means

So yesterday i followed your tutorial for GUis and i wanna rlly understand whats going on for just replicating in another plugin but by myself, so, i wanna understand what class is doing. So i have some questions, you matter if you can solve it to me?

weak meteor
#

So, the classes GUIListener and GUIManager are equal to the forum post, but what are they actually doing more than register and unregister the active inventories?

sterile token
#

This is such a stupid question but i have nightmare. Currently ive been around 4hrs trying to fix this problem

#

Im just trying to implement, that each server doesnt listen to his own published data and also when im sending to a specific server channel, all of the servers receives the data

quaint mantle
#

does anyone know of an easy way to use anvil GUIs?

sterile token
# lost matrix

Where you doing those diagrams? I always want something like that app name

quaint mantle
quaint mantle
#

i just need the textfield.

#

is there no way to get that?

lost matrix
quaint mantle
#

i was using that and you can take the items out.

#

thats not what i want.

lost matrix
#

You cant

quaint mantle
# sterile token Why chat?

If you want to catch an input of the user, you can use the chat, cancel the chat event and read the input

#

i was shift-clicking and i could take the items out.

#

i can show on video.

lost matrix
#

Then you misused the library

#

I have been using this for years and never had any issues

sterile token
quaint mantle
#
new AnvilGUI.Builder()
                .itemLeft(createItem(Material.RED_STAINED_GLASS_PANE, 1, "[Cancel]"))
                .itemRight(createItem(Material.GREEN_STAINED_GLASS_PANE, 1, "[Proceed]"))
                .onLeftInputClick(player -> {
                    player.closeInventory();
                })
                .title("[Change Name]")
                .text("")
                .onComplete(completion -> {
                    player.sendMessage(completion.getText());
                    return Arrays.asList(AnvilGUI.ResponseAction.replaceInputText(""));
                })
                .plugin(ChunkClaimsPlugin.getThisPlugin())
                .open(this.player);```
sterile token
quaint mantle
#

this is what i was doing last time.

#

i was able to shift-click and take the items.

quaint mantle
young knoll
#

Hypixel has entered the chat

quaint mantle
#

how do i use a sign?

#

if anvils won't work.

lost matrix
sterile token
quaint mantle
#

how do i use it?

thorn crypt
#

Yo, how can I make a clickable text in books ?

sterile token
quaint mantle
#

what is the right implementation?

young knoll
#

Spigot doesn’t have api for components in books yet does it

sterile token
lost matrix
#

Which of those items could be retrieved? The left or the right one?

young knoll
quaint mantle
#

wait

#

let me just launch minecraft.

lost matrix
# quaint mantle left.

Delay the close by one tick. I dont think you are allowed to close the Inventory in the click event

young knoll
#

You aren’t

#

Technically

sinful kiln
quaint mantle
#
Bukkit.getScheduler().runTaskLater(ChunkClaimsPlugin.getThisPlugin(), () -> {
                        player.closeInventory();
                    }, 1);```
lost matrix
young knoll
#

Always kind of annoying to delay stuff by a tick

quaint mantle
young knoll
#

Gotta have your plugin instance :/

weak meteor
lost matrix
quaint mantle
#

huh, that seems to have fixed it.

lost matrix
quaint mantle
#

that was a guess?

young knoll
#

You aren’t meant to open an inventory directly in the click event either

quaint mantle
lost matrix
sterile token
#

Smile, something weird is happening, for some stupid reason the data published to global channel is correctly, but when publishing telling the receiver server, the JedisPubSub listener acts like if nothing wasnt received

lost matrix
#

Print out the channel names for pub and sub

quaint mantle
verbal slate
#

Guys, how do I fix tabs in commands? When entering a command, it returns a list of arguments to me, but it is "static". Let's say it returns me a list of the words "apple", "orange", "lemon". And when I start typing "le", the list of hints does not shorten and hangs on the very first option.
In my case, this is a tab at the command /warp, I attach screenshots below

quaint mantle
#

anyway, how do i get the text from the textfield?

#

when the green glass pane is clicked.

sterile token
quaint mantle
#

i just wanna get the text only if the green glass pane is clicked.

#

if that is possible.

verbal slate
lost matrix
young knoll
sterile token
#

I will handle them

young knoll
#

Since it returns a List<String>

lost matrix
# sterile token right, thats true
  public CompletableFuture<Void> something() {
    return CompletableFuture.runAsync(() -> {
      // DO stuff
    }).whenComplete((result, throwable) -> {
      if(throwable != null) {
        throwable.printStackTrace();
      }
    });
  }

Example

sterile token
#

Right i should add to each publisher right?

verbal slate
lost matrix
#

Had too many cases with hidden exceptions 🥲

sterile token
#

okay now yes

#

😡 shity jedis pool

#

Thats causing the issues, its said me that it has the max jedis pool usage that he can use

quaint mantle
#

how did this person do that with the anvil GUI?

lost matrix
quaint mantle
#

but how do i get the text?

#

how do i get this packet?

lost matrix
#

AnvilInventory#getRenameText()

echo basalt
quaint mantle
echo basalt
#

I made my own future class that just delegates to CF but doesn't hide exceptions

#

I call it FancyFuture

quaint mantle
#

i was not able to type cast the inventory object earlier.

echo basalt
#

it also has helper methods like thenSupply(newValue)

young knoll
#

✨Fancy✨Future

echo basalt
#

yea

sterile token
#

CF? Whats that weird slang

echo basalt
#

CF -> CompletableFuture

quaint mantle
#

nvm, i will just use chat probably for text input.

#

i am too tired at this point.

sterile token
#

oh bruh, you must write a book for those type of words, POO, CF, NPE

young knoll
#

ConversationAPI time

#

The api most people don’t even know about

wet breach
#

my favorite

late sonnet
wet breach
#

finally

#

another thing I can point people to 😄

young knoll
#

Tbf I think it’s because it has minimal examples

echo basalt
#

I made my own conversation api

young knoll
#

It took a bit to figure out how to use it

echo basalt
#

I don't like spigot's that much

wet breach
#

my servertutorial plugin uses it

echo basalt
#

it just doesn't vibe with my code style

wet breach
#

and that is what I use to point to people for examples

weak meteor
#

@lost matrix, GUI manager is the one in charge for processing all the events, right?

echo basalt
#

it has like 20 different functions, not just the 2-3 shown in the sample

young knoll
#

Compiled or interpreted?

echo basalt
#

It's like

#

it gets "compiled"

#

well

lost matrix
echo basalt
#

the text line gets converted to an object that looks like this

echo basalt
#

To play, I just have a List<CompiledObjective> and each objective should call incrementStep to play the next queued objective

#

So for example, the wait 50 ticks method just calls incrementStep 50 ticks after

#

It's just something quick that I came up with in like an hour

patent socket
lost matrix
#

wtf

#

Remove that method, (lol !?)

weak meteor
verbal slate
young knoll
#

Don’t pass the same list for both params

lost matrix
young knoll
#

Pass an empty list for one of em

verbal slate
#

oh, okay

lost matrix
# weak meteor Okay

You will always only have 1 listener and 1 manager.
But you will have a lot of different InventoryHandlers (like shown in the diagram)

verbal slate
weak meteor
#

Thanks

#

Finally understood

young knoll
worldly ingot
#

Yeah, pass a new ArrayList instance

#

Maybe give it an initial size if you have it

patent socket
# lost matrix

But now the second task is underlined red in DialogueCommand? task.runTaskTimer(plugin, task, 4, 4);

verbal slate
#

Okay, guys

lost matrix
#

task.runTaskTimer(plugin, 4, 4);

verbal slate
#

It's work! Thank you much

patent socket
patent socket
#

There is none

lost matrix
#

Nope thats not normal. This means you are giving too much time to the plugin

#

config file

lost matrix
#

Are you running paper or spigot?

hushed spindle
#

are there any good methods to sort of benchmark how much bits of code are contributing to overall server lag? right now im just recording the system nanos and comparing it to various places in my code, but this seems to indicate accessing a simple map once takes 0.15ms which seems like a lot for such a simple action so i figured it must be coming from the logging process

lost matrix
#
MaxMillisPerTick: 22.5
AsyncChunkLoadingEnabled: true
HighAsyncPriority: false
hushed spindle
#

spark only shows the classes that are contributing to the lag, but i already know these classes