#help-development

1 messages · Page 452 of 1

lost matrix
#

This throws the NPE

dim adder
#

stands for function

final monolith
tardy delta
#

.itemMeta?.lore ?

final monolith
final monolith
tardy delta
#

kotlin is a very funny language

final monolith
#

xD

ivory sleet
# lost matrix

Yea, this is why we always shove the entire class when showing code ✨

lost matrix
#

Meh, makes sense to me

tardy delta
#

and also a piece of shit qua syntax (dont shout at me)

dim adder
lost matrix
dim adder
lost matrix
ivory sleet
#

map is one way

remote swallow
#

is there a tag for items that need silk touch to braek

tawny remnant
dim adder
ivory sleet
#

if (currentItem.itemMeta?.lore?.map { it.contains("lore line") }) {

}

#

I think

lost matrix
lost matrix
final monolith
#

bro why net.md_5.bungee.api.plugin.Plugin doesn't has a #isEnabled

#

😿

ivory sleet
#

because bungee plugins have no notion of disabled/enabled

#

I talked about this yesterday with someone

#

Let me see

final monolith
#

so

#

theres no way to know if a bungee plugin is enabled or not?

dim adder
ivory sleet
#

Here

lost matrix
#

Check if its null or use the ?. operator with map.reduce

ivory sleet
#

plushTeddy, if a variable can point to null, then that needs to be handled

raw crow
#

can BossBar be used as key in hashmaps? does it implement equals and hashcode?

lost matrix
#

Conclure literally showed you the map.reduce solution

ivory sleet
#

Or a method returns null

ivory sleet
dim adder
final monolith
# ivory sleet Let me see

Let me guess, if a plugin fails or is disabled, it doesn't shows on ProxyServer.getInstance().getPluginManager().getPlugins() collection, right?

ivory sleet
#

Yes

#

That’s what I meant by that message, you’re correct

final monolith
#

not awesome, but amazing

ivory sleet
#

Lol ye

undone axleBOT
dim adder
ivory sleet
#

(:

lost matrix
ivory sleet
#

itemMeta can be null

#

So ye as smile said

raw crow
final monolith
lost matrix
#
if(event.currentItem?.itemMeta?.lore?.contains("Type: NPC")) {
young knoll
#

Oh kotlin

final monolith
#

bros gots stuck on a null error

native summit
#

I have a question how to change the nametag above the player's head

dim adder
#

Type mismatch: inferred type is Boolean? but Boolean was expected

lost matrix
#

Wait no.

#

What was the default operator for nullables

#

Something ?! false

ivory sleet
final monolith
dim adder
ivory sleet
#

Goofy intellij

lost matrix
final monolith
#

Ok, is there a way to check if every plugins is enabled on a bungee server? since there's no isEnabled?

ivory sleet
final monolith
ivory sleet
#

Plugins either exist on a bungee server meaning they were loaded and enabled successfully

lost matrix
ivory sleet
#

Or they get defenestrated out of existence

lost matrix
final monolith
ivory sleet
#

😅

lost matrix
dim adder
# lost matrix show code
class NpcSelectMapInvClick: Listener {

    @EventHandler
    fun onInventoryClick(event: InventoryClickEvent) {


        if(event.currentItem?.itemMeta?.lore?.contains("Type: NPC") ?: false) {
            event.isCancelled = true

            event.whoClicked

            val clickedItem = event.currentItem ?: return
            val player = event.whoClicked as? Player ?: return

            when (clickedItem.type) {
                Material.STONE_BUTTON -> {
                    val worldName = "Npc1_${event.whoClicked.name}"
                    gworld("NpcTemplate1").clone(worldName)
                    val spawnLocation = Bukkit.getWorld(worldName).spawnLocation
                    player.teleport(spawnLocation)
                }

                else -> { return }
            }
        }

    }
}```
raw crow
#

maybe the default implementation of hashCode at Object class is enough ._.

ivory sleet
#

But if you use that you might also go with IdentityHashMap

#

To reduce unnecessary method calls

raw crow
#

oh ok

dim adder
# lost matrix Rest of exception pls

sorry

 at net.teammlg.clutches.inventories.npc.BlockSelectMapInvClick.onInventoryClick(BlockSelectMapInv.kt:36) ~[?:?]
[07.04 22:31:42.587] INFO: [Lobby-1]    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
[07.04 22:31:42.587] INFO: [Lobby-1]    at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
[07.04 22:31:42.587] INFO: [Lobby-1]    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot.jar:git-Spigot-21fe707-741a1bd]
[07.04 22:31:42.587] INFO: [Lobby-1]    ... 15 more
final monolith
#

Conclure, is there a way to get noticed when the bungee server starts to listening? (fully enabled)

ivory sleet
#

Listening to what exactly?

lost matrix
final monolith
ivory sleet
#

Oh

#

Just do it on ur onEnable() ?

#

That runs before the listening thingy?

final monolith
#

sadly yes

lost matrix
final monolith
#

lol

#

🥸

dim adder
lost matrix
final monolith
#

xddddddddddddddd

ivory sleet
#

Lol pain

lost matrix
# final monolith oh no

Anyways... You could try reading the plugin list and doing some iteration shenanigans in a different thread until all plugins are loaded.
You might need to do some unorthodox things to achieve this.

ivory sleet
#

Idk when permissions are called

#

But you could listen to the first permission event that gets fired

#

Very hack workaround tho

final monolith
glossy venture
#

i forgot what does char + char do? does it concat into a string or add the values

glossy venture
#

yeah so? str + any = str

#

but i guess youre saying the latter?

#

it adds the backing values

lost matrix
#

yeah

glossy venture
#

aight

#

why tf is a short the only type a char cant implicitly cast to

#

oh maybe because its signed

ivory sleet
#

Looks very similar to the Number class btw

glossy venture
#

yeah dont want to box twice though

golden turret
#

sorry to bother your but can you help me with the first option please

lost matrix
golden turret
#

and how would I find the entity if the entities arent loaded yet

young knoll
#

Use the entity load event

lost matrix
#

Oh right, the entities are now loaded separately.
Then you need to use the entity load event and register a callback for it.

sullen marlin
#

Doesn getEntities or whatever trigger a blocking load

lost matrix
#

Never tried it out. Lets take a look at what CraftChunk does there

#

Hm no indication for loading the entities if they dont exist. There is a null check which just returns an empty array.

quaint mantle
glossy venture
#

in terms of size yeah

#

but char is unsigned

#

you can specify a permission in your plugin.yml

#
if (!sender.hasPermission("a.b.c")) {
  sender.sendMessage(ChatColor.RED + "No permission");
  return false;
}
#

how are you creating your commands?

#

dynamically or through plugin.yml

glossy venture
#

yeah how you doing it rn

tardy delta
glossy venture
#

what

#

nah im pretty sure its same size as a short
but i guess since a short is signed it cant account for all values

#

so it cant be implicitly casted

tardy delta
#

didnt know a char was 16 bit lmao

echo basalt
#

I decided to learn how to actually use influxdb, this shit's cool

glossy venture
#

yeah its 2 bytes

tardy delta
#

but in the jvm everything is 32 bit basically

glossy venture
#

as locals yeah

#

on the stack everything is 64 bit i think

#

on the heap its compacter

tall dragon
tardy delta
#

heap is a mess id say

lost matrix
echo basalt
#

bruh

tall dragon
#

lmfao

echo basalt
#

I use influx to store the data that's being visualized in grafana

#

the data just happens to be about how long my mongodb shit takes to run

lost matrix
#

You can also just query mondodb 😄

#

Ah ok

echo basalt
#

grafana's mongodb thing is for mongodb cloud

#

and it's paid iirc

lost matrix
#

No joke but we also had a meeting about using graphana and which DB we should use to
back the data. I found influx and prometheus really shit

#

So we just went with Postgres

tall dragon
#

u use influx 3.0 @echo basalt ?

echo basalt
#

uhh

#

2.0 because we set it up like a year ago

echo basalt
tall dragon
#

i found 2.0 easier to use

#

did it with that too once

echo basalt
#

because influx is like "push-as-you-go" while prometheus makes a request every 10 seconds

lost matrix
#

Dont you have to write some weird string based queries for influx? I remember disliking the query syntax

glossy venture
# tardy delta but in the jvm everything is 32 bit basically

so for locals you have one slot by default but 2 for long and double, 4 bytes/slot
on the stack everything must be at least 8 bytes as each entry can supposedly store a long
i assume that everything is sized as compact as possible on the heap (byte and bool being one byte) otherwise memory usage would be high as fuck

tall dragon
#

did not like that either

echo basalt
#

their api is funky

#

but I like abstracting things away

tardy delta
#

arent locals on the stack too?

#

wait

glossy venture
#

they are in the stack frame local area

lost matrix
#

Hm i just found the influxdb-java driver.
Doesnt look too bad honestly

echo basalt
tardy delta
#

hmm

tall dragon
lost matrix
#

I guess its time for a second meeting

tardy delta
#

kinda forgot about all the stuff

glossy venture
#

per thread

tardy delta
#

and some other stuff

#

couldnt find a good pic

glossy venture
#

also isnt the java heap weird as fuck with different areas

tardy delta
#

fragmentation you mean?

#

or like method areas and stuff?

glossy venture
#

nah this shit

tardy delta
#

ah ye

glossy venture
#

eden

#

the old genration

tardy delta
#

Eden Space:When we create an object, the memory will be allocated from the Eden Space.

echo basalt
lost matrix
#

Oh yeah you need to tune the jvm parameters so that big objects dont get transferred to the wrong heap space.
I remember that when i dissected aikars flags

tardy delta
#

i only remember that my raspberry pi nearly began to smoke when i used aikars flags

tall dragon
# echo basalt oo

im guessing you have some kind of system setup to easily upload your data, care to share?

echo basalt
#

it's all built into my mongodb abstraction

tall dragon
echo basalt
#

well

tardy delta
#

8 gigs for the win

tall dragon
#

say u wanted to visualize player steps suddenly

echo basalt
#

it's just a TimeProfiler class that runs a lambda and profiles it

tall dragon
#

ah

echo basalt
#

but yeah for visualizing that

tall dragon
#

think i did about that same

echo basalt
#

I just make that timeprofiler

#

or something

#

because it profiles... time

#

or I can just make it write a "1" and set the graph mode to sum()

#

instead of average

tardy delta
glossy venture
#

JVM developers smart as fuck

tardy delta
#

ah

#

and last of all, you have me allocating objects off-heap

lost matrix
glossy venture
#

young space exists so the JVM can sweep temporary, quickly unused objects, like the event objects when an event is called in bukkit, fast

tall dragon
#

pretty long time ago

tardy delta
#

anyways, gn

glossy venture
#

gn

#

wtf is the JRockit JVM lol

echo basalt
glossy venture
#

bro istg this gui was created in mspaint

#

oh nvm lol

lost matrix
#

Is JRockit still a thing?

glossy venture
#

looks pretty old

#

dont think its still maintained

echo basalt
#

it does auto batching by default, with these params

#

you can make a builder

tall dragon
#

huh

#

didnt know that

#

i batch them myself ;o

tall dragon
echo basalt
#

we have a lil problem

echo basalt
#

it flushes every second or until it reaches 1000

tall dragon
#

every second?, isnt that still a little quick?

echo basalt
#

only when it has data

tall dragon
#

i used to send every 10 seconds

echo basalt
#

well

#

if you want an accurate graph

#

you'll need fine data

tall dragon
#

well u can specify the data collection time

echo basalt
#

tehre's a builder if you want to fine tune the numbers

tall dragon
#

so it will be accurate

#

it just might be 10 seconds behind no?

echo basalt
#

perhap

wary mauve
#

Is there a way to easily delete chunks?

#

make them void?

tall dragon
#

yea, loop over the blocks and delete em

wary mauve
#

And if I need to do that to thousands of chunks?

tall dragon
#

then you'll need to be smart about it

glossy venture
#

use nms

#

put air as a block in the palette

#

block 0

#
int[] v = new int[16 * 16 * 16];
for each chunk section:
  System.arraycopy(...)
#

idk if its an int

tall dragon
#

?workdistro and this can be of some great use as well with this kind of stuff.

wary mauve
#

work distribution is what screwed up my world gen in the first place

tall dragon
#

then you probably did it improperly

glossy venture
#

wait you want to reset chunks?

#

or set them to air

wary mauve
#

what do you mean by the first thing?

glossy venture
#

like regenerate them

#

completely

wary mauve
#

I dont think thats possible

tall dragon
#

it is

glossy venture
#

well if you delete all region files

tall dragon
#

worldedit even has a command i believe

#

//regen

glossy venture
#

minecraft will just regenerate all chunks

#

dont even have to bro you can just stop the server, delete world files and start

chrome beacon
young knoll
#

Worldedit makes a copy of the world and generates the chunk there

#

Then copies it over

tall dragon
chrome beacon
#

Which is also why the regenerate chunk method is deprecated

glossy venture
#

lets go guys

#

this is fun

chrome beacon
young knoll
#

What have you made

glossy venture
#

types

#

for my scripting lang

gleaming grove
glossy venture
#

each thing needs diff behavior

#

flat packages view is clean asf tho

#

no need to horizontally scroll or look at ugly file structures

wary mauve
#

For context, I'm trying to create these sections of land because they are cool. It generates them with a normal chunk generator, then switches to a void generator when players can join the world, so that the chunks surrounding it are void. When the plugin generates these in a single tick, it works. When I use work distribution, two things happen. 2 extra chunks around the chunks I select get generated. TWO! And, the outermost chunk doesn't get decoration.

glossy venture
#

oh my days

tall dragon
#

well if you generate them before anyone is actually playing, whats the point of avoiding lagg by using workload distribution

young knoll
#

The correct way to do this is to make your own chunk generator that handles the whole thing

#

But I believe they are using something third party for the default gen

wary mauve
#

Thats not how chunk generators work I dont think

glossy venture
#

well the vanilla chunk generator is hard to access i think

young knoll
#

Not anymore

wary mauve
ivory sleet
#

More memory or slow down

glossy venture
young knoll
glossy venture
#

oh

#

thats handy

young knoll
#

So you can simply delegate to vanilla for a while

glossy venture
#

until you need void

#

sick

young knoll
#

And then once x or z are bigger than your boundary, start returning false

glossy venture
#

aight gn

wary mauve
young knoll
#

Little bit of math on the x and z coord

#

Mod them by 100 and only generate terrain if the result is 0-5 for example

#

That will give you 6 chunks of terrain and then 94 empty

raw crow
#

how do i make a compass point to a location?

young knoll
#

Version?

raw crow
#

1.19.3

young knoll
#

Well one is per item

#

Idk if setLoadstore requires an actual lodestone at that location

calm robin
#

whats the difference between Inventory and InventoryView

young knoll
#

Inventory represents an inventory that can be opened

#

InventoryView represents the view of an opened inventory

worldly ingot
#

InventoryView is a container representing both inventories

#

Inventory is one or the other

young knoll
#

Ah yes that too, since the player inventory and whatever is on the top are 2 separate inventories

worldly ingot
#

I posted an image of this a long time ago on the forums and I can't find it

calm robin
#

is there any practical reason for using inventory view?

#

and is there any practical difference

worldly ingot
#

Useful for identifying which container specifically is open

#

GUIs and whatnot

calm robin
#

so if i open a custom inventory for a player, am i able to tell if that inventory is open when they do an inventoryclickevent?

#

inventory, not inventoryview

young knoll
#

Yes

worldly ingot
#

You can keep track of the open InventoryView and compare it with the one provided by InventoryClickEvent

young knoll
#

getTopInventory should match your custom inv

worldly ingot
#
InventoryView view = player.openInventory(inventory);

// In your event
if (event.getView() == view) {
    // Your inventory
}```
#

Obviously very simplified, but that would work

young knoll
#

Also an option

calm robin
#

so im opening a custom inventory when a player clicks an enchantment table, im cancelling the defualt inventory and opening my own, but the player makes a 2nd "swing" when right clicking the e table

#

minor thing but do you guys know the fix?

young knoll
#

Check the hand in the interact event

#

If it’s the offhand return

calm robin
young knoll
#

Always use &k as much as possible

young knoll
calm robin
#

a hand

young knoll
#

Shhh

calm robin
#

ah

young knoll
#

People gotta learn to use their ides

calm robin
#

if(e.getHand() == EquipmentSlot.OFF_HAND){
return;
}

#

im so good at this

#

or do i need .equals()

#

or instanceof

#

coolio

#

thanks

small lynx
#

!paste

undone axleBOT
small lynx
#

Help

#

the ? in name dont count?

#

i just added that

compact haven
#

he has 6 tho

#

another is on the WHERE clause

young knoll
#

I assume the table itself has 6 columns

#

And doesn’t allow null for any

compact haven
#

Send the table sql because something is up

#

and the full statements you at using

small lynx
#

the code that i use to create it helps?

#

i use a code onEnable to create it

#

okay

#

Statement statement = conn.createStatement(); statement.execute("CREATE TABLE IF NOT EXISTS kppvp_stats ( name varchar(50) NOT NULL, kills int(11) NOT NULL, deaths int(11) NOT NULL, streak int(11) NOT NULL, coins int(11) NOT NULL , xp int(11) NOT NULL, PRIMARY KEY (name)) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;"); statement.close();

compact haven
#

6 cols

#

and now the code that gives an error

#

o yeah wtf lmao

#

thought that was common knowledge since like 1.8

small lynx
#

do you guys need more part of the code to help me?

wary mauve
#

@young knoll I'm both happy and pissed off this is so easy to do with these methods. I wish I figured that out or someone told me 3 days ago. Thank you

small lynx
echo basalt
#

I'm so far behind

#

show full line

#

yeah I'm blind

#

uhh

#

I'd rather do

#

INSERT INTO kppvp_stats (kills, deaths, killstreak, coins, xp) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE name=?

#

might be useful to specify the actual columns

peak depot
#

so Bukkit.getScheduler().runTaskLater(Main.getInstance(), new ScoreboardTitleTask(animation, scoreboard, player, delayTicks), delayTicks);
to new ScoreboardTitleTask(animation, scoreboard, player, delayTicks).runTaskLater(Main.getInstance(), delayTicks);?

#

ok

echo basalt
#

nice ip

peak depot
#

Like fr idfc if you wanna ddos me goahed

sullen marlin
#

chocos method only takes lowercase input

worldly ingot
#

Yep

#

Can just add || character >= 'A' && character <= 'Z' to the if statement and should still work okay

#

Was an educated guess I suppose ¯_(ツ)_/¯

#

I'm sure there's some other codepoint offset that displays the chars like that

#

I mean it absolutely could be

sullen marlin
#

disable resource packs and see lol

#

and isnt chat logged in the client log also

worldly ingot
#

Yep. Also a good way to figure it out

#

Do you want a ballsack? ѽ

#

CYRILLIC SMALL LETTER OMEGA WITH TITLO (U+047D)

small lynx
sullen marlin
#

sir this is spigot

worldly ingot
#

Too many ?s, not enough parameters passed to your PreparedStatement

echo basalt
#

3.0 is not a thing

echo basalt
#

you either use influx 1.8 or 2.0

#

2.0 introduced flux, their query language

worldly ingot
#

Provide the number of arguments that your query requires, ideally

small lynx
#

it requires 7

worldly ingot
#

One of those errors says it requires 8

#

Oh I found the amogus one ඞ

small lynx
#

uuid, name, kills, deaths, streak, coins, xp

worldly ingot
#

What's your SQL query?

#

The full query

#

& the code that sets the parameters

small lynx
worldly ingot
#

Unsure. There's probably some website that shows English codepoint variations

#

I'm only aware of 0xFEE0 but I guarantee you there are others

#

Hacked clients use them all the time

echo basalt
#

what you trying to do?

worldly ingot
#

Your ON DUPLICATE KEY UPDATE also has a ?

#

(As an aside, I wouldn't rely on name as a constant identifier. Refer to the UUID where possible. It's constant)

#

Alternatively, you could alter your statement to do the following

INSERT INTO kppvp_stats (kills, deaths, killstreak, coins, xp, UUID, name)
    VALUES(?, ?, ?, ?, ?, ?, ?)
    ON DUPLICATE KEY UPDATE name = VALUES(name)
#

That way you do only need 7 and you're avoiding re-assigning the same parameter

echo basalt
#

Okay so you'll need like a mapper for this

worldly ingot
#

Yeah they might just have a set of characters they're manually mapping

echo basalt
#

you gotta look for em

worldly ingot
#

You can usually search for things like "F" and it should come up with similar-shaped letters

echo basalt
#

you only need 26

#

fun fact I failed my homework on 1st grade because the reading test said that the alphabet had 23 letters and I counted 28

#

then yeah 26

#

try and see

small lynx
echo basalt
#

remove the last ,

worldly ingot
#

Well, coins=? , xp=? UUID=?, WHERE name=?, this is a little mangled

#

This is where text blocks really come in handy

    private static final String INSERT = """
        INSERT INTO kppvp_stats (kills, deaths, killstreak, coins, xp, UUID, name)
            VALUES(?, ?, ?, ?, ?, ?)
            ON DUPLICATE KEY UPDATE name = ?";
        """;

    private static final String SELECT = "SELECT * FROM kppvp_stats WHERE name=?";

    private static final String SAVE = """
        UPDATE kppvp_stats
            SET
                kills = ?,
                deaths = ?,
                killstreak = ?,
                coins = ?,
                xp = ?,
                UUID = ?
            WHERE name=?
        """;
#

The ability to indent and properly format SQL makes readability much nicer rather than having it all on one line

small lynx
#

so what i need to do to fix

echo basalt
#

just make .sql files and load em dynamically hehe

small lynx
echo basalt
#

why this dude following me

worldly ingot
#

You're missing a , between xp=? UUID =?, and you have an extra , after UUID = ?

small lynx
#

in save?

worldly ingot
#

Yeah

#

But in INSERT you're also specifying 7 column names but only 6 parameters

#

You really need to read up on some more basic SQL

small lynx
#

private static final String SAVE = "UPDATE kppvp_stats SET kills=? , deaths=?, killstreak=? , coins=? , xp=?, UUID=? WHERE name=?";

#

this is correct now?

worldly ingot
#

Yes

small lynx
#

private static final String INSERT = "INSERT INTO kppvp_stats (kills, deaths, killstreak, coins, xp, UUID, name) VALUES(?,?,?,?,?) ON DUPLICATE KEY UPDATE name=?";

#

and the insert one?

#

?

#

private static final String INSERT = "INSERT INTO kppvp_stats (kills, deaths, killstreak, coins, xp, UUID, name) VALUES(?,?,?,?,?,?) ON DUPLICATE KEY UPDATE name=?";

#

the insert one is correct?

livid dove
#

You ever get to the end of the MVP segment of a project and think "god damn thank god its almost done!" ? xD

echo basalt
livid dove
echo basalt
#

project I've been working on for a while

#

Alright, now just do your lil if check - 'A'

#

characters are internally just numbers that point to their definition on the charset thing

#

'b' - 'a' = 1

#

type deal

#

so

#

yeah you're still comparing numbers

#

you don't really need to care about that

#

also change your mapping to use characters and not strings

#

so

#
public static String remap(String original, char[] mapping) {
  char[] outputArray = new char[original.length()];
  char[] originalArray = original.toCharArray();

  for(int index = 0; index < originalArray.length; index++) {
    char character = originalArray[index];

    if(character >= 'a' && character <= 'z') {
      outputArray[index] = mapping[character - 'a']; // lowercase
    } else if (character >= 'A' && character <= 'Z') {
      outputArray[index] = mapping[character - 'A']; // uppercase
    } else {
      outputArray[index] = originalArray[index]; // not mapped
    }
  }

  return new String(outputArray);
}
#

something like this

#

yes

#

bruh

#

I might be idiot

#

but in theory my code makes sense

analog thicket
#

Yo, I have a plugin called "Generators" I'm saving all generators to a single file pr player. Saving the data in a HashMap<UUID, Set<PlayerData>>. The problem is when the server restarts I have to go through every player file to get all Generator locations, because if I don't everyone could destroy each other's generators. Is this ok as it's only when the server starts, or is there some other way?

echo basalt
#

yes, do it async though

small lynx
#

i have fixed the leave error

#

but that join error changed again

echo basalt
#

originalArray.length is the same as original.length

#

What did you fix?

#

yeah I don't see much of a difference but sure

#

skip arrays entirely

analog thicket
echo basalt
analog thicket
#

Oh yeah i can do it like that too

#

Didn't think about that

echo basalt
#

CompletableFuture.runAsync(() -> loadFiles(plugin)).thenRun(() -> {
// Files are done loading, feel free to print a message
};

echo basalt
#

If you've never used futures before I suggest you read this

worldly ingot
#

lol, creative to prefix your guides

echo basalt
#

It's so I can look them up faster

worldly ingot
#

Figured as much

echo basalt
#

instead of having a little list of discord message links

#

It's my only guide though

#

send me that array for future reference eyeszoom

undone axleBOT
young knoll
#

So that font works in the vanilla RP

#

Neat

echo basalt
#

don't you love when you're reverse engineering a library and you face a 20k line class

#

and the javadocs have fuckin images

small lynx
echo basalt
#

Flowable

small lynx
#

someone wants to help me finding out a fix to it?

echo basalt
#

yes but 20.5k lines

worldly ingot
#

tf is Flowable?

echo basalt
#

something about reactive streams

livid dove
echo basalt
#

I think the biggest class I have out in this project

#

I was gonna say it's my redis impl but it's only 290 lines

#

I gotta find something bigger

#

I generally always stay under 250 lines

#

unless I document a ton

#

o

#

ItemBuilder's got 340

small lynx
echo basalt
#

welp it's time for me to go to bed

#

2:24am, somewhat productive day

quaint mantle
#

hey guys, so a pdc is super convenient and way easier than a db so is there any reason for me to use PDC > databases to store most of my stuff for a player?

young knoll
#

PDC can only be accessed when the player is online

#

You also can’t query it

quaint mantle
#

oh that makes sense then, would be pretty hard to order stuff and shit if i were to only store with pdc.

lost matrix
young knoll
#

PDC isn’t IO

#

Technically

lost matrix
#

Was more referring to local files

quaint mantle
young knoll
#

You can with local files

#

You technically can with PDC too, but you have to manually load player files

lost matrix
quaint mantle
#

ooh yeah thats slightly inconvenient. another question then, it is better for me to have a database that stores files or have an online server with mysql?

lost matrix
quaint mantle
#

yep exactly that. i just worry itll be tougher to set that up over an actual server

analog thicket
#

yo @echo basalt

On Enable stuff

FileManager fileManager = new FileManager(this);

CompletableFuture.runAsync(() -> fileManager.loadPlayerFiles()).thenRun(() -> {
  Bukkit.broadcastMessage("Generators - Player files has been loaded.");
});

File stuff

CompletableFuture.runAsync(() -> {
  // Stuff
});

Is this correct? Cause i can't seem to get it to work :/

lost matrix
#

But generally speaking this is ok

echo basalt
#

uhh

analog thicket
echo basalt
#

well it's somewhat fine to do IO in the main thread

#

but given this is player storage, I'd still recommend doing it async

#

I've had cases where it took 5 minutes for a server to start because of this

#

but I also just switched to a proprietary format of that ever happened, or just use a database

lost matrix
echo basalt
#

well

#

the rest of the server will wait for you

acoustic gorge
#

Hey everyone, I'm trying to develop a server hopper plugin where if a player clicks on a custom item it transfers them to another server however when using something like player.performCommand("server") it returns as unknown command anyone know why?

echo basalt
#

You're running bungee commands on bukkit

lost matrix
lost matrix
echo basalt
#

well performCommand is for extra niche plugins

#

made by extra special people

young knoll
#

It’s good for like

analog thicket
echo basalt
#

telling good devs apart from bad devs

young knoll
#

Configurable rewards for a voting plugin or whatever

analog thicket
#

Not even getting the message

young knoll
#

Incase you want to run the give command of another plugin

echo basalt
analog thicket
#

Imme read it again

young knoll
#

Slurp

echo basalt
#

gotta love having a midlife crisis at 18 and deciding to help people instead of sleeping

lost matrix
acoustic gorge
#

Hmm so not for things relating to bungeecord or spigot commands but for other plugins?

lost matrix
#

Wait i dont think this makes sense in english

echo basalt
young knoll
#

You should only use performCommand for running arbitrary commands

echo basalt
#

fun fact: .exceptionally() creates a new future

young knoll
#

For example: something user configured

acoustic gorge
#

gotcha so like /help or something like that

young knoll
#

If you know what command will be run, there is almost always a better way

echo basalt
#

sometimes I actually wish there was a secret option that a dev had to enable

#

to actually be able to use such methods

analog thicket
echo basalt
#

like a casual HiddenFile.enableFeature(PERFORM_COMMAND)

echo basalt
#

maybe play a bit with Unsafe

#

inject in a cached threadpool

analog thicket
#

Oh message is now there 😮

young knoll
#

How about a command line argument

echo basalt
#

ehh

#

no

#

it'd break plugins and generally not be well seen

#

but a hidden file is cool

#

and a warning

#

like

young knoll
#

Shoutout to -IReallyKnowWhatIAmDoingISwear

echo basalt
#

Hey, seems like you're not meant to run this action. If you're seeing this for the first time, there's always a better way to do what you're currently trying to do. Regardless, if you're actually fetching commands from a config, look up how to enable the "hidden feature"

young knoll
#

I feel that would be good for a lot of things

#

But I digress

#

“Oh you’re trying to use reflection? Write me a short persuasive paragraph on why you should be allowed to do so, you have 5 minutes”

echo basalt
#

and just have a HiddenFeatureManager.allow(plugin)

#

reflection is acceptable

#

but stupid features that aren't meant to be used... should not be used

young knoll
#

I mean

#

If you need reflection you better have a good reason

echo basalt
#

accessing Unsafe?

#

or seeing if a class is present

#

or loading mysql drivers

young knoll
#

Yes those are good reasons

echo basalt
#

or doing nms without a multi-module project

young knoll
#

Ehhhhh

#

Arguable

echo basalt
#

or fucking with internals

echo basalt
#

I've used Unsafe to replace spigot's command map

young knoll
#

Is it static final

echo basalt
#

yes

#

actually non-static

young knoll
#

Then you don’t need unsafe

echo basalt
#

maybe

#

might've been a static final

young knoll
#

Dat don’t look static to me

echo basalt
#

whatever

#

I can't bother doing the &~ thing

young knoll
#

You don’t need to

#

And that doesn’t work anymore

cinder karma
#

Need some guidance on using a specific player-crafted potion as a MerchantRecipe ingredient. I see plenty on how to setup custom potions, but what counts as equivalent for the purposes of a MerchantRecipe ingredient? Do they have to just have the same effect? Same duration? Just looking for some guidance here.

echo basalt
young knoll
#

That doesn’t really help

#

Look at where the game compares them

cinder karma
#

indeed, not quite the question

#

I suppose the "hard coded" potions in the game are just setup using the same bits and bobs we have access to

#

so if I theoretically create a custom potion with the same effect and duration, they SHOULD be equivalent?

#

I guess trial and error it shall be...

young knoll
#

You can set the base potion data on potions

#

Using PotionMeta

cinder karma
#

the player is crafting one potion

#

like, the usual way

#

and I want to trade it to a merchant, so I have to give a recipe to the merchant, not sure what to give them

young knoll
#

Make a potion ItemStack, get the meta, and use setBasePotionData

cinder karma
#

get the meta from the one the player has?

young knoll
#

The one you are making for the recipe

cinder karma
#

oh wait

#

setBasePotionData, I've never seen that before to the javadocs

echo basalt
#

they just compare tags

cinder karma
#

ahhh, PotionType, that's what I've been searching for

#

group effort, peeps 🙂 thanks 🙂

acoustic gorge
#

So I was looking over the plugin messaging channel and I've got a question. Would I put the pluginmessagelistener into an existing plugin for spigot or would i create an entirely new plugin for the bungeecord proxy?

#

and then how would I go about sending that message on a player interaction

young knoll
#

?pmc

acoustic gorge
#

Yes that

analog thicket
#

Wait why wasnt it good having this in the onEnable?

        FileStuff fileStuff = new FileStuff();

        CompletableFuture.runAsync(() -> fileStuff.loadPlayerFiles(this)).thenRun(() -> {
            System.out.println("Generators - Player files has been loaded.");
        });

#

just make a method for it?

young knoll
#

I don’t believe you need a receiver to use the built in messages

#

And it tells you how to send one

acoustic gorge
#

Thank you, I wasn't sure if it was requiring there to be something on the proxy side handshaking with the pluginmessage

summer zodiac
#

I would like to spawn a FallingBlock with FallHurtMax in my plugin code without the command how to do that?

/summon falling_block ~ ~ ~ {FallHurtMax:1000}

young knoll
#

You summon a falling block with world#spawnFallingBlock

#

You can use FallingBlock#setHurtEntities to make it hurt mobs

summer zodiac
worldly ingot
#

Players are entities

summer zodiac
#

they dont get damage

young knoll
#

It doesn’t seem there is an api method to set the damage it deals

#

Or set the max damage it deals

worldly ingot
#

Yeah working on it as we speak lol

young knoll
#

I think those have always existed

#

Idk how that hasn’t come up until now

#

Also FallHurtAmount is a bad name smh Mojang

worldly ingot
#

It is, yeah

young knoll
#

Anyway it seems choco has a PR for that stuff covered, you should see it in spigot build soon, probably a few days

young knoll
#

Small stuff goes pretty quick in my experience

#

Assuming you don’t have any changes requested

lilac nimbus
#

MyPlugin.jar:
https://pastebin.com/raw/NWrz2XDd

Error:
https://pastebin.com/raw/ebnKgDUm

MyPlugin.yml:

name: MyPlugin
version: 1.0
main: com.example.myplugin.MyPlugin
author: Your Name
description: A simple plugin that greets players when they join the server.
commands:
  mycommand:
    description: My custom command
    usage: /mycommand <player>```


The plugin doesn't loads...
small lynx
lost matrix
undone axleBOT
acoustic gorge
#

I'm trying to use the pluginmessage in an event would I just add ByteArrayDataOutput out = ByteStreams.newDataOutput(); out.writeUTF("Subchannel"); out.writeUTF("Arguments"); to the event being triggered? So in my case on inventory slot interaction?

flint coyote
#

Where can I find the code for the implemented book formatter?
The one that takes care of words not being wrapped etc?

I need it to check how much content I can fit on one page and when to put it on the next page

#

Or where can I find code mojangs server code in general? So I can search myself.
Or is it obfuscated?

worldly ingot
#

That would be in the client. It's a client-sided screen

#

Probably ScreenBook or something in Mojmaps

flint coyote
#

Where do I even go to get the client code I have to search in? 😅

worldly ingot
#

Forge, Fabric, or MCP

#

Though I don't think it's worth searching because it's going to vary based on the user's font

flint coyote
#

Hm that's also true. But I doubt that someone would drastically increase the font-size for books.

#

so for smaller fonts the page would be less full but that doesn't matter too much.
Still better than having the page sometimes half-full and sometimes completely full depending on the used words and letters ig

worldly ingot
#

Word wrapping on a single page is handled automatically so you won't need to worry about that, but what you should do is try to restrict how many characters you insert onto a single page, which if I'm not mistaken is 256. I'm sure the wiki has the exact number

#

You'll never get a perfectly formatted book, unfortunately

#

Unless you employ the use of a resource pack with an additional monospaced font

flint coyote
#

I mean the character sizes are known (for the default font). And I made a custom formatter that would wrap words at the end of a line. But it clashes with the one from mojang

#

It's 14 lines with 114 dots. Space between each character is one dot and letter sizes are 1-6 dots.

#

But since they don't wrap words I can't do 14*114

zenith crescent
sullen marlin
#

Can't

zenith crescent
#

Not even with like custom textures?

#

I didnt think it was possible, but i feel like iv seen it before maybe not

young knoll
#

You can do pretty much anything with a resource pack and a dream

#

You can also make fake advancements to trigger the advancement get popup, which is similar

zenith crescent
#

hm ok, i might just try something different. I imagined like a dialogue box thingy but idk if thats gonna be feasable

worldly ingot
#

PES_SadGePray for ClientboundToastPacket and /toast command

cinder karma
#

do Iron Bars use the Fence BlockData ?

young knoll
#

Check the docs

#

It should say next to their Material enum entry

cinder karma
#

ooh, good to know

#

ty

young knoll
cinder karma
#

yup, it's fence, and what a great resource. Never looked there before 🙂

torn shuttle
#

ok I think I give up on writing custom brain behaviors

vast junco
#

Is there a way to set persistent data (that can be read by a spigot plugin) inside of a spawn egg's nbt, so that when it's used, the entity has the tag?

torn shuttle
#

no matter how I twist it there's always a further plot twist that makes it just not usable

vast junco
#

could you do it with /give and the nbt tag you can supply to it?

young knoll
#

Yes

#

PDC is just an NBT wrapper

vast junco
#

is there somewhere I can go to find the format for adding this manually to an nbt tag?

young knoll
#

Probably easiest to just add pdc to an entity and then use the /data command to print it

lilac nimbus
#

Hey, my plugin isn't loading:

Could not load 'plugins/MyPlugin.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:178) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:144) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_19_R2.CraftServer.loadPlugins(CraftServer.java:428) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
    at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:219) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:973) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
    at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:301) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.util.zip.ZipException: zip END header not found
    at java.util.zip.ZipFile$Source.findEND(ZipFile.java:1469) ~[?:?]
    at java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1477) ~[?:?]
    at java.util.zip.ZipFile$Source.<init>(ZipFile.java:1315) ~[?:?]
    at java.util.zip.ZipFile$Source.get(ZipFile.java:1277) ~[?:?]
    at java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:709) ~[?:?]
    at java.util.zip.ZipFile.<init>(ZipFile.java:243) ~[?:?]
    at java.util.zip.ZipFile.<init>(ZipFile.java:172) ~[?:?]
    at java.util.jar.JarFile.<init>(JarFile.java:347) ~[?:?]
    at java.util.jar.JarFile.<init>(JarFile.java:318) ~[?:?]
    at java.util.jar.JarFile.<init>(JarFile.java:284) ~[?:?]
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:166) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
    ... 6 more```
#

plugin.yml

version: 1.0
main: com.example.myplugin.MyPlugin
author: Your Name
description: A simple plugin that greets players when they join the server.
commands:
  mycommand:
    description: My custom command
    usage: /mycommand <player>```
young knoll
#

Recompile it

#

The archive seems to be messed up

lilac nimbus
#

How?

young knoll
#

How did you compile it the first time

lilac nimbus
#

ah

lilac nimbus
#

idk

error: no source files```
#
javac -cp plugins/MyPlugin.jar plugins/myplugin/myplugin.java
error: file not found: plugins/myplugin/myplugin.java
Usage: javac <options> <source files>
use --help for a list of possible options
#

Can you help me with this....

river oracle
#

how can you run your plugins with javac???

lilac nimbus
#

No idea

river oracle
#

I'd just use a build tool like maven / gradle

torn shuttle
#

how do you guys do versioning for multimodule projects? When I change the version I need to reinstall everything through maven for it to work but the parent can't install due to the modules not being found so I end up having to install without the modules first and then add them

#

there has to be a better way

river oracle
#

usually i just use ctrl+shift+f to pop up the versions and change them all at once

#

then save and compile

torn shuttle
#

mvn versions:set -DnewVersion=1.1.0 does all the modifying for me

#

but then intellij forgets where everything is and can't compile

#

it just can't find the modules anymore

river oracle
#

seems like an intellij problem never had that with vsc

eternal oxide
#

In Eclipse you just right click the pom and select update project

#

in IJ you probably have to clear caches and reboot

vocal cloud
#

I find that usually works for intellij

#

Haven't had to clear the cache in a year or so

spare marsh
#

Is there a way to listen to structures being generated for 1.14 api?

spare marsh
#

1.14

sterile axle
#

Then no

#

You'll need to use NMS

spare marsh
#

I guess I'll have to then. Damn it

eternal oxide
#

when you get the command from the plugin.yml you can choose to modify any of it's elements before registering it's executor

icy beacon
#

why?

val worldUuid = it.asJsonObject.get("worldUuid").asString
println("UUID: $worldUuid")
println("Worlds: ${Bukkit.getWorlds().map { world -> world.uid.toString() }} }}")
println("World: ${Bukkit.getWorld(worldUuid)}")
val world = Bukkit.getWorld(worldUuid) ?: return@forEach
#

i'm missing something stupidly obvious am i not

#

oh i got it

#

i forgot to turn the string to uuid

#

💀

ocean hollow
#

reads the side where the player is looking, but does not move, I don’t understand why?

eternal oxide
#

does the entity have AI?

#

or is it an actual Player?

#

also you are doing a lot of math there you simply don;t need

#
newLoc.add(0,0,-1);
ent.setVelocity(newLoc.toVector().subtract(currentLoc.toVector()));```can be replaced with```java
ent.setVelocity(new Vector(0,0,-1));```
#

actually you could even scrap your facing code, just use the Entity#getFacing

ocean hollow
eternal oxide
#

although that is cardinal not cartesian as you are doing

#

so you only want N,E,S,W and ignore NE,SE etc?

#

then your face code is fine, just scrap all the other

#

I'd probably drop using strings though

#

you don;t even need a switch if you make your getDirection method return a Vector

ocean hollow
eternal oxide
#

you could do it all in one line of code

#

no

#

its your vector is too small for you to notice

#

the whole of your code can be simplified tojava ent.setVelocity(getDirection(player));If you change your getDirection() to return a vector.

#

No switch or anything

#
Slime ent = (Slime) player.getVehicle();
ent.setVelocity(getDirection(player).multiply(2));```
#

adding the multiply so you can add a strength of the push

#

If your getDirection is changed to return a Vector

ocean hollow
#

Should there be such a result?

eternal oxide
#

a result?

#

you are already creating a variable for dir so use it

#

ent.setVelocity(dir.multiply(2));

#

you may want to add comments to your getDirection method so later in life you remember which vector is which

sullen canyon
#

I mean what for

ocean hollow
#

Thanks, I already got it

#

I want to try to make a game like Land.io in discord

terse ore
#

for making a subcommand handler the best way is just by checking with ifs right

sullen canyon
#

ask chatgpt

tardy flame
tender shard
#

val val val

icy beacon
#

what does this have to go with kotlin

tender shard
#

because in java you'd know what type a variable has, in kotlin you just say "val" and then have no clue whether it's a string or uuid or world or whatever

rotund ravine
#

It’s not that hard to figure out tbh.

#

Either just hover over it or the functions will shit themselves.

tender shard
#

in java you don't have to figure it out

eternal oxide
#

nothing to "figure out" with Java

rotund ravine
#

So?

#

It’s not like it’s a chore to figure out or not figure out.

tender shard
#

so mistakes like this couldnt happen in java

rotund ravine
tender shard
#

well if I did

UUID myUUID = someString;

then the compiler would tell me that a String is not a UUID

#

if however I just did

val myUUID = someString

then I would assume it's a UUID while it's actually a string

rotund ravine
#

I am sorry. How is it not easy to view on righthand side that it’s a string in his exampel?

#

As well as yours.

hazy parrot
#

It's easy, they are just hating kotlin as usual

tender shard
#

ofc it's easy when you look at the "asString" part. But usually the type is on the left side. and here it's just "val" instead of a type

tender shard
rotund ravine
#

Again. Don’t immediately put your java notions on top of a different language.

tender shard
#

oh because getWorld also has a stirng method

#

makes sense

rotund ravine
#

Cause ^

tender shard
#

yeah anyway, using val is just prone to stupid mistakes

eternal oxide
#

val is in Java now, never going to use it.

tender shard
#

yeah very bad idea imho

rotund ravine
#

I am gonna use it extra much just to annoy you.

tardy delta
#

btw can i use css for textures

eternal oxide
#

Ok 🙂

tender shard
rotund ravine
#
ReflectionSupplier
            .NMS_BONE_MEAL_METHOD_ACCESS
            .invoke(
                null,
                ReflectionSupplier.NMS_BONE_MEAL_APPLY_INDEX,
                boneMealItemStack,
                ReflectionSupplier.CRAFT_WORLD_METHOD_ACCESS.invoke(
                    block.world,
                    ReflectionSupplier.CRAFT_WORLD_HANDLE_METHOD_INDEX
                ),
                *getBlockPosition(block)
            )
        applyEffect(block, player, config)```

The * do be weird
terse ore
#

is it like in py?

tender shard
#

I only know that it's for varargs methods

rotund ravine
terse ore
#

in python using a * before an iterable it unpacks all of it's values

rotund ravine
#

Same

terse ore
#

a, b, c = [1, 2, 3]

#

?

rotund ravine
#

Maybe? Can’t recall

terse ore
#

okok np

rotund ravine
#

Looks like it

serene sigil
#

hi, i am trying to make an inventory where every second a new item get put in the first slot, so basically, every second it gets replaced... some items in Material however cannot be put in an inventory and they just get replaced with air, how can i bypass that?

eternal oxide
#

only use Materials which are isItem()

serene sigil
#

so while material.isItem()?

#

like this?

eternal oxide
#

make a Set of materials at instancing you can pull from

serene sigil
#

how?

chrome beacon
#

I'd just go with a static set created with a stream since it never changes

serene sigil
#

how?

chrome beacon
#

Or maybe just an immutable list 🤷‍♂️

serene sigil
#

how?

eternal oxide
#

.stream().filter(Material::isItem)...

chrome beacon
#

Material.values.stream.filter(isItem).tolist

#

On phone ;/

eternal oxide
#

shorthand 🙂

#

make it a private static final field

pine forge
#

Is there a way to get all positive/negative potioneffects?

chrome beacon
#

Same way as the materials we just talked about above

#

Stream the effects enum and save it to a variable

serene sigil
#

like this?

chrome beacon
pine forge
serene sigil
chrome beacon
pine forge
#

okay,..

#

thats too bad

serene sigil
#

@pine forge who are u able to have external emojis without nitro??

eternal oxide
pine forge
#

when did i use external emojis

serene sigil
pine forge
#

It worked in about me's without nitro some time ago

serene sigil
#

oh

pine forge
#

i didnt edit my about me since then

serene sigil
#

cool

pine forge
#

and discord didnt disable it on my about me

serene sigil
#

lucky 😄

twilit roost
#

is there some PreSpanerSpawnEvent?

tawdry echo
#

SpanwerSpawnEvent

peak depot
#

Is it a bug that I need to press tab twice too see the tabcompletion

terse socket
#

Hi, pretty generic question; how can I remove the "<" and ">" from the chat when a player sends a message?

eternal oxide
#

async chat event setFormat

terse socket
#

Thank you

jagged bobcat
# peak depot Is it a bug that I need to press tab twice too see the tabcompletion

It shouldn't work like that.
Here is example from my plugin

    @Override
    public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] args) {
        if (Reflections.Version.get() == Reflections.Version.NOT_SUPPORTED) {
            return Collections.singletonList("");
        }
        if (args.length == 1){
            return Arrays.asList("create", "delete", "author", "skript", "info", "rename", "addline", "setline", "deleteline", "shiny", "glowing");
        }
            return Collections.singletonList("");
       }
ivory sleet
#

That wont work pretty sure you need to do the copy partial matches thingy from StringUtil class

#

Or well the result will not be as you expect it to be

tardy delta
#

why twice the same return

#

oh wait

jagged bobcat
#

Its not full method

tardy delta
#

i should not be messing with java when writing tokenizers

jagged bobcat
#

Won't mess with it if it works

#

Confusing

tardy delta
#

wtf

tawdry echo
#

just use lib for commands lol

ivory sleet
#

Well at least make it easier for urself by splitting up that giant function

peak depot
tardy delta
#

and use some early returns

jagged bobcat
jagged bobcat
tardy delta
#

and dont ever write "else" if your if already returns smth

#

probably also want to cache materials

jagged bobcat
#

Probably

#

Would actually be better 1 sec

tardy delta
#

as that clones an array of who knows how many constants

#

and then iterates over it

twilit roost
#

how do I make Spawner ignore Light Level?

#

or how do I use Block Wrapper?

vital sandal
#

how can I copy the block data ?

chrome beacon
#

?

#

What is your goal

vital sandal
#

refill the block

jagged bobcat
#

block.getData() or block.getBlockData() I think

vital sandal
#

pp break it and then I replace it later

#

nvm

#

I just use block.getState()

pure dagger
#

How to remove 1 item from an inventory?

pseudo hazel
#

set the slot with air

young knoll
#

removeItem

pseudo hazel
#

or that

#

is probably better xD

icy beacon
#

I wouldn't make the mistake neither with java nor with kotlin under normal circumstances, which can be proven by other serializers in this project, most of which worked first try xD

pure dagger
#

1 item

#

that removes itemstack

icy beacon
#

item.setAmount

pure dagger
#

wha

icy beacon
#

if amount is 1, remove the item, otherwise decrease by 1

young knoll
#

removeItem removes up to the amount specified

pure dagger
#

no

pure dagger
icy beacon
#

what

#

show your code

pure dagger
#

i dont have this item

#

i mean

tender shard
icy beacon
#

or just use jefflib yeah

#

it normally solves every problem for spigot there is

pure dagger
#

ok xD

tender shard
#

for whatever reasons

young knoll
#

True

#

But you can just .clone

tender shard
#

sure

#

still weird lol

sullen marlin
weak kayak
#

isn't the Integer key the index to the ItemStack that couldn't be removed from the varargs ItemStack parameter?

terse socket
#

Constantly check if a value has changed and if it has changed, do something. I know this is more of a Java question and I will be considered a noob, but I need live support to understand this right now.

terse socket
#

And I'm sure you can assign an ItemStack without the Integer

weak kayak
terse socket
weak kayak
weak kayak
weak kayak
terse socket
#

🤔

#

A bit confusing to me

weak kayak
#

yea i was just sorta paraphrasing the docs

#

🤔

young knoll
#

That’s what it says anyway

#

The returned HashMap contains what it couldn't remove, where the key is the index of the parameter

weak kayak
#

yes but that's the index from the given ItemStack varargs parameter, no?

ivory sleet
#

Yes erdi

weak kayak
#

so i phrased it correctly

young knoll
#

Idk why it changes the input sometimes

#

Sounds like a good PR tho

weak kayak
#

dang

#

abouta become a contributor
this is my hero arc

ivory sleet
#

Lol

iron glade
#

Hey guys, do I have to manually add some code so that command blocks recognise @/p, @/s, etc with my plugin's command?

young knoll
#

Yes

weak kayak
#

yeppers peppers

iron glade
#

uff

weak kayak
#

uff indeed

iron glade
#

Is that done in the onCommand part or where?

young knoll
#

Yes

weak kayak
#

there's probably some utility class someone made for it