#development

1 messages Β· Page 28 of 1

dark garnet
#

i tried to seek answers from u, but its ok i got them eventually

icy shadow
#

ah nice

#

yea sorry wasnt checking discord much

dark garnet
#

all g

broken elbow
#

chatgpt makes me feel like these 2 emotes at the same time: 😌 😠

night ice
#

Hey..I have an issue with GSON.... This is a plugin which is developed for another person...

Basically, the issue is with saving an object to JSON with GSON. Its working perfectly fine with in my test server and even my localhosted test server. But when its been used on the clients server GSON is not completing the serialization

Its returning breaking after like this

{"arenaName":"Lush","playerCount":8,"pitPoints":[{"spawnA":{"world":"lobby","x":1.1687046246131196,"y":65.0,"z":0.9998267892427433

while the intended output is something like this https://pastes.dev/n4i3ZhPbHa. Code's relevant to this are

Gson Instance

        GSON_INSTANCE = new GsonBuilder()
                .registerTypeAdapter(Location.class, new LocationSerializer())
                .setPrettyPrinting()
                .create();

Saving part

        FileWriter writer = null;
        try {
            writer = new FileWriter(file);
            Bootstrap.gsonInstance().toJson(this, GladiatorArena.class, writer);
            Bootstrap.instance().getLogger().info("Successfully wrote "+getArenaName()+ " data to "+fileName);
        }catch (Exception e){
            Bootstrap.instance().getLogger().severe("Failed to save file, Arena - "+getArenaName());
            e.printStackTrace();
        }finally {
            if(writer != null){
                try {
                    writer.flush();
                    writer.close();
                } catch (IOException e) {
                    Bootstrap.instance().getLogger().severe("Failed to close the file file, Arena - "+getArenaName());
                    e.printStackTrace();
                }
            }

            Bootstrap.instance().getLogger().info("Save has been completed!");
        }
icy shadow
#

you cant serialize locations with Gson by default

#

it'll stackoverflow bc Location -> World -> a million other references

#

make a custom adapter for Location

dusky harness
#

they did

#

πŸ₯²

icy shadow
#

also please use try-with-resources

icy shadow
night ice
#

This is the console output

icy shadow
#

show the code for GladiatorArena and LocationSerializer

night ice
# icy shadow also please use try-with-resources
        try(FileWriter writer = new FileWriter(Bootstrap.instance().getDataFolder()+ File.separator+"arenas"+ File.separator+fileName)){
            Bootstrap.gsonInstance().toJson(this, GladiatorArena.class, writer);
            Bootstrap.instance().getLogger().info("Succesfully wrote "+getArenaName()+ "data to "+fileName);
        }catch (Exception e){
           
``` This was the the original way. It is working for me and it was working for the client when we tested it on his server...But not anymore
night ice
icy shadow
#

ah

#

you're using CF

#

there is almost certainly some exception being thrown that the future is supressing

#

given that you dont actually need the result, you may as well use the bukkitscheduler instead of CompletableFutures

night ice
icy shadow
#

I would actually put money on that being the issue

#

it happens embarrassingly often

night ice
#

Ig, I did 2 CF's. 1 from the caller method and called saveAsync

CompletableFuture.runAsync(new Runnable() {
            @Override
            public void run() {
               save()
            }
        });

Something like this, So even if the save method errors out. The runAsync wouldn't throw it out

#

Let me give it a try

icy shadow
#

it'll be the same thing even with 1 future

#

they suppress exceptions by design

#

save is throwing an exception yes

night ice
#

Let me check it out with him

night ice
icy shadow
#

classic

#

happens to the best of us

night ice
#

Another doubt regarding the newly found exception

#
Caused by: java.lang.NoSuchMethodError: 'com.google.gson.stream.JsonWriter com.google.gson.stream.JsonWriter.value(float)'

Y does this doesn't throw on my test servers and only throws on his server? Version mismatch?

icy shadow
#

yes

#

almost certainly

#

easy fix is to shade + relocate gson

night ice
icy shadow
#

and shade?

night ice
icy shadow
#

well if not it's pointless to relocate lol

night ice
dusky harness
#

doesn't minecraft include gson already?

mental cypress
#

Ye it does.

night ice
#

to make sure...

night ice
mental cypress
#

Relocating just changes the package it shades under.

night ice
#

instead of gson, i shaded json

mental cypress
#

πŸ˜›

night ice
#

I hate my life 😐

night ice
mental cypress
#

Relocation is the same thing as shading, you just shade it under a different package name.

dusky harness
night ice
icy shadow
#

You can shade without relocating though

icy shadow
#

πŸ€“

dusky harness
#

or at least with gradle

icy shadow
dusky harness
#

why?

icy shadow
#

What is there to relocate if the classes aren't in your jar

dusky harness
#

like lets say craftbukkit had an internal dependency that it relocated

icy shadow
#

I guess technically you could relocate but it would be largely pointless

#

Yeah ig

dusky harness
#

you could use that dependency by relocating your own code

icy shadow
#

That's pretty bad though

dusky harness
#

but im saying that it's probably possible Β―_(ツ)_/Β―

#

idk with maven though

#

since maven says shadedPattern

#

which is either a little misleading or shading is required

mental cypress
#

I prefer the 100 IQ route of just copying and pasting classes from libraries into my own src so I don't need the whole jar.

night ice
mental cypress
#

Oh that was a joke, sorry.

night ice
mental cypress
#

You really shouldn't need to relocate gson unless you're trying to use a method in a newer version of gson that isn't in the version of gson in the server jar.

signal grove
#

you can programmatically detect sarcasm

icy shadow
#

can chatgpt detect it?

night ice
mental cypress
#

πŸ‘

icy shadow
dusky harness
#

you called it an idiot

icy shadow
#

I did

#

because it is

#

"no language or tone that suggests irony or mockery"

#

dumb bot

#

yeah dude it's gonna take our jobs!!

#

i could beat chatgpt in a fight

#

bare knuckle

brittle thunder
#

Nah man, chatgpt would knock you out in 2 rounds, bet

night ice
#

Another matter, Does anyone know any good packet based library for making a player glow... The bukkit impl won't work.. as I may need to glow them for individual players...

mental cypress
#

It'd be really cool to be able to fine tune gpt3 or something like that for Minecraft / HelpChat related things that we could integrate into Barry.

night ice
mental cypress
#

That's ChatGPT

#

GPT3 is different

night ice
dense drift
#

Any idea why gradle cant find any dependencies once I add the java-library plugin and use api()?

river solstice
#

Make AI build minecraft buildings for you? No more paying builders 😎

dense drift
mental cypress
#

I was more so thinking we train it ourselves so we don't have to pay them to.

dusky harness
#

I feel like that'd be very very difficult since you'd have to tell it how minecraft works, how java errors work, how the plugins work, how its configurations work, etc etc etc

#

if you want to use AI

mental cypress
#

I mean GPT3 has a very broad understanding of that.

#

I was more so thinking of training it on how DeluxeMenus works so if people asked a question it could give them config examples, idk.

dusky harness
#

_ _
Pterodactyl for example basically doesn't need a support team anymore because of its autoresponses (which doesn't use AI - or at least it doesn't need an AI)
also can read images iirc (probably using OCR) which is pretty cool

mental cypress
#

Oh?

#

I wonder if there source code for that is in their org

dusky harness
# mental cypress Oh?

yeah it's pretty neat
throw an error in the discord server and like 99% chance they've included an autoresponse

#

super super helpful

#

I've helped server owners by just copying their error messages and putting it in that server lol

mental cypress
#

Ahh so probably just a ton of regex checks?

dusky harness
#

probably even just String#contains would work

icy shadow
#

"AI" is just a bunch of if statements anyway

mental cypress
#

I mean Barry does some of that, but it isn't trained on a lot.

dusky harness
#

@mental cypress it doesn't answer questions
it answers error messages mostly

#

I think

mental cypress
#

Ahh

#

That makes more sense

dusky harness
#

recent example

#

this bot is smart lol

#

πŸ₯²

mental cypress
#

Ahh

dusky harness
#

πŸ’€

#

since it covers like every single issue relating to the panel and wings (wings I think is like the web UI)

#

at least from what I've seen

mental cypress
#

We do have a handful of questions that are typically asked a lot

dusky harness
signal grove
#

i was using flask api a while ago and any error fails preflight response with no headers found

#

but i guess thats a flask problem and not a js problem

dusky harness
#

_ _
I've added a (mostly successful, sort of small though) system in a server where it would remove words like "how", "why", "the", "a", etc and search for keywords

#

it's been a while so I don't remember exactly what I did

#

but it seemed to answer a lot of questions without other people having to answer

#

(And I just got the questions by looking in the chat log and searching for "how", "why", etc)

rugged bane
signal grove
#

training implies a DNN

dusky harness
#

I think Barry just uses if statements

signal grove
#

xD really

dusky harness
#

99% sure yeah

#

for ex its log reading

#

not using an AI is better than using an AI

signal grove
#

oh it's for error checking

#

i see

dusky harness
#

i think it can do a couple other stuff but i dont remember

rugged bane
dusky harness
#

oh Glare if you're still here
suggestion - make it detect leaked plugins

#

πŸ‘

#

and alert in like staff chat

#

unless it already does

#

probably does

#

unless staff examine every log

#

since they've banned people with leaked plugins many times

#

barry probably detects it

vital drum
#

i need help it doesnt load my plugin

signal grove
#

the "bot" is just pings all the staff and they race to come up with an immediate response xD

vital drum
#

i need help it doesnt load my plugin

tight junco
#

that is

#

not descriptive at all

vital drum
#

how can i send plugin?

tight junco
#

well is it a problem with your own plugin or someone elses

vital drum
#

my own

tight junco
#

whats the error in console, there likely is one

dusky harness
#

?help

neat pierBOT
#
FAQ Answer:
Β» Give the helpers some details
Β» Ask suitable questions
Β» Be polite
Β» Wait

Source

vital drum
#

there is no error my plugin is not there

tight junco
#

well there's two possibilities

#
  1. you didnt put the plugin in the plugins folder
  2. there is an error, its at the very top
vital drum
#

i put it in plugin folder

tight junco
#

did you reboot the server

signal grove
#
  1. it's not a jar xD
dusky harness
#

there is always an error if it's a jar file and it's in the plugins folder

tight junco
#

im really just riding the copium that it is a jar

vital drum
#

its a jar

tight junco
#

Then there's an error at the top of your server if you rebooted it and there's a problem with the plugin

signal grove
#

paste the console log?

vital drum
#

ok

signal grove
#

the drive file is locked access

icy shadow
#

its bc the file name starts with a .

#

bukkit doesnt think it's a jar

#

dont do that

vital drum
#

ok

#

if this work

#

that was the mistake

signal grove
#

nice

vital drum
#

thank you

#

someone knowes why that dont work: package listtener;
import Drache.de;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChatEvent;

public class ChatListener implements Listener {

@EventHandler
public void onPlayerChat (PlayerChatEvent event){

    Player player = event.getPlayer();

    de.INSTANCE.sendtoDiscord(player.getDisplayName() + event.getMessage());
}

}

river solstice
#

did you register the listener

#

?codeblocks

neat pierBOT
#
FAQ Answer:

Use codeblocks for formatting code or configuration files:
```<language name>
<your code here>
```

For example:
```yaml
test:

  • β€œhi”
  • β€œthere”
    ```

Produces:

test:
- β€œhi”
- β€œthere”```
dusky harness
#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
β€’ HelpChat Paste - How To Use

dusky harness
#

Send the code of the main class

vital drum
#

i forgot to register im so lost

vital drum
#

how to make an embbenge massage with webhock in java plugin

#

?codeblocks

neat pierBOT
#
FAQ Answer:

Use codeblocks for formatting code or configuration files:
```<language name>
<your code here>
```

For example:
```yaml
test:

  • β€œhi”
  • β€œthere”
    ```

Produces:

test:
- β€œhi”
- β€œthere”```
river solstice
#

Is there a packet for when player clicks a message?

#

We have a chat plugin (close sourced), and you can define some parts of the message clickable, which execute a command, suggests a message, etc.
I want to capture the clicked message part and see which part they clicked on.
(There's no API for this, I checked).

signal grove
#

no

#

the handling of clickEvents are done entirely clientside

#

for chat at least

#

but

#

what you can do, is have a different click event for different parts of the message, for example, each letter

#

then the command will be unique depending on which character was clicked

vital drum
#

how to make an embbenge massage with webhock in java plugin

river solstice
#

what's embbenge and webhock

dense drift
#

embed and webhooks probably

river solstice
#

it's funny how you can go from embed to embbenge

calm loom
#

How would I get an event to message a certain perm on luck perms only with the mewssage

trail burrow
#

would like a little help in reminding me on where I downloaded mvn

vital drum
vital drum
#

no problem

vital drum
#

permisoon

#

permission

calm loom
#

so the role is named tes.ka?

vital drum
#

the permission is named luckperms.test.ka

calm loom
#

so thats the name of the group?

vital drum
#

of the perm

calm loom
#

like how would i make it if i wanted the role to be called ref

vital drum
#

when player??? has permisson luckperms.test.ka and sends measge test then ...

calm loom
#

SORRY

#

TY

dusky harness
#

Huh

spiral prairie
#

@dusky harness is there a way to change the public/priv key of the oracle cloud instance? cause it aint worky anymore

dusky harness
#

Yea

#

Idk how

#

But you can

#

I did it bc i changed my key to no password a while ago

dark garnet
#

github github actions help
this isnt related to mc plugins, but its still development-ish
im trying to run a command from a directory that needs to have a wild card in it
but it just no work!!!! it say no file exist and idk why :(
https://github.com/srnyx/modpack/actions/runs/3783980343/jobs/6432924931

  "cd QOL/1.19.*"
  "../../Tools/backend/packwiz.exe modrinth export"
  "../../Tools/backend/packwiz.exe curseforge export"
  shell: /usr/bin/bash -e {0}
/home/runner/work/_temp/cc4db707-b4e4-4d37-a71c-e73b59948049.sh: line 1: cd QOL/1.19.*: No such file or directory
Error: Process completed with exit code 127.```
lyric gyro
#

alright

trail burrow
#

in Intellij maven-compiler-plugin and are not loading in maven

#
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>16</source>
                    <target>16</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.4.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>``` worked before I had to rebuild my OS
trail burrow
#

figured out what was missing I copied the .m2 folder from old drive

dark garnet
hard wigeon
dusky harness
#

wait what

hard wigeon
#

mhm

dusky harness
#

i thought panel was required and wings was optional

#

well, "optional"

hard wigeon
#

Noo lol

#

without wings you couldn't like... host any servers

#

the panel is just a gateway to interact with wings

#

wings is the file managing API, the console API, etc etc

#

it manages docker

#

and is written in GoLang

dusky harness
#

ohhh did i get it reversed

hard wigeon
#

No, the panel is required too

#

to like... manage the node

#

and stuff

#

and interact with the server

#

all the good stuff

dusky harness
#

wait so what does panel do besides provide a web interface

hard wigeon
#

it manages everything

#

user accounts, servers, nodes, databases, etc etc

#

it ties everything together

dusky harness
#

does wings store that or panel

#

since now I'm thinking that panel is just frontend

hard wigeon
#

wings stores nothing but the docker container

dusky harness
#

huhhhh

#

why don't they just merge it into 1 project

hard wigeon
#

because you can use one panel with many nodes?

#

most hosts don't run their panel on a node

#

they run it in AWS or smth

dusky harness
#

oh I see

#

so you only have 1 panel
but you can have multiple wings?

hard wigeon
#

Yes

dusky harness
#

I see

#

thank you

hard wigeon
#

Most people refer to "wings" as nodes though

dusky harness
#

i had it completely mixed up πŸ₯² πŸ₯²

hard wigeon
#

yup, you sure did πŸ˜‰

#

;p

dusky harness
#

99% sure that won't work

#

but

#

i wanted to reply with an attempt

hard wigeon
#

Ask ChatGPT, that sounds like something it is meant for solving

#

and it sounds like a fun way to mess with ChatGPT lol

dusky harness
dark garnet
#

the last i experience i had with chatgpt was not great... but ill try

dusky harness
#

it's a new skill

#

like googling

hard wigeon
#

Oh make a new conversation

#

and you can ask it nicely not to repeat stuff, or say I already did that, any other ideas?

dark garnet
#

wow it even names the conversation using the ai

hard wigeon
#

it does? wild

mental cypress
#

Yeah that's a recent change

#

And you can now go back and continue older conversations

dark garnet
#

it did something at least

#

i even asked if it could turn QOL/1.19.* into an input variable and it did, flawlessly pog

#

no more human interaction woohoo!!!!!

dark garnet
#

omg barry im sorry please forgive me im so sorry barry please 😭

#

barry please i will spam in all caps all the time so u can always have something to do please please please

neat pierBOT
dark garnet
whole rampart
#

I need to make a kits pvp server on minehut with a discod server and a tebex store /buy will give more info need somone who is willing to vc and i will pay 30 dollars when the server is completed i want something similar to kitscrazy.minehut.gg or kitswars.minehut.gg but it will be a little diffrent please dm if ur intrested

whole rampart
#

what dose tha tmean

bright pier
#

It means you need to ask in that channel. To make a formal request.

#

Make sure you follow the correct format.

dark garnet
#

omg i literally broke chatgpt:

An error occurred. Either the engine you requested does not exist or there was another issue processing your request. If this issue persists please contact us through our help center at help.openai.com.

#

bro it literally cant answer my question how did i break it lol

zenith flare
#

me when chatgpt is literally more helpful and direct than the wiki πŸ˜”

river solstice
#

Well, wikis are meant to be more thorough and informative. You look for the answer yourself. When it comes to CGPT, you ask a question, you get an answer

zenith flare
#

I lied

#

the wiki was much more accurate and informing lol

topaz gust
#

Very neat AI though

somber gale
#

Does Configurate offer an option to retrieve the content of profiles in this example (Preferrably as a own configuration node)?
https://paste.helpch.at/yoxibadubo.yaml

Idk what I could use... Would a getList(ConfigurationNode) already do the trick?

dark garnet
tidal quartz
#

Hello, I'm downloading the DeluxeMenus plugin from the Spigotmc page, but when I start the server, the plugin doesn't create a config folder. Am I doing something wrong?

river solstice
tidal quartz
vital drum
#

i need help my plugin is marked red and send error when i make /pl or use it

proud pebble
#

what does the console say when its attempting to load the plugin?

#

the error stack trace

vital drum
#

ok

proud pebble
#

we cant help if we dont know whats wrong

vital drum
#

i found the mistake

#

i build the plugin on wrong version

ancient ferry
proud pebble
#

tho tbh with you id for loop through the string, use a switch case for each char and then manually set each character of said string

ancient ferry
proud pebble
#

interesting

signal grove
#

is that javascript

proud pebble
#

it is

signal grove
#

are you sure replaceAll returns a value

#

or is it just a mutator function

proud pebble
spiral prairie
#

it returns a value, pretty sure

signal grove
#

ok, and then also are you sure this function is being called xD

proud pebble
#

it functions fine to me, no idea whats wrong with their version of it

#

unless the js engine used for the javascript expansion doesnt allow for replaceAll

signal grove
#

what i mean is

#

im looking at the screenshot there, and it seems like the return value isnt stored or used anywhere

#

displayname();

proud pebble
#

thats the correct format for the js expansion

signal grove
#

im not sure i understand it

proud pebble
#

it was working before i told them to try replaceall instead of just replace

#

also it doesnt solve the issue

mental cypress
#

Oh is this JS Expansion stuff? My bad I didn't see that, you had the right channel in the first place, but I guess sometimes it never hurts to ask here if you don't get a response after awhile. My apologies Heklo πŸ™‚

signal grove
#

hmm, i didnt ask

#

someone else posted it

proud pebble
#

yeah wortyhax did

mental cypress
#

Ope, well apologies to the person who posted it.

#

I did not sleep last night, a little out of it. I'll be on my way now.

signal grove
#

night

proud pebble
#

doesnt replace() and replaceAll() basically just forloop over the entire thing or something

spiral prairie
#

i remember replaceAll having some quirks, i don't remember though

dusky harness
#

Idk about js but in Java, replacrall uses regex while replace doesnt

proud pebble
#

currently if 2 chars of the same type get turned into 1 of the new type
aa,AA,aA,Aa -> α΄€ but it should result in α΄€α΄€

broken elbow
#

well yes

#

because of the +

spiral prairie
#

yup

#

thats probably it

broken elbow
proud pebble
#

it is the +

broken elbow
#

If you want each character to be replaced separately, remove the +

proud pebble
#

ive never used regex before so i was basically useless in this conversation

dusky harness
#

Oh i completely misunderstood the issue

#

Lol

proud pebble
dusky harness
#

I thought that nothing was replacing at all

proud pebble
#

it did replace with replace() but not with replaceAll()

#

wait, replaceAll should be used otherwise itll only replace the first instance of it right

dusky harness
#

No

signal grove
#

yes?

#

replace for first instance right

proud pebble
#

i thought it would but no

dusky harness
#

Oh well at least in Java no

#

Idk about js/nashorn

proud pebble
#

replace() replaces all instances

dusky harness
#

The names are very misleading

proud pebble
#

replaceAll() isnt a function and replace() is what id assume replaceAll() did

#

very weird

#

or atleast replaceAll() doesnt work with the js expansion

dusky harness
#

Js has a separate regex "type"

proud pebble
#

maybe its a web only kinda thing

dusky harness
#

So it doesn't need replaceAll

proud pebble
#

hmm

#

very complicated

#

js in a whole is just complicated, shit that shouldnt work in any other language does

dusky harness
#

Think of replaceAll as replaceRegex

#

Eh

#

Kotlin does something similar

#

String#toRegex

#

Doesn't have a built in type tho

proud pebble
signal grove
#
function test()
{
  var name = "Hekelo"
  .replace("e","3")
  return name;
}

produces:
H3kelo

dusky harness
#

10/10 emoji

proud pebble
signal grove
#

as opposed to what other input

proud pebble
#

i mean the first parameter

#

you can give it a string/char or regex

signal grove
#

oh i understand

proud pebble
#

replaceAll() is probably what would work in the case of a string/char and not regex being used as the thing to be replaced with

signal grove
#

its the g

proud pebble
#

god trying to explain this is hard

signal grove
#

that works nice for me

ancient ferry
dense drift
#

Let me introduce you to the string expansion

dusky harness
#

πŸ’€

dense drift
rocky galleon
#

Hey guys! Im trying to the the sendBlockChange event which is working fine and only the player who it is sending to can see the change block but is it possible to hide the block for that player as well?

lyric gyro
#

sendBlockChange it to air?

#

or what do you mean "hide"?

scenic vapor
rocky galleon
scenic vapor
#

am bit confused πŸ˜„

rocky galleon
#

atm im using vines to allow a player to climb but i want the vines to be invisible

scenic vapor
#

aaaaha

#

well thats not possible

rocky galleon
#

πŸ₯²

scenic vapor
#

u would have to make ur own climbing system

#

using velocity for example

dense drift
#

Does gradle not like when multiple projects define a subprojects { } configuration?
I use it on the main build.gradle to pass the version to the other projects and add some repos (maven central, paper, spigot, etc). Then I have two secondary projects which then contain other sub projects. On these secondary projects I have again a subprojects { } configuration to add more dependencies and repositories.

The structure looks like this:

main build.gradle

project A
 - sub A.1
 - sub A.2
project B
 - sub B.1
 - sub B.2
#

For more context, I create some custom enchants for a customer using multiple plugins (projects A and B) and then each sub projects of these two represent an enchantment

pulsar ferry
#

You should look into the version catalog and convention plugins, it'll change your life

dense drift
#

okay, I will try

rocky galleon
#

player.sendBlockChange(aboveOpp.getLocation(), Material.VINE.createBlockData());
How can i change this to be air with a block tag of climbable

proud pebble
rocky galleon
#

damn :/

rocky galleon
signal grove
#

otherwise people wouldve made cool swim through air plugins

rocky galleon
pulsar ferry
dense drift
#

Thats a tomorrow job

pulsar ferry
dense drift
#

I will bother you dw πŸ˜—

#

So you will have live updates kek

trail burrow
dense drift
#

ClassCastException, pretty straight forward, you are doing a Player cast without checking the sender type first.

zenith flare
#

what they should do is update the wiki to be simply told like chatgpt does, while replacing the old info with latest info

old grotto
#

im working on a 1.17 server plugin and i am trying to trick players game client into seeing another player as if they were in spectator mode (i am doing this so i can remove thier hitbox) ive looked thru protocol lib and only managed to find a game packet that would update a players game mode but not something that could change the player entity data of another player to make them look like a spectator any suggestions on how i can achieve this effect i am intending to use this in pvp zones in combination with scoreboard team visibility to stop bodyblocking

vital drum
#

how i give an item an atriobbut that dont work: AttributeModifier AttackSpeed = new AttributeModifier(UUID.randomUUID(), "generic.attackSpeed", 2, AttributeModifier.Operation.ADD_NUMBER); item.getItemMeta().addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, AttackSpeed);

signal grove
#

then you can see how the game itself handles that, and replicate it

#

can use protocollib to help with that

lyric gyro
vital drum
#

yes

lyric gyro
#

I suggest you can do it with ItemStack.

lyric gyro
vital drum
#

ok thanks

lyric gyro
vital drum
#

ok

#

it works

#

thanks

lyric gyro
vital drum
#

how do i make when the lore of item is Β§4God I than it dont get damge?

lyric gyro
vital drum
#

yes

lyric gyro
# vital drum yes

Want me to do it with the one I gave you above or in a different one?

vital drum
#

above

lyric gyro
# vital drum above

AttributeModifier attackSpeedModifier = new AttributeModifier(UUID.randomUUID(), "generic.attackSpeed", 2, AttributeModifier.Operation.ADD_NUMBER);

ItemMeta meta = item.getItemMeta();
List<String> lore = meta.getLore();

if (lore != null && lore.contains("Β§4God")) {
    meta.setUnbreakable(true);
}

meta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, attackSpeedModifier);
item.setItemMeta(meta);
vital drum
#

this is not working ItemMeta meta = item.getItemMeta(); List<String> lore = meta.getLore(); if (lore != null && lore.contains("Β§4God IΒ§r")) { if(player.getLevel() > 4){ if (player.isSneaking()){ player.launchProjectile(Fireball.class).setDirection(player.getEyeLocation().getDirection()); player.setLevel(player.getLevel() - 5); } } }

lyric gyro
vital drum
#

i have

lyric gyro
vital drum
#

no

lyric gyro
vital drum
#

yeah

#

it has lore Β§4God IΒ§r

lyric gyro
#

You wanted it this way?

vital drum
#

i found mistake i can not have space there : "Β§4God IΒ§r"

lyric gyro
#

if (item.getType() == Material.DIAMOND_SWORD) {
    ItemMeta meta = item.getItemMeta();
    List<String> lore = meta.getLore();
    if (lore != null && lore.contains("Β§4GodIΒ§r")) {
        if (player.getLevel() > 4) {
            if (player.isSneaking()) {
                player.launchProjectile(Fireball.class).setDirection(player.getEyeLocation().getDirection());
                player.setLevel(player.getLevel() - 5);
            } else {
                player.sendMessage("You must be sneaking to use this ability!");
            }
        } else {
            player.sendMessage("You don't have enough level to use this ability!");
        }
    } else {
        player.sendMessage("This item does not have the required lore!");
    }
} else {
    player.sendMessage("This ability can only be used with a diamond sword!");
}
#

This should work better for you.

vital drum
#

ok

warm steppe
lyric gyro
prisma briar
#

no

#

idk what it's called

#

guard clause or something

#

definitely a lot better

spiral prairie
#

yup

#

much more readable

river solstice
#

If you dont have any code below, just do reverse if's

#

With return

spiral prairie
#

yes

river solstice
#

I was once arrow code writer

#

πŸ₯΄

lyric gyro
#

But I still prefer arrow.

river solstice
#

Vertical scroll better than horizontal scroll bruc

spiral prairie
lyric gyro
spiral prairie
#

idk bout yall but i find this cleaner

prisma briar
dense drift
#

Does anyone know how to control MythicMob skills via code? I need to pass some variables and then use them in config

dense drift
#

The skill I want to modify displays a circle of particles, I need to set the range of that circle via code

dense drift
#

do you mean without?

spiral prairie
#

youre never changing it?

vital drum
#

it instant stops gliding : ``` @EventHandler
public void Interact (PlayerInteractEvent event){
Player player = event.getPlayer();
ItemStack item = event.getItem();
ItemMeta meta = item.getItemMeta();
List<String> lore = meta.getLore();
if (lore != null && lore.contains("Β§4God")) {
if (!player.isOnGround()){
player.setGliding(true);
}
}
}

stuck canopy
#
        try {
            for (StructureBlock block : despawnStructure.getBlocks()) {
                String sql = "INSERT INTO DespawnStructures(id, time, world, location, block) VALUES('?, ?, ?, ?, ?');";
                PreparedStatement stmt = connection.prepareStatement(sql);
                stmt.setString(1, despawnStructure.getId());
                stmt.setString(2, despawnStructure.getTime().toString());
                stmt.setString(3, block.getLocation().getWorld().toString());
                stmt.setString(4, block.getLocation().getX() + ", " + block.getLocation().getY() + ", " + block.getLocation().getZ());
                stmt.setString(5, block.getType().toString());
                stmt.execute();
            }
        }catch (SQLException exp) {
            exp.printStackTrace();
        }
    }```
#

why does this not work

icy shadow
#

'?, ?, ?, ?, ?'

#

this is a string

#

?, ?, ?, ?, ? this is multiple parameters

#

what?

vital drum
#

it instant stops gliding : can someone help
@EventHandler
public void Interact (PlayerInteractEvent event){
Player player = event.getPlayer();
ItemStack item = event.getItem();
ItemMeta meta = item.getItemMeta();
List<String> lore = meta.getLore();
if (lore != null && lore.contains("Β§4God")) {
if (!player.isOnGround()){
player.setGliding(true);
}
}
}

icy shadow
vital drum
#

ok

stuck canopy
lyric gyro
elder thunder
#

can someone help me port forward my server every yt vid i see has different settings my carrier is Frontier

bright pier
elder thunder
dense drift
#

Does anyone know how to register custom mythicmobs placeholders that can be used in skills? My mob has a skill that I want to control via code, more specific it spawns some particles in a circle and I need to control its size

lyric gyro
#

I think this is the right syntax.

dense drift
#

I need to know how to register them

lyric gyro
#

That's with the classes. You need one that implements the PlaceholderHook interface, if we are talking about a custom one.

dense drift
#

there's no PlaceholderHook

dense drift
#

That's not what I asked

#

But I figured out something, thanks thumbs_up_parrot

lyric gyro
river solstice
#

hey, I have

build.finalizedBy dependencyCheckAnalyze

dependencyCheckAnalyze is another gradle task from a plugin.

how would I pass parameters to it as if I would run it like
./gradlew dependencyCheckAnalyze --quiet?

spare wasp
#

%player_rank%

#

What i have to download?

dense drift
#

player

spare wasp
#

oh sorry

river solstice
vital drum
#

how do i get particle fly in direction player is facing

river solstice
vital drum
#

with all.spawnParticle

river solstice
vital drum
#

i looked like 2 hours and find only things for 1.13 how?

river solstice
#

just ask chatgpt Β―_(ツ)_/Β―

vital drum
#

ah

river solstice
vital drum
#

thanks

edgy lintel
river solstice
signal grove
#

be careful with chatgpt, its super convenient but it really pumps out garbage code sometimes xD

#

lots of logic errors

vital drum
signal grove
#

if youre using an IDE, you can probably just type in player.particle and look for the tab completes

#

i dont even know the spigot api but i still manage to make plugins by that

vital drum
#

yeah the paricle spawn butnot in player lokking diection

spare wasp
#

M0dii

#

When i type /papi ecloud download player the %player_name% and he dont show my rank

#

Wheres the problem

#

Sorry for bad english

signal grove
#

rather then player name its probably something like display name. not sure

vital drum
#

chatgpd sends code thats not even exists

signal grove
#

or %player_list_name%

spare wasp
#

Noo wait

#

I need to show my rank

#

%player_name%

river solstice
signal grove
#

yes, player_name is definitely just the name, without ranks

spare wasp
#

I need to see ranks

#

%player_rank%

vital drum
#

how do i get particle fly in direction player is facing

spare wasp
#

I tipe /papi ecloud download player and then /papi reload its not working

signal grove
#

it will show how it does in the chat

spare wasp
#

Really?

signal grove
#

probably

#

or how you want in tab with player_list_name

upper jasper
#

Or how do you set ranks

spare wasp
#

Luck pe

#

Rm

upper jasper
#

/papi ecloud download LuckPerms

#

/papi reload

#

%luckperms_prefix%

vital drum
#

wtf is chatgpt sending me

signal grove
#

the luckperms one will probably make more sense

#

or vault placeholders

signal grove
vital drum
river solstice
#

because it might lead to more issues and/or more headache

vital drum
#

M0dii the code just spawns particle

river solstice
#

then make it not just spawn a particle

vital drum
#

wow

#

if i know how

#

i would make it

signal grove
#

i understand

#

direction is normalized

river solstice
#

increase the speed, multiply the vector

signal grove
#

you need to multiply it by a magnitude

vital drum
#

the particle still go in evrery direction

signal grove
#

try this

#
Location playerLocation = player.getLocation();
        Vector direction = playerLocation.getDirection();
        double blockLength = 5;
        double oX = direction.getX() * blockLength;
        double oY = direction.getY() * blockLength;
        double oZ = direction.getZ() * blockLength;
        
        // Im using 1.19 so this might still be ParticleEffect for you
        Particle particle = Particle.FLAME;

        double speed = 0.1;
        int count = 100;
        
        player.spawnParticle(particle, playerLocation, count, oX, oY, oZ, speed);
vital drum
#

its not working

signal grove
#

details?

vital drum
#

the partice fly erverywhere only if i look down its working

signal grove
#

hmm, and what if you look directly 90 degrees north or something

vital drum
signal grove
#

are there particles on the front side of you too

#

or just the back

#

(in the second picture)

vital drum
#

front to

signal grove
#

ok, and then if my assumption is correct, if you look at an angle it really mucks it up

#

yeah ok

#

so the last 3 parameters are actually particle spread

#

which is really annoying because you cant make a line at an angle then

#

maybe im dumb, but i think the only solution is to just spawn thin several particle clusters along the direction vector

vital drum
#

ok

signal grove
#

something like this

#
        Location playerLocation = player.getLocation();
        Vector direction = playerLocation.getDirection();

        // Im using 1.19 so this might still be ParticleEffect for you
        Particle particle = Particle.FLAME;
        int count = 10;
        double blockLength = 5;
        double mag = 0;
        double step = 0.5;
        double thick = 0.2;
        double speed = 0.1;


        while(mag < blockLength)
        {
            double oX = direction.getX() * mag;
            double oY = direction.getY() * mag;
            double oZ = direction.getZ() * mag;
            Location particleLocation = playerLocation.add(oX, oY, oZ);
            player.spawnParticle(particle, particleLocation, count, thick, thick, thick, speed);
            Collection<Entity> nearbyEntities = particleLocation.getWorld().getNearbyEntities(particleLocation, thick, thick, thick);
            if(nearbyEntities.size() > 0) {
                Entity damagedEntity = nearbyEntities.stream().findFirst().get();
                damagedEntity.setFireTicks(100); // I burned it. Do what you want here.
            }
            mag += step;
        }
vital drum
#

i try

#

the speed is to high

signal grove
#

what speed

#

the speed at which the particles spread out, or the speed at which the line is created

vital drum
#

speed wich spread out

signal grove
#

ok you can add speed parameter to the end (just did)

vital drum
#

thats how it works that when other player touches i they get damgee but i dont ge damge

signal grove
#

well you could do raycasting, or you could just add an if statement inside the while loop

#

check if a player is within 0.5 blocks of the particleLocation or something

#

if so, break out of the while loop and apply damage to that player

#

this will stop the beam early too (if thats what you want)

vital drum
#

how i track if an player is within 0.5blocks range

#

like this? Player playerouch = (Player) particleLocation.getNearbyPlayers(0.3);

signal grove
#

well i dont know if nearbyPlayers is a thing, but nearbyEntities sure

#

i modified the method here

vital drum
#

it was auto correct nerbyPlayers

signal grove
#

does it work

#

it seems cool, makes me want to work on a spells plugin or something

vital drum
#

i try wait

#

the particle dont spawn in line

signal grove
#

how do they spawn

vital drum
#

i fixed

#

but he coldown dont work i do wait(100) a end

signal grove
vital drum
#

its not working

signal grove
#

you should not be pausing the thread at all

vital drum
#

ok

signal grove
#

instead, store the last time a player used it in a hashmap

#

then when they try to use it again, check if the current time - the last time >= 100

vital drum
# signal grove then when they try to use it again, check if the current time - the last time >=...

coldown is not working ```Map<Player, Long> cooldowns = new HashMap<>();
int count = 10;
double blockLength = 7;
double mag = 0;
double step = 0.5;
double thick = 0.2;
double speed = 0.006;

                    if (cooldowns.containsKey(player)) {
                        long expirationTime = cooldowns.get(player);
                        if (System.currentTimeMillis() > expirationTime) {
                            while(mag < blockLength)
                            {
                                double oX = direction.getX() * mag;
                                double oY = direction.getY() * mag;
                                double oZ = direction.getZ() * mag;
                                Location particleLocation = playerLocation.add(oX, oY, oZ);
                                all.spawnParticle(particle, particleLocation, count, thick, thick, thick, speed);
                                Collection<Entity> nearbyEntities = particleLocation.getWorld().getNearbyEntities(particleLocation, thick, thick, thick);
                                if(nearbyEntities.size() > 0) {
                                    Entity damagedEntity = nearbyEntities.stream().findFirst().get();
                                    if (!(damagedEntity.getName() == player.getName())){
                                        damagedEntity.setFireTicks(100);
                                    }
                                    // burn
                                    if (damagedEntity instanceof Player){
                                        Player playerdamged = (Player) damagedEntity;
                                        if (!(player.getName() == playerdamged.getName())){
                                            playerdamged.setHealth(playerdamged.getHealth() - 2);
                                        }

                                    }
                                }
                                long cooldownDuration = 2; // the duration of the cooldown in seconds
                                cooldowns.put(player, System.currentTimeMillis() + cooldownDuration * 1000);
                                mag += step;
                            }
                        } else {

                        }
                    }```
signal grove
#

you're defining the hashmap inside this function

#

so every time you call the function, it overwrites the data

#

this should be a global hashmap

vital drum
#

ok

signal grove
#

and the map should be called something besides cooldowns, the name is misleading

vital drum
#

i made it out of the vent metedo but its still not working

signal grove
#

something like lastCastTimes

#

then you can compare it like so

vital drum
#

i found antother mistake the colldown ime was in the while

signal grove
#
long cooldown = 100 * 1000; // 100 seconds
long currentTime = System.currentTimeMillis();
long lastCastTime = lastCastTimes.getOrDefault(player, currentTime - cooldown);
if ( currentTime - lastCastTime >= cooldown) { /* Run the particles */ }
else { player.sendMessage("Still on cooldown"); }
#

something like this

#

are you making this for your server btw?

vital drum
#

the var LasrCastTimes dont exist

#

yes

signal grove
#

yes you need to define it as the hashmap from player to long

#

(globally)

vital drum
#

'get(java.lang.Object)' in 'java.util.Map' cannot be applied to '(org.bukkit.entity.Player, long)'

signal grove
#

getOrDefault, my bad

#

i modified it

proud pebble
#

Dont use Player as the identifier of the map, use the players UUID

#

player.getUniqueID

#

the uuid is a constant, while the player object is not

signal grove
#

youll need to clean it up too, or itl just grow

vital drum
#

the colodwn dont work

signal grove
#

maybe a better idea is just to store a list of players on cooldown, and add a scheduler task in cooldown time to remove them

#

then you dont need to store anything longer

proud pebble
#

the hashmap is the way to go when it comes to storing the cooldown

signal grove
#

but after the cooldown time runs up, there is no need to store that data any longer

proud pebble
#

but more then likely the old value with be written over by the new value when whatever checks for the cooldown adds ot back

#

the only time you would remove the players value from the map is when the player leaves the server

signal grove
#

what i mean is, the hashmap will infinitely grow unless you remove from it

#

ah

#

but then you can bypass cooldown by relogging

proud pebble
#

depends how long the cooldown is

#

you could create a task to remove the value from the map once the cooldown has expired if the player hasnt relogged by then, if they have cancel the task

signal grove
#

why does it matter if theyve relogged, you can just remove the value after the cooldown (with a task)

proud pebble
#

i would assume its wasteful to do so as it would take more resources to remove the value then to just leave it there till a timenwhere you would actually want to remove it when the player leaves completely

#

also having a task to remove the player from the map would add more complexity then needed?

#

lets say you want to add something that reduces the cooldown and its toggleable, ypur method wouldnt work anymore

#

the hashmap is already infinitly growing cause they are using Player instead of UUID

signal grove
#
// GLOBAL
List<UUID> playersOnCooldown = new ArrayList<>();
        
// IN EVENT
UUID uuid = player.getUniqueId();
if(playersOnCooldown.contains(uuid)) 
{ 
    player.sendMessage(" ON COOLDOWN ");
}
else
{
    playersOnCooldown.add(uuid);
    // runLater(playersOnCooldown.remove(uuid), cooldown)
}
#

something like this

proud pebble
signal grove
#

yes thats fine

#

buti see how your point about something reducing cooldown wouldnt work

#

then youd need the hashmap, but i'd still have a task remove it after cooldown

river solstice
#

why not just use a map

#

UUID & last used timestamp

signal grove
#

it's now the current plan too xD

river solstice
#

I don't see an issue

#

you're not going to store more than 1000 values most likely

#

and it can handle it pretty well

#

or most of servers can handle that amount of memory

keen root
#

Hey, can someone help me? I need a skript to get the entity a player is looking at... Not only when the player is near the entity... ( I don't know how to use vectors)

signal grove
#

it's only a couple extra line

lyric gyro
keen root
#

Yes but the entity can be far away of the player

#

Not like an npc

river solstice
proud pebble
#

ive already said exactly that

keen root
proud pebble
#

only time to remove a player from the cooldown map is if they leave the sserver

lyric gyro
signal grove
#

if they leave the server and their cooldown time has already passed

#

in his example he wanted a 100s cooldown

proud pebble
#

actually whats the cooldown even for?

signal grove
#

some sort of spell casting

proud pebble
#

if the player has left but the cooldown hasnt expired then make a task that runs later based on how long the cooldown has left and remove them from the map, if they rejoin just cancel the task

#

that would prevent a player from resetting the cooldown from relogging

signal grove
#

it has the same effect as having a single task, but more convoluted

river solstice
#

for 1000 elements you'd be looking (if not mistaken) at around 0.5 megabytes

proud pebble
#

on newer versions and with this context your more then likely gunna have 100 or less

river solstice
#

worst case scenario, let's say, 1-2 megabytes (depends on the object type, set capacity)

proud pebble
#

since idk many servers where you can fit 100+ players on 1.19.3

lyric gyro
# keen root Even if the entity is away?

It will only return the entity that the player is looking at if the player is looking directly at the entity. If the player is not looking directly at the entity, or if the entity is not within the player's line of sight, the method will return null.

signal grove
#

yeah it will be good without that, as long as the server restarts often. but for me is just a preference

proud pebble
#

lets say you have 100 players, and tehey are all on cooldown, thats 100 tasks which i assume is more resources then just 100 cooldowns in a map and a few tasks for players that have just quit

signal grove
#

okay that works nice with your idea of the task after players quit

river solstice
#

by creating a task you're putting more load on the server
map is O(1), so all your operations take up a linear amount of time
if your list grows to the same amount (1000, which, well, not really plausible), it does more work removing the element

signal grove
#

we have thrown out the list idea i had, in favor of the maps. im in agreement that his idea is best now

#

map with task after the player quits

vivid mango
#

Hello, I am getting this error when using this class.
I converted packages to version 1.16 and have no idea why the server is returning a warn. Thank you in advance for your help
https://gist.github.com/jonahseguin/2c21843806b7c03b42ad
I have changed:

import net.minecraft.server.v1_16_R3.PacketPlayOutScoreboardTeam;```
Error: https://paste.md-5.net/curavijivu.md
lyric gyro
#

Consider trying ScoreboardTeam instead.

vivid mango
#

Okay

#

Just testing it out

vivid mango
lyric gyro
vivid mango
vivid mango
#

Thx!

lyric gyro
#

The changes ^

vivid mango
lyric gyro
vivid mango
lyric gyro
#

You can modify the NametagEdit class.

vivid mango
lyric gyro
river solstice
lyric gyro
dusky harness
#

the gist he provided was by "jonahseguin"

lyric gyro
vivid mango
# lyric gyro The code you provided is yours, right?

The code doesn't belong to me, so I don't know how to modify it, and I came here for help. I sent the source of the code in the first message. I've never dealt with packages, so I don't know how to edit it to make it work on newer versions of the

lyric gyro
#

Am I supposed to just edit the code and pass it over or is it not allowed?

vivid mango
lyric gyro
#

Have any rights?

vivid mango
#

Nope

hoary scarab
#

"You posted this on the internet you lose all rights to it" LMFAO!!!

lyric gyro
vivid mango
#

I'm new to programming and don't know about copyright. I apologize if I misspelled

hoary scarab
#

If code is unlicensed author reserves all rights.

vivid mango
#

So it can't be edited to suit your own needs?

lyric gyro
hoary scarab
#

It can, but you can't claim as your own or repost without authors permission.

lyric gyro
#

I cannot provide you the full code, I can help you understand and do it yourself.

lyric gyro
#

the most you can do with unlicensed code publicly, on github is hit the fork button

lyric gyro
vivid mango
lyric gyro
vivid mango
lyric gyro
# vivid mango I think it's ok

You should also make sure that the class is on the classpath, as this is required for the runtime to be able to find the class and its methods.

#

Idk what else to tell you if I don't see the rest of the code or the IDE.

vivid mango
lyric gyro
lyric gyro
lyric gyro
vivid mango
vivid mango
vivid mango
#

: /

lyric gyro
vivid mango
#

private ScoreboardTeam team;

#

?

lyric gyro
lyric gyro
# vivid mango Okay

You should also create a constructor for the ScoreboardTeam class that takes in a teamName and mode as arguments, and initializes all the properties of the class.

river solstice
river solstice
#

or if github copilot suggests me to use some code (which was written by someone else), then I'm stealing it or is it copilots responsibility?

river solstice
#

if I, theoretically, rewrite an entire class (let's not count package name), which matches with someone elses code 1 to 1, without me knowing it, is it stealing the original authors code?

lyric gyro
#

Am I dump or what!?

#

@river solstice mind giving it a look?

rugged bane
river solstice
#
   public ScoreboardTeam(String name, int mode) {
        handle = new ScoreboardTeam(<where's the name and mode>);
...
river solstice
#

I suppose, if someone goes to someone's repository and copies the entire file, then you could call it 'stealing', but how do you know if someone did or wrote it themselfves

lyric gyro
river solstice
#

then

handle = new net.minecraft.server.v1_16_R3.ScoreboardTeam()

?

lyric gyro
#

Oh wait, gotta update em.

river solstice
#

since you have two classes with same name

rugged bane
vivid mango
#

Maybe there is some other way to change the nametag of player X, so that only player X AND Y see it and others don't?

topaz gust
signal grove
#

so im making a plugin with an inventory that opens when i right click another player, but whenever it opens it fires an InventoryCloseEvent alongside it. The inventory doesn't close, but an inventorycloseevent is fired

#

which (in turn) opens two inventories, closing the first

#

any solutions on how to not fire twice?

dense drift
#

Check the hand on entity interact event

signal grove
#

thanks that will fix it

#

idk why i didnt think

signal grove
#

another issue - im clicking on the top row of my own inventory and this if statement still returns true

#
if (event.getClickedInventory() == event.getView().getTopInventory())
#

it returns false for the bottom 3 rows, and true for the top inventory

#

as it should, but it also returns true for the top row of the bottom inventory

dense drift
#

Objects are compared with equals() not ==

signal grove
#

two different objects that are similar are compared with .equals

#

these should be the same object, with the same memory location right?

lyric gyro
#

it.. what? can you share a screenshot? or at least how large either inventories are etc

signal grove
#

ill gyazo

#

changing to .equals() produced the same result, clicking on the highlighted slot returns true for that if statement

lyric gyro
#

what kind of goofy name is gyazo lol

signal grove
#

idk, its pretty popular though xD

dense drift
#

It cant be the first time you see gyazo lol Emily

lyric gyro
#

I know but i never asked that out loud

dense drift
#

True

signal grove
#

japanese

dense drift
#

Gyazo is a word play based on the japanese word for image: gazo ( 画像 ) To translate to English, Gyazo means basically imagey or imagies .

signal grove
#

imagies xD

#

okso

#

it actually returns true for the first 5 slots of the bottom inventory

#

but not the last 3. (the slots circled in red return true)

lyric gyro
signal grove
#

no idea mate, ive also tried some other hacky thing i found which is checking if slot == rawslot

#

which produces the same weird result that i have in the picture (top inv + first 5 of bottom)

lyric gyro
#

huh

#

I think

#

sometimes

lyric gyro
#

I can't reproduce that at all, it's giving me the right results

signal grove
#

server and plugin are both 1.19.3 spigot

#

let me double check to see if im doing something dumb

#
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event)
    {
        Inventory inventory = event.getInventory();
        Player thief = (Player) event.getWhoClicked();

        // If pickpocketing and on top slot.
        if (event.getView().getTitle().equals(PICK_POCKET_TITLE) 
            && event.getClickedInventory().equals(event.getView().getTopInventory()))
        {
            System.out.println("CLICKED ON TOP INVENTORY. SLOT=" + event.getSlot() + ", RAWSLOT=" + event.getRawSlot());
            // ... Do other stuff
        }
#
[17:08:39] [Server thread/INFO]: CLICKED ON TOP INVENTORY. SLOT=40, RAWSLOT=40
[17:08:44] [Server thread/INFO]: CLICKED ON TOP INVENTORY. SLOT=39, RAWSLOT=39
[17:08:45] [Server thread/INFO]: CLICKED ON TOP INVENTORY. SLOT=38, RAWSLOT=38
[17:08:46] [Server thread/INFO]: CLICKED ON TOP INVENTORY. SLOT=37, RAWSLOT=37
[17:08:47] [Server thread/INFO]: CLICKED ON TOP INVENTORY. SLOT=36, RAWSLOT=36
#

server says the 5 slots are 36-40

#

hmm, are you using event.getInventory() or event.getClickedInventory() for the comparison to TopInventory?

lyric gyro
#

clicked

signal grove
#

same as me, strange

#

the same condition too

#

(minus my first one)

lyric gyro
#
logger.info("Slot: {}", event.getSlot());
logger.info("Raw slot: {}", event.getRawSlot());
logger.info("Converted slow: {}", event.getView().convertSlot(event.getRawSlot()));
logger.info("View: {}", event.getView());
logger.info("Clicked inventory: {}", event.getClickedInventory());
logger.info("Inventory from view from raw slot: {}", event.getView().getInventory(event.getRawSlot()));
logger.info("Top inventory: {}", event.getView().getTopInventory());
logger.info("Bottom inventory: {}", event.getView().getBottomInventory());
#

all as expected

signal grove
#

hmm im gonna steal that and see what my results say

lyric gyro
#

those top 5 slots print for CraftInventoryPlayer (as all the other ones from the bottom inventory do) which matches the bottom inventory

#

tested with a 4-row inventory as well which for its own slots prints CraftInventoryCustom which is correct as well

signal grove
#

my top inventory is a PlayerInventory btw

#

maybe that is the difference

dense drift
#

Why is it a player inventory?

signal grove
#

i guess it doesnt need to be

lyric gyro
#

hm

#

that sounds like it could be troublesome

signal grove
#

give me minute, im loading up the server

#

i gotta shut down intellij every time i do or ill run out of memory xD

dense drift
#

Do you not create it with Bukkit.createInventory(size, title) or InventoryType.CHEST?

signal grove
#

i used createInventory with type PlayerInventory with null owner, but ill change it to chest since there's no purpose for that

lyric gyro
#

that sucks

signal grove
#

^ πŸ™

lyric gyro
#

we know nothing about deluxe menus

#

this is for plugin development support

lyric gyro
#

those are the support channels

signal grove
#
[17:29:54] [Server thread/INFO]: Slot: {}39
[17:29:54] [Server thread/INFO]: Raw slot: 39
[17:29:54] [Server thread/INFO]: Converted slow: 39
[17:29:54] [Server thread/INFO]: View: org.bukkit.craftbukkit.v1_19_R2.inventory.CraftContainer$1@7b8c6f79
[17:29:54] [Server thread/INFO]: Clicked inventory: org.bukkit.craftbukkit.v1_19_R2.inventory.CraftInventoryCustom@23478157
[17:29:54] [Server thread/INFO]: Inventory from view from raw slot: org.bukkit.craftbukkit.v1_19_R2.inventory.CraftInventoryCustom@23478157
[17:29:54] [Server thread/INFO]: Top inventory: org.bukkit.craftbukkit.v1_19_R2.inventory.CraftInventoryCustom@23478157
[17:29:54] [Server thread/INFO]: Bottom inventory: org.bukkit.craftbukkit.v1_19_R2.inventory.CraftInventoryPlayer@5419df2
[17:29:54] [Server thread/INFO]: === PASSED CONDITION ===
[17:29:54] [Server thread/INFO]:

Clicking on the top of my bottom inventory, the pointer is the same as the top memory. strange, im guessing it's just a problem because i used PlayerInventory, and im loading up a new version with Chest now

lyric gyro
#

Yeah it treats custom inventories (custom as in created from createInventory) with InventoryType.PLAYER as inventories with 4 rows (36 slots), but for checking the clicked inventory it checks that the number of the raw slot clicked is lower than the size of the top inventory, and since the actual size of a PLAYER inventory is 41 (36 + 5 crafting slots) it yields true for those 5 slots

#

This is the dumbest shit ever

#

everything bukkit

signal grove
#

xD

#

thanks everyone it works now

#

ive not worked with inventory guis before

river solstice
#

Use a library 😎

signal grove
#

my purposes for it were very simple, so i dont need much overhead

#

just one inv full of glass is all i needed

proud pebble
#

you dont have to specify an inventory type

signal grove
#

yeah i ended up not, because i need 36 slots and when i use PlayerInventory or Chest is just gives me 27

#

so now i just use size 36

dark garnet
lyric gyro
#

dang

dark garnet
#

anyone know how helpchat got the nicer looking javadoc website?

#

spigot has it too apparently

icy shadow
#

nicer?

#

oh

#
  tasks.javadoc {
        val options = options as StandardJavadocDocletOptions
        if (JavaVersion.current().isJava9Compatible) {
            options.addBooleanOption("html5", true)
        }
}
lyric gyro
#

lol

#

Java 19+ javadoc are nicerer 😌

pulsar ferry
#

I'm glad they are improving it

lyric gyro
#

I think it's 18, not 19 actually

#

yep

dusky harness
#

What nicer version?

#

Looks the same to me

#

Or do you mean compared to the one like 10 years ago

spiral prairie
#

i just use dokka

#

even when doing java projects kek

#

its just so much nicer

pulsar ferry
#

Dokka is really nice, you can customize everything about it

spiral prairie
#

yup

#

and it just looks awesome

#

i would love searching spigot fabric docs with dark mode

lyric gyro
# dusky harness What nicer version?

Search page, improved search system, dedicated/proper code blocks (code snippets) with a copy button, copy link buttons on methods, fields etc and description sections

#

Lots of tiny subtle things that make the experience much nicer

dusky harness
#

ah i just looked at the general design

#

wait

lyric gyro
#

The overall design hasn't really changed since like, java 7?

dusky harness
#

wheres copy button?

lyric gyro
#

except that they added a search thingy in java 9 and make use of html 5 but you don't see that last part

lyric gyro
dusky harness
#

oh wait im looking in outdated docs

#

wait yeah you said code snippets with copy button

lyric gyro
#

yes

dusky harness
lyric gyro
#

17

dusky harness
lyric gyro
#

that is not a code snippet

dusky harness
#

oh lol

lyric gyro
#

that's the old way of showing code

dusky harness
#

whats a code snippet?

#

ohhh

#

is that the regular html <code>

dusky harness
#

and code snippet is something different

dusky harness
#

oh looks better
wheres copy button tho

lyric gyro
#

on the right

dusky harness
#

ohh my extension was covering it

#

pretty neat

lyric gyro
#

I really like that you can directly copy a link to methods/fields on the full description to it

dusky harness
#

yeah I've also seen that on some other docs too

#

non-javadocs

lyric gyro
#

before this you had to copy it from the method listing

spiral prairie
#

they still look like dogshit, sorry