#help-development

1 messages · Page 1987 of 1

undone axleBOT
smoky oak
#

because if i set the upward velocity of a player WHILE they hold an item and right click (flight) if there's a 4 tick delay they just hop up and down

lavish hemlock
#

getOfflinePlayer should work for all players, as Player is also an OfflinePlayer

smoky oak
#

and i really dont want to do more static hashmaps

misty ingot
#

I need to kick them after adding them to the bukkit banlist

lavish hemlock
#

player.isOnline() exists iirc

#

if that returns true, you can cast to Player

misty ingot
#

welp, time to rewrite all the code

lavish hemlock
#

or on newer versions of Java, you may also want to use pattern matching w/ an instanceof

#

e.g.

if (oplayer instanceof Player player) {
    player.kick();
}

(or something like that)

misty ingot
#

so If an offlineplayer returns as null, I can be sure to say that the player does not exist at all right

smoky oak
#

alternatively i could just run a task timer 3 times but idk if i can do that with an internal value. is it possible to get how often a task has been run?

ivory sleet
#

iirc Server::getOfflinePlayer yields a CraftOfflinePlayer regardless so best way to obtain the normal player would be with OfflinePlayer::getPlayer

#

(And null check obv)

sharp flare
#

using the method mentioned by the peeps above

misty ingot
#

I cannot check if an offline player has a certain permission, however I would like to check if they have the ban.exempt permission

ivory sleet
#

Vault API allows you to

tardy delta
#

Do they work with a database or something?

ivory sleet
#

Well VaultAPI is just a bridge

#

It offers a set of interfaces which any plugin can implement and provide

quaint mantle
#

Restart is like 2-3 seconds. I use run-paper gradle plugin to simplify debug

trail pilot
#

Damn

quaint mantle
#
            ItemStack iron_sword = new ItemStack(Material.IRON_SWORD);
//            Enchantment enchantment = new Enchantment();
//            iron_sword.addEnchantment(null, 0);
#

does using addEnchantment really work?

lost matrix
quaint mantle
#

why do they have it then?

ivory sleet
#

Legacy probably

lost matrix
#

addEnchantment(null, 0) lul

lavish hemlock
#

Backwards compat is the cause of all evil

grim ice
#

uh

quaint mantle
#

We know right

grim ice
#

anyone can help test smth

quaint mantle
grim ice
#

actually nvm

lavish hemlock
#

Example: Want reified generics? Too bad, backwards compatibility.

quaint mantle
ivory sleet
grim ice
#

u have to login mc tho

quaint mantle
#

my laptop cant even run mc

lavish hemlock
#

Speaking of Java, I really fuckin' want Project Valhalla to come out >:(

ivory sleet
#

Yeah, I’ll get a virtual orgasm once valhalla is out fr

quaint mantle
#

By the way how was I supposed to know I need to use ItemMeta?

summer scroll
ivory sleet
#

Idk

quaint mantle
#

I didnt even know about that class till I googled how to add enchantments

ivory sleet
#

Yeah torchun it’s not trivial at first

#

But now you know (:

grim ice
#

uhhh actually i still need someone to test with me

quaint mantle
#

please someone help Hex

#

i like his pfp

ivory sleet
quaint mantle
#

wait no way

grim ice
#

lol

quaint mantle
#

i just realized it

#

that is diamond armor

#

he made the diamond armor become sus

#

i can see it now

misty ingot
#

why is it showing with the red underline and a bunch of errors

#

I copied it as is

#

hao

#

oh I just did that

#

it worked thanks

#

I havent actually worked with any APIs before :p

ivory sleet
#

Cap

smoky oak
#

should i just launch a task three times with different delays or do a counter in it?

ivory sleet
#

I’d say the former

#

But if you want to keep the same task object the latter would suit you better

smoky oak
#

eh I really dont need it

#

the most complicated part is doing it so i dont actually write the code three times

ivory sleet
#

Ye

smoky oak
#

bc this far I'Ve been doing new BukkitRunnable(){@Override public void run{}}.runTaskTimer...

ivory sleet
#

Looks a bit compact but nice

smoky oak
#

of course i have line breaks in there

ivory sleet
#

🙏

smoky oak
#

i just dont know why to bother doing a BukkitRunnable object if i can just initialize and directly schedule it

ivory sleet
summer scroll
#

Does restoring the nether portal inside runTaskTimer will have different result or something?

ivory sleet
#

I don’t think so

#

But like what goes wrong specifically?

summer scroll
#

It only sets one block

smoky oak
#

is .runTask(Plugin) equivalent to .runTaskLater(Plugin, 0) ?

ivory sleet
#

Yeah

summer scroll
#

runTask will run 1 tick after

ivory sleet
#

or if it was 1L

summer scroll
#

Wait, so If I store Block instead of BlockState, will the contents of the Block will be changed If I set the Block type to something else?

ivory sleet
#

Aglerr it’s a bit hard to figure what goes wrong as of now since I can’t test it for myself

#

Idr the implementation so can’t answer that but I’d assume so

#

What

maiden mountain
#

@summer scroll Probably no

ivory sleet
#

What’s wrong with BukkitRunnable

maiden mountain
#

I assume you're talking about changing the Material for example? @summer scroll

summer scroll
#

Yes the material

maiden mountain
#

Then the Block stored in the list will change automatically

ivory sleet
#

That’s false

maiden mountain
#

Reference Types 🙂

ivory sleet
#

BukkitRunnable allows you to derive it and still offers its instance methods imperatively

#

Which would be a real hassle to deal with if you simply stick with Consumer<super BukkitTask> and the BukkitScheduler

summer scroll
smoky oak
#

god fucking dammit
java.lang.IllegalStateException: Already scheduled as 173
I can't use the same instance

maiden mountain
# summer scroll Yes the material

Unless you create an entire new Block class, the block that's stored will just change along since that's how Reference Types work 🙂

quaint mantle
#

I was doing leather_helmet_meta.getItemMeta() and I was wondering why im not getting the method till I realized what variable I was using. Is this the kind of stuff that happens to you guys?

smoky oak
#

aaaaand it doesnt even have a clone() function urgh

summer scroll
maiden mountain
#

Yep since they are both references to the same object

ivory sleet
#

Moterius you’d either use a runTaskTimer or schedule a new BukkitRunnable instance inside the callback itself

#

Either two are fine (think we went over it alr)

smoky oak
#

well i want it to trigger exactly three times and im unsure how to count that

#

also i have yet to hear an answer to the question if i can see how often a task was executed already

ivory sleet
#

It’s possible to implement that

#

If it’s only concerning runnables of your own

smoky oak
#

ah

#

i guess doing a counter in a class implements BukkitRunnable, then setting that counter on creation, and just doing if(i++>3) cancel()

ivory sleet
#

Hmm

#

Yeah

#

Might work

smoky oak
#

anyone knows why it doesnt show an error while i am trying to define a class inside a function?

ivory sleet
#

Doesn’t show an error?

#

Idk maybe share the code

smoky oak
lost matrix
smoky oak
#

i found a completely different issue lol

#

it cant see that class

#

maybe i need to put it above?

#

yup

summer scroll
#

How can I get all locations of nether portal block from one location?

lost matrix
summer scroll
smoky oak
#

repeat on all newly found portal blocks until you no longer find new blocks

tardy delta
#

Why creating class in a method lol

smoky oak
#

class only needed in method

tardy delta
#

And not just an inner class

smoky oak
#

we need a runTaskTimer(Plugin, task, delay, period, count) function

tardy delta
#

I would still create an inner class

#

👀

summer scroll
smoky oak
#

🤷‍♂️

#

havent worked much with algorithms like that

#

one time i tried i gave up and did something else

misty ingot
#

so I tried getting permissions of offlineplayers using the VaultAPI but even that shows errors lmao

#

I have the latest version of the API i.e. 1.7.1

smoky oak
#

doesnt it need a player object?

lavish hemlock
#

I believe you need to pass the world as well to use an offline player

#

public boolean playerHas(String world, OfflinePlayer player, String permission)

misty ingot
lavish hemlock
#

Also, has is (mostly) deprecated

misty ingot
#

which one

lavish hemlock
#

The two that are deprecated lol

misty ingot
#

I am using the top one

lavish hemlock
#

You need to use playerHas

misty ingot
misty ingot
#

the world of who

young knoll
lavish hemlock
#

Actually wait yeah why are you doing player.getUniqueId()?

misty ingot
young knoll
#

You don’t need to create an offline player instead at all

misty ingot
#

I just realised how dumb my brain becomes after I have been awake for 21 hours

misty ingot
#

note the part where it says that it does not return an object for offline players

#

my brain is on fire

lavish hemlock
#

I mean it is "may not"

#

but idk wording is confusing

misty ingot
#

well it doesnt do it

#

so

#

yeah

#

I just need a way to check permissions of a player regardless of them being online or offline

#

oh and to check if they are isBanned()

young knoll
#

Then get them as an OfflinePlayer

misty ingot
#

now thats where the issue comes in

quaint mantle
#

its time for me to learn generics

misty ingot
#

I cannot get the permissions for offline players even when using VaultAPI for some reason

#

I am either very very dumb or I am very very dumb

mortal cedar
#

Is there a way to let players interact e.g. hitting entities outside of the world border?

visual tide
summer scroll
misty ingot
#

Already am I think

#

also has() does not work with offline player object

visual tide
#

that looks correct

#

hm

#

sec

misty ingot
smoky oak
#

can i no longer do Integer.maxValue() ?

devout solstice
#

Hey can anyone help me with a plugin that I want to make for a manhunt video for my friends channel you can @ me if you want to

summer scroll
visual tide
# misty ingot yeah I because I got it straight from their github instructions thing
 /**
     * Checks if player has a permission node.
     * Supports NULL value for World if the permission system registered supports global permissions.
     * But May return odd values if the servers registered permission system does not have a global permission store.
     * 
     * @param world String world name
     * @param player to check
     * @param permission Permission node
     * @return Success or Failure
     */
    public boolean playerHas(String world, OfflinePlayer player, String permission) {
smoky oak
visual tide
smoky oak
#

oh wait

#

yea i just realized that too

#

different topic, what's the event that happens when a player drinks milk and erases their effects?

misty ingot
summer scroll
smoky oak
#

imma try thanks

young knoll
#

PlayerItemConsumeEvent or EntityPotionEffectEvent

#

The later has a cause for milk

visual tide
#

just ctr click on the method

#

ig

tardy delta
#

whats the difference between CompletableFuture#whenComplete and CompletableFuture#thenAccept

#

#thenAccept returns a CF<Void> where whenComplete returns a CF<T>

quaint mantle
lavish hemlock
#

Hey, how do I convert hours to ticks?

smoky oak
#

*60 *60 *20

#

also

#
EntityPotionEffect e
(e.getAction() == EntityPotionEffectEvent.Action.ADDED) && (e.getNewEffect().getType == PotionEffectType.POISON)``` returns false - I'm not having any effects and using a poison splash potion
quaint mantle
#

Duration.ofHours(hours).toMillis() / 50

tardy delta
#

💀

tardy delta
#

im making a home command and im keeping a homes cache for each user, is it bad to save a newly created home on the database immediately?

#

and then putting it in the cache

next stratus
tardy delta
#

a record will expose all its fields

next stratus
#

So is it worth making it a record then?

quaint mantle
#

So, I want to fix a player's camera rotation. The player can't move the camera. And no, I don't want the... what should I call it?... I don't want the jitter effect when trying to move the camera that is achieved by constantly teleporting the player. My idea is that I can switch the player to spectator mode, and make the player go into a mob. The mob has no ai or gravity, and the player can't rotate the camera. Would this work?

tardy delta
#

if you want to have a getter for all of your fields you can consider making it a record

#

fields are also final

visual tide
#

instead of a mob

quaint mantle
#

Ah okay

next stratus
quaint mantle
#

Is there a method that sets what entity the player that is in spectator mode viewing as?

quaint mantle
#

alr thanks

tardy delta
#

for example if you have a field test the getter will be named test() instead of getTest()

next stratus
#

hm, that's interesting

#

Sorry, i've not used records before aha

quaint mantle
quaint mantle
#

alr thank you

grim ice
#

getTest then

#

/j

tardy delta
#

?

smoky oak
#

@tardy delta I've taken to saving my cache only when a player leaves or the plugin gets disabled

tardy delta
#

what if the server crashes lol?

smoky oak
#

not too big an issue

visual tide
#

ServerCrashEvent 😄

grim ice
#

plugin ondisable is called on crash isnti t

smoky oak
#

rejoining resets almost all variables in my plugin

visual tide
smoky oak
#

but still

visual tide
#

if the server crashes it crashes

#

= ded

smoky oak
#

why is it the second i actually want to know somethign this server is just DEAD

tardy delta
#

what event is that?

smoky oak
#

the event when a potin effect gets added or changed (or reset via milk)

tardy delta
#

can i see the whole code?

#

did you even register it lol

smoky oak
#

I did

#

i know that because if i send a log message right before that if clause up there it shows up in the logs

quaint mantle
#

I do it like this

smoky oak
#

?paste

undone axleBOT
tardy delta
#

searching thro the github repos

smoky oak
tardy delta
#

whats that Echo thing lol

#

logger i guess

smoky oak
#

ye

tardy delta
#

// handle milk kekw

smoky oak
#

i have code there but its not relevant

#

the other comment is the one you should read

tardy delta
#

i dunno

#

is this actually a comment or did you just set it as a comment for now?
// && Echo.hasTrait(player, trait_enum.PASSIVE_POISON_IMMUNE)

smoky oak
#

for now

#

iirc that ALSOdoesnt trigger

tardy delta
#

well then isnt that your issue?

smoky oak
#

probably

#

still

tardy delta
#

have you tested it with only the effect type check?

smoky oak
#

I think so. i cant do it rn but i think that one also doesnt work

#

@tardy delta can i ping you later when i have time?

tardy delta
#

ye

smoky oak
#

k thanks

#

ttyl then

grim ice
#

code review

#

thx

tardy delta
#

THIS IS NOT FOR YOU. :(

grim ice
#

lol

#

I mean

#

how else do i stop them from using the method

#

well im only doing that in the main class

#

but in everything else

#

you only use classes inside api package

mellow edge
#

how to stop the server with spigot

#

?

mellow edge
#

that was the command lol

#

I tought it is Bukkit.stop();

lost matrix
#

System.exit() XD

grim ice
#

Bukkit.getServer().shutdown()

#

oh nvm elgar alr sent it

mellow edge
#

"YEA system.exit would defenetly be good"

trail pilot
#

Uhm

#
[15:12:51 ERROR]: [SetHome] > get result error: java.sql.SQLException: [SQLITE_CONSTRAINT]  Abort due to constraint violation (column player is not unique)```
#

wtf is that?

#
public ResultSet getResultSet(String query) {
        ResultSet resultSet = null;
        try {
            Statement st = connection.createStatement();
            resultSet = st.executeQuery(query);
        } catch (SQLException e) {
            getDatabaseConnection();
            plugin.logger.log( Level.SEVERE, "[SetHome] > get result error: " + e);
        }
        return resultSet;
    }```
#

here code

#

sorry for bad england (XD)

smoky oak
#

why are you using SQL anyways? Can't you store stuff like that in configs or PDC?

trail pilot
#

my plugin have config storage

#

but an dude said to use databse

chrome beacon
manic delta
#

someone knows about luckperms api?

chrome beacon
#

Yes

manic delta
#

Can you help me

trail pilot
#
public void setPlayerHome(String homeName, Player player) {
        plugin.sqlite.getResultSet( "INSERT INTO '" + plugin.database.table +"'(player, home, x, y, z, world_name) VALUES ('" + player.getUniqueId() + "','" + homeName + "','" + getPlayerLocation( player ).getX() + "','" + getPlayerLocation( player ).getY() + "','" + getPlayerLocation( player ).getZ() + "','" + player.getWorld().getName() + "');");
    }```
manic delta
#

I just want to get user rank

trail pilot
#

so tf should i use?

manic delta
trail pilot
lost matrix
trail pilot
smoky oak
#

writing and reading files is slow

#

he's saying to keep it in memory until the player leaves or the server stops

trail pilot
#

yea that i know

smoky oak
#

variables?

#

use hashmaps

grim ice
#

make a class for Storage

grim ice
#

or make an auto save

rough drift
#

could've used a string builder there

trail pilot
#

i think the best option is thinking_gun

grim ice
#

every 10 minutes, on another thread access the database

#

and write

#

from the hashmap

#

however u might wanna distribute it

trail pilot
#

should be cool

grim ice
#

not sure, ask someone else

chrome beacon
trail pilot
#

but i have really basic knowledge LEL

grim ice
#

who cares

trail pilot
grim ice
#

if u just dont do anything

trail pilot
#

because im the one who cries if something is broken

grim ice
#

cuz ur level is low

#

u wont learn

grim ice
#

use version control?

grim ice
#

so if u break ur code u can restore it

smoky oak
#

lp user <user> info shows permissions and groups

trail pilot
rough drift
#

github

#

alot alot of github

trail pilot
#

yea i use it

#

so tf i need to do?

rough drift
trail pilot
rough drift
#

better way of handling strings

eternal oxide
#

Use a PreparedStatement

trail pilot
#

i only know how to set an instanceuwuBear

#

and print things in console

rough drift
#
StringBuilder sb = new StringBuilder();
sb.append("a");
sb.append("b");
```Allows you to replace the +
#

looks cleaner

rough drift
#

then sb.toString() to get result

hardy swan
#

please use prepared statements

rough drift
#

instead of your messy "abc" + a + "dfg" etc

quaint mantle
#

MessageFormat.format() tho

trail pilot
#

...

quaint mantle
#

Prepared Statements is a way to go yes

trail pilot
trail pilot
rough drift
#

yeah ig... just, why the spaces?

trail pilot
#

lol

quaint mantle
#

Use prepared statements
Use prepared statements
Use prepared statements
Use prepared statements

rough drift
#

wdym it works fine for me

trail pilot
quaint mantle
#

Read any jdbc guide

trail pilot
glossy venture
#

prepare a statement, clone it and set the values

#

then execute it

#

put a ? where you want to insert the values

#

like SELECT * FROM my_database WHERE id = ?

#

and then to set it do statement.set...(position, value)

manic delta
#

some java regex expert?

#

i want to convert &c&lAdmin&7 :&f to Admin (Just need the string)

#

forgot i just will use group name

lost matrix
manic delta
#

forgot

lost matrix
#

Why do you want to do this?

manic delta
#

i will use group name instead

manic delta
grim ice
manic delta
#

using spigot

#

but i will do it with the group

grim ice
#

I wanna improve anything possible

glossy venture
manic delta
#

i will use play group name

glossy venture
#

o

manic delta
#

u

glossy venture
#

k

trail pilot
#

i got it!

glossy venture
#

nice

hardy swan
#

it is important to understand why you should use PS, to guard against sql injection

vale frigate
#

Hello yall! I have a problem using nms. I need it for NBT modification. now since everything got changed I have no idea how to get the nms classes into my workspace. I only added the spigot api to my project with maven since everything else did not work for me, does someone know a solution?

tacit drift
#

a good api

#

no need for nms

vale frigate
#

Sure? I need to add CanBreak and CanDestroy tags to some items. Does it provide that?

lost matrix
tacit drift
#

i just did that in my plugin

#

it's just 3 lines of code

#
NBTItem pickaxeNBT = new NBTItem(pickaxe);
NBTList<String> tags = pickaxeNBT.getStringList("CanDestroy");
tags.add(canDestroyTag);
#

canDestroyTag is something like "minecraft:redstone_ore"

vale frigate
#

Oh okay, thank you! So you did not "import" nms right? I am actually wondering on how to do that... I mean, I know we should avoid NMS but I am still wondering why it isnt working... But thank you! Really appreciate that!

tacit drift
#

no nms

#

either put the api as a plugin on the server

#

either shade it

#

check the wiki for more info or join their discord

vale frigate
#

Oh okay, I'll give it a try.

#

Thank you!

smoky oak
#

whats the latest spigot version?

lost matrix
quiet ice
#

1.18.2-R0.1-20220301.213937-3

smoky oak
#

thanks

#

whats the arg for remapping? I cant find it on the spigot page

lost matrix
#

--remapped i think

smoky oak
#

thanks

sage dragon
#

I saw there's a broadcastChanges method in PlayerChunk, is there a way to get PlayerChunk from a chunk?

sage dragon
lost matrix
#

Its def nothing api related

sage dragon
viral crag
#

you sure that is not from some other api?

sage dragon
smoky oak
quiet ice
#

that is because 1.18.1 is latest stable release

smoky oak
#

ah

quiet ice
#

1.18.2-R0.1-20220301.213937-3 is the latest maven release (you should really use 1.18.2-R0.1 though)

grim ice
#

my EntitySerializer library now works, yay

lost matrix
boreal sparrow
#

im dumb whats wrong with this?
public class LoginListener implements Listener {
@EventHandler
public void normalLogin(PlayerLoginEvent event) {
Object player = event.getPlayer();
for (Player p : Bukkit.getOnlinePlayers()) {
p.sendMessage("Ubrandon (aka " + player + ") has joined and gets amaswidis");
}
}

@EventHandler
public void normalQuit(PlayerQuitEvent event) {
    Object player = event.getPlayer();
    for (Player p : Bukkit.getOnlinePlayers()) {
        p.sendMessage(player +  " has left the call, no amaswidis for them...");
    }
}

} i have 0 idea what im doing ._.

grim ice
#

hmmm

#

theres no fix for that

lost matrix
boreal sparrow
#

._.

quiet ice
#

A var a day makes your life easier

lost matrix
boreal sparrow
#

true

quiet ice
#

I believe he gets an output like "org.bukkit.Player@145466 has joined and gets"

lost matrix
#
    @EventHandler
    public void normalLogin(PlayerLoginEvent event) {
        Player player = event.getPlayer();
        for (Player online : Bukkit.getOnlinePlayers()) {
            online.sendMessage("Ubrandon (aka " + player.getName() + ") has joined and gets amaswidis");
        }
    }
boreal sparrow
#

y

#

ty

grim ice
#

maybe i should do smth

#

to liek

tardy delta
#

sorry for bad england

lost matrix
#

😄

grim ice
#

get the entity

#

o

#

that makes sense

#

but what location

#

oh do i spawn it

#

in the sky

lost matrix
#

Idk. Try something at ~ 3000 ~
So just up. This way you dont need to load any new chunks.

grim ice
#

yeahh

#

genius :o

boreal sparrow
#

lol that doesnt work it doesnt do anything when they join weird

lost matrix
boreal sparrow
#

u mean public class LoginListener implements Listener

grim ice
#

no

boreal sparrow
#

._.

grim ice
#

ok he didnt register it

boreal sparrow
#

yes

boreal sparrow
#

i did that sry im dum

ivory sleet
#

?event-api

undone axleBOT
boreal sparrow
#

in min class

#

weird

grim ice
#

show how you did it

#

also r u using eclipse

#

u prob are

boreal sparrow
#

just found smh weird

#

other ppl can see the message

#

u cant

#

wasting my time for ~20 minutes

grim ice
#

@lost matrix But if i spawn it at the sky

#

then tp to the ground

#

it will take damage

#

wont it

#

ill have to set it to invincible

past vapor
#

How can i get the direction of a sign

lost matrix
lost matrix
past vapor
#

Only a wallsign

lost matrix
lost matrix
quiet ice
lost matrix
#

WallSign is Directional not Rotatable

lost matrix
quiet ice
#

I see no issue there

boreal sparrow
#

ye maybe but onlineplayers... shouldnt that include the one who has logged in just now?

quiet ice
#

Oh, yeah the player that joined isn't considered online at that point

boreal sparrow
#

damn

quiet ice
#

You'd need an extra line of code to also include the joining player

boreal sparrow
#

ok

quiet ice
#

Similarly dead players will not recieve the message or something like that

boreal sparrow
#

ooh

quiet ice
#

It is better to use Bukkit#broadcast

boreal sparrow
#

thats the thing

#

i also used that

#

same issue

quiet ice
#

?jd-s

undone axleBOT
boreal sparrow
#

thats why i fell back to onlineplayers in the first place

smoky oak
#

... ... ... ... ...
screw this game.

player.sendMessage((newEffectType == PotionEffectType.POISON)+""+e.getNewEffect().getType()));```
quiet ice
boreal sparrow
#

oh come on XD

#

ty

#

welp maybe i should read docs nect time

lost matrix
boreal sparrow
#

bruh docs are like chinese how do i use setjoinmessage

quiet ice
#

event.setJoinMessage("This is the join message");

smoky oak
lost matrix
#

What do you use to compare objects on equality which are not a primitive or enum?

smoky oak
#

because im used to it from block#gettype

#

also anyone knows when 1.18.2 will be stable?

quiet ice
#

For newcomers the documentation can be complicated

undone axleBOT
#

There is no ETA. Having an ETA leads to unrealistic deadlines, false hope, and a bad product. It will be ready when it's ready.

lost matrix
#

== -> equality if primitive or enum. Identity for objects.
.equals() -> equality for objects.

quiet ice
#

== is always identity

smoky oak
#

well that solved that problem

quiet ice
#

Enums just happen to be singletons

lost matrix
ivory sleet
#

Generally

a == b -> true then a is b
a != b -> true then a is not b

quiet ice
#

Yeah, you should use == for enums either way. Whether it is equality or identity does not make a difference there. (though using .equals() will lead to fail-fast behaviour if the left argument is null)

#

Probably, though I'd avoid PlayerLoginEvent because it isn't async

#

it should be deprecated either way

ivory sleet
#

Well first we have PreLogin which is the blocking part (thus it’s invoked async), then we have Login which is post PreLogin and more data is established, for the Join, even the player entity is fully established.

lost matrix
smoky oak
#

is there an api method to check if a entity stands in sunlight?

ivory sleet
#

I mean smile they’re the same

#

That’s the semantic specification

quiet ice
smoky oak
#

heightmaps?

ivory sleet
#

Because we treat, for all b and a, b and a are values

lost matrix
ivory sleet
#

You’re mistaking me

#

I am not involving any variables

smoky oak
#

is glass a solid block?

ivory sleet
#

I’m simply stating that if a is b then a == b is true and vice versa, thus if a == b then a is b

#

And we’re inferring that for all a and b, a and b must be values

smoky oak
#

it is

quiet ice
#

Completely forgot transparent blocks existed

#

Material#isTransparent might be one, but that one is deprecated

lost matrix
boreal sparrow
#

cannot resolve method eventsetjoin message in playerjoinevent this is proboply a very dumb question but seriously whats wrong

quiet ice
#

You forgot the dot

boreal sparrow
#

@EventHandler
public void normalLogin(PlayerLoginEvent event) {
event.setJoinMessage("This is the join message")

lost matrix
boreal sparrow
#

god damnit

quiet ice
#

Unlikely. Paper probably has a way of resolving the transparency via Starlight however

smoky oak
#
public static HashMap<UUID, Set<BukkitRunnable>> runningTasksPerPlayer;
    public static void listTask(UUID id, BukkitRunnable r){
        runningTasksPerPlayer.get(id).add(r);}

would calling listTask add the task to the set inside runningTasksPerPlayer, or to a copy?

lost matrix
smoky oak
#

which answers the question not

quiet ice
#

Either it throws an exception, or add

lost matrix
quiet ice
#

It will not create any copy

smoky oak
#

ok thanks

quiet ice
#

Probably not what you want

tall dragon
#

True or false 👍

quiet ice
#

Given that I'd say that it returns false for Glass for example

#

?stash Actually, let'S find out for sure

undone axleBOT
quiet ice
#

For determining transparency it's either nms or the material enum

#

That being said - there is a material enum refector in the works, so using the deprecated method is probably "good enough" for the meantime

#

Add what?

#

You could just hardcode the transparencies, but that would amount to just being Material#isTransparent

#

?jd-s

undone axleBOT
quiet ice
#

What if there is no sunlight over the block?

#

If this issue is of no concern, yea, go ahead

viral crag
#

transparency is a texture and clientside render ...

grim ice
#

?paste

undone axleBOT
quiet ice
#

It is also serverside

grim ice
#

tips to improve?

#

easter egg

#

and it doesnt matter the numbers

quiet ice
#

what the hell...

#

What is that method supposed to do?

grim ice
#

well

#

would make more sense

#

1s

#

that class is returned

viral crag
grim ice
#

after deserializing a serialized entity

#

and with spawnAndGet()

quiet ice
#

Plus you can teleport it to a location outright...

grim ice
#

o

grim ice
#

im not spawning an entity

#

im placing a structure

#

then retrieving the entity

#

spawned with it

quiet ice
#

Then I'd just pass a List to the spawn method were all the entities are put into

grim ice
#

wdym

quiet ice
#

Or make the spawn method return the entity outright

#

What even is the spawn method?

grim ice
#

public void spawn(Location loc) {
structure.place(loc, true, StructureRotation.NONE, Mirror.NONE,
0, 0f, new Random());
}

quiet ice
#

oh yeah, that makes things difficult

grim ice
#

better than using nms tho

#

or maybe not but still

quiet ice
#

I'd still not use streams, but I think that is the best you can do

#
.min((e1, e2) -> (int) (e2.getLocation().distanceSquared(location)
                        - e1.getLocation().distanceSquared(location)));

Also, this is asking for trouble. What if e1.getLocation().distanceSq is greater than e2.getLocation().distanceSquared?

#

dangerous

#

It will probably lead to artefacts if minecraft's lighting system is still as fragile as I remember it

undone axleBOT
boreal sparrow
#

how do i get a player's name that isnt weird and full of craftbukkit crap

#

ty

quiet ice
#

Well it will be not equal to the upper light level if it isn't transparent

#

0 means no daylight

#

(also beware that this method breaks at night)

#

0 is no light at all

humble heath
#

how would be the best way to kick a player as kickPlayer is now depricated

opal juniper
#

are you using paper

wary harness
#

any one has idea how this works

#

so it pops and rotates like 3d text

humble heath
#

i am using paper

wary harness
#

and item

opal juniper
#

that’s why

#

they use adventure

grim ice
wary harness
grim ice
#

its a totem

#

retextured

wary harness
#

it is an totem

#

yep

#

xd

#

but cool

grim ice
#

lol iits not that hard to figure out

wary harness
#

well didn't play that much

#

from like 1.9

boreal sparrow
#

can i use an if statement with pname witha string to check for specific player in the event?
Player player = event.getPlayer();
var pname = player.getName();

#

eg. if(pname == "name"){

#

ty

grim ice
#

equals will not check for cases

#

"Diamond".equals("diamond") returns false

wooden fable
#

equalsIgnoreCase

grim ice
#

however "Diamond".equalsIgnoreCase("diamond") returns true

#

and dont do checks with player names for most of the time

#

you wanna use uuids

boreal sparrow
#

prob

#

if their user changes

wooden fable
#

How do I set the result of a PrepareAnvilEvent to nothing?

  event.setResult(null);
  event.setResult(new ItemStack(Material.AIR));

This is what I've tried and both don't work.

sage dragon
#

Does PacketPlayOutMapChunk send the blocks of a world when a player connects?

wooden fable
#

ofc

grim ice
#

my library is officially done now :D

#

i still need code reviews

viral crag
viral crag
wooden fable
#

Ik

viral crag
#

i am going with teh stated event.setResult()

wooden fable
brave sparrow
#

The left slot isn’t the result

#

The right slot is

wooden fable
#

oops of course haha

raw ibex
#

How would I send a 5 4 3 2 1 respawn countdown on the screen?

grim ice
#

and then get teh slot

#

a second ive made a plugin with anvils before

#

ill give you some basic code

viral crag
#

PrepareAnvilEvent is not event

brave sparrow
boreal sparrow
#

how to play sound to all online players ._.

viral crag
#

gl with that

grim ice
brave sparrow
#

Are you high?

brave sparrow
boreal sparrow
#

ty

ivory sleet
undone axleBOT
grim ice
#

probably since afaik low is an expert

wooden fable
#
e.getInventory().setItem(3, null);

Like this?

grim ice
#

well not 3

brave sparrow
#

Probably 2

grim ice
#

its 2

brave sparrow
#

Counting starts at 0

wooden fable
#

Oh yes of course...

boreal sparrow
#

can someone give me the command to play a sound to bukkitgetonline players

grim ice
#

setResult shouldve worked though

#

thats weird

wooden fable
viral crag
brave sparrow
#

So we can make sure it’s being called

wooden fable
#
    @EventHandler
    public void onPrepareAnvil(PrepareAnvilEvent e) {
        final ItemStack result = e.getResult();
        final ItemMeta meta = result.getItemMeta();

        if(!shouldCheck(e.getInventory())) return;
        if(!isMending(meta)) return;
        if(!isArmor(result)) return;
        e.getInventory().setItem(2, null);
        log("Called");
    }
grim ice
#

ur tryna stop mending?

#

then u dont need that

#

well u kinda do but

#

u can do a workaround for it

wooden fable
#

How?

#

That would be great

#

but only on armor

grim ice
#

Inv click event

hasty prawn
#

Delay the setItem call by 1 tick?

brave sparrow
#

I’m still interested in why this doesn’t work

brave sparrow
hasty prawn
#

Well but if the inventory isn't updated when the event is called then you're setting nothing to null

grim ice
hasty prawn
#

Because the result isn't there yet

boreal sparrow
#

physically why cant i do this:
Bukkit.getWorld("world").playSound(0, Sound.ENTITY_ENDER_DRAGON_GROWL, 1000000000, 1);

grim ice
#

bruh

worldly ingot
#

Don't use Inventory#setItem() in a PrepareAnvilEvent

boreal sparrow
#

it needs to go far lol

wooden fable
grim ice
#

u wanna kill their ears??

brave sparrow
#

@wooden fable give me one sec I’m gonna figure out why setResult doesn’t work for you

wooden fable
#

That doesn't work to

grim ice
brave sparrow
#

I’m checking the spigot code now

grim ice
#

eitherway just use the workaround i talked about earlier if u cant find another solution

worldly ingot
#

Yeah if it doesn't work then either the snippet is doing something wrong or there's a bug that should be reported on the JIRA

#

Or another plugin is overriding it

grim ice
#

time to contribute! (jk i dont have an idea on how to do that)

brave sparrow
#

public static PrepareAnvilEvent callPrepareAnvilEvent(InventoryView view, ItemStack item) {
PrepareAnvilEvent event = new PrepareAnvilEvent(view, CraftItemStack.asCraftMirror(item).clone());
event.getView().getPlayer().getServer().getPluginManager().callEvent(event);
event.getInventory().setItem(2, event.getResult());
return event;

boreal sparrow
#

no volume makes it go further not actually makes it louder

brave sparrow
#

The spigot code appears to be correct

#

Very strange indeed

grim ice
#

if the volume is an integer

hasty prawn
#

Interesting

#

Hey but look I was right about the result being set after 😛

grim ice
#

nvm

brave sparrow
#

But it’s super weird that setResult isn’t working

hasty prawn
#

You're right though I forgot about the exploits

#

That is odd Thonk

boreal sparrow
#

am i dum or smh becuase what
Bukkit.getWorld("world").playSound(0, Sound.ENTITY_ENDER_DRAGON_GROWL, 100000000, 1);

brave sparrow
#

@wooden fable do you have any other plugins on?

hasty prawn
#

Let me see if it works for me

brave sparrow
#

So I have to think about it

hasty prawn
#

LOL fair enough

brave sparrow
#

There’s one they found once where if they spam the keyboard and spin around and open the inventory it lets them dupe

#

All kinds of nonsense

ivory sleet
#

Sounds like some sort of cult at this point lol

grim ice
#

ur location arg is "0"

worldly ingot
#

Works fine for me

boreal sparrow
#

ye but what should it be like what

worldly ingot
#

So you have another plugin overriding it

boreal sparrow
#

0 0 0?

grim ice
#

anyone free to rate code

brave sparrow
# wooden fable Ye

Make your event priority MONITOR just for a minute, let’s see if it works for you

#

You can’t leave it as MONITOR but it’ll be good to check

brave sparrow
boreal sparrow
#

what should i put in coords?
Bukkit.getWorld("world").playSound(????, Sound.ENTITY_ENDER_DRAGON_GROWL, 100000000, 1);

hasty prawn
#

Where you want the sound to play

boreal sparrow
#

0 70 0

raw ibex
boreal sparrow
#

(middle of map sorta)

wooden fable
brave sparrow
#

Whichever function in Player shows a Title

hasty prawn
#

new Location(Bukkit.getWorld("world"), 0, 70, 0) then. Although your world should probably be obtained some other way than using getWorld since that can return null.

boreal sparrow
#

ty

brave sparrow
#

That’s only going to play it to the players in that world though

#

Not every player online

hasty prawn
#

Idk what they're trying to do so

brave sparrow
#

Right

brave sparrow
hasty prawn
#

Ah ok

raw ibex
grim ice
hoary pawn
#

im not quite getting with the namespacedkey is about, and how i can set them?

hoary pawn
#

ayy yo wtf, didnt even see there was anything about that lol

grim ice
#

wdym

hoary pawn
#

it was more a general question, i did not see you were talking about that

grim ice
#

Oh

#

lol

#

basically

#

a namespace and a key (a string)

#

a namespace being ur plugin in most cases

hoary pawn
#

ahhhhhh

brave sparrow
#

Top and bottom text

worldly ingot
#

We do have docs on these things explaining exactly what each method and its parameters do

brave sparrow
#

^

worldly ingot
#

?jd is relevant here. There's a search bar in the top right

brave sparrow
#

I just sent them that

#

Lol

worldly ingot
#

I'm like 95% out of this convo atm lmao. Thanks o/

brave sparrow
#

No worries

hoary pawn
grim ice
#

yeah

#

it just needs ur plugin instance

viral crag
brave sparrow
#

It’s not a cancellable event

#

I sent the actual code for the event

viral crag
#

i did not say to cancel it

brave sparrow
#

It only uses the item result

#

It doesn’t check the abstract event result

viral crag
#

item result has usable enums of which DENY is one

brave sparrow
#

Spigot does not check that for this event, it sets the slot in the inventory

lunar forge
#

hi, I tried to use this,

        getConfig().getConfigurationSection("items").getKeys(false).forEach(key -> {
            String s = getConfig().getString("items." + key + ".dropped-from").replace("[", "").replace("]", "");
            System.out.println(s);
            itemStackHashMap.put(Material.matchMaterial(s), new ItemBuilder(
                    new ItemStack(getConfig().getInt("items." + key + ".id")))
                            .setAmount(getConfig().getInt("items." + key + ".amount"))
                            .setName(getConfig().getString("items." + key + ".title"))
                            .setLore(getConfig().getStringList("items." + key + ".lore"))
                            .setData(getConfig().getInt("items." + key + ".data"))
                    .toItemStack());
            chances.put(Material.valueOf(getConfig().getString("items." + key + ".dropped-from")), getConfig().getInt("items." + key + "chance"));
        });```

And that is giving this error:
```[15:00:53 INFO]: WHEAT
[15:00:53 ERROR]: Error occurred while enabling MineCentralFarming v1.0.0 (Is it up to date?)
java.lang.IllegalArgumentException: No enum constant org.bukkit.Material.[WHEAT]
        at java.lang.Enum.valueOf(Enum.java:238) ~[?:1.8.0_312]
        at org.bukkit.Material.valueOf(Material.java:1) ~[patched.jar:git-PaperSpigot-"4c7641d"]
        at me.waterbroodje.minecentralfarming.Main.lambda$loadVariables$1(Main.java:57) ~[?:?]
        at java.lang.Iterable.forEach(Iterable.java:75) ~[?:1.8.0_312]
        at me.waterbroodje.minecentralfarming.Main.loadVariables(Main.java:47) ~[?:?]
        at me.waterbroodje.minecentralfarming.Main.onEnable(Main.java:26) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[patched.jar:git-PaperSpigot-"4c7641d"]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [patched.jar:git-PaperSpigot-"4c7641d"]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:407) [patched.jar:git-PaperSpigot-"4c7641d"]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:359) [patched.jar:git-PaperSpigot-"4c7641d"]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:318) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:408) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:372) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:327) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:267) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched.jar:git-PaperSpigot-"4c7641d"]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312``` I just don't know how to fix
brave sparrow
#

Seems like there’s no material WHEAT

#

You can see that where it says “No enum constant WHEAT”

lunar forge
#

[WHEAT]

#

Not WHEAT

#

When I try to replace it with " " instead of "" it says "No enum constant org.bukkit.Material. WHEAT "

#

And Material.WHEAT is a thing

quiet ice
#

Your issue might be regex, but idk

brave sparrow
quiet ice
#

It does afaik

#

ah no

brave sparrow
#

It doesn’t

ivory sleet
#

replaceAll uwu

quiet ice
#

replace all uses regex heh

brave sparrow
#

replaceAll and replaceFirst do

#

Yeah

hasty prawn
#

chances.put(Material.valueOf(getConfig().getString("items." + key + ".dropped-from")), getConfig().getInt("items." + key + "chance"));

Should be chances.put(Material.valueOf(s), getConfig().getInt("items." + key + "chance"));

You're only replacing the brackets when you're printing and not when you're using it.

brave sparrow
#

Yeah it’s that valueof

hoary pawn
#

hmm im trying to load a string from a presistentdatacontainer, but im getting this

quiet ice
#

You need to also pass the type

#

So something like .get(key, PersistentDataType.STRING), idk - all pseudocode

twilit wharf
#

How do I get the NMS Level object from a bukkit world? I try the whole getHandle() thing but that returns WorldServer

hasty prawn
#

That is the NMS object

chrome beacon
#

^

foggy estuary
#

?paste

undone axleBOT
foggy estuary
lost matrix
foggy estuary
#

Lol

grand coral
#

What this want

#

[20:13:49 ERROR]: Parameters: net.minecraft.server.v1_16_R3.PacketPlayInUpdateSign@10131704[ a=BlockPosition{x=181, y=0, z=113} b={,,,}

lost matrix
#

full stack trace pls

grand coral
#

20:13:49 ERROR]: [Auktionshaus] Unhandled exception occured in onPacketReceiving(PacketEvent) for Auktionshaus java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[?:?] at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[?:?] at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) ~[?:?] at java.util.Objects.checkIndex(Objects.java:359) ~[?:?] at java.util.ArrayList.get(ArrayList.java:427) ~[?:?] at gn.auktion.utils.SignGUI$1.onPacketReceiving(SignGUI.java:40) ~[?:?] at com.comphenix.protocol.injector.SortedPacketListenerList.invokeReceivingListener(SortedPacketListenerList.java:114) ~[?:?] at com.comphenix.protocol.injector.SortedPacketListenerList.invokePacketRecieving(SortedPacketListenerList.java:67) ~[?:?] at

lost matrix
grand coral
#

This is a SignGUI

wooden fable
#

I tried that

#

But it still doesn't work

lost matrix
#

You miss your config.yml in the compiled jar

wooden fable
# wooden fable But it still doesn't work
    @EventHandler(priority = EventPriority.MONITOR)
    public void onPrepareAnvil(PrepareAnvilEvent e) {
        final ItemStack result = e.getResult();
        final ItemMeta meta = result.getItemMeta();

        if(!shouldCheck(e.getInventory())) return;
        if(!isMending(meta)) return;
        if(!isArmor(result)) return;
        e.getInventory().setItem(2, null);
        log("Called");
    }
grand coral
lost matrix
wooden fable
grand coral
#

Or do u know a way how to get sign input from a not existing sign

wooden fable
lost matrix
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

lost matrix
wooden fable
#

No errors, I don't know what else to say, the code is running and I've already tried PrepareAnvilEvent#setResult but that doesn't work either.

wooden fable
#

1.12.2

lost matrix
wooden fable
#

Tried already, doesn't work.

quiet ice
#

In Java 8 how do I convert a codepoint (int) to a String?

#

eh, I'll just cast it.

wooden fable
#
        e.setResult(new ItemStack(Material.AIR));
        e.setResult(null);
        e.getInventory().setItem(2, null);
        e.getInventory().setItem(2, new ItemStack(Material.AIR));

I've tried all these but nothing works

lost matrix
brave sparrow
#

@wooden fable try removing every other plugin and just test with yours

#

You do need to make it setResult though @wooden fable

#

So do that first

#

setting the inventory slot wont work at all

devout solstice
#

Would anyone want to help with a twist I am going to make for a Minecraft manhunt dm me if you would like to help. I’m new to making plugins

wooden fable
#

I tested it with:

        e.setResult(new ItemStack(Material.AIR));
``` and ```java
        e.setResult(null);

but it still doesn't work.

viral crag
#

Event.Result.DENY instead of null

brave sparrow
#

Right but now we need to figure out why those two don’t work

twilit wharf
brave sparrow
#

Whereas setItem will never work

brave sparrow
viral crag
#

null is not valid for InventoryEvent

brave sparrow
#

Yes it is

viral crag
#

for the return yes

brave sparrow
#

Dude

#

I looked at the code

#

It’s valid as null

#

Just accept that you’re wrong about this

viral crag
#

okay I am wrong - somewhere null must be mapped to default

wooden fable
brave sparrow
#

This may be a bug on the version of spigot you’re using then

#

I’ll take a deeper look later

#

One last thing, try setting null again as opposed to air @wooden fable

delicate lynx
#

try to delay set the item

wooden fable
#

Thank you very much for still helping.

brave sparrow
viral crag
#

you were not responding to me, everything i read says Itemstack is NotNull so i am looking for alex's version

wooden fable
#

Maybe I have an idea, what if I use InventoryClickEvent and check if the item is armor with mending and if it is, I cancel the event.

#

You still see the result item but you can't pick it up anymore and then it's fine.

grim ice
viral crag
# grim ice ur still on tht

yeah looking for the alternate version to this: IMPORTANT: An ItemStack is only designed to contain items. Do not use this class to encapsulate Materials for which Material.isItem() returns false.

wooden fable
grim ice
#

Anyone

#

has a code review

#

I wanna achieve more abstraction and a better design, any ideas

ivory sleet
#

Yes

#

Make interfaces for the api

#

It’s an interface right

tight pagoda
#

Cannot inherit from final 'net.md_5.bungee.api.chat.ComponentBuilder'

#

why does that not work

ivory sleet
#

Right now you’re just throwing concrete implementations at the consumer

lost matrix
tight pagoda
#

because the class said it

lost matrix
#

?jd

hoary pawn
#

da hell this suppose to mean?

lost matrix
tight pagoda
hoary pawn
lost matrix
# tight pagoda what

Im just looking at the javadocs. Where does it say that you should extend ComponentBuilder?

tight pagoda
tight pagoda
#

it was used in my plugin before

#

but now it doesnt work

grim ice
#

if u dont have time its fine

hoary pawn
lunar forge
#

How to fix this?

java.util.ConcurrentModificationException
        at java.util.ArrayList.forEach(ArrayList.java:1262) ~[?:1.8.0_312]
        at me.waterbroodje.minecentralfarming.tasks.ReplaceTask$1.run(ReplaceTask.java:25) ~[?:?]
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59) ~[patched.jar:git-PaperSpigot-"4c7641d"]
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:352) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:783) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [patched.jar:git-PaperSpigot-"4c7641d"]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312]```

```java
    public void run() {
        new BukkitRunnable() {
            @Override
            public void run() {
                blockReplaceDataList.forEach(blockReplaceData -> {
                    if (blockReplaceData.isCooldownOver()) {
                        if (blockReplaceData.getMaterial() == blockReplaceData.getLocation().getBlock().getType()) return;

                        blockReplaceData.getLocation().getBlock().setType(blockReplaceData.getMaterial());
                        blockReplaceDataList.remove(blockReplaceData);
                    }
                });
            }
        }.runTaskTimer(mainClass, 20L, 20L);
    }```
brave sparrow
#

you can't modify while iterating

lunar forge
#

What do you mean?

solar dew
#

Help-me here pls, what is the other agument of this method?

#
new PacketPlayOutSpawnEntity(entity,another argument);```
lost matrix