#help-development

1 messages · Page 767 of 1

devout tartan
#

I don't get it 😦

tender shard
#

crusty

devout tartan
#

Add that plugin as dependency

lost matrix
#

You should not worry about that for now

eternal night
storm crystal
river oracle
#

erm cuz C is lower level functional etc. Want to learn the basics, plus C++ is well C++

lost matrix
#
fn main() {
    let name = "Rust";
    
    match name {
        _ if name == "Rust" => sue_owner(),
        _ => println!("This is mine >:("),
    }
}
lost matrix
#

Writing libraries is way beyond your scope for the moment

devout tartan
meager wolf
#

Hey, im a beginner, and im just learning the basics, in the picture u can see that i made an item and gave it a display name, and then i tried to get that name and print it, but when i do that i get an error in line 24 where i declared my ItemStack and now im confused, did i get that error cause im trying to acess the things in a wrong way or did make a mistake in the declaration

(Im so sorry for the pictures bad quality i cant send screenshots)

https://prnt.sc/Y1Z6oTwx2XYH
https://prnt.sc/76rDPNojhaCT

mighty crane
#

any good replacements for ChatColor.translateAlternateColorCodes('&', message)?

mighty crane
#

how do I do that?

river oracle
#
public String colorDuh(String str) {
  return ChatColor.translateAlternateColorCodes('&', str)
}```
#

boom util method

echo basalt
mighty crane
#

no I mean ChatColor.translateAlternateColorCodes is depricated so what can i use instead

echo basalt
#

spigot

mighty crane
#

?

meager wolf
#

That will take a lot of time

echo basalt
#

mockbukkit moment

#

or just run a server in your IDE

#

and save some time

river oracle
undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

meager wolf
# echo basalt mockbukkit moment

Now idk if thats a tool or ur just saying it and i dont want to google cause if i didnt find it i will get depressed cause i dont understand fun messages

tender shard
mighty crane
#

how do i import in spigot?

echo basalt
#

paper deprecates it

#

go figure

tender shard
mighty crane
#

ohh

#

oof

echo basalt
mighty crane
#

going to the paper server then

echo basalt
#

I'd just recommend making a "test" plugin and server and doing all your tests with it

river oracle
#

wtf C uses arrows instead of dots

#

kms

#

list->tail->next literally cursed

echo basalt
#

this<-name = name

#

iirc

lost matrix
river oracle
#

ahh okay

lost matrix
#

Its (kind of) short for (*list).tail

mighty crane
#

Is LegacyComponentSerializer.legacy('&').serialize(message) a good replacement for ChatColor.translateAlternateColorCodes('&', message)?

river oracle
#

?paper

#

?whereami

mighty crane
#

oh yea sorry

#

keep forgetting

timid hedge
#

Does anyone know where i can download javax.vecmath? i need it for mcp

wet perch
#

Hi, does someone know how to properly use %%USER%% placeholder into my premium resource?

tender shard
#
private String user = "%%__USER__%%";
#

do not make it final

#

it does not get replaced if the field is static final

#

it also does not get replaced if you download your own plugin

timid hedge
wet perch
#

isn't working

wet perch
tender shard
#

yes, it should work for added buyers. unless ofc you use an obfuscator that encrypts strings or anything

tender shard
#

is it a direct .jar or a zip file or sth?

wet perch
#

does the class name affect that somehow?

tender shard
wet perch
#

any possibe fix then?

#

maybe I can try to put that into the main class?

#

yeah, not even in main class works: [HPET] [STDOUT] %%USER%%

scenic onyx
timid hedge
#

Can someone please help me with downloading javax.vecmath? i dont know where i can download it and i need it for my mcp

wet perch
# tender shard no

sorry to bother you, from your experience how did you use that premium placeholder?

dire marsh
wet perch
#

posso supporre dal nome che sei italiano

scenic onyx
dire marsh
#

that check is a joke

scenic onyx
wet perch
#

mi sa che come dicono gli altri è solo uno scherzo

#

anche perchè come giustamente tu pensi non avrebbe altrimenti senso

#

ah ma tutti italiani?

scenic onyx
wet perch
#

allo mi sapete di come porcodio si usa l'USER placeholder nelle risorse premium?

scenic onyx
wet perch
#

How can I use the %%USER%% placeholder into my premium resource?

wet perch
scenic onyx
#

lo vuoi mettere uno a pagamento?

wet perch
scenic onyx
wet perch
#

ma non funziona diocan

scenic onyx
#

cmq non lo so

wet perch
#

vabbò ok

#

Does someone know how to use the spigotmc premium placeholders into my premium plugin?

#

Do I just have to use %%USER%% in a variable and that's it? Because that is not working

storm crystal
#

if I want to access something from main class I shouldnt make an instance and just put it into constructor with this.thing = thing; ? do I get that right?

wet perch
#

if you're in main class you just set the instance in the onEnable into a static instance and make a getter

#

then you just use that to do things

storm crystal
#

could someone with more expertise confirm it?

pseudo hazel
#

making it static is one way

lost matrix
#

?di

undone axleBOT
pseudo hazel
#

another is using dependency injection

lost matrix
#

Making a static getter is the singleton pattern

#

Both are viable

storm crystal
#

so the constructor thing is called dependency injection?

wet perch
#

Do you guys know by any chance how to properly use premium resources placeheolders? Those aren't working for me

inner mulch
#

guys where do i find the hikariCP.jar download?

shy wolf
#

?paste

undone axleBOT
lost matrix
inner mulch
#

i did the maven stuff

#

but the server needs it

lost matrix
wet perch
#

How do I use the premium resources placeholders into my plugin?

lost matrix
inner mulch
storm crystal
#

do I need to use dependency injection for classes other than Main or can I just do instances?

lost matrix
lost matrix
sage patio
#

as always i forgot, was the LOWEST priority the first one to run in the events?

young knoll
#

Yes

sage patio
#

thanks

wet perch
lost matrix
lost matrix
storm crystal
#

when I want to use same instance and when new instances every time

shy wolf
#

bungeecord alert command

wet perch
lost matrix
wet perch
lost matrix
storm crystal
#

I have one more question about using database connections, when I want to assign let's say a value of 100 to player I should check on player join event if he joins for the first time, make connection, assign values and make disconnection? and if I wanted to add another 10 to that 100 via a command I would have to connect, add 10 and disconnect? would that be an efficient procedure to not clog channel?

lost matrix
# wet perch build artifacts, no obfuscation

You could just delete your pom and have the same result.
Meaning you dont use maven at all if you do this. You need to acutally
use maven lifecycles. Go to your right side and open the maven pannel in ij

lost matrix
wet perch
#

I mean SpigotSandbox is the project itself?

lost matrix
storm crystal
wet perch
#

what if I'm using some jar dependencies?

lost matrix
#

Also files can scale decently

storm crystal
lost matrix
#

"dynamically edit it by hand" what do you mean by that?

#

You can store a lot of different things a huge amount of data in Files just fine

storm crystal
#

okay lets say Id like to make file that would keep custom enemies (type, name, custom attributes such as hp, armor, potion effects), so if I wanted to add a new enemy Id just make a new line in file, fill in what's needed and I could use it in for example spawn method that would take wanted parameters from said file

#

would that work?

lost matrix
# storm crystal okay lets say Id like to make file that would keep custom enemies (type, name, c...

I would use the name of the file for your custom entities.
Create a folder custom_mobs and then create a File for those mobs <UUID>.yml or <UUID>.json
Replace the <UUID> with their UUID of course. There are quite a few different approaches like having a folder structure
with your worldname and the coordinates of the chunks which contain the mob files. It all comes down to properly thinking
about a clean file structure.

Just dont put everything into one file. Use folders and file names for a cleaner experience.

storm crystal
#

uuid of what

lost matrix
#

The entity

#

Or did i missunderstand you

storm crystal
#

but wouldnt that mean that

lost matrix
#

Oh i think i misread this

storm crystal
#

if I wanted to spawn 50 peons I'd have 50 unique files

#

even if they all share same attributes

#

like same custom name hp etc.

lost matrix
#

Ok what you are talking about are templates aka configuration files.

storm crystal
#

I want to only read attributes from templates that would be in files

#

yes exactly

lost matrix
#

Those should never be in a database in the first place

#

ever

storm crystal
#

oh really?

#

may I know why?

lost matrix
#

Yes

#

Because it is very user-unfriendly to edit a database compared to editing a file

storm crystal
#

okay

#

and I assume working with files, reading from files is a java thing, not really spigot thing?

lilac dagger
#

there are power users tho

lost matrix
#

The vast majority of users have no idea how to even look into a database, let alone edit values in it

storm crystal
#

you mean php myadmin?

#

or however this thing was called

lost matrix
lost matrix
storm crystal
#

okay

#

so lets say that I want to make custom mob conf file

#

it would look like that?:

mobs:
mob1:
type:
hp:
potion_effects:

and then let's say Id make custom summon command and if I just typed mob1 it would read parameters from conf file and fill spawn method with them (hp, type, potion effects)?

pseudo hazel
#

yes pretty much

storm crystal
#

okay that actually does sound easier

#

can I even use files to make a list of players' currency and dynamically change it via some actions on the server?

young knoll
#

At some point you have to accept that it’s too much to configure via file

#

And then you make the in game config

storm crystal
#

wdym by in game config?

pseudo hazel
#

with like UIs and commands and stuff

#

but thats like level 2

young knoll
#

What’s level 3 then

#

Oh wait

#

Web editor

pseudo hazel
#

exactly

storm crystal
#

I cant really visualize it

pseudo hazel
#

I wanna do a web editor for one of my plugins, but idk if its even safe to use a bunch of mc assets on my websites xD

#

the creator thingy is very vague imo

#

well, I have made a plugin for playing bingo, and I have in game way to create a card for bingo

#

with like chances per item or set of items etc

#

and its like 100x easier as a user to configure it in game compared to in a yaml file

#

for the same reason as for why you are probably not using just a console for your entire pc

young knoll
#

Yeah I’ve got an in game item editor for my dungeon plugin

#

Gotta to an in game mob editor too

pseudo hazel
#

btw coll, do you have an example of plugins using web editors?

storm crystal
#

so I guess I should learn how to make in game editors fo what I want to do as well?

pseudo hazel
#

yes if you wanna make a good plugin, I would recommend doing it

young knoll
#

Luckperms has a web editor

storm crystal
#

should I make separate management plugin for it?

young knoll
#

I think AdvancedEnchantments also has one

pseudo hazel
storm crystal
#

can you make a plugin execute commands that you've made in it?

young knoll
#

You could

pseudo hazel
#

there is no need

young knoll
#

Yeah

wet perch
#

So how do I have to compile to use premium resource placeholders?

lilac dagger
#

there's nothing special

#

put the placeholder and that's it

#

spigot will replace it for all your buyers

#

not for you

shy wolf
pseudo hazel
#

btw is it bad to have a lot of yml config files to store stuff like custom configurations for mini game settings, leaderboards, custom kits, etc?

kind hatch
#

Not really. If anything it makes it easier for you to organize your stuff. I think that's better than shoving everything into a single file.

pseudo hazel
#

well yeah

#

okay, illkeep going then I guess

quaint mantle
tender shard
#

what do you need the Connection object for?

umbral ridge
#

hey

tender shard
#

(which is the super class of ServerGamePacketListenerImpl)

storm crystal
#

how can I safely change name of my plugin?

umbral ridge
#

What's owner for in Bukkit.createInventory() ? difference if i actually specify a player? or null

quaint mantle
#

nvm

tender shard
pseudo hazel
#

inventoryholder is bad

tender shard
umbral ridge
pseudo hazel
#

kinda hard to explain, but inventory holder is pretty much a backwards compatibility thing from what I know and shouldnt really be used to compare inventories

#

either that or its kinda unused

#

so there is no point in using it in the first place

quaint mantle
tender shard
#

you need to use getDeclaredField on the class where the field is declared

#

getField only gets public / accessible fields, while getDeclaredField gets you the field specifically declared in that class

#

e.g. FakeEntityPlayer20 could have a public field called "c", you wouldn't want to get that

#

so use getDeclaredField on ServerCommonPacketListenerImpl.class

quaint mantle
storm crystal
#

is it really unnecessary?

hazy parrot
#

it is if you dont have any code under

lilac dagger
storm crystal
#

in some path I should place path from my PC or just from server folder?

hazy parrot
#

its path in you config.yml

#

for example

#
this:
  is:
    path: value
#

path of "value" would be this.is.path

storm crystal
#

oh thats the path they are talking about

#

inside file okay

#

im trying to figure out how to make custom config files with specific names

#

not just config.yml

pseudo hazel
#

general advice, never use some path of your pc in code for a project that other people will be using xD

meager wolf
#

Hey, so i made a simple ItemStack in a class other han main "public class CustomItems" the item is public static, and im curious if i can /give it to myself from in game, is that possible ?

meager wolf
lilac dagger
#

just make a /somegive command and then player.getinv .addItem(your stack)

meager wolf
#

So i have to add it like that ? Chatgpt said that i can just do like /give me myplugin:item

#

So it confused me

fringe yew
#

make sure to make the itemstack publicly available

pseudo hazel
#

chatgtp is making up shit

fringe yew
#

it doesn't know any of the api

#

only general points in languages

pseudo hazel
#

you dont register items in minecraft, this is what mods do xD

meager wolf
#

Ok tysm!

lilac dagger
#

don't trust it

meager wolf
lilac dagger
#

if you look straight ahead one should be 0, that's pitch

#

yaw is looking left right

#

pitch is up down

#

and roll is well, rotating

#

we don't have that in mc

#

i think bukkit is from 0 to 360?

#

just do some tests, not sure

#

i think because it's easier to work with it remained like this

storm crystal
#

I tried making custom.yml file with that spigot tutorial but the plugin does not even load

chrome beacon
#

Don't send text in images

#

Use paste

#

?paste

undone axleBOT
chrome beacon
#

Also there is an error in your console

storm crystal
#

okay I got it in logs after reloading

chrome beacon
#

Do a full server restart

#

Oh wait

#

That's your main java plugin class ???

worldly ingot
#

Yeah vanilla is the weird one here

storm crystal
#

Customdamage

#

public final class Customdamage extends JavaPlugin implements Listener

worldly ingot
#

Bukkit actually exposes them to sane values

#

You can't extend JavaPlugin

chrome beacon
#

^

worldly ingot
#

Only your main plugin class should do that

chrome beacon
#

^^

worldly ingot
#

You're passing it via the constructor. You can use that instead

chrome beacon
#

I think that's actually their main class

storm crystal
#

yeah it is

#

I thought its needed

chrome beacon
#

They just copy pasted the tutorial without knowing what theyre doing

#

Since they've refused to learn Java many times now

storm crystal
#

...not really, I thought its needed since when I try to do "plugin.getCustomConfig().getString("some-path");" there is an error

#

I'd appreciate it if you stopped assuming it 24/7

worldly ingot
#

Oh, if that's your main class then yeah, remove the constructor

#

Your plugin instance, wherever you need it, will be this

#

I didn't see an onEnable() or onDisable() so I assumed it was just a listener or util class :p

chrome beacon
#

Same until I read the stacktrace

worldly ingot
#

Ah, constructor init of PluginClassLoader, yeah. Should have caught that

storm crystal
worldly ingot
#

Correct

#

Anywhere you need a Plugin instance you can use this instead because this will refer to your class that extends JavaPlugin in that context

#

And in case I wasn't clear, your plugin variable can be removed too. Lines 1 - 4 in the snippet you sent can be removed

#

The plugin loader requires a no-args constructor

storm crystal
#

how can I set my server join to first time again?

glad prawn
#

?

storm crystal
#

I want to reset hasPlayedBefore for my uuid

hazy parrot
#

delete your file inside of playerdata

#

i believe its that one

orchid gazelle
#

I mean, is it just a simple File#exists clause to check?

storm crystal
#

it doesnt seem to work properly

orchid gazelle
#

I'd guess so

storm crystal
#

it doesnt create custom.yml, had to do it manually

#

when I do it manually there are no errors

#

but it does not add anything to it

orchid gazelle
#

sorry I don't know shit about configs lol, I only write private plugins for myself with everything hardcoded tbh lol

worldly ingot
#

How about instead of checking if hasPlayedBefore() you check if the file exists?

orchid gazelle
#

good idea

storm crystal
#

in line 10

#

this method is used by onEnable

#

and I know it works because if I delete the file it throws exception

glad prawn
rotund ravine
storm crystal
rotund ravine
#

Also you gotta save after setting stiff for the config to reflect that

storm crystal
rotund ravine
#

Show us

storm crystal
glad prawn
#

yes but what they mean is not like this

storm crystal
#

?paste

undone axleBOT
storm crystal
glad prawn
#
        YamlConfiguration.loadConfiguration(customConfigFile);``` wtf?
storm crystal
#

I guess its similar but less code

glad prawn
#

customconfig = YamlConfiguration.loadConfiguration(customConfigFile);

storm crystal
#

damn it works now

#

theres something wrong with this part

#

cuz it doesnt create file

rotund ravine
#

Give me a screenshot of you opening the jar

#

And the contents

storm crystal
rotund ravine
#

Yeah remember to export it to your Jar

storm crystal
#

its exported like that

#

and the .yml file should be in customdamage folder

#

its not

orchid gazelle
#

it's searching for inside the jar

#

not the directory

rotund ravine
#

Open the customdamage-1.0.jar

storm crystal
#

nothing happens

rotund ravine
#

You can rename it to customdamage-1.0.zip if you don’t have anything else to open it with

storm crystal
rotund ravine
#

See

#

It’s not there

storm crystal
#

why would it be here 😭

rotund ravine
#

Cause it needs to be

#

For you to save it?

#

It needs to be included in the jar

storm crystal
#

but entire tutorial has not said a single thing about it

rotund ravine
#

What tutorial

storm crystal
rotund ravine
#

Are we reading the same thing?

glad prawn
#

yes

rotund ravine
#

Maybe we should go change the size of that paragraph to 25 to make sure new guys read it

glad prawn
#

i think he just doesn't understand

rotund ravine
#

Since they’ll probably just look at code

#

Ohh

storm crystal
#

well it works now

rotund ravine
#

👌🏻

glad prawn
storm crystal
#

okay my plugin finally works

#

?paste

undone axleBOT
storm crystal
#

I tested it and right now it works as intended

#

creates config if it's not there, assigns base attack value to player by UUID, reads this in custom damage formula and assigns health bars to living entities

umbral ridge
#

hey

#

player.openWorkbench(..) opens up an inventory of type WORKBENCH right?

rotund ravine
#

Use the chatcolor constnats @storm crystal

umbral ridge
#

nvm didn't reload the config...

storm crystal
rotund ravine
#

?rtf

#

Well they’re constants so u don’t yse the paragraph symbol

#

Also makes code much easier to read

#

?jd-s

undone axleBOT
rotund ravine
#

?google

undone axleBOT
rotund ravine
#

Look up chatcolor spigot on both

storm crystal
#

Mhm

#

How does it look technicality wise

#

Is it any okay

grand flint
#

What packets do I need to send to display player heads in the tab?

storm crystal
short pilot
#

how do database connections work? When using the getConnection built in method for jdbc, do we need to close it every time we call the function?

grand flint
rotund ravine
#

Usually you use smth like hikari etc.

short pilot
#

nother question

#

how can you assign perms to someone?

rotund ravine
#

Permission attachments i suppose

#

Or use the API of the bigger permission plugins

timid berry
#

?learnjava

undone axleBOT
timid berry
#

need this for me sorry

slender elbow
#

good luck

timid berry
#

thanks

shut shoal
#

Hello, I had a problem with a purchase of a plugin, I asked for a refund, the person took the plugin from me and did not return the money, I need to complain about this disastrous service and scam

signal kettle
#

is there a way to get ItemStack in hand as String? or check ItemStack as object to object?

#
Objects.equals(item), foodCrateMechanic.getRequiredItem1())) {

smth like this

meager wolf
#

Its going like Error] null and then big java style errors

remote swallow
#

what in the hell am i looking at

rotund ravine
#

I saw voth questions and decided not today

umbral ridge
rotund ravine
#

Or isSimilar if ur not checking amount too

timid berry
#

unrealted to spigot. what java version should I make my program in?
im trying to make gui programs for windows through java but im wondering if i should use java 8, java 11, or 17

rotund ravine
#

Latest LTS

#

Java 21

timid berry
#

this one?

#

oh 21?

#

okay

#

isnt there more learning resources for older versions of java tho?

rotund ravine
#

Java does not change that majorly

timid berry
#

didnt they allow u to use a 1 liner print statement now?

signal kettle
#

I mean I get from config a string and ItemStack what player have in hand and I need to check if they are equal, I make a way liket that:

            if (foodCrateMechanic.hasNextCrate3() && foodCrateMechanic.hasItemRequirement3()) {
                String vi = foodCrateMechanic.getRequiredItem3();
                if (StringUtils.isAllUpperCase(vi)) {
                    ItemStack vanilla_item = new ItemStack(Material.valueOf(vi));
                    if (Objects.equals(item, vanilla_item)) {
                        OraxenFurniture.remove(baseEntity, null);
                        OraxenFurniture.place(foodCrateMechanic.getNextCrate3(), baseEntity.getLocation(), yawToRotation(FurnitureMechanic.getFurnitureYaw(baseEntity)), baseEntity.getFacing());
                    }
                } else
                if (Objects.equals(OraxenItems.getIdByItem(item), foodCrateMechanic.getRequiredItem3())) {
                    OraxenFurniture.remove(baseEntity, null);
                    OraxenFurniture.place(foodCrateMechanic.getNextCrate3(), baseEntity.getLocation(), yawToRotation(FurnitureMechanic.getFurnitureYaw(baseEntity)), baseEntity.getFacing());
                }
            }

The problem I run is that when e.g GOLDEN_APPLE is all from uppercase but don't want to work because of "" I think and idk now how I can fix it so it will read it if they will be from upper case but also ignore ""

rotund ravine
#

Who knows not paying attention @timid berry

signal kettle
#

ugh

#

_

timid berry
signal kettle
#

this little thing discord editing :c

rotund ravine
#

Also tjat looks like hell

timid berry
#

would old tutorials still work for new versions like 21?
https://www.youtube.com/watch?v=eIrMbAQSU34

Java tutorial for beginners - Learn Java, the language behind millions of apps and websites.
🔥 Want to master Java? Get my complete Java mastery bundle: http://bit.ly/2tKoy8C
👍 Subscribe for more Java tutorials like this: https://goo.gl/6PYaGF

📕 Get my FREE #Java cheat sheet: http://bit.ly/2JNlQnw

⭐️ Want to learn more from me? Check out thes...

▶ Play video
rotund ravine
#

Yes

#

Remember to use a proper build tool btw like gradle or maven

#

Good to drill into the bones

timid berry
#

are there bad ones

#

i got this ide

rotund ravine
#

Yes

#

Just use gradle or maven with that

#

They’re pretty much the standard nowadays

signal kettle
#

isn't isSimiliar work only for itemstacks or items but not for string to itemstack?

rotund ravine
#

You have two itemstacks

#

Stop behaving weirdly

timid berry
rotund ravine
#

?

#

I can also just

#

?learnjava!

undone axleBOT
timid berry
#

ye thanks

signal kettle
#

there's a problem that I don't if I will not forst convert string to itemstack🥲

    foodcrate:
      nextCrate1: food_crate_red_apple_default
      requiredItem1: APPLE
      nextCrate2: food_crate_green_apple_default
      requiredItem2: green_apple  
      nextCrate3: food_crate_gold_apple_default
      requiredItem3: GOLDEN_APPLE  

here this is the config and I need to read from reguiredItem line of text and that's not an itemstack, and that's why I cant just use isSimilliar or normal equal item stack to itemstack, in screen its how it taking the string line from config to code

#

that's why I convert the string to ItemStack, and also I need to check if it's from UpperCase so that's how player speciefie Vanilla items and when they are from LowerCase that's when player mean OraxenItemStack

rotund ravine
#

Sigh

#

Have a look at maps before continueing

signal kettle
#

and the problem came when Material Name have special chars in the name so underlines because StringUtils do not recognize it as AllUpperCase

#

ahh

#

HashMaps yes?

#

I will learn then

timid berry
#

did they get rid of packages in the newer versions?

remote swallow
#

no

#

you have to make the package

rotund ravine
#

^

timid berry
#

yah but its not there by default anymore right

remote swallow
#

i dont think it ever was, you should be creating a package though

timid berry
#

it didnt ask me to name a package on the latest version of java and intellaji

rotund ravine
#

Ask IJ

#

They’re the ones that made it

remote swallow
#

if anything thats probably an ij build system thing

wet breach
#

I am thinking its just more visual and that it really did make a package

timid berry
#

ah i see

noble flume
#

I just nvim for code editing

#

am I crazy?

rotund ravine
noble flume
#

I can't seem to find out

rotund ravine
#

Whst did you try?

noble flume
rotund ravine
#

Maybe you should not use VIM if you do not know that

noble flume
rotund ravine
#

Better learn smth more modern

noble flume
#

Isnt NVIM modern

rotund ravine
#

VIM is for those that wanna feel special or old fogeys

noble flume
#

VScode?

rotund ravine
#

IntelliJ is a good chiice

#

Cross platform too

noble flume
#

IntelliJ is a kinda of IDE i just want a light weight thing

rotund ravine
#

Vscode is easy sure

#

Plugins installed with one click

#

Offers multiple language support

#

Etc etc

quaint mantle
#

how would i get a cape from a player with api

#

or just get the official mojang cape urls

rotund ravine
quaint mantle
#

i dont want to hide the capes

#

i want to get them

rotund ravine
#

M8

#

Look ar the contents of the thread

#

Not the name only

quaint mantle
#

nononon

#

im trying to get all the urls for all the capes

rotund ravine
#

You will get base64 not an url

quaint mantle
#

ok

#

but im trying to get all the urls for all the capse

rotund ravine
#

Og

#

I just checked javadocs

#

Use the PlayerProfile Api

#

@quaint mantle

quaint mantle
#

well

#

how would i get ALL of the mojang capes

#

all of the minecraft texture urls

#

not namemc

#

or any other third party

rotund ravine
#

I mean this just gets their cape?

quaint mantle
#

what/

rotund ravine
#

There’s a list of capes here https://minecraft.fandom.com/wiki/Cape

Minecraft Wiki

Capes are commemorative items that can be worn in addition to the player's skin. However, unlike skins, players cannot create custom capes or transfer any owned capes to a different account. When equipped, they also change the appearance of worn elytra. Capes are purely decorational, and do not alter the wearers' capabilities in any way.
There a...

#

Also does namemc have access from mojang to add capes?

quaint mantle
#

no

quaint mantle
rotund ravine
#

Well dik then

upper hazel
#

bruh how cancel dragInventoryEvent why my items cloning

full holly
#

Does anyone has an idea how can I move a minecart on rails into the direction of a specific rail?

tall dragon
#

push it

full holly
#

😂

upper hazel
#

?paste

undone axleBOT
upper hazel
#

https://paste.md-5.net/elivufodax.cs - I'm completely confused, I have a bug when I take an item from creative mode, the event is not canceled and the item is clonedwhen I drag it across the player's inventory
how this work bruh...

pseudo hazel
#

I think the creative inventory was like fully client side or something

#

there was something different with it, but I dont remember

upper hazel
#

this code work but it cancels the event after an item is placed in the inventory and because of this the item remains in the player's inventory if he leaves it

#

when dragging from creative mode it works fine but when dragging from another inventory the item does not stay there

full holly
#

How can I disable the control of a minecart by the player?

onyx fjord
#

My guess would be that playermoveevent triggers it

full holly
#

sadly not

onyx fjord
#

Hmm im not sure then, perhaps try debugging all events

#

Like make some dummy handler for all events and print them

smoky anchor
onyx fjord
#

@full holly by Control you mean pushing the cart or being inside of it and doing something

full holly
#

being inside and doing something

onyx fjord
#

Yeah no idea then

full holly
#

event.getVehicle().setVelocity(event.getVehicle().getVelocity().setX(0).setZ(0)); that's working, but unfortunately it still moves minimally

eternal oxide
#

are you doing that in the move event?

full holly
#

yes

eternal oxide
#

its likely just client side then

#

why not set getTo to the same as getFrom in the move event?

#

or just canceling the event should be fine

full holly
#

canceling isn't possible

#

event.getVehicle().setVelocity(new Vector(0,0, 0));
Minecart m = (Minecart) minecart;
m.setMaxSpeed(0.0);

storm crystal
#

Should I make separate plugin for config handling and just access its methods to other plugins or just make plugin handling formula in any plugin that would need it by hand?

meager wolf
drowsy helm
#

A library is what you want

storm crystal
#

Making and using library is more of a java thing than spigot thing yeah?

drowsy helm
#

Correct

storm crystal
#

Alright ill get on it then

chrome beacon
#

._.

#

Don't try to ping @ here

drowsy helm
#

What have you tried to debug it?

#

Are you sure the method is executing in the first place

#

Thats not what im saying

#

Is the method executing at all

#

Have you tried a println

#

Do that

#

See if it’s running at all

peak depot
#

how can I disable achivment annouce for a certain world

hazy parrot
#

What exactly is not working

#

Nothing is printing out?

#

Where did you put those println

#

It means either your if is failing or event isn't even running

#

Altrough you did a lot of wrong things in this code

#

First, don't differate your inventory with inventory holder

#

Second, all of those other if statements just seem redudant

#

Because if item have your holder, it's already canceled

lilac dagger
#

instanceof does null check

hazy parrot
#

Put println on top of method, check if method is even running

lilac dagger
#

oh nvm

hazy parrot
shadow night
#

Is Objects.requireNonNull(null) a crime

eternal oxide
#

requireNonNull does not stop it being null

shadow night
#

Can I somehow make my ide not warn me about a variable being null even if it's = null, but only for this variable?

eternal oxide
#

yes, don;t use InteliJ 🙂

shadow night
#

But it's a good ide

eternal oxide
#

there is probably some suppression annotation

shadow night
#

I hope so

hushed spindle
#

anyone know what type of event is fired when a villager throws an item as a result of a gift from the hero of the village effect?

lilac dagger
#

you're just sending another exception

#

it's always something small

peak depot
#

how can I disable achivment annouce for a certain world

umbral ridge
#

?jd-s

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
__**Admin:**__

selfrole Add or remove a selfrole from yourself.

__**Cleanup:**__

cleanup Base command for deleting messages.

__**Core:**__

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

__**Downloader:**__

findcog Find which cog a command comes from.

__**Mod:**__

names Show previous usernames, global display names, and server...
userinfo Show information about a member.

__**ModLog:**__

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

__**Permissions:**__

permissions Command permission management tools.

umbral ridge
#

and filter the output from there

tacit veldt
#

How to listen to the player opening the backpack by pressing “E”

umbral ridge
umbral ridge
tacit veldt
umbral ridge
#

oh wait it doesn't trigger the event

#

No idea

#

?jd-s

undone axleBOT
umbral ridge
#

There is one dirty way to do it (maybe?)

tacit veldt
#

let me see this

eternal oxide
#

no event is fired when the player opens his own inventory

umbral ridge
eternal oxide
#

not possible

#

as checking the players open inventory will always return their own inventory even if it's closed

#

it returns their inventory or another if they have one open

umbral ridge
#

Yeah it's kinda f I tested it now

tacit veldt
#

oh....

meager wolf
#

how can i use MockBukkit

tacit veldt
#

It doesn't look like a simple thing

umbral ridge
#

on a scheduler

#

but idk how it'll work

eternal oxide
#

no

slender elbow
#

it won't

eternal oxide
#

I already told you getOPenInventory will always return teh players inventory even if it's not open

umbral ridge
#

So there's no solution? Is mojang that stupid? no event for this

eternal oxide
#

players inventory or another inventory if one is open

#

player inventory opening is client side

#

teh server has no need to know when it opens

#

only when changes are made

umbral ridge
#

Interesting

meager wolf
tacit veldt
#

Interesting

umbral ridge
tight sphinx
eternal oxide
#

no it doesn;t

#

it used to, long ago

somber scarab
#

@wet breach !!! remember me??!!

#

I did it! Floor is Lava is now out >:) u said i couldnt

lost matrix
lost matrix
somber scarab
lost matrix
#

Its alright.

somber scarab
#

what's wrong there?

#

id just like to refine it if there is actually smth wrong

lost matrix
somber scarab
#

ahhhh

#

true true

#

ill fix that on the next update

lost matrix
somber scarab
rotund ravine
#

Been a while since i saw that

somber scarab
#

im planning to revise it ofc

young knoll
#

When the lom is bok

rotund ravine
#

Kotlin with lombok 👀

#

Jkjk

lost matrix
#

lol...

somber scarab
#

overall tbh, i feel fkn great about my plugin

rotund ravine
#

That’s nice

somber scarab
#

this is the largest project i worked on so far

lost matrix
rotund ravine
#

Now add some RCE and upload it to the spigot resource section

glass mauve
#

working with packets and trying to send item frame entity + entity data with setting the item of the item frame but get some weird error
https://gist.github.com/SquidXTV/7855e178ec0b7b01cdd4b7f8954627d2

[13:02:15] [Netty Server IO #1/ERROR]: Error receiving packet 82
java.lang.ClassCastException: class org.bukkit.inventory.ItemStack cannot be cast to class net.minecraft.world.item.ItemStack (org.bukkit.inventory.ItemStack and net.minecraft.world.item.ItemStack are in unnamed module of loader java.net.URLClassLoader @46ee7fe8)

prob caused by this:

            public void setMap(@NotNull ItemStack map) {
                if (map.getType() != Material.FILLED_MAP) {
                    throw new IllegalArgumentException("ItemStack must be of type FILLED_MAP.");
                }

                List<WrappedDataValue> values = List.of(
                        new WrappedDataValue(8, WrappedDataWatcher.Registry.getItemStackSerializer(false), map)
                );
                getDataValueCollectionModifier().writeSafely(0, values);
            }

the full stacktrace isnt really showing the cause

somber scarab
#

next big step is ingame settings and GUI

rotund ravine
somber scarab
#

my fav type of debugging

#

not a joke

rotund ravine
slender elbow
#

setMap(@NotNull ItemStack
is that a bukkit itemstack or a nms itemstack?

somber scarab
rotund ravine
#

The proper debugger is just much better

somber scarab
somber scarab
#

I legit only use p.sendMsg() for debugging

glass mauve
slender elbow
#

that's probably your issue

glass mauve
#

my code worked before with WrappedDataWatcher

#

but someone told me that nowadays it changed to those List<WrappedDataValue>

somber scarab
#

I have a question. am I allowed to sell plugins that have dependency on WorldEdit/Multiverse?

rotund ravine
#

Yes’ish

#

As long as it fits the premium guidelines

somber scarab
rotund ravine
#

Google spigot premium guidelines

glass mauve
#

also could the first possible change the second one?

            public void setInvisible(boolean invisible) {
                List<WrappedDataValue> values = List.of(
                        new WrappedDataValue(0, WrappedDataWatcher.Registry.get(Byte.class), invisible ? (byte) 0x20 : (byte) 0)
                );

                getDataValueCollectionModifier().writeSafely(0, values);
            }

            public void setMap(@NotNull ItemStack map) {
                if (map.getType() != Material.FILLED_MAP) {
                    throw new IllegalArgumentException("ItemStack must be of type FILLED_MAP.");
                }

                List<WrappedDataValue> values = List.of(
                        new WrappedDataValue(8, WrappedDataWatcher.Registry.getItemStackSerializer(false), map)
                );
                getDataValueCollectionModifier().writeSafely(0, values);
            }

does writeSafely delete the previous values?

young knoll
#

?guidelines

#

Aww

lost matrix
glass mauve
#
        public static class ItemFrameDataPacket extends PacketContainer {

            public ItemFrameDataPacket(int entityId) {
                super(PacketType.Play.Server.ENTITY_METADATA);
                getModifier().writeDefaults();

                getIntegers().write(0, entityId);
            }

            public void setInvisible(boolean invisible) {
                List<WrappedDataValue> values = List.of(
                        new WrappedDataValue(0, WrappedDataWatcher.Registry.get(Byte.class), invisible ? (byte) 0x20 : (byte) 0)
                );

                getDataValueCollectionModifier().writeSafely(0, values);
            }

            public void setMap(@NotNull ItemStack map) {
                if (map.getType() != Material.FILLED_MAP) {
                    throw new IllegalArgumentException("ItemStack must be of type FILLED_MAP.");
                }

                List<WrappedDataValue> values = List.of(
                        new WrappedDataValue(8, WrappedDataWatcher.Registry.getItemStackSerializer(false), map)
                );
                getDataValueCollectionModifier().writeSafely(0, values);
            }
        }
#

basically created my own class for this

rotund ravine
undone axleBOT
young knoll
#

Doh

lost matrix
rotund ravine
#

Good ol’ craftitemstack

glass mauve
#

no I am not sure, but its the only packet stuff using ItemStack

lost matrix
#

I mean one without needing nms on the classpath

glass mauve
#

and the stacktrace isnt really helpful

lost matrix
#

"receiving packet 82"
receiving packet?

glass mauve
#

let me try removing the setMap call and check if the error persists

glass mauve
#

oh and I got this:

[13:02:15] [Server thread/INFO]: SquidXTV lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.ClassCastException: class org.bukkit.inventory.ItemStack cannot be cast to class net.minecraft.world.item.ItemStack (org.bukkit.inventory.ItemStack and net.minecraft.world.item.ItemStack are in unnamed module of loader java.net.URLClassLoader @46ee7fe8)
lost matrix
#

Hm

eternal oxide
#

wrong ItemStack

glass mauve
lost matrix
#

ElgarL coming through with the wisdom 🙂

eternal oxide
#

😄

lost matrix
#

I got another idea but im gonna go eat now 😛

glass mauve
#

removing the setMap call fixes the error

#

so it must be that

lost matrix
#

Look for an adapter in the meantime

young knoll
#

There’s an adapter in CraftItemStack

#

I assume you don’t want that tho

wet breach
somber scarab
#

:p

worldly ingot
#

lmao

wet breach
#

well, if it helped you then, you are welcome I suppose and awesome uwu

worldly ingot
#

I bet you can't contribute to the Bukkit API and add a cool new feature

#

🤞

wet breach
#

lol

quiet ice
glass mauve
#

this update broke all my packet stuff lol

undone axleBOT
scenic onyx
#

how i can get The IP of a player?

young knoll
#

?jd

undone axleBOT
young knoll
#

Player#getAddress()

scenic onyx
quaint mantle
#

How can I use the 1.20.2 super for EntityPlayer? I also am concurrently using 1.19.4 and 1.18.2 .jar files for them and it only allows me 3 parameters instead of 4. Is there any workaround it so I can use 4?

super(MinecraftServer.getServer(), MinecraftServer.getServer().a(resourceKey), gameProfile, null);

I can't use the 4th parameter "null"

eternal oxide
#

before signed chat it only took 3 params

scenic onyx
#

because i get it?

young knoll
#

what

scenic onyx
young knoll
#

You do

#

127.0.0.1

scenic onyx
young knoll
#

It's the loopback address because you are on localhost

quaint mantle
young knoll
#

Only use 3

quaint mantle
#

1.20.2 must be offered 4

quaint mantle
young knoll
#

If you are trying to do multiple versions you need to handle that properly

#

Either reflection or modules

quaint mantle
#

Alright, but how then can I compile all those modules into a singular .jar file?

lilac dagger
#

using the shade plugin

#

and scope compile in the main module

#

tho i think scope compile is by default

#

if that's the case scope provided for libs you don't wanna shade in

umbral ridge
#

how would you detect the difference between

  • opening a crafting inventory manually via player.openWorkbench() that triggers via /craft command
    and
  • interacting with a crafting table

is it possible to do it without player UUID lists to store players who executed the /craft command? How do you detect this on InventoryOpenEvent and InventoryCloseEvent? player.openWorkbench() fires when players interacts with a crafting table or is it done differently?

torpid blaze
#

Hey,
I want make a flying arrow create a trail of blocks. What is the best way to do this?
A List of arrows and a global Runnable that places blocks for each arrow in the list or is there a better option?

young knoll
#

Yeah that's fine

#

A runnable per arrow is probably also fine

quaint mantle
ivory sleet
#

i believe at least?

lilac dagger
meager wolf
#

How can i make a new bar, similar to health and hunger ?

umbral ridge
# ivory sleet pretty impossible

Yeah.. I want to do it the "clean" way. I could save player uuids to the temp config and read from it and determine who used /craft but... that is a mess

slender elbow
#

StackWalker :trollface:

young knoll
#

Why a temp config

#

All you need is a map

umbral ridge
young knoll
#

Heck you could probably use a cache that exipires a few ticks after write

umbral ridge
#

People use /reload all the time

ivory sleet
umbral ridge
#

it would be cool to have this.. some way to easily determine if an inventory was opened manually or by interaction

#

i'll think of something

slender elbow
umbral ridge
#

what about inventoryHolder? is it null all the time? even on interaction?

ivory sleet
#

id assume its just the player

umbral ridge
#

ok so that's where I can do it then xD

#

it's null if I open the inventory by code, it's a player if it's opened by interaction

ivory sleet
#

no i think its the player regardless lol (not sure tho)

umbral ridge
#

then I guess location? xD

#

weird stuff

#

I might just ditch the opening and closing messages but that would suck, i want it to be fancy

ivory sleet
#

the location isnt saved anywhere sadly

#

or maybe it would be saved, but then if its null it prob gets converted to like the players location or sth odd

umbral ridge
#

yea

#

regardless of what I put as location it gets changed to player location or workbench location

#

lol

torpid blaze
young knoll
#

Yeah in that case a single one may be better

#

Although it isn't a huge overhead

ivory sleet
torpid blaze
young knoll
#

Afaik runnable is just a wrapper around a

#

well, runnable

#

That just gets shoved in a list

torpid blaze
#

good to know

subtle folio
#

SpigotRunnable when?

ivory sleet
#

prob not needed

#

x)

subtle folio
#

.runTaskEveryOtherHalfSecondIfBaracObamaIsPresident()

ivory sleet
#

u can prob have some thing like a Predicates.<BukkitTask,Void>compose(task -> checkSomeCriteria(), task -> { doStuff(); return null}) and pass that (i think thats a thing in guava)

umbral ridge
# ivory sleet the location isnt saved anywhere sadly

I figured if you interact with a crafting table, the location becomes a crafting table. If you open a crafting table manually and specify null player.openWorkbench(null, ...) then the location is a player location. That's how I guess I can determine things..

ivory sleet
#

yea

#

sounds reasonable

umbral ridge
#

Nice.. I almost lost hope lol

subtle folio
ivory sleet
#

lol, ig feature request?

river oracle
#

the task may execute

subtle folio
young knoll
#

Why did you need to detect anything for that

#

Ah wait, is /craft not your command

river oracle
river oracle
#

have I ever told oyu how I hate that method

#

yes I have, speaking of inventories

#

how's it going coll

young knoll
#

Yeah but if you only want the message with the command

#

Just... send it in the command

umbral ridge
#

No.. unprofessional 🤓

young knoll
#

I guess that would only be for opening tho

ivory sleet
#

i hope u have a good time :)

river oracle
umbral ridge
#

XD

ivory sleet
#

not if we just... delete it out of existence in the api

river oracle
#

maybe in 1 or 2 major updates?

umbral ridge
#

I shall stay on 1.20.2 then xD

#

forever

river oracle
#

fair enough

#

good version it is

dire marsh
#

anyone know how to modify the biomes sent in the chunk biomes packet with protocollib?

umbral ridge
#

I didn't know that openBlock existed, I'll take a look at it

river oracle
#

I'm just being annoying about my PR as always

young knoll
#

smh

river oracle
#

Coll is gonna ban me :( its okay I'll email him instead

#

@umbral ridge just a heads up thouhg openEnchanting doesn't work if you're going to do that one

umbral ridge
#

oK thanks for the heads up

#

I wasn't planning to do that one though

#

only the classic essentials commands

river oracle
#

I thought essentials had that one

#

huh

umbral ridge
#

I might do /enchant

young knoll
#

Wait it doesn't work?

river oracle
#

see my PR 😈 you need to wrap it in a TileInventory aka SimpleMenuProvider

ivory sleet
#

:>

young knoll
#

Wonder when it did work

river oracle
#

Speaking of PR no love for my sign ticking PR

eternal night
#

no love for my PDc list pr either

#

people just have small hearts 😭

ivory sleet
#

soon ™️ :]

river oracle
#

I think its cuz paper did that sign one already and our code was similar to something

#

iirc choco commented about that on one of my prs

eternal night
#

eh doubt it

#

the sign ticking shit can really only be implemented one way

#

I think

river oracle
#

I mean you could just comment out the whole tick method, it'd still run the tick method but ig that wouldn't prevent them from ticking

eternal night
#

Yea

river oracle
#

the SignChangeEvent or whatever its called I tried to add blockstate to that

#

yeah nah fuck that that's not working properly

eternal night
#

I mean

#

fetching block states preemtively is a bit bleh

river oracle
#

because of where SignChangeEvent is, I might do that PR again juts take a different approach seeing as you can't edit the block state directly I have to add methods for each operation instead

#

@eternal night working on new spigot PR, Prevent ticking (performance)

eternal night
#

Implement /tick freeze on spigot globally

young knoll
#

That's not until next version!

eternal night
#

spigot-preview

river oracle
#

spigot-snapshots when?

#

I wouldn't mind adding some form of snapshot support the main issue is I wouldn't know where tf to start with updating an entire server codebase

young knoll
#

Probably not that hard

#

Depending on what changed

eternal night
#

Yea, problem is always when you finalise API

#

and people not understanding that snapshot API is not final

#

which I presume is why spigot isn'T updated publically on stash

river oracle
eternal night
#

See

#

you'd think that would do it

#

it doesn't

river oracle
#

:(

#

@Deprecated?

eternal night
#

people dont give a shit 😂 method exists, method will be used

river oracle
#

forRemoval=true

eternal night
#

¯_(ツ)_/¯

river oracle
#

I would love to play around with internals while updates occur

river oracle
eternal night
#

Yea

#

probably separate artefact would be best

young knoll
#

I don't think we've had anyone come here complaining that the experimental branch broke their shit

#

So we good so far

eternal night
#

Well

#

Experimental branch has like 0 usage for people right now

#

Like, sure, API is awesome

#

but if you tell people, heyyy, you can now technically run snapshot

river oracle
#

speaking of awesome API 😈

ivory sleet
#

didnt know that existed until now 👀

eternal night
#

you best believe people will be running that

#

damn

young knoll
#

Wonder if fabric has many issues with it

eternal night
#

I mean

river oracle
#

fabirc doesn't have much of an api

young knoll
#

Probably not as fabric based servers are still pretty rare

eternal night
#

fabric has a lot less API

#

yea

young knoll
#

Simply get more

#

duh

river oracle
#

you know you're learning low level when someone calls the memory slow

ivory sleet
#

but like we just fkn drive over it with mixins

#

since some mods rly just update instantly and others take forever (still quite nice to run new stuff)

umbral ridge
halcyon hemlock
#

I can't download sources or javadoc, any clue why?

#

doesn't exist?

lilac dagger
#

You didn't build 1.17 with sources i think

halcyon hemlock
#

oh i need to build with sources?

lilac dagger
#

Yes

#

It's a flag in build tools

halcyon hemlock
#

can I rebuild?

#

or will just create a mess

lilac dagger
#

Just rebuild

#

Don't worry about it

#

You can delete folders from your buildtools folder for a clean rebuild

#

The files in .m2 will be replaced

halcyon hemlock
#

ah ok ill do that then

young knoll
halcyon hemlock
#

like this?

lilac dagger
#

I think so

#

Looks like it

umbral ridge
#

Do I need a special jar?

halcyon hemlock
#
       <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <version>0.10.2</version>
        </dependency>
eager smelt
#

Is it possible to create a Minecraft plugin in Python?

halcyon hemlock
#

Just use java

#

Why go through that pain

orchid gazelle
halcyon hemlock
ivory sleet
#

its just nms

eager smelt
halcyon hemlock