#help-development

1 messages · Page 329 of 1

gaunt relic
#

true

tender shard
#

after all a plugin might also add additional blocks to the list on e.g. normal, e.g. some weird "LARGER EXPLOSIONS!!!!!111" plugin or sth lol

#

if I was verano, I would probably make the priority configurable

gaunt relic
#

some plugins might add blocks to the list

tender shard
#

or listen to both lowest and highest

#

i mean lowest can also make sense, e.g. when people want to add custom drop explosions

#

so yeah best way would probably to listen to both lowest and highest

gaunt relic
#

well it seems like it's for his own server so i guess it's not that important

tender shard
rotund ravine
#

all three

tender shard
#

why the heck does IntelliJ not have a clone() generator

sterile token
#

mfalex

tender shard
#

who's that

sterile token
#

Something is wrong, debug are not display

#

💀

#

Im really exausted haha

tender shard
#

well show your code

sterile token
tender shard
#

send your code

sterile token
tender shard
#

did you register the listener?

sterile token
#

yes

tender shard
#

how did you test whether it gets called?

#

like, how did you create an explosion?

#

because as I already said a few times, TNT is not BlockExplodeEvent

rotund ravine
remote swallow
#

the block explode event gets called when a block, eg chest is blown up

#

entity explode event to get when a tnt or something blows

rotund ravine
#

Use EntityExplodeEvent

tender shard
#

maybe I should adjust the default values a bit lol

tender shard
rotund ravine
#
Ok I've found why.
In March 2015, @Thinkofdeath has changed how the event is triggered here : https://hub.spigotmc.org/stash/proj...mits/e387d8dc7752a7f03e6baa1dadaf66ec2e7e3512

BlockExplodeEvent only fires when the explosion has an unknown source.
If the source is known like when a player explodes a TNT, an EntityExplodeEvent is fired.

The Javadoc is not quite clear about that : https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/block/BlockExplodeEvent.html
tender shard
#

IIRC only beds and these end crystal thingies call a BlockExplodeEvent

rotund ravine
#

The crystal thing is probably an oversight.

#

They still entities right

tender shard
#

maybe it's indeed the entity event too, idk

#

all I remember is beds are block explode event, and that I once had some trouble with the end crystals because they worked in some unexpected way

sonic wadi
#

Can anyone help me with something regarding server address? It is crucial to getting my server on server list websites

tender shard
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

sonic wadi
# tender shard ?ask

My server is on version 1.0 of Minecraft. I have everything setup correctly in port forwarding and even went as far as to contact the domain registar and they said to get help from Minecraft lol. Anyway, I am supposed to be able to connect using hydricmc.com but when I do so, it says "Connection refused: connect" instead I have to type hydricmc.com:25589 to connect to the server.

tender shard
#

then I'll try to help you there

sonic wadi
undone kernel
#

lmk when it releases

tender shard
#

ok

warped shell
#

So 1.19.3 changed somthing I think where Wardens no longer use EntityTargetLivingEntityEvent, so what event is called when they target a player? (I also tried WardenChangeAngerEvent, which also doesnt work)

subtle temple
#

is there a way to spawn x particles with random locations in relation to an origin

#

built in

warped shell
#

I switched to EntityTargetEvent which somhow fixed it

#

hm

#

well it worked last i checked

#

lemme check again

#

ye its working for me

tender shard
#

when I do "for(Bukkit.getWorlds()" ...

#

why is there no shortcut to turn it into to "for(World world : Bukkit.getWorlds())"

river oracle
#

There's always vscode

tender shard
#

and that would be able to do that?

subtle temple
#

theres gotta be some way to configure intellisense for that

river oracle
#

Idk could probably add config

tender shard
#

bc tbh, a for(<someCollection>) will always result in for(T element : myCollection<T>)

#

why is not builtin

subtle temple
#

maybe its language level thing?

tender shard
#

that doesnt have anything to do with that

#

the enhanced for has been available since forever

#

why am I paying over 600€ per year per user for intellij when it cannot even do simple things like that lmao

river oracle
#

Paying for your IDE 💀

tender shard
#

ok granted it's only 600€ in the first year

#

after that it goes down to 360€

#

still, what a shitty thing that they don't even have basic convenience features like this

#

another reason why I think apple > the rest

#

people would be outrated if XCode couldnt do that

regal scaffold
#

Is it possible to have maven package 2 different "plugins" and export them separate from the same project?

river oracle
#

Why would you need that

#

I mean you could do maven mutli module

regal scaffold
#

If I wanna make a world generation inside something else

tender shard
#

it looks like you want to use modules but are not doing that

regal scaffold
#

Has to load before everything

#

But if my plugin has dependencies loading before others will mess with stuff no?

tender shard
#

i dont really understand

river oracle
#

Yeah ^

regal scaffold
#

There's the load property in plugin.yml right

tender shard
#

yeah, STARTUP and POSTWORLD

regal scaffold
#

That means my plugin will load up before other plugins too. What if I depend on a plugun that hasn't loaded yet

subtle temple
#

@tender shard cntrl + J , type iter, type your collection

regal scaffold
#

So im wondering if the correct way is separating the world generation part of the plugin instead of loading my entire plugin startup

#

Or will dependencies not have any impact if I load startup instead of postworl

river oracle
#

I think ur overcomplicating this just write the plugin yml and let it go

tender shard
#

i dont get why interfaces only allow public members 🥲

floral dome
subtle temple
#

so that you can override them?

tender shard
floral dome
#

no i mean use abstract classes instead of interface

tender shard
tender shard
#

imho the whole "visibility" thing in java is bullshit, I mean you can always get rid of visibility using reflection anyway

subtle temple
#

interfaces are intended to be stateless

tender shard
#

private fields.... well, that's so pointless given that you can just do getDeclaredField(...), set it accessible, and then change it anyway

tender shard
floral dome
tender shard
#

I'll try to explain what I meant in 10 minutes, I'm going for a nasty smoke lol

river oracle
#

Seems like you just want to use abstract classes

tender shard
#

no

remote swallow
tender shard
#

you can only ever extend one class

subtle temple
#

you are using an interface to define methods that will be used to load files/read configs. im not sure what is going to be different between these methods other than a file name, but you need them to be public on the interface so you can override them outside of the interface. you can always implement them and make them private on your implementation

tender shard
tender shard
#

the stuff I currently write is an aggregator to collect data, wrapped into YamlCOnfigurations

#

it doesnt load any files

#

yeah anyway, I'll try to come up with an example where a private interface method would make sense

subtle temple
#

did you read the full explanation

tender shard
#

not yet, one sec sorry

#

I've read it and I'm going to give you an example, althoug tbh I need a few minutes to think of an actual use case because frankly, I'm a bit jägermeister'ed

remote swallow
#

would anyone happen to know if its possible to make the wiki on a github page be saved actually in the repo files, instead of it not being accesable anywhere else

atomic swift
#

bump?

tender shard
#
public interface ExampleInterface {
    
    public default String myExampleMethod() {
        if(requiresWhatever()) {
            return myInternalThingThatRequiresSomething();
        } else {
            return theDefaultThing();
        }
    }
    
    public default String theDefaultThing() {
        return "default";
    }
    
    protected boolean requiresWhatever();
    
    protected default String myInternalThingThatRequiresSomething() {
        return "internal";
    }
}
#

send the full stacktrace pls

atomic swift
#

ok

remote swallow
#

alex

#

fun fact

#

?stacktrace this exists now

undone axleBOT
tender shard
#

nice

atomic swift
remote swallow
#

lmao

tender shard
#

here's the whole list of what I got added: ?notworking ?nms ?blockpdc ?morepdc (and a few more, but I forgot about those ones)

atomic swift
remote swallow
#

switchmappings

tender shard
#

oh yeah

#

that too

atomic swift
tender shard
#

please also paste the WHOLE source code (so we can see the proper line numbers) of

  • Keys.java
  • Main.java
atomic swift
#

as Main just calls the method

#

and this is my example

keys:
  example:
    recipe:
      shape: "#-#|%#%|#%#" ## Use what ever you want you can have 3 rows and 3 characters # USE * for empty
      ingredients:
      - "#|IRON_BLOCK"
      - "%|REDSTONE_BLOCK"
      - "-|IRON_INGOT"
    ==: org.bukkit.inventory.ItemStack
    type: TRIPWIRE_HOOK
    meta:
      ==: ItemMeta
      meta-type: UNSPECIFIC
      display-name: §6§lExample Key
      lore:
      - "§7Unlocks§f: §2Example"
dull magnet
#

I want it to be knockback when hit by a snowball, but I haven't been able to find a way

tender shard
#

if you want to "knockback" players that are being hit by snowballs, simply get the snowball's velocity in ProjectileHitEvent, normalize that vector, multiply with whatver you want, then add that vector to the player's current velocity

dull magnet
#

Oh thanks

tender shard
#

I can you show an example in 5 minutes or so

dull magnet
#

Oh ok thank you

tender shard
#
    @EventHandler
    public void onSnowballHit(ProjectileHitEvent event) {
        if(!(event.getEntity() instanceof Snowball)) return;
        if(!(event.getHitEntity() instanceof Player)) return;
        Snowball snowball = (Snowball) event.getEntity();
        Player player = (Player) event.getHitEntity();

        Vector snowballDirection = snowball.getVelocity().normalize();
        player.setVelocity(player.getVelocity().add(snowballDirection.multiply(2)));
    }

@dull magnet

#

this would e.g. make the hit player getting knockbacked a bit

#

to make it stronger, you would have to adjust the math in the last tine

dull magnet
#

Ok

dull magnet
#

Good!

#

How do I write code here?

remote swallow
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
remote swallow
#

?paste

undone axleBOT
atomic swift
#

hmmmm if (world==Bukkit.getWorld("world")) {

#

but the world does equal

grizzled oasis
#

how can i make save temporary the position of the player and when he falls into the void automaticaly tp back on the location saved?

ornate patio
#

is it possible to remove knockback players receive when taking damage?

#

whether from another player, fire, poison, etc

wet breach
#

You would cancel the event and the apply damage manually

tall dragon
warm light
#

I am working on a discord bot(JDA)
so I am trying to add SelectionMenu in a embed. & did this

event.replyEmbeds(builder.build()).addActionRow(menu).queue();

got this from JDA wiki. but IDE saying Cannot resolve method 'addActionRow(SelectionMenu)'

#

here is my menu

vocal cloud
#

Sigh. JDA has an official discord

#

Links are banned but the code is JDA

warm light
#

got it.

remote swallow
vocal cloud
#

Huh weird that when I linked it got autoremoved

remote swallow
#

needs https:// on it

vocal cloud
remote swallow
#

cafebabe doesnt like plain discord links

formal bear
#

how to prevent players from taking items from armor stand? i want to make spawn protection for my server

earnest forum
#

cancel this ?

shell gyro
#

bro i send the acc like 1years u still didnt respones + ( I resend a lot)

remote swallow
#

huh?

austere cove
#

any way to convert legacy material + damage value to modern material?

last tulip
#

Hi guys!, i want to make a plugins for an event that needs player to break a block, the most block they broke will win
But i have a problem with grass, sapplings, and farming item like carrot, potatoes, bamboo, etc.
Any idea for better code? not writing all the unwanted blocks like this picture below.
Like Seeds have Natural Blocks category, Carrot have Food&Drinks category, how to get that category?

tardy delta
#

you mean the creative categories?

last tulip
#

yes

tardy delta
#

those are client side and you cannot get them

last tulip
#

so there is no better code? because i think loop-check every BlockBreakEvent will bad for server...

tardy delta
#

uh if thats just an enumset it doesnt really matter

#

not like it will take long

last tulip
#

so it's fine?, well thanks mate

tardy delta
#

why not doing ::contains?

last tulip
#

ah..

tardy delta
#

on EnumSet.of(Material.A, Material.B, ...)

last tulip
#

i'll do that, thanks!

tardy delta
#

atleast its not linear then

eternal night
#

enum sets for materials upsidedown_cry

#

please don't

tardy delta
#

cry about it

eternal night
#

I am because where is that material to registry PR 😭

tardy delta
#

hoping materials in the future will still have reference equality

last tulip
tardy delta
#

normal set

#

could use a list too as there arent many elems

last tulip
#

oki, thanks!

eternal night
last tulip
#

BlockBreakEvent, how to use event.getBlock().getDestroySpeed()?

#

is it like how long it takes to break the block?

last tulip
#

ooo

#

i thought it same

#

ok sorry, thanks!

rotund ravine
#

Nah

tardy delta
#

world objects have reference equality

eternal night
#

not like .equals would hurt tho kekw

river oracle
torn shuttle
#

what's a popular minecraft world pregeneration plugin that I can recommend to people?

#

preferably something easy to use

chrome beacon
#

Chunky

torn shuttle
#

alright seems legit, thanks

atomic swift
#

doesn't work

#

that's what I'm doing rn

#

but doesn't work

undone axleBOT
#

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

atomic swift
#

I have Player#getWorld().getName() in PlayerChangeWorldEvent and I'm switching to word world but they don't match for some reason

tardy delta
#

what are you even doing

rotund ravine
#

Print them @atomic swift

atomic swift
#

checking if the player changed to world

atomic swift
exotic garnet
#

Does anyone know how to set the speed and transfer amount of a hopper without going into the spigot.yml, in code.

chrome beacon
#

Why though?

#

Upgradable hoppers or smth?

tardy delta
#

load the spigot.yml and change it

exotic garnet
#

I'm looking to have "upgradeable" hoppers

#

It would have to be a per block value though

chrome beacon
#

For transfer speed you will probably have to use a scheduling task or nms

#

?scheduling

undone axleBOT
exotic garnet
#

So I could just check the amount left in the hopper and move the rest according to my transfer amount. I'm assuming that's how other people do it.

balmy valve
#

Anyone know if it would be theorhetically possible to make player heads powerable? Or not because they are just transparent blocks

quaint mantle
#

uhh will I not be able to download buildtools with this?

#

holdup

#
    1.8.0_232 (x86_64) "AdoptOpenJDK" - "AdoptOpenJDK 8" /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home```
#

?

regal scaffold
#

How to prevent AI from fighting, targetting stuff, anything except moving or at least having gravity

#

Cause event.setAI(false) just has him floating he can't even reach the floor

hasty prawn
#

Remove the AI goals that do all the targeting

regal scaffold
hasty prawn
hasty prawn
quaint mantle
#

but how do I change my java version from jdk 16 to this?

regal scaffold
hasty prawn
quaint mantle
#

im on mac

hasty prawn
#

Welp I have no idea then. Might just have to Google how to change default Java on Mac.

regal scaffold
#

Google

rough drift
#

Scoreboard problems

quaint mantle
#

well im using terminal will that work?

hasty prawn
# regal scaffold

Those aren't the goals, in the NMS entity class you're trying to modify (So if it's a Zombie you're changing, find the NMS Zombie class), there's a ton of goals in there. You'll have to make a custom entity to remove the goals.

regal scaffold
#

Please read the link

regal scaffold
#

You really think the only way is to use NMS

#

Damn

#

That's no bueno

hasty prawn
#

To remove part of the AI? Yep, you need a custom entity and the only way to do that is extending the NMS entity.

#

Afaik anyways. What exactly are you trying to not let it do? If it's just targeting, I think there's an EntityTargetEvent or something you can cancel.

opal wedge
#

Hello I am currently trying to use the PlayerInteractEvent. My current code looks like this: https://gist.github.com/TeddyBear2004/34b7ea7fd60b8799433059658852c808

I currently give the player a slimeball in the offhand so that the RIGHT_CLICK_AIR is executed. However, this is executed more often when held down, whereas LEFT_CLICK_AIR only works once per click. Is there an item that executes multiple LEFT_CLICK_AIR events where you have only clicked once?

Gist

GitHub Gist: instantly share code, notes, and snippets.

#

What do I get out of checking the hand?

#

I can assign whether right or left has been clicked on

#

If the right button is held down, permanent events appear.

#

While left-clicking only calls the event once.

dire marsh
#

that's just what the client sends

opal wedge
#

However, the server can indirectly manipulate what the client sends, so RIGHT_CLICK_AIR is only executed when the player is holding certain things.

#

And my question is whether there is an item with which this works with left clicks.

hasty prawn
#

Probably not since left clicks are animated and right clicks aren't.

#

Pretty sure that's why it always fires for left clicks, since that animation happens no matter what they're holding.

#

Where if they right click with nothing... nothing happens so the server doesn't care.

opal wedge
#

And the mining distance is probably also only clientside?

hasty prawn
#

Ye

opal wedge
#

Ok :/

trim creek
#

I might be an idiot, but where is the problem in this statement?

"INSERT IGNORE INTO `players_settings` (NAME, UUID, CHAT, SHOWPING, FLY, PM, JOIN, JOINOTHER) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"
#

That sounds weird.

#

The table itself exists

#

with all data izék I put over the statement

#

[16:44:31 WARN]: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN, JOINOTHER) VALUES ('NeonOwlGery', 'bd0e1b9d-ac9b-3251-87f4-649ba1ea3e32...' at line 1 - this is what I get btw

#

Which is again weird because the simple "players" table uses the same method, and doesn't gets this error, but this one does?

#

I don't get how they would not be the same. 🤔

#

Oooooo... Then Imma try other names

#

Yup. It was that error.

#

Thanks :D

tender shard
#

what even is JAVA_HOME for lol

cold jolt
#

How to

full enchantment tool

but rename only costs xp 1

tender shard
dry valley
#

Hey anyone know how to make the thing when ur in combat u cant walk back to spawn? i fr need that plugin (dont judge my username)

tender shard
#

cant walk back to spawn?

#

wdym

quiet hearth
#

how do I spawn a falling block with packets???

tender shard
#

anyway: clientboutAddEntityPacket or however its called

cold jolt
#

how?
how do rename the tools, the cost is only xp 1?

quiet hearth
#

50 x 50 x 5

tender shard
#

the client will die

quiet hearth
#

would that be fine with packets anyway probably not]

#

yeah

quiet hearth
#

it doesnt and I dont know how to change the block

#

I have no idea how to to it

chrome beacon
#

Send the entity metadata packet

#

or not

dire marsh
#

weird thing is wiki.vg only has block pos as metadata for falling block

chrome beacon
#

It's part of the object data

dire marsh
#

ID of the block state

#

smh

#

id's in 2023

chrome beacon
#

I thought they got rid of all of them ;/

formal bear
#

i cannot destroy armorstand even with my permission? whats the problem? ``` @EventHandler
public void onPlayerDamageEntityEvent(EntityDamageByEntityEvent event) {

    if (!Objects.equals(pluginManager.getSpawnLocation().getWorld(), event.getDamager().getWorld())) return; // if player is on spawn

    if (event.getDamager() instanceof Player player) { // if damager is player

        if (player.hasPermission("bpsurvival.protection")) return; // if player has permission, dont cancel

        event.setCancelled(true); // else cancel the event

    }

    event.setCancelled(true);

}```
dire marsh
chrome beacon
#

I mean in nms

tender shard
formal bear
#

hm?

#

the permission logic is inverted, only admins have it

#

yep i got multiple events

#

i have it on every interaction event

#

        if (!Objects.equals(pluginManager.getSpawnLocation().getWorld(), event.getPlayer().getWorld())) return;

        if (event.getPlayer().hasPermission("bpsurvival.protection")) return;

        event.setCancelled(true);

    }```
#

if players are not on spawn let them destroy stuff

formal bear
atomic swift
formal bear
#

Player player

atomic swift
#

he is

#

with java you can use Player instanceof Player player to declare a player

dire marsh
# chrome beacon I mean in nms
@Override
    public void onSpawnPacket(EntitySpawnS2CPacket packet) {
        super.onSpawnPacket(packet);
        this.block = Block.getStateFromRawId(packet.getEntityData());
formal bear
#

yes

atomic swift
#

I'm for so.e reason errors out every time i try it though

formal bear
#

i will make some logs and paste it here

chrome beacon
#

That's always going to throw an error kekwhyper

formal bear
#

is using final on player variable necessary?

atomic swift
#

so if the player is a player then return if not error out

formal bear
#

im just curious

tender shard
atomic swift
#

through cmd

tender shard
#

cmd only cares about the PATH variable

formal bear
#

i forgot to call the log only when the entity is an instance of player XD

tender shard
#

I've set JAVA_HOME to "" and still "java" works

atomic swift
#

like if you remove it from PATH then run set PATH=C thebr e open cmd and enter java the command will most likely be unknown

atomic swift
tender shard
atomic swift
#

exactly

tender shard
#

so my question still stands - what is JAVA_HOME for?

atomic swift
#

for cmd

tender shard
#

then why does it work fine without that var being set?

tardy delta
quiet hearth
atomic swift
#

bc you have to reset path after removing it the. it will break

hazy parrot
#

I assume other similar apps too

tender shard
#

I would have thought gradle just downloads a few more wrappers and brings its own jdk

hazy parrot
#

Probably some kind of convention

tender shard
#

but alrighty, seems like it's only needed for the JDK, that explains why using java -jar´ still works fine without it

#

it doesnt however explain why a normal JRE also sets this variable

#

very weird lol

dire marsh
formal bear
#

idk maybe im using wrong event?

quiet hearth
formal bear
#

ik

#

one sec

tender shard
dire marsh
#

I don't think so

tender shard
dire marsh
#

I wonder how viaversion translates the id depending on version

tender shard
#

yeah that'd be interesting

dire marsh
#

protocol.getMappingData().getNewBlockStateId(blockState)

#

it's not simple

regal scaffold
#

Is all the NMS stuff sort of new? I remember doing some dev at least 6 years ago and never heard of it before

dire marsh
#

net.minecraft.server

regal scaffold
#

I know what it is now, I’m asking if it’s sort of new or it was being used 6 years ago

formal bear
#
    public void onPlayerDamagedEvent(EntityDamageEvent event) {

        if (!Objects.equals(pluginManager.getSpawnLocation().getWorld(), event.getEntity().getWorld())) return;

        if (event.getEntity() instanceof Player player) {

            Bukkit.getLogger().info("TEST 1: " + player.getDisplayName());

            if (player.hasPermission("bpsurvival.protection")) return;

            Bukkit.getLogger().info("TEST 2: " + player.getDisplayName());

            event.setCancelled(true);

        }

        event.setCancelled(true);

    }```
#

I have this permission, why it does not call the second log?

tender shard
#

because you return if you have that permission

formal bear
#

i wrote it wrong

#

why it does not take damage

echo basalt
#

you cancel regardless

formal bear
#

it should not return the whole method?

echo basalt
#

it should actually yeah

tender shard
#

but that's what "return" is for

echo basalt
#

was talking about like

#

the setCancelled outside the if block

formal bear
#

its when entity is not player

sterile token
#

return true/false is use in commands to índicates if execution success or not

tender shard
#

?

dire marsh
#

tried spawning the falling blocks with packets. a bit cursed.

tender shard
#

offset it by 0.5, 0, 0.5

formal bear
#

Why does it not take damage when i'm returning it

#

I don't understand

dire marsh
#

They look like they're lining up to kill me.

tender shard
formal bear
#

maybe something else blocks it... youre right

#

is Armor stand an Hanging Entity?

#

Because i have eventlistener for that

#

Regardless, im checking for the same thing lol

#

If player is on spawn,
and if player has permission

tender shard
#

ItemFrames or paintings are

formal bear
#

Ok maybe i messed up, i have one more event, EntityDamageEvent, but it does not have Damager? or has it

formal bear
#

Ok it works; Thanks for help! @tender shard @last temple 💜

tender shard
#

Great!

formal bear
#

I was wondering why EntityDamage dont have getDamager() method, but now i understand that it could be something like fall damage or smh

#

When player hits an entity it's calling both at the same time 🗿

#

No problem!

tender shard
quaint mantle
#

hi, is there a way to create blocks that dont actually exist? Like blocks that are not actually registered in the chunk or region files. Sort of like modifying the packets of blocks being sent to the player. Temporary blocks of some sort.

rotund ravine
#

sendBlockChange

quaint mantle
rotund ravine
#

nope

quaint mantle
#

ok

quaint mantle
#

Appreciate the help!

tall dragon
#

any suggestions regarding how to design an Invsee command that also contains the target's armor and is still modifiable directly?

ivory sleet
#

design as in UI ?

#

like for the end user, or do u mean code wise

tender shard
tall dragon
#

cuz i have to deal with a bunch of things

#

like when the target player gets or removes items

tender shard
#

is github offline?

tall dragon
#

works for me

tender shard
#

weird

#

no website works for me lmao

#

but discord does

#

and no, its not a DNS issue

#

I wanted to add you to angelchest's repo so you can see the gui code

#

buuuut

#

idk no website is loading

#

edge works

#

chrome doesnt

tall dragon
#

thats uhh

#

very odd

#

firefox enjoyer :>

#

always works

tender shard
#

thursday, my macbook arrives, then I can finally use safari again

tall dragon
#

is safari also not Chromium based?

tender shard
#

webkit yes, chromium no

#

I killed chrome and now it works again

tall dragon
#

lmao

tender shard
#

whaty your gh name again

tall dragon
tender shard
#

check out the GUI package

#

🥲

tall dragon
#

looks fairly nice. but i was not rlly looking for a gui library PepeLaugh

topaz cape
tall dragon
#

u need access

topaz cape
#

oh it's a private

tall dragon
#

alex trust me

topaz cape
#

alex trusts everybody

tall dragon
#

@tender shard lmfao

tender shard
tall dragon
#

good one

tender shard
#

you just cannot see it

tender shard
#

WTF 2019?!

#

damn that's almost 4 years

tall dragon
#

aperantly

#

who knew a simple "deathchest" plugin could be so advanced haha

#

more than 100 friking classes

tender shard
#

way more

tall dragon
tender shard
tall dragon
#

idk i never liked calling it that haha

tender shard
#

angelchest itself has 126 classes, but it also depends on JeffLib which has another 200 classes or so

tender shard
tall dragon
#

true

#

i usually just do my plugin name appended with "Plugin"

tender shard
#

also it's not just "Main" but...

#

other plugins accessing it would use "AngelCHestPlugin" interface

tall dragon
#

like u implementing

#

that wouldve been my main name

tender shard
#

I just don't like having to type "private final AngelChestPlugin" everytime

tender shard
#

15072 without all the libraries

#

so kinda inaccurate since e.g. JeffLib was only made for angelchest

#

so actually the lines of JeffLib should be added

tall dragon
#

fair

#

thats pretty insane tho 15k for a plugin like that already

#

prolly loads of dependency, configurability stuff

#

always hated that with public plugins

tender shard
#

angelchest is literally the only proper death chest plugin

#

all others are shit

#

that was the only reason why I made it in the first place

tall dragon
#

i once made one as well

tender shard
#

jefflib has another 31998 lines

tall dragon
#

it had like 2 listeners

#

thats it

tender shard
#

so angelchest is roughly at 50k lines of java

tall dragon
#

jeez haha

#

im making a full on minigame plugin and im only on 10k java lines rn

#

its probably only 50% done tho

tender shard
tall dragon
tender shard
#

yes

#

Daytime, StackResize etc are paid too and they are also on github

#

also you'd need com.jeff_media:PluginCompiler to compile it

tall dragon
#

soo ur just going off the fact that most buyers cant compile it themself anyway?

#

o

tender shard
#

yeah tbh if someone manages to compile this, then they can use it if they like

#

it uses so many libs that aren't public, it'd be a pain to compile this

#

e.g. StepSister

#

or PluginCompiler

tall dragon
#

tf is that xD

tender shard
#

StepSister is the new version of Daddy

#

I made that so that AngelChest Plus and Free can share the same source code

#

it does stuff like this:

#
if(Daddy.allows(PremiumFeatures.SHOW_GUI)) {
  showGui();
}
tall dragon
#

lmfaooooo

#

naaah rlly?

tender shard
#

the PluginCompiler replaces the Daddy calls with "true" for the paid version, and false for the free version, so I got 2 .jars

#

but

#

one day, Daddy was stuck in an endless loop

#

so I renamed it to Stepsister

#

because we all know that stepsisters tend to get stuck in awkward places

tender shard
#

Help stepbro

#

oh shit, the repo contains the allatori annotations

#

I gotta make it private again before somebody complains about "copyriiight"

tall dragon
#

haha

#

very true

tender shard
#

also my commit messages are shit lol. "9.7.3"

tall dragon
#

very descriptive!

tender shard
#

"going to sleep. custom blocks and items somehow work"

ornate patio
#

if i want to make a plugin bungeecord compatitable, what special measures should I be taking when developing it?

pseudo hazel
#

"graveyards fully working, adding potions now"

ornate patio
#

for example how I would store player data across all servers?

tender shard
pseudo hazel
#

probably in version x.x.x

tender shard
#

in 5.1.0

#

it's at 9.8.0 meanwhile

pseudo hazel
#

pog

tender shard
#

well 10.0.0-SNAPSHOT on my pc

#

but before that gets released, I'll have to upload Drop2InventoryPlus 4.0.0

#

I wanted to do that today but I was too drunk

pseudo hazel
#

damn, 10.0.0 sounds like a long time

#

or a shitty versioning system

tender shard
#

a new major version means that a big feature was added

#

e.g., Graveyards in AngelChest

#

a new minor version means that there's a new config option or another rather small feature

#

and a patch just means that sth got fixed

pseudo hazel
#

a major version bump for me means that basically all the code or features kinda changed xD

tender shard
#

it's actually a private repo, only made it public for now

tender shard
#

I mean, look at chrome. they go from version 238 to 241 within one month lol

#

best class ever

tardy delta
#

got that too

#

i might replace it with a boolean but who cares

tender shard
#

who you gonna call?

robust light
#

how can I close an inventory of a player? I use p.closeInventory(), but if they shift click they can take the item out. What could I do?

tender shard
#

wdym. they cannot shift click when the inventory is closed

robust light
#

I mean like if they shift click an item to close an inventory

tender shard
#

good luck trying to compile it

pseudo hazel
tender shard
#

yes

#

e.g. StepSister

#

or the ConfigUpdater

robust light
#

atleast the entire code to exit

tender shard
#

players sholdnt be able to take any items

robust light
#

They can

tender shard
undone axleBOT
tender shard
#

usually calling player.updateInventory() should fix any client bugs related to this

robust light
#

its pretty weird

#

this is the entire function

    @EventHandler
    public void onInvClick(InventoryClickEvent e){
        if(!e.getInventory().equals(inv)) return;

        e.setCancelled(true);
        final ItemStack clickedItem = e.getCurrentItem();

        if(clickedItem == null || clickedItem.getType().isAir()) return;

        Player p = (Player) e.getWhoClicked();
        ItemMeta meta = p.getInventory().getItemInMainHand().getItemMeta();

        if(clickedItem.getType() == Material.BARRIER){
            e.setCancelled(true);
            p.closeInventory();
        }

    }
tender shard
#

oh please use proper variable names

#

and try Player#updateInventory()

rotund ravine
#

is he in inventory?

tardy delta
#

why cancelling twice

rotund ravine
#

creative*Ø

tender shard
#

btw normally you wanna cancel EVERY clickevent in your custom GUI, unless you wanna allow taking out items from it

robust light
#

yeah it seems like the problem was being in creative

tender shard
#

for GUIs I usually have a listener on LOWEST that cancels everything, then another on NORMAL that does the actual logic

rotund ravine
#

Give each gui item a pdc called "guiitem" on inventorycloseevent clear the inventory from gui items. easy

tender shard
#

"BlOcKs Do NoT hAvE pDc"

robust light
robust light
#

is it the same as with players?

tender shard
#

every Entity has a PDC

#

you can even do a bit of number juggling to get PDC for blocks

#

?blockpdc

undone axleBOT
tender shard
#

pdc is love

robust light
#

it kinda seems unnecessary to make a pdc for every single value

tender shard
#

erm yeah

#

you are supposed to reuse the same PDC everytime

robust light
#

dont they impact performance on the long run?

tender shard
#

no

#

they are just NBT tags

#

the PDC is just a NBT tag container called "PublicBukkitValues" on itemmeta

#

or "BukkitValues" on everything else

regal scaffold
#

If I load my plugin or startup and I'm doing extra world creation, how can I make it happen after the world gets created so you don't get "Cant create additional worlds on startup"

tender shard
robust light
regal scaffold
#

Hmmm alr

quaint mantle
#

is there a way to check for the highest block in a chunk?

tender shard
#

the PDC is a container for EVERYTHING you wanna store

quaint mantle
#

besides like looping through all the blocks manually.

tender shard
#

a PDC is like a Map<String,Object>

quaint mantle
#

in case something like that exists.

tender shard
#

e.g. you could store "itemname=asdasd", "owner=mfnalex", "age=27" in the same PDC

regal scaffold
#

Alex your lib looks pretty cool

tender shard
regal scaffold
#

Just the lib

tender shard
#

which one

regal scaffold
#

General one

#

lol

tender shard
#

JeffLib?

regal scaffold
#

Yes

tender shard
#

oh yeah

#

if you like JeffLib, check out my others too lol

#

?blockpdc

undone axleBOT
tender shard
#

?morepdc

undone axleBOT
tender shard
#

and the update checker thing

regal scaffold
#

lol

#

We've already talked about this remember?

#

You talk to too many diffrent people

#

I''ve already been using both of those

#

You even helped me out

tender shard
#

yeah I cannot remember everyone, sorry. I do not even can recognize my friends by their face

#

I usually recognize people off their voice

regal scaffold
#

It's all good

#

Gonna try the jefflib this time, only one missing

tender shard
#

I made JeffLib so I dont have to update every plugin that uses NMS

regal scaffold
#

I assume you have other projects on your gh showing implementation

#

I'll just look around 🙂

tender shard
#

that's my newest thingy

regal scaffold
#

Looking at your repos here 116 shesh

tender shard
#

it's like the "Minecraft development plugin" for intellij, but in good

regal scaffold
#

I used that I think

#

Do you have a plugin that uses your jefflib which you did gui and multiworld?

#

Not really related between eachother just to see implementations

tender shard
#

but it doesnt have any GUI features

regal scaffold
#

I saw a api for it but yeah doesn't look like it had much

tender shard
#

it only has a few utils for GUIs

#

e.g. turning "row 2 slot 4" into the actual slot number

#

that'S about it

regal scaffold
#

Yeah prob any actual gui framework has better

tender shard
#

yeah I never used any, so no idea

regal scaffold
#

You really make all your gui yourself

#

No fw

tender shard
#

yes

regal scaffold
#

Sheesh

#

Is it because you don't like what's available or you just organize it better?

tender shard
#

every plugin has its own GUI logic >.<

#

kinda annoying

regal scaffold
#

Wait so your gui files do tend to be pretty long and somewhat complicated right

#

Like it's not just me

tender shard
#

depends

#

lemme show you ChestSort's gui config

tardy delta
#

so many warnings

tender shard
#

it heavily uses YAML anchors

regal scaffold
#

Oh you actually make it all configurable...

#

That's something I've always hated doing tbh

#

But I guess makes it less repetitive in code afterall

tender shard
#

yeah I just use JeffLib's ItemStackUtils.fromConfigurationSection or sth

regal scaffold
#

Alright gonna see what's good with jefflib

#

And regarding nms

tender shard
#

if you use minimizeJar and wanna use NMS stuff, be sure to read the readme

regal scaffold
#

What is the actual use application of it

#

Like what can I access from nms that I couldn't normally

tender shard
#

1 sec

#

everything that's listed here

#

e.g. pathfinding

#

or getting the TPS

#

or checking whether the server is currently starting up, running, or shutting down

#

or using NMS' getRandomBlockPos

#

bla bla just look at it yourself lol

tall dragon
#

actually alex. do u know of a way to know whether the server has fully started?

#

like finished loading all the plugins

tender shard
#

if this returns ServerLifePhase.RUNNING, then it is running, i.e. all plugins are already loaded etc

tall dragon
#

thats lovely

#

i can use that

regal scaffold
#

I see I see

#

Alright defo gonna use this'

tender shard
#

btw if it returns "RUNNING" in onEnable, then it means the server is currently reloading

regal scaffold
#

Also I know nms is version dependant heavily

#

Will I need to change much every time?

tender shard
#

well it depends

tall dragon
tender shard
# tender shard well it depends

if you use mojang mappings, the only thing you have to do when a new update gets released is to change the mappings version in your pom.xml

#

?nms

tender shard
#

(unless there's actually any significant changes in mojang's code, but those are kinda rare)

tender shard
tall dragon
#

great

tender shard
regal scaffold
#

Wait

#

We talking server versions or client

#

What about via version

tender shard
#

client doesnt matter

regal scaffold
#

Alright so if server is version X then just need to make it for that verison, correct?

tender shard
#

exactly

regal scaffold
#

Beautiful

#
                <configuration>

                    <relocations>
                        <!-- MorePersistentDataTypes start -->
                        <relocation>
                            <pattern>com.jeff_media.morepersistentdatatypes</pattern>
                            <shadedPattern>me.tomisanhues2.dungeonmaster.morepersistentdatatypes</shadedPattern>
                        </relocation>
                        <!-- MorePersistentDataTypes end -->
                        <relocation>
                            <pattern>com.jeff_media.jefflib</pattern>
                            <shadedPattern>me.tomisanhues2.dungeonmaster.jefflib</shadedPattern>
                        </relocation>
                        <!-- CustomBlockData start -->
                        <relocation>
                            <pattern>com.jeff_media.customblockdata</pattern>
                            <shadedPattern>me.tomisanhues2.dungeonmaster.customblockdata</shadedPattern>
                        </relocation>
                        <!-- CustomBlockData end -->
                    </relocations>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludeDefaults>false</excludeDefaults>
                            <includes>
                                <include>com/jeff_media/jefflib/internal/nms/**</include>
                            </includes>
                        </filter>
                    </filters>
                </configuration>
#

hmmmm

tender shard
#

and when you use mojang mappings and wanna switch your server from 1.19.3 to 1.20, then you simply have to adjust your pom and replace 1.19.3 with 1.20

regal scaffold
#

I think I like alex's stuff

tender shard
#

if you don'T use mojang mappings, you have to check whether "method b()" is still called "b()" or if it's "c()" meanwhile

regal scaffold
#

If I don't use nms don't really need to remove the pom stuff for nms right?

tender shard
#

so yeah - use mojang mappings

regal scaffold
#

Like it won't matter

regal scaffold
tender shard
regal scaffold
#

But is it bad to keep it if I don't use it?

tender shard
#

no

regal scaffold
#

Alr perfect

tender shard
#

well it'd make your .jar bigger

regal scaffold
#

By how much we talking here

tender shard
#

like 100kb

regal scaffold
#

xd

#

Alr

tender shard
#

if you do not call JeffLib.enableNMS(), then it would never instantiate the NMSHandler anyway

regal scaffold
#

Fair

#

Now to look at your plugin structure

#

Lets see how you do things

tender shard
#

my free plugins are a mess

#

take a look at my more modern ones

regal scaffold
#

😦

tender shard
#

e.g. DayTime or StackResize

regal scaffold
#

ChestSort?

tender shard
#

they are paid but open source

#

ChestSort is a mess, it was my first plugin

#

look at StackResize

regal scaffold
#

Oh really

#

Alright

#

Will do

#

Anything specific you want me to look at?

#

Maybe you proud of something specific 👀

tender shard
#

nah lol

#

the most important feature of StackResize is actually in JeffLib

#

MaterialUtils.setMaxStackSize or sth

regal scaffold
#

lol

#

Wait but stack resize has no gui implementation at all

#

Is the gui implementation on chestsort really that bad?

tender shard
#

oh you wanted to look at GUI stuff?

regal scaffold
#

I mean

#

Jefflib

#

And gui

tender shard
#

the GUI implementation of chestsort is great

regal scaffold
#

Alright so stackresize for jefflib

tender shard
#

what's your github name?

#

I'll add you to AngelCHest

regal scaffold
#

Same

tender shard
#

then you can look at AngelChest's gui too

#

alr 1 sec

regal scaffold
#

Is that one really good?

tender shard
#

imho it's pretty straightforward

regal scaffold
#

Fantastic

tender shard
#

but ChestSort's GUI is configurable and not so complicated, AngelChest is much more complicated but not yet configurable

#

I can also show you JukeboxPlus, that one is complicated AND configurable

#

1 sec

regal scaffold
#

I'll have a ton of reading to do

#

So anything you provide is so appreciated

tender shard
regal scaffold
#

Man all your plugins have the same structure

#

It's so clean

tender shard
regal scaffold
#

Thanks a lot I'll be looking at those for a few hours

tender shard
#

np

regal scaffold
#

AngelsChest is massive tho right?

#

Like compared to chestsort it has way more stuff going on

tender shard
#

about 50k lines of java if you include jefflib, yeah

#

yes, death chest plugins are massive when done right

regal scaffold
#

Alright gonna look at chestsort > angels > jukebox

tender shard
#

oki

#

20% of angelchest's code is probably about graveyards lol

regal scaffold
#

Wait a second here alex

#

Your gui implementation feels like you make your own "framework"

#

Like

#

You have stuff ready to handle anything

#

That's so clean

tender shard
#

I thought about switching to IF

#

but then I looked at it and I thought "nah"

regal scaffold
#

I looked at triumph

tender shard
#

I've heard of that, but never took a glance

regal scaffold
#

wAIT NO

tender shard
#

oh

regal scaffold
#

Wrong one, cirrus

tender shard
#

never heard of that

regal scaffold
tender shard
#

however I tend to only use libraries made by people that I know

regal scaffold
#

I was actually thinking about using that

#

But you sugested to not use a lib

#

So I'm in limbo zone now

tender shard
#

e.g. ACF by aikar, I use all the time (command framework, not for GUIs). I would never use any "random" GUI framework, because it might be dead in 2 years

quiet ice
#

I myself use phoenix616's inventory lib

tender shard
#

which is funny since I also have a ton of libraries that others use lol

regal scaffold
#

I see

#

Give cirrus a look rq

tender shard
#

kk 1 sec

quiet ice
tender shard
regal scaffold
#

Oh yeah I've seen phoenix

#

ikr

#

It's what caught my eye

tender shard
regal scaffold
#

Screw confug

tender shard
#

admins hate you if the GUI is not configurable

regal scaffold
#

Wait no

#

That thing is configurable

#

It's just a preview of the config file

#

Just like you use in yours

quiet ice
#

I never got an issue with people complaining about configurability

regal scaffold
#

Like, the preview is of the configuration file

quiet ice
#

Probably a premium plugin issue I'd guess

regal scaffold
#

yeah geol

#

Those need to be bulky

#

Wait alex you gotta admin it don't look that bad

tender shard
#

tbh it looks a bit complicated to me

regal scaffold
#

Really

#

You think your structure is better?

tender shard
#

no

#

mine isn't "universal" like Cirrus is, but it works for me

regal scaffold
#

Ah I see

quiet ice
regal scaffold
#

I mean we're talking 2 different things here tho no?

tender shard
#

it looks good but I wouldn't have any benefits in switching to it

regal scaffold
#

there's a gui players should be allowed to change "values " from but not change the actual config of the gui

#

And then there's customizable gui

#

Wait alex this might be noob question but

#

You don't actually export your gui config file with your resource right

#

I mean you export it, but not for the user to edit it

tender shard
#

but yeah , as said, cirrus looks really promising, but I don't see any reason to use it right now. Maybe for my next plugin, but I wouldnt bother changing all my current code just to use it

#

I did the same for ACF. My "old" plugins like AngelChest, D2I, ChestSort, etc all use only bukkit's command handlers

#

for newer plugins like StackResize, I switched to ACF

#

but I'd never think about rewriting my old code just to use ACF

regal scaffold
#

Nah don't think it would ever be worth it

tender shard
#

I just always think "if it works, don't change it"

regal scaffold
#

Alex

#

Your gui.yml

tender shard
#

in chestsort?

regal scaffold
#

Technically you could have that but uneditable right

#

Yeah

tender shard
#

sure

regal scaffold
#

Like it doesn't actually

#

Have to be editable for what that plugin does

tender shard
#

it could have been included as resource instead of saving that file, sure

regal scaffold
#

If you didn't care about it being editable. would you still use the gui.yml method

#

or would you hardcode the stuff

tender shard
#

hardcoding is always a bad idea

regal scaffold
#

So you would still generate the exact same with gui.yml as a resource

tender shard
#

AngelChest 10 is soon to be released which will use a similar system as ChestSort currently does

river oracle
#

Always hardcode everything change later when one random guy complains

tender shard
#

same for D2i 5.0

regal scaffold
#

Hmmm alrighty

tender shard
#

although first I gotta release version 4

regal scaffold
#

lol

#

Already thinking about 5

#

I'm gonna use cirrus and jefflib and see how it goes

tender shard
#

D2I 4 adds per-player autosmelt, per-player auto-sell and per-player auto-condense

#

yeah cirrus looks good indeed

regal scaffold
#

You really never saw it before?

tender shard
#

tomisan you should pull request Cirrus to my Spigot Plugin Generator 😛

tender shard
regal scaffold
#

lol

tender shard
#

never seen it until 5 minutes ago

regal scaffold
#

You want me to?

tender shard
#

here you can PR it ^

regal scaffold
#

The real question is will I really use your generator

#

idk yet hehehe

tender shard
#

you gotta change the pom.xml in maven-archetype-resources, the archetype-metadata.xml, and adjust the README file

#

the GUI then automatically knows about the changes

regal scaffold
#

i'm not really familiar with github besides thge basic stuff

#

We're talking about the pullrequest right

#

I haven't interacted much with other peoples resources

tender shard
#
  1. fork the repo (just click on "fork")
  2. In IntelliJ, click on File -> New -> Project from Version Control (then enter your fork's URL)
  3. change stuff
  4. go to commit -> commit & push
  5. On GitHub, click on "Create Pull request" and fill it out
  6. Done
regal scaffold
#

Ok I think I did it correctly @tender shard

tender shard
#

yes looks good

regal scaffold
#

Ummm I do wanna clarify that cirrus has framework for like all different things

tender shard
#

please change the description in "archetypr-metadata" to sth like "Cirrus GUI library"

#

so people know its about GUIs

regal scaffold
#

I only did 1 I was kinda confused

sterile token
#

Hi mfalex, i have read what you have told me and i just understand what you were meaning

tender shard
#

you can just do another commit, it automatically updates the pull request

regal scaffold
#

How can I edit

#

Oh ok

sterile token
regal scaffold
#

Alright that was my first time ever interacting with someone elses project

tender shard
#

what's that "if" for in line 73?

regal scaffold
#

Yeah so hear me out

#

I just noticed that you have the if on the other file

#

Let me remove

#

IntelliJ doesn't even let me write in that file with # correclty

tender shard
#

yeah I know D:

#

intellij doesnt undetstanfd this format

#

it's called VTL (Velocity Templating Language)

regal scaffold
#

There we go

#

Never ever heard of it

tender shard
#

thanks!

regal scaffold
#

Thank you for teaching me!

tender shard
#

I'll have a smoke, then test & merge it

quiet ice
#

Looks like the C-preprocessor slapped on XML to me

tender shard
#

it's how maven archetypes work

#

kinda annoying since no IDE supports VTL

quiet ice
#

No IDE supports Maven correctly

tender shard
#

well well well

quiet ice
#

It's very strange if you think about it

tender shard
#

VTL is like a weird mixture of "anything" and groovy

#

it's a bit like html+php

quaint mantle
#

hi

#

how do i use Player.sendBlockChange()?

tender shard
#

VTL:

# if($sth== "true")
 <something>asd</something>
#end

PHP:

if($sth == "true") { ?>
 <something>asd</something>
<?php } ?>
quaint mantle
#

the one that takes blockData as arguments.

regal scaffold
#

So alex all the way back to the start of this conversation

quaint mantle
#

and can it be used asynchronously?

regal scaffold
#

Your jefflib has the thing to be able to check the state of the server

tender shard
tender shard
quaint mantle
#

how do i use blockdata?

tender shard
#

Material.DIRT.createBlockData()

#

or sth like that

regal scaffold
#

I'm asking the same thing about jefflib

tender shard
regal scaffold
#

I see the method is ServerUtils.ServerLifePhase

#

Ummm I don't even know how to ask this

tender shard
#

example:

#
    @Override
    public void onEnable() {
        if(ServerUtils.getLifePhase() == ServerUtils.ServerLifePhase.STARTUP) {
            System.out.println("The server is starting rn");
        } else if(ServerUtils.getLifePhase() == ServerUtils.ServerLifePhase.RUNNING) {
            System.out.println("DO NOT USE /reload !!! IT BREAKS STUFF!!!");
        }
regal scaffold
#

But

#

I can't make it run stuff after startup has been called? Because onenable only called once right

#

Like I want to use the world gen on startup then wait until i'm allowed to create worlds and create the worlds

quaint mantle
#

ok can somebody help me with this problem i am having right now?

#
Bukkit.getScheduler().runTaskAsynchronously(ChunkClaimsPlugin.getThisPlugin(), () -> {
            try {

                Player player = (Player) sender;

                World playerWorld = player.getWorld();
                Location playerLocation = player.getLocation();

                int chunkCoordinateX = playerLocation.getBlockX() / 16;
                int chunkCoordinateZ = playerLocation.getBlockZ() / 16;

                Chunk playerChunk = playerWorld.getChunkAt(chunkCoordinateX, chunkCoordinateZ);
                int highestBlockInChunk = getHighestBlockInChunk(playerChunk);
                
                BlockData blockData = outlineBlock.createBlockData();
                for (double i = 0; i < 16; i++) {
                    player.sendBlockChange(new Location(playerWorld, i, highestBlockInChunk, 0), blockData);
                }

                for (int i = 0; i < 16; i++) {
                    player.sendBlockChange(new Location(playerWorld, 0, highestBlockInChunk, i), blockData);
                }

                for (int i = 0; i < 16; i++) {
                    player.sendBlockChange(new Location(playerWorld, i, highestBlockInChunk, 15), blockData);
                }

                for (int i = 0; i < 16; i++) {
                    player.sendBlockChange(new Location(playerWorld, 15, highestBlockInChunk, i), blockData);
                }

            } catch (Exception e) {
                ChunkClaimsPlugin.logInfo(e.getMessage());
            }
        });```
#

basically, just trying to create an outline of blocks in a chunk for a player to see.

rotund ravine
#

Don’t getchunk async

quaint mantle
#

can the rest work async?

#

i am iterating over the height map of the chunk so i am doing this async.

rotund ravine
#

sendblockchange sure

chrome beacon
#

Only the sendBlockChange part is safe to do async

quaint mantle
#

okay

#

wait, what about the heightmap?

chrome beacon
#

No

quaint mantle
#

okay.

upbeat hornet
#

is there a method to get a list of all PersistentDataContainers?

rotund ravine
#

You can get all the keys sure.

quaint mantle
#

?paste

undone axleBOT
upbeat hornet
#

I don't need the keys of a specefic location, I need a list of all blocks (in this case) containing persistentdata

rotund ravine
#

huh?

quaint mantle
quiet ice
rotund ravine
#

I mean, you can get all tilentities

quaint mantle
#

so in the code i pasted, i am trying to make an outline of blocks just above the highest block in a chunk

#

not actually replacing any blocks in the world or modifying any region files

#

but it does not seem to work

#

not even any errors in the console either!

mortal hare
#

I hate graphic design

#

it hurts my brain more than searching for a bug cause

quiet ice
#

Debugging is easy

#

I like debugging.

mortal hare
#

says no one

quiet ice
#

Designing on the other hand, ewwwwwwwwwwwwwwwwwww

upbeat hornet
#

so blockpdc is really just a quick fix for bigger problems :/

mortal hare
#

I dont have a creative vision

#

in my brain cells

quiet ice