#help-development

1 messages · Page 286 of 1

undone axleBOT
tardy delta
#

since when is the bot doing the penguin thing?

river oracle
#

No clue good luck

river oracle
#

Thanks imajin

remote swallow
#

yes

tulip drift
#

not quite. I Previously was using newer versions for my server, however plugins did not replicate the old mechanics needed for our server accurate enough.

remote swallow
#

imajin is our bitch for custom commands

tardy delta
#

lmao

tulip drift
#

Where can I find a list of nms packets for different versions?

river oracle
#

Has all the protocol

river oracle
#

There is no nice mappings for legacy versions so it's good to be aids

humble tulip
#

This is for 1.8.8

tulip drift
humble tulip
#

Look for packetplayoutanimation or something

tulip drift
#

yes thakn you very much! I think ive got it from here

serene sigil
#

ok nvm i dont understand!

#

lmao

river oracle
#

😭I gotta go man good luck

remote swallow
#

hashmap.add(event.getPlayer().getUniqueId(), bukkitTask)

serene sigil
river oracle
#

It's put L get destroyed

remote swallow
#

i havent touched it in like 2 weeks

#

been ill

river oracle
#

Shut up no excuses

#

You clearly need to relearn everything

tardy delta
#

FREE JAVA LESSONS

remote swallow
#

jree fava lessons

#

v

serene sigil
#

so like this?

remote swallow
#

looks right

serene sigil
#

and what do i now put in the invcloseevent??

remote swallow
#

i would guess, create a method to check if the players uuid is in the haspmap if they are get the bukkit task and cancel it]

river oracle
#

No no no

serene sigil
#

bruhhhh

river oracle
#

Look what you're doing bro

#

The bukkit task is outside the task itself

serene sigil
#

but like i dont understand the concept

river oracle
#

You need to just assign the whole thing to the variable

#

Gimme a minutw to get on my pc

#

Bare with me here

serene sigil
#

okay

#

tysm

river oracle
# serene sigil tysm
// in the open event
BukkitTask task = Bukkit.getScheduler().runTaskTimer(() -> System.out.println("Task"), 1, 1);
map.put(playerUuid, task);

// in close 
BukkitTask task = map.remove(playerUuid);
if(task == null){
  return;
}
task.cancel();
remote swallow
#

arent you missing a plugin instance

river oracle
#

i forgot lol

#

I have a task api that doesn't use plugin instance lol

tardy delta
#

combine get and remove

remote swallow
#

damn

tardy delta
#

map.remove(key).cancel()

river oracle
#

isn't there a removeIfPresent

#

no its computeIfPresent

tardy delta
#

remove doesnt care whether its present or not

#

it will return the prev associated value or null

river oracle
#

just doing a null check is prob more preformant than doing computeIfPresent huh

#

I guess I'd have to look at internals

tardy delta
#

what are you talking about now?

river oracle
#

I was just saying this

BukkitTask task = map.remove(playerUuid);
if(task == null){
  return;
}
task.cancel();

Is almost certainly better than this

map.computeIfPresent(playerUuid, 
            (UUID uuid, BukkitTask task) -> map.remove(uuid).cancel());
#

cuz I was thinking of doing this ^, but that is probably just a net negative compared to the former

tardy delta
#

why would you do a computeifpresent

river oracle
#

no reason to in this situation since we can just do a null check and we are removing anyways

#

i was simply working out my stupid logic outloud lol I talk to myself when coding a lot lol

river oracle
#

yea, though what are you doing with the task it might be better to do something else

summer scroll
river oracle
#

like what are you going to do with your repeating task

summer scroll
#

i mean there is a chance

tardy delta
#

still have to null check ye

river oracle
lapis belfry
#

How to change plugin version like
Plugin is 1.16 and I want to make it 1.18

river oracle
#

go into your pom.xml

#

and change 1.16

#

to 1.18

#

or!

#

I want to be inclusive

remote swallow
#

it should just work, unless you have nms

river oracle
#

gradle.whateverthefuck

lapis belfry
#

I'm in mobile it works in mobile ? || Just asking xd||

river oracle
#

👀 what the fuck

#

Java Edition isn't bedrock edition

#

i'm surprised you even have a plugin

lapis belfry
#

No i mean idh my pc rn

#

Is it possible to change plugin version with mobile

river oracle
#

uhhh if you have an android you can probably get something to compile it with?

lapis belfry
#

Just askin

river oracle
#

android has some compilation programs for java

serene sigil
lapis belfry
#

Nvm I'll wait 12 hours and get my pc after that

river oracle
serene sigil
#

thats too hard lol

river oracle
#

no its not

#

😭 my god

quaint mantle
#

hey all, id like a human to explain this to me since im terrible at understanding shit, what does it mean for me to run something asynchronously and whats the advantages/disadvantages for me to use it?

river oracle
#

its teh easiest way

serene sigil
#

no, actually

#

ill send u the code after its done

river oracle
quaint mantle
#

alright, thank you! So in the tasks stuff, i can run it asynchronously, why would I want to do that over just running it later?

river oracle
#

running it later just delays the time its run at. Async runs it immediatly without pausing the server unless you do async run later ofc

#

asynchronous is more meant for very heavy tasks

quaint mantle
#

ah okay

river oracle
#

as I mentioned earlier database calls being an example

#

asynchronously though keep in mind you can't really write data to the server you'd have to run the task synchronously again to write data.

#

I'll show you a simple example with my api since its short

#

MegumiTask.async(() -> {
  DataStuff stuff = heavyDatabase.call();
  MegumiTask.sync(() -> stuff.setBlock(Material.DIRT));
});
#

very rough example, but it kinda shows

lapis belfry
#

To change plugin version
Go to pom.xml and then remove old version and add new version
Am I right?

river oracle
#

its gonna be a dependency

#

@tardy delta don't judge I didn't feel like writing out CompletableFutures lol

tardy delta
#

abstraction

quaint mantle
#

how can i bring nms into my project?

river oracle
#

?nms

quaint mantle
#

i last saw that i can just delete the -api but that brings up errors

lapis belfry
#

Y2K_ what if there is no pom.xml file in plugin ..
||Just askin||

remote swallow
summer scroll
#

you kinda need

lapis belfry
#

nms?

summer scroll
#

materials and stuff

remote swallow
river oracle
lapis belfry
#

Alice AntiCheat

river oracle
#

reflection and enums have things to allow you to do this Runtime

summer scroll
#

oh, i didn't know that

lapis belfry
#

I'm asking because my server is 1.18 and i need that plugin in 1.18 to work right?

remote swallow
#

you can just try and see if it works first

#

it might not need updating

river oracle
# summer scroll oh, i didn't know that

egg Material#matchMaterial runs runtime and since you mark server as provided it'll use the server's version of Material#matchMaterial in which that enum contains all the new materials. for shaded APIs the same logic doesn't apply however

remote swallow
#

if it does it would need more work

lapis belfry
#

Yes I'll try it tomorrow when I get on pc

quaint mantle
#

where should i build the BuildTools jar? What folder?

river oracle
#

or other cloud storage

quaint mantle
#

oh alr

tender shard
#

does yaml also support delimiters like java?
e.g.

number-of-ticks: 6_000
one-million: 1_000_000
#

or as the indians do it:

hundred-thousand: 1_00_000
#

shame

tardy delta
tender shard
tardy delta
#

a:1_000_000 being a strign?

#

or jsut the number

#

idk tho

tender shard
#

yeah I wanted to just use it as getInt or sth

#

actually I don't care, I just wondered

#

SnekYaml

tardy delta
#

python

tender shard
tardy delta
#

at that point just write binary

tender shard
#

it is allowed to use _ in numbers

river oracle
#

I just started making my configs in assembly

#

You have to print everything you want in the config yo std and all you are given to do it is a loose description of what values should be present

tranquil stump
#

is there any particular reason yaml is the standard

#

I like json more

#

I want to use it in my plugin but because it isn't the standard maybe I shouldn't

final monolith
#

My library is included at my plugin but the server doesn't recognizes it and throws a NoSuchMethodException 🤔

river oracle
#

Just use json tbh

river oracle
#

That's the only reason I use yaml I cbf to waste time doing that

tranquil stump
#

is there like a gson equivalent for yaml?

river oracle
#

Not that I know of

dry yacht
# tranquil stump is there any particular reason yaml is the standard

The main reason is that some people think that it's easier to read/write YAML because of the missing extra control characters like {} and [], while lists and objects are denoted in a more "human readable fashion". In reality, YAML is a clusterfuck which causes headaches daily, made everything worse and is the most stupid decision ever.

I personally think that we should slowly transition towards JSON, as it's not much harder to write (if at all), and causes way less issues.

final monolith
vale ember
tranquil stump
#

yaml is more "human readable" until it isn't

sturdy reef
#

guys, im trying to make a game using config files as storage for player's statistics..

vale ember
#

json ❤️

tranquil stump
#

json ❤️

sturdy reef
#

but when i save the config

dry yacht
final monolith
tardy delta
#

probably not already included

tranquil stump
final monolith
dry yacht
final monolith
#

i think its a version issue, thats a very old version (Spigot)

dry yacht
sturdy reef
#

when i write on the file nothing happens

#

no errors no anything

final monolith
#

savePlayerConfig(UUID uuid)

sturdy reef
final monolith
#

when this get performed?

sturdy reef
#

on the createPlayerConfig()

#

after giving the player the default stats

#
    public void join(PlayerJoinEvent e) {
        Player p = e.getPlayer();
        if (!Major.stats.hasPlayerConfig(p.getUniqueId())) {
            Major.stats.createPlayerConfig(p.getUniqueId());
        }```
dry yacht
#

"...Saved a Statistics file..." is printed tho, right?

dry yacht
#

That means neither the config nor the file can be null, that's something at least.

river oracle
#

why are you using a config file as a database?

quaint mantle
#

So I did the whole BuildTools stuff, downloaded it but now when i remove the -api in my pom.xml, i still cant import stuff like CraftPlayer etc

final monolith
vale ember
river oracle
#

?nms

final monolith
#

i recommend you to use SQLite

vale ember
#

1.14+ right?

final monolith
#

👍

dry yacht
quaint mantle
final monolith
quaint mantle
#
        <plugins>
            <plugin>
                <groupId>net.md-5</groupId>
                <artifactId>specialsource-maven-plugin</artifactId>
                <version>1.2.2</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-obf</id>
                        <configuration>
                            <srgIn>org.spigotmc:minecraft-server:1.18.2-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
                            <reverse>true</reverse>
                            <remappedDependencies>org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
                            <remappedArtifactAttached>true</remappedArtifactAttached>
                            <remappedClassifierName>remapped-obf</remappedClassifierName>
                        </configuration>
                    </execution>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-spigot</id>
                        <configuration>
                            <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
                            <srgIn>org.spigotmc:minecraft-server:1.18.2-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
                            <remappedDependencies>org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>```

this thing
final monolith
#

please

final monolith
river oracle
#

yes it is

#

lol

#

idk what you on

final monolith
river oracle
#

if you hate yourself its not

final monolith
#

xD

river oracle
#

give me a reason why you shouldn't use moj maps

#

its just better

quaint mantle
final monolith
quaint mantle
#

i ran the buildtools command in my desktop, thats fine right?

river oracle
#

check if its in your .m2

#

idk where that is on windows

quaint mantle
#

no clue wtf a .m2

#

is

river oracle
#

do you have maven

#

on your computer

final monolith
vale ember
final monolith
#

probably it not builded successfulltr

#

DAMN

#

SUCCESSFULY

#

SCUESFUY

#

SUCCESSFULLY

quaint mantle
#
Success! Everything completed successfully. Copying final .jar files now.
Copying spigot-1.19.3-R0.1-SNAPSHOT-bootstrap.jar to C:\Users\Acer\Desktop\.\spigot-1.19.3.jar
  - Saved as .\spigot-1.19.3.jar
#

end of the file

#

clearly is was successful

#

dw its a hard word lmfao

quaint mantle
twilit roost
#

whats best way to create timer over hotbar?
not just Scheduling tasks

final monolith
#

of the spigot

sturdy reef
final monolith
sturdy reef
quaint mantle
# final monolith yeah
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.19.3-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>```
#

this thing?

twilit roost
twilit roost
#

great

final monolith
#

try to remove that <build>

quaint mantle
#

nope, shows an error

tender shard
#

?nms

final monolith
quaint mantle
tender shard
#

worst advice ever

tender shard
quaint mantle
#

thats a lot of stuff to be removing seniore

quaint mantle
tender shard
#

have you even ran buildtools?

river oracle
final monolith
# tender shard NOOO

Did you know if 1.8.3 contains some bug in the libraries loading system? I've included a library into my plugin and at the 1.8.3 it gaves me a NoSuchMethodException at this library 🤔

quaint mantle
#

yeah, ran the command and it finished successfully according to the log

tender shard
quaint mantle
river oracle
#

Why tf would you ever use 1.8.3

tender shard
quaint mantle
#

and i cant use anything from bukkit or nms

#

what

tender shard
#

it's literally the first sentence in my blog post

river oracle
#

Apparently he ran build tools but it probably wasn't installed into his m2

quaint mantle
#

i literally ran it

final monolith
quaint mantle
#

i have the log

quaint mantle
#

and it says it finished just fine

tender shard
#

then click on the maven reload button in intellij

quaint mantle
#

alr

final monolith
tender shard
#

this should usually do it

#

alternatively, run mvn clean compile -U -X

quaint mantle
#

yep reloading it did it i think

river oracle
#

This could be the most intellij moment of all time imagine not automatically updating the local repo

#

Vscode stays winning

quaint mantle
#

YEP IT DID IT

final monolith
#

lets goooo

#

🥳

quaint mantle
#

bro, i love maven

#

smh

final monolith
#

i dont

quaint mantle
#

sarcasm

subtle folio
final monolith
#

xD

subtle folio
#

xml over wtv the f gradle is

#

should be dead with eclipse

remote swallow
#

gradle is love

final monolith
#

(1.8.3)

subtle folio
remote swallow
#

do you want a chicken nugget

subtle folio
final monolith
#

DONT JUDGE ME XD

subtle folio
#

1.8 was like 7 years ago

remote swallow
#

?1.8

undone axleBOT
final monolith
#

i have highly justifiable reasons

remote swallow
#

what are they

quaint mantle
#

Bruh hypixel milked 1.8 alr 😩

subtle folio
#

i can’t see any reason for 1.8.3??

quaint mantle
#

THE PVP

#

only reason i still play it

final monolith
subtle folio
#

hypixel runs a modified 1.7.10

final monolith
#

i need to test all versions

#

highly justifiable reasons

subtle folio
#

there is such a thing as too much legacy support

final monolith
#

i know

#

highly justifiable reasons

#

xD

subtle folio
#

might find help in the forum but idk who’s gonna help here

final monolith
#

i will try to use the BuildTools .jras

final monolith
remote swallow
#

?paste it

undone axleBOT
subtle folio
#

that’s not enough info

#

paste the whole error

tardy delta
#

then it isnt included

#

also use maven to build

subtle folio
ivory sleet
#

1.8.3 what in the world would motivate you to use this particular version

tardy delta
#

that ij build system breaks shaded dependencies

final monolith
quaint mantle
#

how do i make a gun that functions like one from actual triple A games. The gun shoots as long as I hold the left click button down and when my finger goes off the left click button, it stops shooting. Im sure theres something in nms but im not sure

ivory sleet
subtle folio
ivory sleet
tardy delta
#

1.7 💀

ivory sleet
subtle folio
#

yep

final monolith
ivory sleet
#

That’s from reflection

final monolith
#

that weird, at the v1_8_R1 that reason doesn't happens

ivory sleet
#

Oh

final monolith
ivory sleet
#

It was an error

final monolith
#

yeah

#

🤔

ivory sleet
#

Yes basically

#

The gson used on the server is an older version

final monolith
#

i will just use the old gson version

ivory sleet
#

Than you depend on

#

If someone didnt tell u that much alr

tardy delta
#

or shade it yourself

final monolith
tardy delta
#

what

final monolith
#

what you mean with shade

quaint mantle
tardy delta
#

include it yourself

#

as a dependency

final monolith
#

its already

#

thats the problem

tardy delta
#

dont use the ij build system i said

final monolith
#

why?

tardy delta
#

dont even know what im looking at

subtle folio
#

duh the ij build system is bad

final monolith
#

others versions works good

#

like v1_8_R1

tardy delta
#

cuz other versions have another version of that dependency ;-;

final monolith
#

i will check the maven build system then

tardy delta
#

do you even have a pom.xml?

ivory sleet
#

While you can setup a powerful build pipe environment with Ant, Gradle and Maven can do it better

#

And since maven is centralized among spigot devs, it is therefore the preferred option, tho gradle is becoming quite popular also

final monolith
#

sounds good

tardy delta
#

happy new year \😢

ivory sleet
#

Unit tests?

tardy delta
#

nah made my own test system

#

few hundred of expressions to be parsed, with their result underneath

subtle folio
remote swallow
#

he has been doing it for like 3 months now

tardy delta
#

quit it for a while so definitly not 3 months

subtle folio
#

why

remote swallow
#

well not constantly

subtle folio
#

does Math() work?

remote swallow
#

but you have been putting some effort in for 3 months atleast

tardy delta
#

Math?

remote swallow
subtle folio
#

oh right ofc

#

doesn’t redempt have a math library

remote swallow
#

yes

tardy delta
#

yes

subtle folio
#

that’s like stupidly speedy

remote swallow
#

its like somewhat slower than fourteens

subtle folio
#

oh lmfao

tardy delta
#

depends on expression length

remote swallow
#

milliseconds i think

subtle folio
#

does the speed difference really matter in the grand scheme of things ?

tardy delta
#

definitly not milliseconds

#

parsing of max(1, 3) + min(3, 2) doesnt even take a ms

subtle folio
#

wut

tardy delta
#

speeds are next to it

#

very jit compiler depending

subtle folio
#

wow

river oracle
#

It's goes pretty fast once you warm up

#

Damm thats crazy

tardy delta
#

yah

river oracle
#

I wonder if it's possible to beat those speeds

subtle folio
#

yes

#

if you know all the answers to every expression ever

#

just get it from a hashmap 😉

remote swallow
#

enum set

subtle folio
#

yes

#

even better

tardy delta
#

hashmap size would be too small

subtle folio
#

2,7b?

remote swallow
#

make an enum of enums with a few enums of enums

tardy delta
#

idk

#

the array can be Integer.MAX_VALUE long and then the buckets too ig

subtle folio
tardy delta
#

but it transforms itself when the size exceeds a certain threshold so dont really know

subtle folio
#

i see

remote swallow
#

Math.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A

#

boom

#

every math equasion

#

with answer

subtle folio
#

easy 1us parsing time

tardy delta
#

like i didnt even know the max length of a string is thr integer limit

subtle folio
#

is it!

remote swallow
#

whats the int limit

subtle folio
#

bc it’s a char

subtle folio
tardy delta
#

what if youre trying to read a very big file with Files.readString()

remote swallow
remote swallow
#

why

#

why cant i have an int the size of my ram

subtle folio
#

ficking processors idk

remote swallow
#

fuck t hem

subtle folio
#

get a 5gb int

#

see how java does with it

#

rust could probably handle it

remote swallow
#

i want a 16gb int

subtle folio
#

lmfso

tardy delta
#

hmm is a char really 16 bit?

subtle folio
#

yes

#

10110101101011101

quaint mantle
#

dumb man asking dumb question, how do i check whats in my main hand?

remote swallow
#

that i want to convert to binary, that to base64, that to spanish then to binary and base64 again

subtle folio
#

bc capital and symbols

chrome beacon
remote swallow
subtle folio
quaint mantle
#

ah yeah getinventory thats what im missing

remote swallow
#

you could use getItemInHand but its not recommended

subtle folio
#

deprecation

quaint mantle
#

yeah its gonna fuck with offhand stuff

#

so im not gonna

tardy delta
#

wait 16 bit, i thought i read 16 byte 💀

quaint mantle
#

why is my if check for it being not null always true tf

#

its on a playerinteract event

subtle folio
remote swallow
#

check for air too if its on an itemstack

#

bukkit is weird in which it uses

quaint mantle
#

good point

tardy delta
#

max length string being 4GB?

#

max int value (2147483647) * 16,assuming string use a char array and not a byte one

hardy garnet
#

I'm having a little issues with worlds right now in spigot. Say I create world 42 when the server is running and a player is in world 42

#

I then shut down the server and when I restart the server I (purposefully) don't have world 42 loaded anymore

#

I want to intercept players joining that were in world 42 and teleport them to a specific location in world

subtle folio
tardy delta
#

^^

hardy garnet
#

That sucks, I was hoping I could catch the name of the world they were in when they join

subtle folio
#

can’t catch the world’s name if they aren’t in a world

#

get stuck in a limbo

hardy garnet
#

The funny thing is, when the player joins again

#

player.getWorld doesn't return null

#

it returns world (default world)

#

so the server places the player in a world before the join event even fires

#

if the world was null it would still be fine with me I can still use that

subtle folio
#

that’s normal bukkit stuff

hardy garnet
#

Ugh. Lol

#

The server does print a warning in the server log, I wonder if there is a way I can catch that

subtle folio
quaint mantle
hardy garnet
quaint mantle
hardy garnet
#

If I don't have a choice I guess I will though

quaint mantle
#

okay so i managed to make a working gun, im using arrows as my projectile of choice, is there any way for me to set it to be invisible and instead have particles around it/following it?

remote swallow
#

entity#setInvisable

#

then just math im pretty sure

#

entity move even maybe

subtle folio
#

yeah

quaint mantle
#

see i have the arrow as a Arrow

subtle folio
#

take a look at a particle library for insipeiwtioj

#

arrow extends prokectile which is an entity

quaint mantle
#

i dont see the method for .setInvis

#

only seeing .setInvulnerable

quaint mantle
#

weird

twilit roost
#

how can I make ghost effect, without using additional teams?

quaint mantle
#

couldnt i just set the arrow to have an invis potion ig?

subtle folio
quaint mantle
#

again, i cant get the addPotionEffect to show up on the arrow

#

seems like its only applicable to living entities

tranquil stump
#

does version spigot api for 1.8.8 have persistent data containers

quaint mantle
#

no it has nbt

tranquil stump
#

how do I access the nbt

quaint mantle
#

couldnt tell ya, i dont use 1.8.8

tranquil stump
#

is there a class I can use to add data to an item

remote swallow
#

NBT api might exist for 1.8

subtle folio
onyx fjord
#

is anyone aware if its possible to revert upstreams patch?

#

i dont feel like uncommenting 1000 lines by hand

remote swallow
#

use notepad++ and use the replace feature

#

or intellij's replace

river oracle
#

Or vscodes replace feature uwu

subtle folio
tranquil stump
#

how can I convert a string like "&ahello" to ChatColor.GREEN + "hello"

buoyant viper
#

ChatColor.translateAlternateColorCodes iirc

#

?jd-s

undone axleBOT
buoyant viper
#

yeah

#

just make sure u use the bukkit ChatColor class and not the Bungee one @tranquil stump

tranquil stump
#

will this work?

        final String json = "[{\"fileName\":\"cannon.schematic\",\"name\":\"&aCannon\",\"lore\":[\"&aA cannon\"]}]";

        final SchemInfo[] schemInfosArray = gson.fromJson(json, SchemInfo[].class);

        // convert color codes with & to ChatColor enums
        for (SchemInfo schemInfo : schemInfosArray) {
            schemInfo.name = ChatColor.translateAlternateColorCodes('&', schemInfo.name);
            for (String line : schemInfo.lore) {
                line = ChatColor.translateAlternateColorCodes('&', line);
            }
        }
dry yacht
# twilit roost how can I make ghost effect, without using additional teams?

There's no way to do so without teams, mojang did not implement another redundant way to accomplish the effect. That's why I think that it's very important to have full control over teams on your server and why I usually dislike bloatware like the popular TAB plugin.

How do you want to use this effect?

tranquil stump
#

when I set line, will the effect still take place outside the scope? intellij says "The value 'ChatColor.translateAlternateColorCodes('&', line)' assigned to 'line' is never used" but it doesn't say the same for setting name

quaint mantle
#

I need developer in my server but cant FIND one i working always alone

river oracle
#

?services

undone axleBOT
dry yacht
quaint mantle
tranquil stump
dry yacht
#

If so, provide a paste of it.

tranquil stump
#
public class SchemInfo {
    public String fileName;
    public String name;
    public ArrayList<String> lore;

    @Override
    public String toString() {
        return "SchemInfo{" +
                "fileName='" + fileName + '\'' +
                ", name='" + name + '\'' +
                ", lore=" + lore +
                '}';
    }

}
dry yacht
#

You either have to iterate with indices and thus be able to set items and "exchange" them for their translated version or use the replaceAll function.

zealous scroll
#

Why does spigot pass the converted nms recipes into bukkit in PrepareItemCraftEvent instead of the instance that was originally registered?

I registered my own recipe CustomRecipe and when reading it from the event, I get a Recipe that's not equals to the one I registered

tranquil stump
#

so im holding obsidian in my hand that I got from the creative inventory, but its display name is null. how do i get its name or just "obsidian" if it doesn't have a "display" name?

eternal night
#

that is the translatable name of the material

tranquil stump
#

ah ok that makes sense

#

thx

#

i guess ill just make a quick workaround

eternal night
#

what do you need it for

tranquil stump
#

the actual thing will have a display name but i didn't want to write a command to give me a block with custom display name for testing

dry yacht
eternal night
#

hmm, yea well falling back onto the en_us translation of the material minecraft:obsidian is pretty meh with spigot API

#

last I checked at least

tranquil stump
#

Block at -386,67,174 is DROPPER but has net.minecraft.server.v1_8_R3.TileEntityDispenser@3992089f. Bukkit will attempt to fix this, but there may be additional damage that we cannot recover. what does this mean

final monolith
#

How to build with maven guys? can someone give me a tutorial link or smth?

eternal night
#

mvn package

#

if you just want to build

zealous scroll
final monolith
#

libraries included

eternal night
#

yes

#

mvn package

#

if you want to include libraries

final monolith
#

oh thanks 🙂

dry yacht
eternal night
#

use the maven shade plugin

#

yea

#

idk if you are talking about your plugin that you have to configure

dry yacht
#

I can show you an example of how I build my stuff, one second, you can maybe find some inspiration from that

eternal night
#

or another plugin you are just trying to build

tranquil stump
dry yacht
final monolith
#

awesome, thanks 🙂

dry yacht
# final monolith awesome, thanks 🙂

Maven really takes some time getting used to, but once you got it, it's really easy, believe me. Maven plugins are just a processor in the chain and transform your result. Btw, maven plugin order matters, they're executed in that order they're specified in (not going to matter for what you do, but it's good to know this).

buoyant viper
dry yacht
#

I just wanted to see what API you call to register a recipe, as I haven't worked with bukkit in ages. Looks like the recipe you pass is just a wrapper for them and they convert to the CraftRecipe anyways, thus not keeping a hold of the original. It's sad that they cannot even keep a ref to it... Well. I think you have to identify your recipe by providing a namespaced key (just something unique) in it's constructor and then map locally to resolve to your internal data type. Hope these infos help you.

dry yacht
dry yacht
final monolith
#

?paste

undone axleBOT
buoyant viper
final monolith
buoyant viper
#

its usually just oh i need this plugin for maven let me add it and configure it

final monolith
#

Still gives me a NoSuchMethodException

#

maybe the shading failed?

buoyant viper
#

not thinking that if something to happen BEFORE another plugin executed that it would actually matter how i have them in plugins section

dry yacht
zealous scroll
dry yacht
dry yacht
#

Wait, you didn't specify any includes in your pom

#

groupId:artifactId of the dependencies you want to shade

#

It will never just shade all your dependencies by default, except for when you instruct it to do so with a wildcard, which would be insanity, lol. Rather have inclusions than exclusions.

final monolith
#

Ooh ok

#

Thanks!

quaint mantle
#

so im using the projectile launch event and looking to get the pdc of an arrow, but trying e.getPers... doesnt work

#

got it nvm

worldly ingot
quaint mantle
#

?pasre

#

?paste

undone axleBOT
quaint mantle
dry yacht
quaint mantle
#

what do i need to put in my main class for a runTaskTimer?

undone axleBOT
quaint mantle
#

not exactly what i meant, i meant how do i get the task to start running

#

i know i need to put somehting in the main class, i dont remember what

#
@EventHandler
    public void onShotFollowingTrail(ProjectileLaunchEvent e) {
        if (e.getEntityType() == EntityType.ARROW) {
            if(e.getEntity().getPersistentDataContainer().has(new NamespacedKey(Nebula.getPlugin(), "a8pistol"), PersistentDataType.STRING)) {

                new BukkitRunnable() {
                    @Override
                    public void run() {
                        Location loc = e.getLocation();
                        World world = e.getEntity().getWorld();
                        world.spawnParticle(Particle.REDSTONE, loc, 50);

                        if (e.getEntity().isDead() || e.getEntity().isOnGround()) {
                            cancel();
                        }
                    }

                }.runTaskTimer(Nebula.getPlugin(), 0L, 5L);
            }
        }```

this is where my task is, what should i change then? It should be running no?
#

so nothing needed in my main class yeah?

#

alr

#

since ur here

#

lemme ask u this

#

what should be the way i pass an instance of my plugin?

undone axleBOT
quaint mantle
#

whats the better method?

#

no i created it

#

its a getter

#
@EventHandler
    public void onShotFollowingTrail(ProjectileLaunchEvent e) {
        if (e.getEntityType() == EntityType.ARROW) {
            if(e.getEntity().getPersistentDataContainer().has(new NamespacedKey(Nebula.getPlugin(), "a8pistol"), PersistentDataType.STRING)) {

                Bukkit.getScheduler().runTaskTimer(Nebula.getPlugin(), task -> {
                    Location loc = e.getLocation();
                    World world = e.getEntity().getWorld();
                    world.spawnParticle(Particle.REDSTONE, loc, 50);
                    System.out.println("s");

                    if (e.getEntity().isDead() || e.getEntity().isOnGround()) {
                        task.cancel();
                    }
                }, 0L, 5L);
            }
        }```

complete piece of code, no particles being spawned nor is "s" being printed so the task isnt running
#

sure

#

yep event is running

#

yeah me too

#

im gonna check that

#

yep the pdc is the issue

#

odd

#
@EventHandler
    public void onShoot(PlayerInteractEvent e) {
    Player p = e.getPlayer();
    if (p.getInventory().getItemInMainHand().getItemMeta() != null) {
        if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
            Arrow bullet = (Arrow)p.getWorld().spawn(p.getEyeLocation(), Arrow.class);
            bullet.setShooter((ProjectileSource)p);
            bullet.setVelocity(p.getLocation().getDirection().multiply(4.5D));
            bullet.setDamage(5.0);
            PersistentDataContainer bulletPDC = bullet.getPersistentDataContainer();
            bulletPDC.set(new NamespacedKey(Nebula.getPlugin(), "a8pistol"), PersistentDataType.STRING, "shot");
            PacketPlayOutEntityDestroy packet = new PacketPlayOutEntityDestroy(bullet.getEntityId());
            ReflectionUtils.sendPacket(p, packet);

        }

        }
    }```

and im setting the pdc here, why wouldnt it work 🤔
torn basalt
#
[01:14:27 ERROR]: Could not pass event PlayerJoinEvent to FoudreLobby vv0.0.1
java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "this.text" is null
        at java.util.regex.Matcher.getTextLength(Matcher.java:1769) ~[?:?]
        at java.util.regex.Matcher.reset(Matcher.java:415) ~[?:?]
        at java.util.regex.Matcher.<init>(Matcher.java:252) ~[?:?]
        at java.util.regex.Pattern.matcher(Pattern.java:1134) ~[?:?]
        at com.tr.denizusta.foudrelobby.Main.color(Main.java:41) ~[?:?]
        at com.tr.denizusta.foudrelobby.events.OnJoin.onJoin(OnJoin.java:17) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor1.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.5.jar:git-Paper-794]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.PlayerList.postChunkLoadJoin(PlayerList.java:356) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.PlayerList.lambda$a$1(PlayerList.java:303) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.PlayerConnection.tick(PlayerConnection.java:316) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.NetworkManager.a(NetworkManager.java:408) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.ServerConnection.c(ServerConnection.java:168) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1520) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:436) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1347) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1135) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.Thread.run(Thread.java:833) [?:?]
#

someone can help me?

#
    public static void createBoard(final Player player) {
        (new BukkitRunnable() {
            public void run() {
                if (Bukkit.getPlayer(player.getUniqueId()) == null) {
                    cancel();
                } else {
                    ScoreboardManager manager = (ScoreboardManager) Bukkit.getServer();
                    Scoreboard board = (Scoreboard) manager.getNewScoreboard();
                    Objective obj = manager.getMainScoreboard().registerNewObjective("foudre", "studios", "foudre");
                    obj.setDisplaySlot(DisplaySlot.SIDEBAR);
                    obj.setDisplayName(color(Main.plugin.getConfig().getString("scoreboard.title")));
                        List<String> lines = Main.plugin.getConfig().getStringList("scoreboard.lines");
                    for (int i = 0; i < lines.size(); i++) {
                        Score score = obj.getScore(color(PlaceholderAPI.setPlaceholders(player, lines.get(i))));
                        score.setScore(-i + lines.size());
                    }
                    player.setScoreboard((org.bukkit.scoreboard.Scoreboard) board);
                }
            }
        }).runTaskTimer(Main.plugin, 0L, Main.plugin.getConfig().getInt("scoreboard.update-ticks") * 20L);
    }
```my code
quaint mantle
torn basalt
drowsy helm
torn basalt
drowsy helm
#

message is null

torn basalt
#
    public static String color(String message) {
        Pattern pattern = Pattern.compile("#[a-fA-F0-9]{6}");
        Matcher matcher = pattern.matcher(message);
        while (matcher.find()) {
            String hexCode = message.substring(matcher.start(), matcher.end());
            String replaceSharp = hexCode.replace('#', 'x');

            char[] ch = replaceSharp.toCharArray();
            StringBuilder builder = new StringBuilder("");
            for (char c : ch) {
                builder.append("&" + c);
            }

            message = message.replace(hexCode, builder.toString());
            matcher = pattern.matcher(message);
        }
        return ChatColor.translateAlternateColorCodes('&', message);
    }
tardy delta
#

dont compile that pattern oon every invocation

#

its pretyy heavy

torn basalt
#

let me try

#

i fixed it

#

but now

#
[01:56:36 WARN]: [FoudreLobby] Task #1429 for FoudreLobby v0.0.1 generated an exception
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_16_R3.CraftServer cannot be cast to class org.bukkit.scoreboard.ScoreboardManager (org.bukkit.craftbukkit.v1_16_R3.CraftServer and org.bukkit.scoreboard.ScoreboardManager are in unnamed module of loader 'app')
        at com.tr.denizusta.foudrelobby.managers.Scoreboard$1.run(Scoreboard.java:24) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:485) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1432) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:436) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1347) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1135) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.Thread.run(Thread.java:833) [?:?]
worldly ingot
#

(ScoreboardManager) Bukkit.getServer();

#

That's not valid and your IDE should be warning you about this

#

ScoreboardManager manager = Bukkit.getScoreboardManager()

vocal cloud
#

Notepad++?

opal juniper
worldly ingot
#

lol no no

buoyant viper
#

its the little features that count :) gonna try and extend this to all entities and make entity-specific particles happen on damage (ie. bone item crack for skeletons and skele horses)

#

theres probably a million other plugins that already do that but its more fun when u do it urself

torn basalt
# worldly ingot `(ScoreboardManager) Bukkit.getServer();`
[02:06:38 WARN]: [FoudreLobby] Task #1777 for FoudreLobby v0.0.1 generated an exception
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_16_R3.scoreboard.CraftScoreboard cannot be cast to class com.tr.denizusta.foudrelobby.managers.Scoreboard (org.bukkit.craftbukkit.v1_16_R3.scoreboard.CraftScoreboard is in unnamed module of loader 'app'; com.tr.denizusta.foudrelobby.managers.Scoreboard is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @751af8a4)
        at com.tr.denizusta.foudrelobby.managers.Scoreboard$1.run(Scoreboard.java:25) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:485) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1432) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:436) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1347) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1135) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.Thread.run(Thread.java:833) [?:?]
eternal night
torn basalt
#
    public static void createBoard(final Player player) {
        (new BukkitRunnable() {
            public void run() {
                if (Bukkit.getPlayer(player.getUniqueId()) == null) {
                    cancel();
                } else {
                    ScoreboardManager manager = Bukkit.getScoreboardManager();
                    Scoreboard board = (Scoreboard) manager.getNewScoreboard();
                    Objective obj = manager.getMainScoreboard().registerNewObjective("foudre", "studios", "foudre");
                    obj.setDisplaySlot(DisplaySlot.SIDEBAR);
                    obj.setDisplayName(ChatColor.translateAlternateColorCodes('&', Main.plugin.getConfig().getString("scoreboard.title")));
                        List<String> lines = Main.plugin.getConfig().getStringList("scoreboard.lines");
                    for (int i = 0; i < lines.size(); i++) {
                        Score score = obj.getScore(ChatColor.translateAlternateColorCodes('&', PlaceholderAPI.setPlaceholders(player, lines.get(i))));
                        score.setScore(-i + lines.size());
                    }
                    player.setScoreboard((org.bukkit.scoreboard.Scoreboard) board);
                }
            }
        }).runTaskTimer(Main.plugin, 0L, Main.plugin.getConfig().getInt("scoreboard.update-ticks") * 20L);
    }
#

what i did wrong idk

eternal night
#

wrong scoreboard cast

#

wrong import for that scoreboard

worldly ingot
#

Yeah you don't need to be casting anything there

#

getNewScoreboard() should return you a Bukkit Scoreboard

#

Fix your imports and you won't need to cast anything

torn basalt
#

org.bukkit.scoreboard.Scoreboard

#

import org.bukkit.scoreboard.*;

#
[02:09:30 WARN]: [FoudreLobby] Task #1252 for FoudreLobby v0.0.1 generated an exception
java.lang.NoClassDefFoundError: me/clip/placeholderapi/PlaceholderAPI
        at com.tr.denizusta.foudrelobby.managers.Scoreboard$1.run(Scoreboard.java:29) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:485) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1432) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:436) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1347) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1135) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.ClassNotFoundException: me.clip.placeholderapi.PlaceholderAPI
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:155) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:114) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        ... 9 more
jagged monolith
torn basalt
#

i installed

#

1 min

#

would have deactivated the plugin if I hadn't downloaded it

jagged monolith
#

The first part of that error says placeholderapi not found.

#

What's line 29 of the Scoreboard class

torn basalt
#

i fixed it

#
[02:14:57 WARN]: [FoudreLobby] Task #1787 for FoudreLobby v0.0.1 generated an exception
java.lang.IllegalArgumentException: An objective of name 'foudre' already exists
        at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:47) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:84) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:62) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:20) ~[patched_1.16.5.jar:git-Paper-794]
        at com.tr.denizusta.foudrelobby.managers.Scoreboard$1.run(Scoreboard.java:24) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:485) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1432) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:436) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1347) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1135) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.Thread.run(Thread.java:833) [?:?]
#

i want kms

jagged monolith
#

That one is pretty obvious as well

#

Can't have 2 objectives with the same name.

torn basalt
#

so

#

registerNewObjective("foudre", "studios", "foudre");

#

i changing to this

#

registerNewObjective("foudre", "studios", "foudre2");

#

?

jagged monolith
#

Yeah, you can only have 1 of each

torn basalt
#
[02:19:49 WARN]: [FoudreLobby] Task #1783 for FoudreLobby v0.0.1 generated an exception
java.lang.IllegalArgumentException: An objective of name 'foudre' already exists
        at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:47) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:84) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:62) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:20) ~[patched_1.16.5.jar:git-Paper-794]
        at com.tr.denizusta.foudrelobby.managers.Scoreboard$1.run(Scoreboard.java:24) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:485) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1432) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:436) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1347) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1135) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.Thread.run(Thread.java:833) [?:?]
#

#

Objective obj = manager.getMainScoreboard().registerNewObjective("foudre", "studios", "foudrestudios");

jagged monolith
#

Delete all objectives from the scoreboard then register the new ones it still has a trace of them old one

torn basalt
#

i added placeholderapi and citizens to depend but

#

its still giving this error

#
[02:25:25 WARN]: [FoudreLobby] Task #1790 for FoudreLobby v0.0.1 generated an exception
java.lang.IllegalArgumentException: An objective of name 'dummy' already exists
        at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:47) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:84) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:62) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:20) ~[patched_1.16.5.jar:git-Paper-794]
        at com.tr.denizusta.foudrelobby.managers.Scoreboard$1.run(Scoreboard.java:24) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:485) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1432) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:436) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1347) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1135) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.Thread.run(Thread.java:833) [?:?]
#

but the scoreboard come

chrome beacon
#

Yeah you can't create a new objective if it already exists

torn basalt
#

now its gone

hardy garnet
#

can chunk.load load chunks which have not been rendered yet?

nova sparrow
#

How do you check whether a player is looking at an entity

hardy garnet
#

Probably something to do with raytracing

chrome beacon
#

^ rayTraceEntities

hardy garnet
# chrome beacon Yes

Okay, because my program is supposed to be doing chunk.load and spawn entities in that chunk

#

and unloads the chunk, but it seems there is an issue with that

#

program can't find the entities that are supposed to be spawning

chrome beacon
#

What version are you making the plugin for?

hardy garnet
#

1.19

#

spigot server is 1.19.2, but I figured it would be the same as 1.19.3

buoyant viper
#

spawning did actually change between 1.19.2 to 1.19.3 didnt it

#

something with light levels

vivid cave
#
  1. how to get the default world/main world?
  2. When i do Bukkit.createMap(world), is this map available from any world? Or does its ID increment differently from world to world? Like does each world have their own ID counter?
hardy garnet
chrome beacon
hardy garnet
vivid cave
chrome beacon
#

Be aware of mobs that despawn and such however

hardy garnet
#

alternatively, going in-game and going into f3 will have a name for the world minecraft:world_name, but this is not foolproof

chrome beacon
vivid cave
#

i'm mostly concerned about 2)

#

where i create this map is absolutely no contextual (no context)

#

so i don't really know what to put there

chrome beacon
#

I believe the map count is global

#

So the id isn't per world

vivid cave
#

okay cool 🙂

#

thx

chrome beacon
#

Though looking at the api methods I might be wrong

#

You can always check the implementation just to be sure

vivid cave
#
    @Override
    public CraftMapView createMap(World world) {
        Validate.notNull(world, "World cannot be null");

        net.minecraft.world.level.World minecraftWorld = ((CraftWorld) world).getHandle();
        // creates a new map at world spawn with the scale of 3, with out tracking position and unlimited tracking
        int newId = ItemWorldMap.createNewSavedData(minecraftWorld, minecraftWorld.getLevelData().getXSpawn(), minecraftWorld.getLevelData().getZSpawn(), 3, false, false, minecraftWorld.dimension());
        return minecraftWorld.getMapData(ItemWorldMap.makeKey(newId)).mapView;
    }
#

@chrome beacon the impl^

#

doesn't help much does it

#

esp since ItemWorldMap is an NMS class

#

now good luck understanding nms

#

xd

chrome beacon
#

It's not that hard when you have a good understanding of Java

vivid cave
#

i don't even know where to find the impl of NMS

chrome beacon
#

Though something I wouldn't touch is the DFU

#

I'll stay as far away from that as I can

vivid cave
#

fair enough

vivid cave
#

but reading code is easy when you know what it's dealing with, the least info u have, and the more decrypting u need to do 😛

chrome beacon
#

The Minecraft wiki usually has all the information you need

vivid cave
#

Plus, NMS is obfuscated lol (i don't think i can find any versions with mojmaps directly applied to the source)

chrome beacon
#

Any good environment will provide you with a mapped source you can use

#

Spigot, Paper, Forge, Fabric, Quilt all of them have tools to map sources so you can view them

vivid cave
glossy venture
chrome beacon
#

DataFixerUpper

#

It's generic hell

#

and probably the most over engineered part of the mc source

eternal night
#

Lies

#

You have not dabbled in the hell that is codex yet

chrome beacon
#

👀 What's it used for

eternal night
#

A serializer on crack

#

Used mostly to convert shit to network ready bytes

#

It's horror

glossy venture
#

the codec shit is in like every nms class

chrome beacon
#

Time to take a look

chrome beacon
chrome beacon
eternal night
#

Nah

chrome beacon
#

I found decoders for byte messages but they don't look that bad

#

I'm just going to assume the codec you're talking about is part of the DFU

eternal night
#

Lemme look it up

chrome beacon
#

Because that's the only codec I've seen in the code

eternal night
#

com.mojang.serialization.Codec

#

is the specific type

chrome beacon
#

Yeah that's part of the DFU

eternal night
#

it is

#

horror

#

pain

#

depression

chrome beacon
#

I know I've worked with it 💀

eternal night
chrome beacon
#

I used it when modding

eternal night
#

protobuf where are you

chrome beacon
#

Thankfully I could just copy paste and slightly modify Mojangs code to suit my needs

#

I believe I scrapped that in the end though

opal juniper
spice shoal
#

Guys , how i can give a custom item in determinated slot?

        p.getInventory().addItem(instance**.getTotem**());

i use this but give item where the slot is empty

chrome beacon
#

Try using the Javadocs next time

balmy valve
#

so setCollidable just isn't working

#

from the LivingEntity class

#

any ideas?

spice shoal
#

?help

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 names and nicknames of a member.
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.

tulip nimbus
#

oops i just saw thats answered

spice shoal
#

idk but show errors

limpid bloom
#

need some help

jagged monolith
# spice shoal

Because you need to create the itemstack first. and pass it into setItem

rotund ravine
jagged monolith
#

Yep, and you need the actual slot number.

spice shoal
chrome beacon
#

?learnjava You really should follow some Java tutorials

undone axleBOT
spice shoal
#

which is better?

#

1 2 3 4 5?

chrome beacon
#

I recommend trying some different courses

spice shoal
#

oh ok , thanks

vocal cloud
#

Try and find what works best

chrome beacon
#

I've heard that https://java-programming.mooc.fi/ should be quite good too

spice shoal
#

thanks :))

jagged monolith
#

I've used courses from Udemy which aren't bad.

ionic thicket
buoyant viper
#

image.png.xml

#

what the fuck

ionic thicket
#

wait

#
package events;
import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.ItemStack;

import pack1.PluginMain;
public class OnPlayerMovingListener implements Listener{
    
private Plugin plugin = PluginMain.getPlugin(PluginMain.class);
    
    @EventHandler
    public void onMovingPlayer(PlayerMoveEvent playerCoinvolto) {
        
            
        Player player = playerCoinvolto.getPlayer(); //In questo modo ogni volta che scriveremo player, ci riferiamo al player coinvolto (All'interno di questo metodo)
        
        if(!player.hasPermission("testplugin.move")){
            playerCoinvolto.setCancelled(true);
            }
        
        Block bloccoSottostante = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
        ItemStack diamondPick = new ItemStack(Material.DIAMOND_PICKAXE, 1);
        if(bloccoSottostante.getType() == Material.COBBLESTONE) {
                player.getInventory().addItem(diamondPick);
            
        }
        
    }
}





#

should i use pastebin?

twilit pulsar
#

hey im wondering if anyone can test my plugin rq?

buoyant viper
buoyant viper
undone axleBOT
ionic thicket
buoyant viper
#

you have org.apache.logging.log4j.core.config.plugins.Plugin imported

ionic thicket
#

oh that

buoyant viper
#

yeah

#

u need the one in org.bukkit

ionic thicket
#

oke

#

done thank you

humble tulip
#

Or 16

buoyant viper
#

i mean... if u can send the packets duke

#

but yeah its spigot p sure

#

dont think it has much beyond chat but

#

?jd

buoyant viper
#

oh shit

#

there is something for scoreboard?!

undone axleBOT
buoyant viper
#

hm

hardy garnet
#

You guys have any ideas on how to stop items going through portals?

#

Would that work you think?

undone axleBOT
hardy garnet
#

The event is not cancellable

#

Lol if only

#

Unfortunately I need to go for style points

torn badge
#

Maybe just teleport it somewhere else?

tribal wraith
#

I'm missing the spigot() method from my Player class in 1.8.8
I've compiled using spigot and not craftbukkit

#

Does anyone know the issue?

jagged monolith
#

Don't use 1.8.8

tribal wraith
#

I kind of have to

#

I agree with you wholeheartedly

jagged monolith
#

Well the spigot() method does apply to player is 1.8.8 so you must be doing something wrong

tribal wraith
#

Yea that's what I'm trying to figure out

#
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>```
```<dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>``` I'm using the right spigot repository
fluid river
#

hape niu yer

vocal cloud
#

Most sober Russian

fluid river
#

rtue...

short surge
#

IntelliJ reports the spigot API to contain a few vulnerabilities, is there anything I can do about this as a plugin developer?

        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.19.3-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
Provides transitive vulnerable dependency com.google.protobuf:protobuf-java:3.19.4
CVE-2022-3171 7.5 Uncontrolled Resource Consumption vulnerability with medium severity found
CVE-2022-3509 7.5 Uncontrolled Resource Consumption vulnerability with medium severity found
jagged monolith
#

It will be fine

hardy garnet
#

So a big problem I am having is players time out of the server when spigot is loading a new world (from a world file not creating a new one). It takes too long for it load the spawn region of the world and everyone times out

bold crane
#

Does anyone know why when I try to import this into eclipse it just dosnt work even I put the spigot.jar into the pathspublic class Main extends JavaPlugin{

buoyant viper
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

bold crane
#

1.19.2

buoyant viper
#

close enough

#

it doesnt have the classes of the api in it, thats why

bold crane
#

ohhh

#

I see thank you

buoyant viper
#

ye, better to use maven or gradle than to try and directly depend on the jars

bold crane
#

Ill do that now, sad tho

bold crane
#

Was using eclipse but it seems to not be the program anymore

torn basalt
#
    @EventHandler
    public void onClick(NPCClickEvent event) {
        String npc = event.getNPC().getName();
        final ConfigurationSection section = Main.plugin.getConfig().getConfigurationSection("bungeecord-npc");
        for (String npcname : section.getKeys(false) ) {
            for (String servername  : section.getKeys(false) ) {
                final String data = Main.plugin.getConfig().getString("bungeecord-npc." + npcname + "." + servername);
                if (npc.equalsIgnoreCase(npcname)) {
                    Main.sendPlayerToServer(event.getClicker().getPlayer(), servername);
                    event.getClicker().getPlayer().sendMessage("Başarıyla" +npcname+" adlı npc ile "+servername+ " sunucusuna gidiyorsun.");
                }
            }
        }

    }
```i have code like and have config like this:

bungeecord-npc:
skyblock:
server: skyblock
towny:
server: towny

#

when player click a npc its check npc name if the npc name added to bungeecord-npc section plugin get the server and send player to server

vagrant stratus
#

?paste

undone axleBOT
vagrant stratus
#

So, I'm trying to get a consistent method to check if a string is encoded with Base64 and my current methods are https://paste.md-5.net/zezuwodebo.java
The issue however is that I cannot get a method that works consistently for the test strings.

Using the following strings:
SGVsbG8sIFdvcmxkIQ==
Hello, World!
HidePlreload

I get the following results: https://paste.md-5.net/omehorubow.bash
For whatever reason the first one fails 1 test, the middle passes all of them, and then the last string fails all but 1 😐

#

Looking through logs /plugins, /ver, /version, /ifo, /lag, and /mem are also treated as base64 encoded strings

buoyant viper
#

well, cant any string /be/ base64 technically

real blaze
#

quick question, for PlayerRespawnEvent, does anyone know if event.getPlayer().getWorld() gets the world where the player died in or the world the player is attempting to spawn in?

vagrant stratus
buoyant viper
#

could always just test it out to check

real blaze
#

was lazy to check due to testing it on a modded server, so the answer is appreciated

sonic goblet
#

I can test real quick if u want

real blaze
#

go ahead if you want to

buoyant viper
#

but something must be wrong with how youre checking the chars

#

oh wait isBase642 fails all

#

hmm

#

isBase641/3/4 might be right then

vagrant stratus
#

Yea, but those exact ones also say HidePlreload is base64 lmao

#

Ig if anything I just log & check extra stuff 🤷‍♂️

buoyant viper
#

well, i think it is

#

looks like a base64 string doesnt NEED to end with equals

vagrant stratus
buoyant viper
#

idk maybe that specific one doesnt have ascii chars

vagrant stratus
#

hmmm

buoyant viper
#

base64 looks a bit wonky

vagrant stratus
#

Yea

#

Ig if anything I just log & check more shit lmao

sonic goblet
real blaze
vagrant stratus
#

It's also possible something else is fucky, but I'm not too sure on that one

real blaze
#

alright now im trying to do something real weird

#

how should I record the output of a command

vagrant stratus
#

What's annoying is that out of every single in the log those are the only ones being detected as Base64 @buoyant viper

buoyant viper
#

hmm

vagrant stratus
#

Minecraft for example, not considered Base64
v not considered Base64
\plugins also not considered Base64 but /plugins is

#

/pl on the other hand is also not considered Base64

#

Shit's fucked

buoyant viper
#

well from the list of valid chars for base64 yeah i think \plugins isnt one

#

bc \

vagrant stratus
#

time to test all of these against the 4 methods lmao

#

?paste

undone axleBOT
vagrant stratus
#

lmao bruh

#

At this rate I'll just drop base64 support lmao

buoyant viper
#

yeah i think isBase642 is def just like

#

Dead

#

idk

sonic goblet
#

If a BukkitRunnable calls a method in a different class and that class has a while loop will that freeze the main thread?

sullen marlin
#

if the runnable is sync, yes

#

if the runnable is async, no

sonic goblet
#

Ok ty

#

That makes sense lol

quaint mantle
#

hi

#

i am writing a small minigame and i wanted to write the while loop for the game.

#

should i use multi-threading for it?

#

just a while loop

#

that does things every certain interval.

tranquil stump
#

is there a way to make it so while my player is in a conversation using the convo api they are not able to move, place blocks, etc. they are ONLY allowed to type in chat

quaint mantle
#

i am trying to run an asynchronously task in the background without freezing the main game thread. How would i do it?

lapis belfry
#

i need help
i am using old plugin in new server version but i am getting kicked for timed out how to change plugin version?

river oracle
#

you don't need to unless it uses NMS

#

if you aren't the author contact them

#

if they don't respond

#

find an alternative or get rid of it

#

there is no cut paste solution

rough drift
crystal palm
#

heyo. what'd be the best way to insert a key & a value into a nested hashmap?

eternal oxide
#

.get(...).put(k,v)

crystal palm
#

actually ig this wouldnt even work in the first place

eternal oxide
#

why is your first key the same as your second?

crystal palm
#

it isnt supposed to be

#

its <UUID HM<String, Integer>>

eternal oxide
#

you are trying to insert a UUID, integer

#

as you call get on teh main map

#

your map shoudl be Map<UUID, Map<String, integer>>

river oracle
#

what are you doing here? looks like your storing player name and some number, honestly think a custom Data class would bess fit your scenario more as then it'd also be more expanadable. e.g. you want to add a third value.

eternal oxide
#

then it's testing.put(p.getUniqueId(), testing.get(p.getUniqueId()).put(p.getName(), value)