#help-development

1 messages · Page 850 of 1

glossy venture
#

it makes sense its like that unoptimized

grim hound
#

Machine code compilation would be faster that runtime bytecode translation

glossy venture
#

ofc

#

but not cross platform

#

and the runtime can be nice

#

with things like reflections

wise mesa
#

i've been reading through crafting interpreters and its got some interesting bits about that

grim hound
wise mesa
#

but if you can't?

#

like obviously there's use cases where reflection is useful

grim hound
#

Well then I guess

wise mesa
#

because people use it

glossy venture
#

its also bytecode so its not as slow as interpreteting the script and its converted to machine code at runtime by the jvm

#

also class loading and gc

#

are nice

grim hound
grim hound
glossy venture
#

java isnt even that slow anymore nowadays

grim hound
#

Like 0.02 ms when I tested

eternal night
#

join the church of valhalla COPIUM we all believe it is read for the next LTS COPIUM

wise mesa
#

so just saying MAKE EM DIRECT ACCESSES isn't a very productive statement

pliant topaz
#

How would i go about using Entity.remove() to remove an entity with a specific CustomName, say 'Test'?

wise mesa
#

probably want to find that entity somehow

glossy venture
#

for the jvm

tender shard
grim hound
#

Before the server loads the class

eternal night
glossy venture
#

that would be great

wise mesa
#

woah

#

like in c#?

eternal night
#

that would indeed be great

wise mesa
#

that would be crazy

grim hound
#

It should find the variable, make it accessible and parse it into machine code

wise mesa
#

mfw every update is just java trying to catch up to c#

glossy venture
grim hound
#

Why not at loading?

glossy venture
#

some parts may actually be compiled immediately idk

grim hound
#

Too much memory usage?

glossy venture
#

dk

grim hound
#

But that wouldn't make any sense

glossy venture
#

should u JIT compile code which is run like once per frame

#

just takingn up more resources and memory

grim hound
#

Since the VM can access anything

glossy venture
#

than it saves

wise mesa
#

once per frame is actually a lot

#

that's a pretty hot spot

glossy venture
#

nah bro

wise mesa
#

will probably be compiled rather quickly

glossy venture
#

like 16 ms to do its thing

#

i wouldnt consider it hot

wise mesa
#

i don't understand your example

glossy venture
#

but like rendering code called for every vertex should be compiled yeah

glossy venture
wise mesa
#

once a frame is a lot

#

it might not be a lot as the other one but its a lot

#

stuff that probably won't get compiled is one off stuff

grim hound
#

Not like netty a lot

#

But rendering a lot

wise mesa
#

in the example of a minecraft server a command you call occasionally

grim hound
#

I once read an article that said that the JIT is actually a bad thing

#

Since the code must be changed at runtime

wise mesa
#

ugh

#

articles say all sorts of things

#

everything has its place

#

jit is fine

#

worry about writing good code

grim hound
#

I use switch(packet.getClass().getSimpleName()) for packet identifying

echo basalt
#

eh

#

icky

grim hound
#

And it takes 0.5ns on average

wise mesa
#

couldn't you use a pattern matching switch

#

and just match on the type

grim hound
#

To compare, empty lines (so no code) take 0.25ns

grim hound
#

Matching packet classes

#

Great I can do that

wise mesa
#

i don't actually know if its faster

#

just suggesting

grim hound
#

Especially with those mfos changing names every version

grim hound
wise mesa
#

pattern match

grim hound
#

?

echo basalt
#

just pull a CraftEntity.getEntity

#

and have a solid 200 if(whatever instanceOf Whatever) lines :)

glossy venture
wise mesa
#
Shape s = functionThatReturnsAShape();
switch (s) {
  case Rectangle r -> r.area();
  case Circle r -> r.area();
}
glossy venture
#

i doubt a hashmap isnt faster

wise mesa
#

not a great example but

grim hound
#

instanceof is a really confusing thing to me, since during testing it's performance varied from 0.25ns to a whopping 0.5ms per declaration

echo basalt
wise mesa
#

its a preview feature in java 17 and i believe its normal in java 18

#

pattern matching

glossy venture
wise mesa
#

so if you're able to use those versions

#

you can take advantage

grim hound
glossy venture
#

nah wtf why didnt they do that at first

wise mesa
wise mesa
grim hound
#
  1. They need to have the same name
grim hound
wise mesa
#

doesn't have to be exhaustive

#

just have a default case

echo basalt
wise mesa
#

i mean I don't fully understand what you're doing but to me I don't see why it wouldn't work

#

you're matching on the type

grim hound
#

The class names would need to stay the same

#

And they don't

grim hound
wise mesa
#

¯_(ツ)_/¯

#

can't help you there

grim hound
#

But I can input all possible class names

#

And have them execute a line of code

#

But if I try to input a non-existent class

#

ERROR

grim hound
#
  1. Java 18+
#
  1. Dunno but I think they need to be sealed
wise mesa
#

anyways if your system works fine then that's great

#

im fairly confident that 3 is wrong

grim hound
#

I wanna max the performance

wise mesa
#

as long as you have a default case

#

idk this seems like premature optimization

#

have you identified this as the most inefficient part of your program

#

plugin whatever

grim hound
grim hound
#
  1. Getting the Offline Player's info
#
  1. Teleporting
#

Yes

#

Paper has like getOfflinePlayerIfCached

#

Dunno when they cache em tho

#

To see if someone of This nickname has ever entered the server

#

And to ensure the user given nickname is correct

#

Correct it if not

#

I need to know before my plugin was installed as well

young knoll
#

Completable future woo

grim hound
#

I was wondering whether I should make it async

grim hound
#

ForkJoinPool.

#

Same thing

#

That's the other way I was considering

grim hound
young knoll
#

Yes you should use getOfflinePlayer(string) async

grim hound
#

Since when?

young knoll
#

Yes?

#

Long time ago

grim hound
#

Isn't on my spigot.

#

Bukkit.getOfflinePlayers()

#

Is there

kind hatch
#

?contribute

grim hound
#

"all players exist"

#

"web blocking request" For what?

young knoll
#

To get the uuid from the name

fleet kraken
#
<dependency>
  <groupId>groupId</groupId>
  <artifactId>artifactId</artifactId>
  <version>version</version>
  <scope>system</scope>
  <systemPath>path to my plugin.jar</systemPath>
</dependency>

Why importing my other plugin like this I can't access the variables when I do the hook?

grim hound
#

Noo

tender shard
grim hound
#

It's terrible

tender shard
#

well system scope is bad but should work. wdym with "cant access the variables"?

grim hound
#

Pretty simple

#

Write code

#

But at interaction, synchronize

#

Like everything

toxic sage
#

Does anyone know why this event occurs after a block is placed?
Additionally the coordinates are not of this chunk, but of the placed block

    @EventHandler
    public void onChunkUnload(ChunkUnloadEvent event) {
        Chunk chunk = event.getChunk();
        getLogger().info(String.format("%s | %s", chunk.getX(), chunk.getZ()));
    }
grim hound
fleet kraken
grim hound
#

It's a chunk event

young knoll
#

Are you placing the block way off in the farlands

toxic sage
fleet kraken
tender shard
#

the maven remove it?

fleet kraken
#

yes

#

sync remove the jar

tender shard
#

would be helpful if you could show a screenshot of the issue. I don't understand what you're trying to say. and maven will not "remove anything" from your local repository

fleet kraken
#

one second

chrome beacon
#

You can install a jar to your local maven repo

#

System scope is deprecated

tender shard
#

mvn install on the other dependency, or if you only have the jar: https://blog.jeff-media.com/manually-installing-jar-files-to-your-local-maven-repository/

Sometimes you have a certain .jar file that you need as dependency, but the author of that .jar was too lazy to properly upload it to a public repository. That’s bad, but not a problem. There are two ways to solve this, but only one proper way. The proper way: install the dependency The proper...

fleet kraken
#

i can't send screenshot here

tender shard
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

tender shard
#

depends what you wanna do. if you e.g. wanna call the getOfflinePlayer thingy, I'd just run CompletableFuture#supplyAsync

CompletableFuture<OfflinePlayer> offlinePlayerFuture = CompletableFuture.supplyAsync(() -> {
  return Bukkit.getOfflinePlayer(...);
});

sth like that

toxic sage
#

https://imgur.com/a/BFlOWyI

    @EventHandler
    public void onChunkUnload(ChunkUnloadEvent event) {
        Chunk chunk = event.getChunk();
        getLogger().info(String.format("%s | %s (%s)", chunk.getX(), chunk.getZ(), event.getEventName()));
    }

well, can anyone explain why this is happening?

#

I'm sorry for the quality

kind hatch
#

Hey @tender shard, do you have a guide for setting up how to make changes to spigot?
Trying my first attempt at an actual PR, but I have no clue how to get these repos to work together locally.

tender shard
river oracle
tender shard
#

the implementation of bukkit

kind hatch
river oracle
#

that should go to CraftBukkit

tender shard
#

basically spigot-api

river oracle
#

well once components go over it will bascially be all of spigot

tender shard
#

Player, World, etc. all those classes are bukkit

river oracle
#

@kind hatch if you don't know how to setup CB I can help you if you have time

kind hatch
river oracle
#

yeah

river oracle
#

mvn install

#

have you run BuildTools for that version?

fleet kraken
kind hatch
#

I ran it for 1.20.4

river oracle
#

alr

young knoll
#

That’s basically all you need :p

#

Then just open the projects

river oracle
young knoll
#

Buildtools already applies the patches

#

Silly

river oracle
#

well it depends how he did it

#

I always just get mine from git

#

using git clone

#

then I apply patches manually

young knoll
#

Well aren’t you fancy

river oracle
#

I just don't like messing with changing the remote

#

its rather annoying

tender shard
kind hatch
#

Fuck, I screwed up where it downloaded.
Hopefully I can salvage this rq.

tender shard
undone axleBOT
kind hatch
#

Ok, so starting from scratch.
I fork CraftBukkit and clone it.

toxic sage
tender shard
fleet kraken
# tender shard ?paste your whole class

I can't share everything, but that's all

val myOtherPluginProvider = Bukkit.getPluginManager().getPlugin("myOtherPlugin")
if (myOtherPluginProvider == null) {       
    server.pluginManager.disablePlugin(this)
}

val myOtherPlugin = myOtherPluginProvider as MyOtherPlugin


// myOtherPlugin.plugin ?????
tender shard
fleet kraken
kind hatch
#

There is in mine

tender shard
#

oh probably because you ran buildtools without --rev ?

#

doesnt buildtools default to 1.20.2?

#

you'll need 1.20.4

kind hatch
#

I built it for 1.20.4

tender shard
#

weird, why don't I have a latest folder lol. but yeah, if it's there, that should work

tender shard
kind hatch
#

Alright, all patches applied.

tender shard
#

now you can just open the crafbtukkit folder in IJ or whatever

#

then do your changes, then run createPatches (only needed if you changed any NMS classes)

#

why would you even call getPlugin() if you already got the instance of your other plugin?

fleet kraken
tender shard
#

are they public? can you e.g. call reloadConfig() on myOtherPlugin ?

fleet kraken
#

all are public

tender shard
#

how does it look if you decompile MyOtherPlugin in IJ? (Ctrl+B on the class reference)

quaint mantle
#

PlayerInteractEvent sometimes is not sent when damaging an entity

#

I don't really know how to reproduce 100% of the times

fleet kraken
quaint mantle
#

Here it's not sent, I damaged the entity while on ground

tender shard
#

try Invalidating caches in IJ and check if your kotlin plugin is up to date

quaint mantle
quaint mantle
tender shard
fleet kraken
tender shard
#

if it compiles, it's 99% an IJ cache issue

kind hatch
#

Ok, so now how do I compile these changes into a working spigot jar?

tender shard
river oracle
fleet kraken
#

ok

river oracle
#

I just test using CraftBukkit

tender shard
#

if it still shows the error, check if your kotlin plugin is up to date

river oracle
#

mvn install

quaint mantle
#

If I hit it like this there's no issue

kind hatch
river oracle
tender shard
#

can also just mvn package it

river oracle
#

if you wanna compile into spigot IIRC you might have to download and fuck with spigot

quaint mantle
river oracle
#

though I suppose its uneeded to depend on craftbukkit

tender shard
#

yeah usually you'd just install bukkit

#

but whatever, doesn't matter

#

but I'd always change the version when installing it, otherwise maven updates it the next day lol

fleet kraken
young knoll
#

Don’t forget that -p development

tender shard
fleet kraken
#

1.8.0 both

tender shard
#

I mean the IJ plugin version

fleet kraken
#

same as you

tender shard
#

hm no clue then

#

although there'S a bunch of 1 star reviews for the kotlin plugin claiming the last update broke stuff lol

#

everything's working fine for me though on latest IJ ultimate :/

fleet kraken
#

hmm, i will try others things

sullen marlin
molten hearth
#

we all know 1 star reviews arent real

#

same goes for 2

#

and 3

#

depending on the developer same goes for 4

fleet kraken
#

and yes

#

i can't access companion variables

#

@chrome beacon @tender shard thanks for help

next stratus
tender shard
#

you can just do MyOtherPlugin.plugin

#

@fleet kraken

next stratus
#

I don't know if anyone can answer this but what is the benefit of having a plugin what loads groovy scripts dynamically over java code?

next stratus
tender shard
#

yes

next stratus
#

I should really use kotlin more tbh

#

It's so much better than Java style wise etc.

tender shard
#

some things in kotlin are indeed very fancy

next stratus
#

I just wish I had more coding knowledge lol.

tender shard
next stratus
#

I mean the server I play have many modules and they have scripts for each module and it allows them to change values while the server is running

young knoll
#

That’s called a config file

next stratus
#

Groovy scripts

#

I'm fully aware of the differences between yaml files and scripts.

tender shard
#

I guess it‘d be fancy for stuff like missions, tutorials and stuff

#

Basically like what most games use LUA for

next stratus
#

They have a different script for each part of the server I think, I'm not sure how the backend code looks but I know it's using multiple scripts

tender shard
#

Bukkit groovy DSL when

fleet kraken
tender shard
#

yeah as mentioned you just gotta access the companion object like static members in java

#

MyOtherPlugin.plugin would be the plugin var in the companion object

fleet kraken
#

yes

#

and i can't access it right?

tender shard
#

you can

fleet kraken
#

how?

tender shard
#
val myOtherPluginProvider = Bukkit.getPluginManager().getPlugin("myOtherPlugin")
if (myOtherPluginProvider == null) {       
    server.pluginManager.disablePlugin(this)
}

val myOtherPlugin = myOtherPluginProvider as MyOtherPlugin


// myOtherPlugin.plugin ?????

All of this is not needed ^^

You just do this:

val myOtherPlugin = MyOtherPlugin.plugin
fleet kraken
#

thank you very much

tender shard
#

i had to create two projects myself right now to figure it out lol

fleet kraken
graceful turret
#

what's the way to get player access token on login (1.20)?

sullen marlin
#

?xy

undone axleBOT
young knoll
#

Can’t wait for the legendary xyz problem

river oracle
#

fortunately I don't think that is something mojang gives out

#

afaik the server does not store their session token. Regardless this smells of wanting to make malware

kind hatch
#

What maven import do I need to rely on to get my custom craftbukkit changes?

young knoll
#

mavenLocal craftbukkit

#

Assuming you did mvn install

#

Or just Bukkit if you don’t need any NMs

smoky oak
#

qq can you detect player pressing 'no' on beacon gui

young knoll
#

Doubt it

#

I would imagine that gui is client side

#

Well, maybe not because you do have to sacrifice an item

pseudo hazel
#

yeah but cancel is just like closing the menu

smoky oak
#

you can only detect the yes button then

kind hatch
#

Yay, my method fires. 😄
Now I just gotta figure out how to work with the .dat files. fml

young knoll
#

Wot

kind hatch
#

I'm trying to add OfflinePlayer#getLastLocation();.
The player's location data is stored in their .dat file under an NBT section called Pos.

In theory, I just need to figure out how to parse that and convert it to a Bukkit Location.

smoky oak
#

wot

#

cast offlineplayer to player

#

get the player location

#

why u reading dat files

kind hatch
#

Will that work if the player is offline though?

young knoll
#

No

kind hatch
#

So there we go

young knoll
#

I’ve been meaning to get back to my offline player pr

#

Should really do that

kind hatch
#

Do you have one open?

young knoll
#

Yeah

#

I probably need to redo it and introduce an entirely separate system

#

Something like Bukkit.loadPlayerData(uuid)

kind hatch
#

Oooo, that sounds fancy.

smoky oak
#

hey coll shouldnt it still return the location

#

even if the players offline

young knoll
#

No?

#

getPlayer will just fail

#

Aka return null

inner mulch
#

how can i take a method as a variable?

young knoll
#

depends

#

If it’s a simple method you can use one of the function interfaces and method references

#

Consumer, BiConsumer, Function, Supplier, etc

inner mulch
#

okay, i will try that

#

thank you

young knoll
#

But yeah if I make a proper system to load offline player data you should be able to access nearly everything

#

PDC, inventory, etc

smoky oak
#

or we could just fake a player logging in and steal that fake player's data

#

not sure how feasible thatd be tho

young knoll
#

Up to you

kind hatch
#

I think I'm gonna continue anyways to get practice.

young knoll
#

Never hurts to learn

kind hatch
#

You know, minus the Bukkit#getWorld() call, this does exactly what I was expecting it to. :p

young knoll
#

World is probably stored somewhere too

kind hatch
#

Dang. Would have been very cool if it still stored that info.

young knoll
#

?

kind hatch
#

It doesn't look like there's a straight world name that can be pulled.

young knoll
#

Must be something

kind hatch
#

There seems to be WorldUUIDMost & WorldUUIDLeast

young knoll
#

Ah, well that’s usable

kind hatch
#

At least when opening the player.dat files.

young knoll
#

Convert to uuid and then get world by uuid

kind hatch
#

Is there a method to do that or do I gotta bitshift myself?

young knoll
#

I think uuid has a constructor for it

#

Ye, 2 longs

kind hatch
#

Sweet

#

Ok, alright. It's coming together now.

#

Now to test

smoky oak
#

oh i actually have a background similar to that

kind hatch
#

We ballin

#

Hmmm, I have a feeling that this will work with Multiverse, but I can't get my plugin to load after it to confirm.

#

Why is there no loadafter? smh

river oracle
#

just clone it and add something to the plugin.yml

#

hen build

river oracle
#

it'll force your plugin to load after xD

kind hatch
#

lmfao

#

I forgot about that one

#

Yea, it works.

echo basalt
#

@kind hatch a niche trick I learned

#

you can make your plugin load last

#

Guaranteed

#

by adding a softdepend: [zzzzzzzzzzz]

young knoll
#

But what if two plugins do that

echo basalt
#

prob load by name

young knoll
#

So not guaranteed last

#

Checkmate

echo basalt
#

add more z's

kind hatch
quaint mantle
#

But that's my plugin name

shell mirage
#

Hi

#

has some course about analyse Spigot source code?

#

I was wondering how spigot can bridge Minecraft with Bukkit

echo basalt
#

Well

#

Bukkit is just a set of interfaces that define an API

#

Then came CraftBukkit which provided an implementation of Bukkit and modified NMS to make it all work

#

When we refer to NMS we're referring to mojang's server code

#

So for example, when adding an NMS entity to a world, CraftBukkit would wrap the entity to a Bukkit entity and call the event

shell mirage
#

I know,What I'm trying to say is I want to analyze the source code to know how this process works right

echo basalt
#

Right

#

In this case I'd probably remap spigot and just decompile and go over the code

#

I use paperweight because I'm a gradle fanboy and there's nothing proper for spigot

shell mirage
#

嗯嗯

#

thanks

#

@echo basaltare there some videoes about analyze Craftbukkit source code in the network?

echo basalt
#

Well.. no

shell mirage
#

thanks

quaint mantle
# shell mirage I know,What I'm trying to say is I want to analyze the source code to know how t...

You don't really need to analyze the code to know how a process is made (unless you want to exactly know how, literally line per line). Usually you just want to know the logic, in which case (and I guess that's the case) you can do it by yourself.

I mean, if you think about it enough, and if you have some knowledge of java (or general OOP porgramming) and minecraft, you will end up discovering the logic on how spigot works with minecraft

(I don't know if that's what you were asking abt)

spring stag
#

So I'm having a problem in regards to an inventory search. Whenever a player picks up my custom item, an event takes place and it is supposed to go through the player's inventory and enchant the tools that are in the players inventory. I am running into a problem that when the event reaches my custom item, the loop stops and throws me an "item is null" exception. Is there a way to skip over the item if the loop reaches that item? Here is the code:

#
    @EventHandler
    public static void itemPickupEvent(EntityPickupItemEvent event) {
        if (!(event.getEntity() instanceof Player)) return;
        Player player = ((Player) event.getEntity()).getPlayer();
        PlayerInventory inventory = player.getInventory();
        if (event.getItem().getItemStack().isSimilar(ItemManager.abundanceDiamond)) {
            for (int i = 0; i < inventory.getSize(); i++) {
                ItemStack item = inventory.getItem(i);
                ItemMeta meta = item.getItemMeta();
                if (item == ItemManager.abundanceDiamond) {
                    System.out.println("Abundance diamond is in the player's inventory");
                    return;
                } else if (item.containsEnchantment(Enchantment.LOOT_BONUS_BLOCKS) || item.containsEnchantment(Enchantment.LOOT_BONUS_MOBS)) {
                    System.out.println("Enchantments have already been added");
                } else if (MaterialPlus.isTool(item.getType())) {
                    System.out.println(item.getTranslationKey() + " is in your inventory.");
                    meta.addEnchant(Enchantment.LOOT_BONUS_BLOCKS, 3, true);
                    meta.addEnchant(Enchantment.LOOT_BONUS_MOBS, 3, true);
                    item.setItemMeta(meta);
                    System.out.println(item.getTranslationKey() + " is now enchanted.");
                } else if (item != null) {
                    System.out.println(item.getTranslationKey() + " is in your inventory.");
                } else if (item.getItemMeta() == null) {
                    System.out.println("Item does not have item meta value to it.");
                } else if (item == null) {
                    System.out.println("Empty slot");
                }
            }
        }
    }
tender shard
spring stag
#

Add an early return statement?

tender shard
#

Return? No

#

Just do

if(item == null) continue;

#

Do that directly after using getItem(i)

#

Then it skips all empty slots

quaint mantle
#

As alex said, you want the continue

spring stag
#

wait, there are more statements then return? my java class never taught me that lol

quaint mantle
#

Then you're barely new in OOP, because breaks and continues are learned on loops, which are the third thing they show you usually

crisp rover
#

Who know how to teleport player to a position?

spring stag
#

my prof never did that lol

quaint mantle
spring stag
#

but that's good to know

winter schooner
#

One message removed from a suspended account.

quaint mantle
crisp rover
#

ok

quaint mantle
#

It's Player.teleport

#

Next time try making a google search or looking at the javadocs

crisp rover
#

ok

crisp rover
quaint mantle
crisp rover
#

uhh?

quaint mantle
#
Player player = /*obtain a player*/
player.teleport(/*location here*/)

Player is org.bukkit.entity.Player
"Location" is org.bukkit.Location

spring stag
#

So I added the continue statement but i still got the exception.

quaint mantle
spring stag
quaint mantle
#

You should do the continue even before you do anything with the item

#
if (item == null) continue
ItemMeta meta = ...
spring stag
#

ah

quaint mantle
#

Also you don't need continue statements at the end of the loop

#

Nor on a if/elif structure

spring stag
#

oh gotcha

quaint mantle
jagged thicket
#

yo man hows the wallpaper

quaint mantle
#
for (...) {//My amazing loop 
    if (somethingNullable == null) continue; //Needed

    if (cond1) {
          //Do something
          continue; //loop already ends here, as there's nothing else after this if/elif
     } else if (cond2) {
          continue; //loop already continues here, uneeded
     }
}

for (...) {//My amazing loop 
    if (somethingNullable == null) continue; //Needed

    if (cond1) {
          //Do something
          continue; //loop continues after the if/elif, this is needed
     } else if (cond2) {
          continue; //loop does not end here, needed
     }

     //Do something
}
quaint mantle
#

I'm rich now

jagged thicket
#

where my profit

quaint mantle
#

Sorry, I can't hear you from my helicopter

jagged thicket
#

im going to shoot your pc

#

and steal yo nft

quaint mantle
#

You can't steak a NFT

jagged thicket
#

i can

quaint mantle
#

It has a complex hash algorithm which signs it and defines it as unique

#

1+1

jagged thicket
#

Ok

#

i will just make 10 more

#

and sell it

quaint mantle
#

I still have the real one

#

Plus I registered and has copyright now

jagged thicket
#

nah we have discord proof

quaint mantle
#

I bought discord 🗿

#

rn

jagged thicket
#

i bought you

#

im controlling you right now

#

you think you are in control

#

but actually your every thought is mine

spring stag
#

tis the matrix

quaint mantle
#

If you are controlling me, then what am I doing rn?

jagged thicket
quaint mantle
#

Ok, that was just luck

#

Again

jagged thicket
#

still the same answer

quaint mantle
#

STOP CONTROLLING ME

jagged thicket
#

HAHA

quaint mantle
#

Leave out my mins

#

Mind*

jagged thicket
#

OK i signed as you as you

#

and got the copywright

#

you are free now

quaint mantle
#

Haha idiot!

#

You've never got the copyright

jagged thicket
#

No one said i could not control you again

quaint mantle
#

I do

#

🗿

#

I bought mental control

jagged thicket
#

i am still controlling you

#

i lied

#

and now you paid me for buying myself more mindcontroll

quaint mantle
#

That's... just not possible

#

I'm CatMan

jagged thicket
#

Ok Bye im going away with the money

quaint mantle
#

No

#

Come back

#

Or i will destroy ya

minor junco
#

does anyone here knows if it's possible to mock using ormlite?

crisp rover
#
package vz.pl.first.Commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.*;
import org.bukkit.event.*;

import vz.pl.first.Main;

public class spawn implements CommandExecutor {

    public spawn(Main main) {
    }
    Location lc = new Location(Bukkit.getWorld("world"), 0, 0, 0);
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if(cmd.getName().equalsIgnoreCase("spawn")) {
            Player player = event.getPlayer();
            sender.sendMessage("將您傳送至大廳...");
            player.teleport(lc);
            
        }
            
        return false;
    }

}
#

How can I fix it

hazy parrot
#

Totally don't say what is not working

#

Also

#

?learnjava

undone axleBOT
crisp rover
#

ok

spare hazel
#

what is the event fired before the player joins?

minor junco
#

async something connect event

#

preconnect if i remember correctly

spare hazel
#

?jd-s

undone axleBOT
spare hazel
#

leme check jd

#

i need to check if they have a certain permission before joining

rotund sun
#

error when im trying to despawn npc

com.comphenix.protocol.reflect.FieldAccessException: Field index 0 is out of bounds for length 0
        at com.comphenix.protocol.reflect.FieldAccessException.fromFormat(FieldAccessException.java:49) ~[ProtocolLib.jar:?]
        at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:316) ~[ProtocolLib.jar:?]
        at org.firestorm.deathpro.Utils.NPC.despawnNPC(NPC.java:92) ~[DeathPro.jar:?]
        at org.firestorm.deathpro.EventListener.Corpse.lambda$onDeadBody$0(Corpse.java:30) ~[DeathPro.jar:?]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.17.1.jar:git-Pufferfish-22]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[patched_1.17.1.jar:git-Pufferfish-22]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1569) ~[patched_1.17.1.jar:git-Pufferfish-22]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:495) ~[patched_1.17.1.jar:git-Pufferfish-22]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1485) ~[patched_1.17.1.jar:git-Pufferfish-22]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1284) ~[patched_1.17.1.jar:git-Pufferfish-22]
        at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:321) ~[patched_1.17.1.jar:git-Pufferfish-22]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]```
#

my code


        if (uuid != null) {
            // Create a PacketContainer for the Entity Destroy packet
            PacketContainer destroyPacket = protocolManager.createPacket(PacketType.Play.Server.ENTITY_DESTROY);

            // Set the packet data to the NPC's entity ID
            destroyPacket.getIntegerArrays().write(0, new int[]{uuid.hashCode()}); // entity ID

            // Loop through all online players and send the packets
            for (Player player : Bukkit.getOnlinePlayers()) {
                protocolManager.sendServerPacket(player, destroyPacket);
            }
        }
    }```
wet breach
#

also, you are using pufferfish

shadow night
#

Pufferfish? That's the fork of a fork, right?

wet breach
#

think so

spare hazel
#
public class VipJoin implements Listener {

    private Node vipNode = Node.builder("iransky.vip").withContext(DefaultContextKeys.SERVER_KEY, "smp").build();

    @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
    public void onPlayerPreLogin(AsyncPlayerPreLoginEvent e){
        User player = LuckpermsAPI.api.getUserManager().getUser(e.getUniqueId());
        if(!player.getNodes().contains(vipNode)){
            e.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_FULL);
            e.setKickMessage("The Server Is Full! You Need SkyGod Or Higher To Join");
            return;
        }

        for (Player p : Bukkit.getOnlinePlayers()) {
            if(p.hasPermission("iransky.vip")) continue;
            p.kickPlayer("You Were Kicked Due To A VIP Player Join!");
            e.setLoginResult(AsyncPlayerPreLoginEvent.Result.ALLOWED);
            break;
        }
    }

}```
is there anything i need to improve?
umbral ridge
#

variable naming

#

User isn't player but its user

#

player is Player

spare hazel
#

what is the difference

#

user is player

umbral ridge
#

better code

#

easier to read

#

and is more logical

#

This is like calling

Apple banana
or
Grape apple

#

Apple apple is better and
Grape grape too

#

naming an event with an e can also be confusing

#

calling it event would be better

#

avoid using one character variable names if its not something more permanent like a constant.. if everything is done right you should actually never have very short variable names

lets say I have point a and b, int

I could call it just a and b but why? it wouldnt make any sense and if my code is very long how am i supposed to quickly know what the a and b is. in this case naming it pointA and pointB would be better

glass mauve
#

how can I change the "tab" display using Scoreboard?

icy beacon
#

This is probably not the problem (because you never said what the problem is) but that's very unnecessary

#

Just remove the constructor if you're not using it

#

And yeah since you are not following naming conventions (lowercase class name) and using a non-existent variable (event.getPlayer()), you do need to learn java first as Goksi mentioned

#

Also btw you do not need to check for the command name if(cmd.getName().equalsIgnoreCase("spawn")) because you're already registering the command specifically for the name "spawn"

spare hazel
#

im getting an async kick error

#

how do i fix that

glass mauve
#

share the error

spare hazel
#

nvm fixed it

tender shard
shadow night
#

Naming your main class Main is a serious sin

icy beacon
#

Ego??????

shadow night
#

No?

icy beacon
#

Yeah it's kinda not a good idea for spigot plugins especially lmao

#

Given that there can be tens of them running on the server

tender shard
#

the main class is org.bukkit.craftbukkit.Main though

icy beacon
#

And the main class is already Main yes

#

So you are making a secondary main

shadow night
#

It depends on your project, but I never name my main class Main, even when I make a standalone

tender shard
#

it's still not the main class, otherwise it'd have a public static void main method

icy beacon
#

Why do you not want to use something more descriptive

#

?????

tender shard
#

anyway, it should definitely not be named "main" but at least "Main"

shadow night
#

Whaa

icy beacon
#

Dependency injection is a joke to you?

tender shard
#

and it should be used if it's passed in the constructor

icy beacon
#

Yes I am

#

So?

shadow night
#

Man with 0 plugining experience talking shit in plugin dev channel

icy beacon
#

What principle

#

What the fuck are you talking about

#

So you aren't gonna tell me

#

Welp

shadow night
#

In bukkit plugins your main class is your plugin, you can query thr config or the data folder from your plugin instance and it's less of a main class than in a standalone

icy beacon
#

I am gonna be the first one to call troll because I don't wanna deal with this shit and waste my time xD

#

Just judging by this

#

Happy coding guys

#

I'm gone

tender shard
#

well only if it's actually needed

eternal night
shadow night
#

In the minecraft client there is something like a bootstrap which is the class with public static void main which passes data over to the actual main class, then there is a Minecraft class that uses the singleton pattern and is always passed around everywhere to get keybinds, settings, etc. that gets this data from the public static void main thingy

#

You can, but should you?

wet breach
#

in every language the main class is the main class of the program. Main classes of plugins are not the main class of the program, rather an addition to the main program and therefore does not make sense to name it Main and why you shouldn't

eternal night
wet breach
#

If you don't want to follow the rules sure, I just explained to you why in plugins or even mods the main class is not named main

shadow night
#

A good reason I've seen is that when you make an API, you want users to get the instance of PluginName and not Main, because of common sense

shy wolf
#

hello, im trying to get a string from a FileConfiguration,
the output of the FileConfiguration.getString("punishment.command.proves") => "MemorySection[path='punishment.command.proves', root='YamlConfiguration']"

                            p.sendMessage
                            (
                                    ChatColor.translateAlternateColorCodes('&',
                                                    Main.getMessages().getCustomConfig().getString("punishment.command.proves")
                                            .replace("{caseID}", args[0])
                                            .replace("{playerName}", Main._dataBase.getCasePlayerTarget(Integer.valueOf(args[0])).getName())
                                    )
                            );

and the getCustomConfig() gives me FileConfiguration(aka the file "messages.yml"):

punishment.command.proves: "&6&lHere's the list of proofs of case: {caseID} ({playerName})"
punishment.command.noProve: "&4&ltheres no proves for the case: {caseID} ({playerName})"

any one know where could be the problem?

eternal night
#

oH nO i aM cReAtiNg a GoD oBjEcT iN an aPI tHaT hAs a sTatiC sInglEton

wet breach
#

anyways shows your understanding of programming

native ruin
#

could anyone recommend me some good resource for learning nms?

wet breach
#

with that, I have no more interest debating it

shadow night
#

We are following plugin-coding standarts

wet breach
#

you make some wild claims, but what is your credentials to say everyone is wrong?

#

So your opinion

#

These rules are derived from conventions which every language has one

eternal night
#

There are no rules
OmG yOu aRe pAsSinG tHe eNtiRe mAiN iNstAnce, iDioT thAt iS aGaInst tHe rUleS

shadow night
#

Hmm, doesn't spigot do that for you, basically?

tender shard
wet breach
#

Anyways, as I said shows your lack of understanding. If you want to have the opinion that everyone is wrong that is fine, but in that sense your opinion is no more correct then everyone else is wrong

#

such as?

tender shard
#

can you people pls move your stupid argument into a thread or sth

wet breach
#

just fyi, not all of us here just know Java or only spigot

#

some of us know more programming languages and worked on other stuff before MC even existed

shadow night
#

I'm pretty sure most people here do something in java besides spigot, and maybe not only java

shy wolf
shadow night
#

For example I was doing discord bots in nodejs before java, now I do spigot plugins, forge mods (planning on starting fabric modding), I'm also thinking of making some discord bots and I've made a few little utility standalone applications for checking some stuff

tender shard
wet breach
#

probably before purp was born

shadow night
#

Before that I was doing BDFD man

icy beacon
#

I'll return to the convo with 1 request

#

Purp, send your github or/and works

shadow night
#

Damn 💀

shy wolf
eternal night
#

Weird dick measuring contest NGL

wet breach
#

modifying windows 95-xp and making custom drivers

tender shard
#

can you guys please move your useless discussion into a thread, it's a annoying if this channel is spammed with useless shit

icy beacon
#

Fair

shadow night
#

Hmm, true

tender shard
icy beacon
#

Thought so LMAO

tender shard
shy wolf
#
      clickToProve: click me to show!
    proves:
      noProves: '&4here''s the list of proofs of case: {caseID} ({playerName})'
    noProve: '&4&li didn''t find any proves for the case: {caseID} ({playerName})'
wet breach
#

drivers back in the day were not always perfect and stuff stopped getting updates routinely so instead of swapping your hardware out you could just improve the driver yourself or otherwise make the fixes yourself

#

this was more common with GPU drivers

eternal night
#

I mean, if your self worth is so low you have to trash talk in a help development channel

#

It is what it is

tender shard
wet breach
#

other times it was getting hardware to play nice together

shadow night
wet breach
icy beacon
#

Frostalf, how old are you?

wet breach
#

almost 33

icy beacon
#

Holy cow

shadow night
#

Or it said there were no drivers installed? Idk

wet breach
#

easier then making a new driver

shy wolf
wet breach
#

windows 10 has compatibility for all the way back to windows xp sp2

plain plaza
#

Is there a way to prevent the EntityDamageByEntityEvent from being emitted when using LivingEntity#damage with a source being specified?
In other words, is there a way to look for legitimate damages from the entity?
Ill check for crit attack in the mean time, but lmk if anyone has a solution

wet breach
# shadow night Hmmm

but even if you could get a driver working for it, its still possible the GPU wouldn't work right

#

windows doesn't do very deep investigation in regards if its working. Really it just detects if it powers on and if windows is able to assign an IRQ

tender shard
wet breach
#

because I can be? and I generally help/teach people

tall dragon
#

cuz my man enjoys helping people maybe?

wet breach
#

nope

#

I am a tire technician at JB Hunt 🙂

shadow night
wet breach
#

I actually don't need to work at all to be honest

plain plaza
wet breach
#

I do because its boring otherwise

plain plaza
#

also death messages / kill credit as well

tall dragon
wet breach
#

because I make plenty of money as it is

#

from the various investments I have

#

indeed

#

I am not interested in doing it as a job

#

I am mean that isn't completely true as I have done paid jobs before or commissions people like to call them

#

however for the most part I just keep it as a hobby

#

I don't like having some manager who has no clue what they are doing telling me how to do something 😛

#

But programming isn't all I know, I even know how to do Satellite Communication stuff and networking 🙂

#

Satellite Communications thanks to the military lmao

shadow night
wet breach
#

networking is probably more fun for me then programming itself, even more so if I have to also program or make scripts to make some stuff work XD

wet breach
#

GPS was fun to learn about in the Military

#

to learn that for example your cellphone doesn't communicate with the GPS sats all the time

#

and in fact its the cell towers that do that

echo basalt
#

Nerd talk

wet breach
#

and the cell towers do fancy math based on your signal to give you your GPS coords

echo basalt
#

What about those satellite sos systems

#

When there's no reception

wet breach
#

the SOS devices you speak of really do wait for a GPS sat to come over head

#

however it drains those devices quickly

#

so they don't communicate with the sat as often as you think

shadow night
#

Well, maybe alex was right when he said this discussion should be moved to a thread

wet breach
#

GPS satellites don't have high bandwidth and thus you need to be in a single spot for like 10-15 minutes so it can pull GPS information, this is why cellphones don't communicate with sats other then being a big power drain

#

It depends on what is needed, I can setup just about anything as long as I am able to. In the military I had the freedom to just run lines whenever I wanted just about XD

#

however in civilian world I can't really do that, so I have to rely on what I do have access to which makes it fun sometimes and challenging

tender shard
#

imagine how much money one could make by selling cold beer to thirsty firemen

wet breach
#

In the US they would all get fired

tender shard
#

well. they're firemen

shadow night
#

Was the pun intended

wet breach
#

no, I wasn't thinking about puns XD

#

its hard to point to any one particular thing because what makes networking great is that its ever evolving and what is needed always is different or changes

#

the military does have its own protocols, which I can't really tell you

tender shard
#

a friend of mine works for ESA on cubesats and they code most stuff for them in python2

wet breach
#

Classified materials is not subject to public dispersal NDA or not

tender shard
#

?protocol

tender shard
shadow night
#

funny

wet breach
#

oh the little stuff yeah I have tried out making a protocol before but its more of a pain then its worth

#

because literally you have to install the protocl on everything you want part of it

shadow night
wet breach
#

but it was cool to learn to do regardless because for in home network though it may come in handy at some point

#

but over the wire communications its useless

tender shard
#

python is handy if it gets too complex for a simple bash script

wet breach
#

well the issue is all the devices understanding it 😛

shadow night
hazy parrot
#

Python is now preinstalled on systems?

tender shard
wet breach
#

I once made a system that was secure because of a protocol and as far as I am aware no one knowing how to deal with it. And this was allowing two systems the same IP without having issues

hazy parrot
#

Have I missed some chapter xd

shadow night
wet breach
#

it works in a limited way, but if both systems are doing two different things that don't interfere with each other, its doable to allow them both the same IP on the network

tender shard
hazy parrot
#

Never had mac, probably that

shadow night
#

python is a common to be preinstalled software nowadays

valid basin
#

Player interact at entity event doesn't work on spigot 1.8.8 when trying to detect if player right clicks on an armor stand. I've tried debugging the even doesn't fire at all while other events work fine in my class. Does anyone know why and how to fix?

shadow night
tender shard
#

if not use PlayerInteractEntityEvent

wet breach
#

essentially yes, and I did this because I had always been told that it wasn't possible for two machines to have the same IP and during my research really it just came down to the OS's not being happy about it, and as long as the information in the line for either system was not the same it was fine

#

however on the opposite end of the network from the outside, it made these systems more secure because you couldn't target a specific one

#

I never did measure the performance so I couldn't say, but you are correct it wasn't really worth it to keep it up and always do this with my systems because you had to ensure there was no overlap in data

valid basin
# tender shard do you need the exact clicked location?

I've tried using PlayerInteractEntityEvent and it didn't work as well.
This is my code:

    public void onPlayerInteract(PlayerInteractAtEntityEvent event) {
        Bukkit.getLogger().info("Player interact event triggered!");
        if (event.getRightClicked() instanceof ArmorStand) {
            Bukkit.getLogger().info("Player interact event triggered at armor stand");
            Iterator<LuckyBlock> iterator = activeLuckyBlocks.iterator();
            while (iterator.hasNext()) {
                LuckyBlock luckyBlock = iterator.next();
                if (luckyBlock.getArmorStand().equals(event.getRightClicked())) {
                    Bukkit.getLogger().info("Player interact event triggered at lucky block");
                    luckyBlock.onPlayerInteract(event.getPlayer());
                    new LuckyBlockLootEvent(event.getPlayer(), luckyBlock);
                    iterator.remove();
                    break;
                }
            }
        }
    }```
wet breach
#

actually I take that back, there was one piece of information that could overlap without issue

#

and that was the time data

#

^

tender shard
valid basin
wet breach
#

interesting, good luck with that

tender shard
#

which event isnt fired? PlayerInteractEntityEvent or PlayerInteractAtEntityEvent? The "At" entity isn't called for many things

valid basin
#

Should I try using PlayerArmorStandManipulateEvent?

mellow edge
#

?nms

tender shard
#

are you sure you registered the listener properly?

valid basin
#

Should be properly registered because I'm also using PlayerMoveEvent and it fired just fine

#

so it's not a class problem

#
        Bukkit.getPluginManager().registerEvents(this, plugin);
        this.plugin = plugin;
        this.instance = this;
        this.spawnLocations = new ArrayList<>();
        this.activeLuckyBlocks = new ArrayList<>();
        loadLuckyBlockConfig();
        loadLocationsFromConfig();
        startSpawningTask();
    }```
tender shard
#

No clue then, it works fine for me using spigot 1.20.4

#

Didnt you mention 1.8?

#

Maybe the armorstand event doesn’t extend the interact event in 1.8

valid basin
#

yep, I'm using a 1.8.8 spigot base

#

possibly, I'll try using armorstandmanipulateevent

#

i'll see if it works

quaint mantle
#

hi guys i wanna prevent drop saplings from leaves
am i call leavesdecayevent ?

tender shard
#

And BlockBreakEvent

quaint mantle
#

well i will g ive my code 1m

#

btw i need use iterator or list ?

#

for get leaves drops ?

tender shard
#

For what exactly?

quaint mantle
#

w8

quaint mantle
# tender shard For what exactly?
    @EventHandler
    public void onEntitySpawn(LeavesDecayEvent e) {
        for (ItemStack drop : e.getBlock().getDrops()) {
            if (drop.getType() == Material.OAK_SAPLING) {
                drop.setAmount(0); // Fidanı sil
            }
        }
    }```
#

this will work ?

tender shard
#

you need BlockDropItemEvent to remove a block's drops

quaint mantle
#

well i did this

#
    @EventHandler
    public void onBlockDropItem(BlockDropItemEvent e) {
        if (e.getItems().stream().anyMatch(item -> item.getItemStack().getType().name().contains("SAPLING"))) {
            e.setCancelled(true);
        }
    }```
#

working when i break block

#

but natural breaks

#

not working

#

ah

#

wait i

#

cancelling event

tender shard
#

for drops from decaying leaves, you'd have to cancel the LeavesDecayEvent and manually set the block to air. it looks like decaying leaves dropping items doesn't call any event

shadow night
#

._.

#

spigot so inconsistent

tender shard
#

not really

#

BlockDropItemEvent says "Called if a block broken by a player drops an item."

mellow edge
#

?help

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

selfrole Add or remove a selfrole from yourself.

__**Cleanup:**__

cleanup Base command for deleting messages.

__**Core:**__

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

__**Downloader:**__

findcog Find which cog a command comes from.

__**Mod:**__

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

__**ModLog:**__

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

__**Permissions:**__

permissions Command permission management tools.

tender shard
mellow edge
#

I want to send a title using protocollib, do I need to fake minecraft protocol packet to do that?

tender shard
#

in BlockDropItemEvent you should check if the blockstate's getMaterial is tagged with LEAVES

#

and only then remove every drop that's tagged with SAPLINGS

tender shard
#

why don't you just use sendTitle method?

quaint mantle
#

aght ty

tender shard
mellow edge
#

?1.8

undone axleBOT
mellow edge
#

^^^^

#

in spigot 1.8 I can send titles but I cannot do fade in, stay, fade out and I don't want to execute command as server

tender shard
#

hm well then I'd just send a ClientboundSetTitlesAnimationPacket manually

#

without protocollib

mellow edge
#

I mean I could use NMS

tender shard
#

PacketPlayOutTitle(EnumTitleAction, IChatBaseComponent, int fadeIn, int stay, int fadeOut)

#

(in 1.8)

mellow edge
#

ok thanks, why do you recommend to use nms for that tho?

tender shard
#

imho it's much easier than ProtocolLib. you just create the packet from the constructor and send it

mellow edge
#

fine

#

I must use it anyway for other things

tender shard
#

remember that there's no mojang maps for 1.8 though lel

mellow edge
#

but there are third party mappings

tender shard
#

i'd just use the spigot mappings in 1.8

hasty oyster
#

Hope I'm not interrupting,

public void spawnAtPos(World world, Location loc) {
        Bukkit.getLogger().info("Before");
        Block block = world.getBlockAt(loc);
        block.setType(Material.BLUE_CONCRETE);
        Bukkit.getLogger().info("After");
        return ;
    }

Any ideas why this function, when it's run, just fails to set the block in the world?
Both logs get outputted, Before and After, but no change is made?
No errors in the log either.
Been looking at tutorials looking for some "block.update" or thinking that it only set the object in memory's type but I don't think that's the case

mellow edge
shadow night
hasty oyster
#

Will try that

hasty oyster
#

Hmmm, I changed it to this:

public void spawnAtPos(Location loc) {
        Bukkit.getLogger().info("Before");
        loc.getWorld().setType(loc, Material.BLUE_CONCRETE);
        Bukkit.getLogger().info("After");
        return ;
    }
#

Still just silently fails 😠

icy beacon
#

Try outputting the location just in case

#

Maybe you are passing an incorrect value

shadow night
#

imagine if they just forgot to call it

icy beacon
#

Lmao

hasty oyster
shadow night
#

would be funny tho

hasty oyster
#

Location{world=CraftWorld{name=world},x=329.0,y=79.0,z=-1663.0,pitch=0.0,yaw=0.0}

#

The location seems correct

tender shard
#

Which version?

hasty oyster
#

1.20.2

tender shard
#

Did you set api-version in plugin.yml?

shadow night
hasty oyster
tender shard
tender shard
shadow night
#

hm

#

spigot goofin

tender shard
#

Not setting an api versions will get you a bytecode manipulated version of the material class

hasty oyster
#

Right, would you mind explaining what it does? :)

#

Do you have an example of api-version? :)

tender shard
#

api-version: "1.20"

shadow night
hasty oyster
#

api-version: '1.20'

#

Okay nice

agile hollow
#

how can i get a variable made in the spigot plugin on the bungeecord?

tender shard
#

Without api version, you only get the legacy material class

shadow night
hasty oyster
#

Oh hold on, I do set api-version?

#

Does it need to go first?

tender shard
#

Print out the block before and after changing it, not just the location

tender shard
hasty oyster
#

Okay cool

shadow night
hasty oyster
rotund ravine
hasty oyster
rotund ravine
tender shard
tender shard
shadow night
# rotund ravine ?

I'm calling the event from a runnable but it doesn't get called when I listen to it. The runnable runs, the listener is registered, but the event just doesn't trigger

tender shard
mellow edge
#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
            <classifier>remapped-mojang</classifier>
        </dependency>

yeah this doesn't exist

tender shard
#

As i said, no classifier

rotund ravine
shadow night
#

actually, I'm stupid

tender shard
hasty oyster
#

So weird

shadow night
#

holy gof

hasty oyster
#
[11:36:21] [Server thread/INFO]: Before
[11:36:21] [Server thread/INFO]: Location{world=CraftWorld{name=world},x=329.0,y=79.0,z=-1663.0,pitch=0.0,yaw=0.0}
[11:36:21] [Server thread/INFO]: REINFORCED_DEEPSLATE
[11:36:21] [Server thread/INFO]: BLUE_CONCRETE
[11:36:21] [Server thread/INFO]: After
mellow edge
#

no worries

hasty oyster
#

The REINFORCED_DEEPSLATE is the before, and BLUE_CONCRETE after

#

What I want

#

But in the world, it doesn't update

shadow night
tender shard
hasty oyster
#

it doesn't ):

#

It's not because I'm cancelling the original event of BlockPlaceEvent is it?

eternal night
#

it is

shadow night
#

lmao

hasty oyster
#

omg

#

Come on now

mellow edge
#

what is with the code publishing if I contain mojang's code or can I avoid that somehow?

hasty oyster
#

Soooooooooo

eternal night
rotund ravine
eternal night
tender shard
hasty oyster
#

How do I cancel the placing of one block and swap it out for another block?

tender shard
hasty oyster
rotund ravine
#

Why async?

tender shard
undone axleBOT
rotund ravine
#

That’s anono

#

For world stuff

tender shard
#

But dont do it async

#

Just use runTaskLater

hasty oyster
#

Do I need to wait a tick, it seems to work even if I set it in the same tick

tender shard
#

Well if it works, its fine

#

You would have to wait a tick if you cancel the event

#

If you dont cancel it, you can set it right away

shadow night
#

goofy spigot stuff

tender shard
#

BlockPlaceEvent is called after the block was set, cancelling it would then reset it back

shadow night
#

damn my iq is high

hasty oyster
#

I guess my next question is can I spawn a sign with text, or do I have to update it like this:

        Block block = loc.getBlock();
        loc.getWorld().setType(loc, Material.BIRCH_SIGN);
        Sign sign = (Sign) block.getState();
        sign.setLine(0, ChatColor.GOLD.toString() + this.niceName() + " generator");
        sign.setLine(1, ChatColor.DARK_PURPLE + "Outputs 3 per min");
        sign.setLine(2, ChatColor.GRAY + "Stored: 0");
        sign.setLine(3, ChatColor.BLUE + "Level " + this.level);
        sign.setEditable(false);
        sign.update();
#

Because unfortunately, this doesn't work ):

#

Or do I have to wait a tick

halcyon hemlock
#

something crazy happened today

tender shard
quaint mantle
#

I think it exist

tender shard
quaint mantle
#

oops then

tender shard
#

Theres only setBlockData

#

But the data only contains the rotation

hasty oyster
#

Hold on

tender shard
#

Hm try not calling update, or call update(true, true)

hasty oyster
#

Will try ^

tender shard
#

No clue otherwise, im in the bathtub right now lol

#

As last resort you can always try to wait a tick lol

tender shard
quaint mantle
#

MutableList needed for that

hasty oyster
#

Can I jsut do this:

BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTask(plugin, () -> {
  // This is delayed one tick?
});
hasty oyster
#

Nice, thanks

tender shard
#

I am

shadow night
#

damn lambdas are fancy

tender shard
shadow night
quaint mantle
#

Don't make your apis too lambda based

shadow night
#

last time I used kotlin I got a !!seizure!!

shadow night
eternal night
#

kotlin developers when they see that runTaskLater does not have the consumer as the last paramter and now their whole language collapses 🧠

shadow night
#

lmao

quaint mantle
#

lmao

quaint mantle
shadow night
#

!!

shadow night
eternal night
#

mhm extensions OMEGALUL

tender shard
#

Otherwise you never need it

shadow night
tender shard
#

You‘d either use ?: or if you‘re sure it cant be null, dont deckare it nulalable

shadow night
#

a lot of stuff can be null, you see

quaint mantle
#

I still write:

if (variable != null) {}
tender shard
#

I dont see any reason when one‘d have to use !! when not having to deal with java kotlin interop

shadow night
#

well, null is useful

eternal night
tender shard
#

I never experienced this scenario in real life though

shadow night
#

damn burchard really did remake forges energy api

#

did he accidentally remake capabilities or something

#

I'd say kotlin isn't bad, it's a pretty good programming language, but not for me lol

#

I've been told to learn kotlin by some experienced people ik irl lol

#

it's a fine langauge, especially when used in the right place

tender shard
#

I hate kotlin‘s name though

#

Kot means shit in german

#

Thank god its pronounced differently

shadow night
tender shard
#

Kotlin has a short o, while the Kot word has a long o

tender shard
shadow night
#

yeah

#

very sad story lol

tender shard
#

MongoDB is even worse

quaint mantle
#

Imagine using mongodb

#

json :((

shadow night
#

I remember there was a server that lost all its oneblock data due to json corruption lmfao

#

?

#

nah, it was some little server that has a little oneblock gamemode

#

the data was stored on json and corrupted

tender shard
#

And the word is a slur against disabled people in german lol

#

And the dev of mongodb even is a german!!

shadow night
#

well, doesn't english come from german