#help-development

1 messages · Page 1308 of 1

chrome beacon
#

ouch

#

thought it would be

rare ether
#

if it were my previous code would handle it i think. this one: java final Block block = event.getClickedBlock(); final Player player = event.getPlayer(); final Plot eventPlot; if(block != null) { eventPlot = PlotManager.getInstance().getPlot(block.getChunk()); if(ProtectionUtil.canPlayerAffect(player, eventPlot)) return; event.setCancelled(true); }

#

ill set the event to always cancel just to be sure it isnt issue with detecting

#

yeah cancelling the event with no conditions doesnt do it either

#

ill try cancelling BlockPhysicsEvent

chrome beacon
#

The interact event is the right one

rare ether
#

it may be used for detecting but cancelling doesnt work

chrome beacon
#

And you're testing on Spigot?

#

also is the listener triggering

rare ether
rare ether
sly topaz
#

so, PHYSICAL interaction just isn't triggering is what you're saying

rare ether
#

no well it is

#

but it doesnt seem to correspond to redstone ore lighting up

#

because cancelling it with no conditions at all prevents other things but not this

sly topaz
#

that might just be a bug, though it's hard to say

rare ether
#

maybe thats intented idk, but im just looking for a way to make it work

sly topaz
#

you could cancel the BlockRedstoneEvent

rare ether
#

i already do

#

it only works for certain redstone components like dust, repeaters etc

#

doesnt even work for pistons

#

i mean i do it on a condition so ill try with no condition

#

i forgot its not cancellable lol

#

so no thats not it

sly topaz
#

it might just be that the redstone ore lighting up is a client side effect, but let me check just to be sure

rare ether
#

i m pretty sure that it can be detected by detectors but i didnt bother to check my bad, lemme just check that

#

but i think since 1.13 its server side

chrome beacon
#

Just tested it myself, the effect only shows up for the player walking on the ore

young knoll
#

Doesn’t it involve a state change though

#

It triggers block updates afaik

chrome beacon
#

It desyncs from the client

#

Probably only triggers once on the server but multiple times on the client or smth

#

causing them to go out of sync

sly topaz
#

I wonder if cancelling block physics altogether does anything

chrome beacon
#

probably not

young knoll
#

Probably client prediction then

chrome beacon
sly topaz
#

I don't get what I am supposed to be looking at lol

chrome beacon
#

The ore not glowing after the player standing on the ore

#

It however glowing on the Dummy account

#

since they are on the ore

sly topaz
#

ohh

#

so, yeah it is a client side thing

#

@rare ether sadly there's nothing you can do about it

#

an alternative would be to layer it with a block display of the block so that it never looks lit up

rare ether
#

ill check with a detector now, if its only client side that fine

#

i didnt consider it could be only client side mb

sly topaz
#

the current changes so a detector would in fact detect that

young knoll
#

Current?

#

Nothing should be changing server side when the event is cancelled

rare ether
#

yeah i just checked my code works, its just client side glowing now

sly topaz
#

I mean normally, not when the event is cancelled

rare ether
#

so the playerinteract one is actually the one

#

in the future ill try some packet shenanigans to fix it client side but its find if its just cosmetic, i shouldve looked on the other client im testing this on but i didnt think about it

#

sorry for wasting everyones times lol

#

and thank you guys so much for the help ❤️

sly topaz
#

but as said, you can put a block display on top so that it doesn't loop like it is lit up, if anything

rare ether
#

i think id work but i have an easy way to test that theory

#

give me a minute

sly topaz
sly topaz
#

if other players look at it, it doesn't look lit up

rare ether
#

lemme tell you sth

#

because these are two possible scenarious

#
  1. the block actually gets lit up and everyone gets and update from the server and sees it
#
  1. the effect is just client side, because its just client prediction and server never sent anything
#

right now the second thing is happening

#

HOWEVER

sly topaz
#

both things are happening

young knoll
#

You could probably sendBlockChange to the player to stop it from glowing

#

Probably gotta have a 1 tick delay though

sly topaz
#

though I guess that would revert the state change maybe, worth a try

rare ether
#

i just did an experiment: Player1 triggered the ore to light up. Player2 joined after 15 seconds. both players saw the ore stop glowing in the same exact moment

#

so

young knoll
#

Not it you set it to the unlit state

rare ether
#

there are two options

#

either server sends an information about remaining glow time to the player joining

#

or

#

it sends a packet after the glow effect stops

#

if its the second it should be possible

#

thats why im asking if you're 100% sure @sly topaz

young knoll
#

It’s the later

rare ether
rare ether
sly topaz
#

Player#sendBlockChange to be more specific

young knoll
#

Just do a quick Material.REDSTONE_ORE.createBlockData(), set the lit property to false, and then sendBlockChange the block data

rare ether
#

im just sending the state of the ore after cancelling the event, lemme see if it works

young knoll
#

True, that should work too

#

You’ll probably need a 1 tick delay is my guess

rare ether
#

idk what happened but the detector sees it again lol i broke sth

sly topaz
#
Bukkit.getScheduler().runTask(YourPlugin.instance(), task -> {
 var data = (Lightable) Material.REDSTONE_ORE.createBlockData();
 data.setLit(false);
 player.sendBlockChange(clickedBlock.getLocation(), data);
});
rare ether
smoky oak
#

.

rare ether
#

the client side fix though: event.getPlayer().sendBlockChange(blockBelow.getLocation(), blockBelow.getBlockData()); worked

#

but i still have to think of a reliable method for detecting when the interaction happens, ill try BlockPhysicsEvent maybe

sly topaz
#

wait, didn't the player interact event fire for it?

#

just use that

rare ether
#

i think it fired but PlayerInteractEvent doesn't provide the block for physical interactions according to javadoc

#

so i have a flawed method of detecting it

sly topaz
#

I am not sure what you mean

rare ether
#

check the javadoc

#

you'll understand

sly topaz
#

I do not

#

if PlayerInteractEvent fires for it consistently, then just cancelling it + sending the block change should be good

rare ether
#

okay, and how do i check what block the player interacts with

sly topaz
rare ether
#

no

#

check the javadoc

sly topaz
#

it seems to be

young knoll
#

Where does the javadoc say it’ll be null

#

I only see that for getClickedPosistion

rare ether
#

ill report it cuz the docs should be more clear about it

#

it clearly says in the description that its the clicked block

sly topaz
#

it is the clicked block though, you're clicking the block with your ass pressure

rare ether
#

hahhaha lol hard to argue with that

sly topaz
#

(for those who don't get the joke)

rare ether
#

getClickedBlocks works, why did i even bother writing that detection lol

#

i actually wanna report that because the name is needlessly confusing

#

do i just do that on forums?

sly topaz
#

?jira

undone axleBOT
sullen canyon
sullen marlin
#

Is the issue that you don't click with your ass?

#

I guess it could be getInteractedPosition or something

#

But it's been that way for 15 years

rare ether
#

i think it'd just be great if the description in the doc mention that it also covers not clicked blocks

sullen marlin
#

Yeah that's easy

#

Just put it on jira

rare ether
#

Okay, thanks ❤️

sly topaz
#

didn't think I'd have to explain it lol

sullen canyon
#

🐒

#

ass.

young knoll
bronze robin
#

can i not use placeholders for for skins

#

on fancynpcs

#

and also my deluxemenus dont actually work

#

my warps menu dont do shit

chrome beacon
sullen marlin
# rare ether Okay, thanks ❤️
--- a/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java
@@ -159,9 +159,9 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
     }
 
     /**
-     * Returns the clicked block
+     * Returns the block that was interacted with.
      *
-     * @return Block returns the block clicked with this item.
+     * @return Block returns the block interacted with.
      */
     @Nullable
     public Block getClickedBlock() {
@@ -169,9 +169,9 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
     }
 
     /**
-     * Returns the face of the block that was clicked
+     * Returns the face of the block that was interacted with.
      *
-     * @return BlockFace returns the face of the block that was clicked
+     * @return BlockFace returns the face of the block that was interacted with
      */
     @NotNull
     public BlockFace getBlockFace() {
@@ -180,7 +180,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
 
     /**
      * This controls the action to take with the block (if any) that was
-     * clicked on. This event gets processed for all blocks, but most don't
+     * interacted with. This event gets processed for all blocks, but most don't
      * have a default action
      *
      * @return the action to take with the interacted block

How's this?

rare ether
#

Since the getClickedBlock name is actively misleading a little nudge by saying something like @return Block returns the block interacted with, even if the interaction was not actually clicking on the block or some adnotation with similar meaning is in place imo. But the rest are imo fine because their names do not suggest anything else than they actually do. I really appreciate you making this changes ❤️

sullen marlin
#
    /**
     * Returns the block that was interacted with, even if the interaction was
     * {@link Action#PHYSICAL} rather than clicking on the block.
     *
     * @return Block returns the block interacted with.
     */
    @Nullable
    public Block getClickedBlock() {
        return blockClicked;
    }```
rare ether
#

that's perfect diamond

tawny osprey
#

Hello can someone kindly explain the RegisteredServiceProvider class pleasee

hardy garnet
#

Is manual world saving syncronous?

#

yes right?

stiff mist
#

server is on 1.21.8 when players join in 1.8 scoreboard is on half cant see another half of scoreboard and world on 1.21.8 is mach deaper so when i dig hole for factions base and player form lower version joins can see anything evrythingis black
pics https://postimg.cc/tZ3Zzbbk

#

paying for help

sly topaz
sly topaz
sly topaz
spiral roost
#

I'll give PacketEvents a look, thanks for the tip!

tawny osprey
onyx fjord
#

how does storing PDC look when there's multiple worlds?

#

for the player

#

what i mean is - is it tied to a world or copied over as soon as player travels to a world

#

or kept in one

chrome beacon
#

If you attatch a pdc tag to the player it would be kept when changing world

#

It's tied directly to the players data not a specific world

tranquil oyster
#

Did anyone work with Scarpet? ``` __on_use_item(player, item, hand) -> (
if (item~'id' == 'minecraft:flint_and_steel' && player~'name' != 'Panyel',
(
player~'send_message'('⚠ Only the realm master can use flint & steel to light portals!');
cancel();
)
)
)

sullen marlin
#

sir this is spigot

young knoll
#

Spigot? I thought this was Spanish class

tranquil oyster
mortal vortex
tranquil oyster
#

No i

#

fk. o meant no u

#

Anyway, my bad, I mistook this discord for the admincraft one

#

Have a good kne

mortal vortex
#

have a good kne too brah

worldly ingot
#

Where do these server implementations come from!?

burnt trench
#

Anybody willing to make a Server Software with me (fork), that focuses on performance and stability?

pseudo hazel
#

is there nothing existing that works for your usecase?

burnt trench
smoky anchor
#

well decide, alone or with ppl

burnt trench
smoky anchor
#

Will it be in Rust at least ?

burnt trench
#

Java 💀 its minecraft

smoky anchor
#

"its minecraft" ok and ?

burnt trench
#

If you can make minecraft in rust, ok fine

smoky anchor
#

there are server softwares for Minecraft Java client that are made in different languages

#

anyways I was just making a joke

burnt trench
#

Anybody willing to make a Server Software with me (fork), that focuses on performance and stability?

#

(Language = Java)

#

(DM me)

vast ledge
burnt trench
#

self-made I said

vast ledge
#

Did you read what it is?

burnt trench
#

Im terribly sorry

#

Does it allow paper and spigot plugins tho?

vast ledge
#

No, it says that in the readme

#

Do you understand what "writing my own server" means?

#

If you wrote your own server, paper / spigot plugins wouldn't run either

smoky anchor
#

🥄

vast ledge
#

._.

smoky anchor
#

Best I can do

burnt trench
#

Ima ask it somewhere else

vast ledge
burnt trench
#

facts

#

I may use Minestom

#

But not many people will use it because it had no paper support

vast ledge
#

Yea, if you want a fast and efficient/ private server, you're not na wanna add another layer on top of another server software

burnt trench
#

Facts

#

I will do it

#

Sorry for my messages btw

vast ledge
#

np xD

burnt trench
#

:P

#

welp, if anybody wants to join: DM me :P we use minestom :P

upper cypress
#

If you force an interaction entity to ride the player, could the player interact with it?

upper cypress
grand flint
#

no?

#

its riding u

upper cypress
#

I mean like this

#

If the interactions hitbox overlaps with your LoS

worldly ingot
#

You could try it 👀

upper cypress
grand flint
#

so why u asking

thorn isle
#

i don't remember if you can punch your mount while riding it

#

at a baseline i'd assume yes but i would also understand it not doing that

#

easy way to check; jump on a boat or on a horse and try punching it

#

if the entity is riding on the player on the other hand, i don't see any reason why it wouldn't be punchable

echo basalt
#

here's another way to explain it

#

or in my own words

young knoll
#

Man is talking to himself

mortal hare
#

you wont get anything faster with couple of people than paper which has massive community anyways

#

if you really want performance you need to make your own server with something like minestom

#

which in some cases can give you 10-20x performance gains due to how there's situations when something is not needed in NMS that wont be in there

young knoll
#

?nms

young knoll
#

@tender shard can I copy your old blog post onto the wiki?

rotund ravine
mortal hare
#

honestly tools like skript are not that bad. Its like DSL for bukkit api

#

it costs efficiency but it allows for best stability across server versions and technologies

#

for simple things like chat commands, static guis i think its even better to move the functionality to such DSL's or to datapacks

#

like utility features, since those would be the most stable across server versions the most and those things won't cost as much in terms of performance

#

or for example you could extend skript parser with expressions to support your server core functionality

#

like persistence layers, economies, actions etc

#

that way the game logic itself wouldn't be coded into the game server software itself but in readable format that's easy to port across server versions since those skript files would be linked to proper apis at runtime

#

its actually the same logic as gta does with mission stuff

#

it doesnt actually code those missions into the game code, it has its own DSL to script those things outside of the game core engine

#

for example older gta games had .scm files which carried opcodes for mission stuff

young knoll
#

Pfft, why use skript when you can use JShell

mortal hare
#

because jshell is general purpose, and skript expressions can be domain driven

#

if you hate skript you can make your own DSL

young knoll
#

What’s wrong with general purpose

mortal hare
#

its just that skript has community support

mortal hare
#

with general purpose you can do whatever you want

#

it just simplifies syntax

#

a lot

thorn isle
#

i'll categorize this take in the same folder as "we should all move away from plugins and use datapacks"

mortal hare
#

i just prefer domain specific abstractions (DSL, config files with schema validation) over general purpose ones (API's in general purpose langs)

ivory sleet
young knoll
#

I mean it should in theory be as stable as the Bukkit api

ivory sleet
#

thats pure idealism

young knoll
#

Hence the in theory

thorn isle
#

the one thing skript is good for is quickly rigging up something quick and dirty and terrible for, say, a one-off minigame on short notice

#

even then if you have a decent framework to start with, just rawdogging it with quick and dirty and terrible java is probably going to be faster

ivory sleet
#

i mean maybe for like single threaded, straight forward features like a tp command or something skript would suffice... but anything else you'd quickly be quite limited

#

sure you could do economies, but how do u handle async saving/loading of the data w skript?

thorn isle
#

there's a lot of syntactic sugar and convenient "qol" things like persistent and global variables that make jerryrigging terrible shit easy and fast

mortal hare
thorn isle
#

async saving? who cares

ivory sleet
#

save main thread?

young knoll
#

I would rather use JShell for that

thorn isle
#

the goal is to get it to barely run as soon as possible with as little effort as possible

young knoll
#

Scripts syntax is horrendous to me

#

As someone who is used to more traditional programming syntax

mortal hare
# ivory sleet elaborate

you wouldnt build something abstract like persist variable1 to database but expressions like:

persist player Dovias inventory
persist player Dovias winning status

or if you want something more high level you wouldnt even expose such things in the skript expressions themsleves

thorn isle
#

never would i use skript for anything proper or run it on a production server

mortal hare
#

how the expressions would be interpreted that would be up to server's software

#

having DSL for game actions allows for hotpatching of certain features without restarting the server

#

for example

thorn isle
#

all of my plugins are reloadable

#

if your plugin isn't reloadable it's bad

young knoll
#

Hypixel should make their mini games in skript

mortal hare
#

just like you do websites with components nowadays with tools like react or astro you could build your game logic out of DSL expressions

#

minigames would work really well actually for such case

thorn isle
#

minigames is about the only thing i use skript for

#

it's very convenient

ivory sleet
thorn isle
#

we try to come up with something new every week so writing a skript for it and then tossing it in the trash is quite economical

ivory sleet
mortal hare
#

for example Microsoft have X++ for Dynamics 365 ERP to control things programatically

#

or AWS having lambda expressions

#

the point of DSL that it abstracts the logic out of the software for good that shouldnt suppose to be

#

essentially turning your software into rule engine

ivory sleet
#

ye but like x++ is completely out of scope for game dev

mortal hare
ivory sleet
#

unless its changed last years

mortal hare
#

that's why DYOM mod and Cleo exists

#

for example

#

its not as if those missions are hardcoded into gta_sa.exe executable

#

gta_sa.exe has interpreter for those opcodes and does actions depending on those values from those .scm files

#
IF IS_BUTTON_PRESSED PAD2 RIGHTSHOULDER1
AND flag_create_car = 1
AND button_press_flag = 0
    IF IS_CAR_DEAD magic_car
        DELETE_CAR magic_car
    ELSE
        IF NOT IS_PLAYER_IN_CAR player magic_car
            DELETE_CAR magic_car
        ELSE
            MARK_CAR_AS_NO_LONGER_NEEDED magic_car
        ENDIF
    ENDIF 
    flag_create_car = 0
    initial_car_selected = 0
    button_press_flag = 1
ENDIF
young knoll
#

A lot of games have scripting systems for quests

#

But that’s different from the core game logic

ivory sleet
#

unless there's some terminology im not familiar with here

mortal hare
#

that's just an example
the point of is both are DSL for specific needs

#

X++ was made to control Dynamics 365 software

ivory sleet
#

keyword specific needs

mortal hare
#

.scm was made for controlling missions ingame

#

different domains, different syntax

#

both allow for flexibility high enough to be executed at runtime

thorn isle
#

i spent many years exploring and trying out various solutions to scripting quests

#

among many others, betonquest

#

which is probably turing complete and very flexible

#

but at the end of the day no scripting language is as flexible and robust and convenient than an actual programming language

#

in my current quest framework, everything is declared in java source

young knoll
#

What about both

#

JavaScript

ivory sleet
#

JavaSkript?

thorn isle
#

do we even have a lts way of running javascript in java anymore

#

didn't nashorn kick the bucket?

young knoll
#

KubeJS is a popular mod

#

It uses Rhino

ivory sleet
#

nashorn back in the days

young knoll
thorn isle
#

either way, it's the best architecture decision i think i've ever made; i have type safety and generics, all the benefits of object oriented programming, linting and compile-time-errors and a wide array of things you would have to struggle to get working with a scripting language

ivory sleet
thorn isle
#

and yes this includes abstracted persistence where i just toss shit into a record or a state class and gson magics it into whatever storage medium is configured

mortal hare
#

no one's saying that you should put your data inside .csv lol

ivory sleet
#

not talking about other ecosystems and environments given they require other premises

ivory sleet
#

sure for something simple as a tp command its pretty obvious

#

but economy, that can depend

thorn isle
#

unfortunately perfect foresight is rare to have, so "the server will handle it" only works to handwave the problem to the extent where you're working with incredibly tried-and-tested systems

mortal hare
#

if you know the functional requirement you can base where to draw the line on that

ivory sleet
#

where the line isnt constant

#

business requirements change, tech requirements change inevitably

mortal hare
thorn isle
#

like if you've ever tried to build an api that you have to use in another project, you'll know this problem

#

unless you have perfect foresight, your skript side of things will invariably end up requiring things you weren't able to predict in how "the server will handle it", and now you're weaving between the two to fix and patch this and that and refactor the interfaces and it'll be terrible

ivory sleet
mortal hare
#

what's the deal with skript in this case idk

#

you cant avoid a problem that something is not working as expected

thorn isle
#

even in super battle-hardened systems where the interfaces are very mature and a lot of people before you have already hit those roadblocks hard enough for them to be refactored out, you will often spend a good portion of your time doing workarounds around "the server will handle it" because you happen to need a specific behavior

mortal hare
#

some DSL use their own rule engines

#

some dont

ivory sleet
#

im talking about Skript for the Bukkit API

#

or whatever similar shit

#

Gradle itself is an entirely different story

mortal hare
#

you remove or deprecate those expressions

#

you can avoid this in either case

ivory sleet
mortal hare
#

i've never seen a plugin which has completely stable configuration file across various server versions, neither the DSL would be in such case

ivory sleet
#

skript is not isomorphic to Java

#

so removing/modifying may have to be done if you use skript, meaning full recompilation, but it doesnt have to be the case if you wrote it in java

mortal hare
#

well i've seen one

thorn isle
#

le configurate versioning

mortal hare
#

EssentialsX

#

but damn it is crusty

mortal hare
#

one for quests, one for commands, each for minigame type

ivory sleet
#

I mean sure, that could work

mortal hare
#

in high level syntax sense

#

essentially i've reinvented datapacks

#

but in custom syntax

ivory sleet
#

im just saying skript in particular, since that was kinda what fired the topic

mortal hare
#

and you can modify skript to remove specific expressions you dont need

#

it leaves the hardwork of syntax parsing for skript devs not you

thorn isle
#

the only expression i need is the member reference .

#

everything else is just syntactic sugar

#

which, sure, is nice, but i'm not changing languages just to be able to add to a list with +

ivory sleet
mortal hare
#

on the other side your DSL would already be simple enough to grasp since it would be quite limiting in terms of what it does

ivory sleet
#

that depends on the level of complexity regarding ur DSL

mortal hare
#

the more complexity it has the worse

#

usually

ivory sleet
#

so about gradle dsl

mortal hare
#

well i do hate gradle dsl a bit

#

😄

ivory sleet
#

well its not fair to bring up gradle dsl vs minecraft plugin dsls

#

but yea

mortal hare
#

for example simple dsl for commands (@ symbol means specific argument type, it it doesnt have one its literal, () means positive action, {} negative action, based on that keyword server software searches for a registry with specific action.
actions can be registered via different plugins for example:

  • gui plugin could allow you to register action to server core which opens a gui
  • command dispatcher plugin could allow you to register actions to server core which allow you to execute collection of server commands
pvp @player(pvp_toggle){pvp_player_not_found} @boolean(pvp_toggle_state){pvp_invalid_state}
sly topaz
#

I like what Skript has built in terms of an stdlib, however the implementation leaves things to desire

mortal hare
#

based on those registered actions, command registration plugin scans the syntax and applies the dispatching

#

by utilizing mojang's brigadier

mortal hare
#

minimalistic and extensible

ivory sleet
#

does it compile to jvm bytecode, or does it just compose a set of functional interfaces?

ivory sleet
#

or i mean jvm bytecode is probably not...

#

yea

sly topaz
ivory sleet
#

yea and well... invokedynamic is quite fast

sly topaz
#

it just parses the syntax with a rather clunky parser and then matches it to given expressions/effects/sections/events

ivory sleet
#

makes sense

sly topaz
#

in part that's why it works well, since everything is interpreted, makes for easy hot-reloading and all

ivory sleet
#

rather clunky parser
what is meant by this?

#

like the lexing and parsing is happening in one stage or?

slender elbow
#

I can't imagine parsing English to be very elegant :D

young knoll
#

There’s a version of skript that does compile to bytecode

#

It has a slightly different syntax though, and much less adoption

#

It’s called ByteSkript

sly topaz
#

but it doesn't retain compatibility with OG Skript syntax so it has no adoption, not sure if it works properly either

slender elbow
#

skript could really make use of dynalink

young knoll
#

Just ask chatgpt to update it to support the OG syntax

slender elbow
#

but that also implies compiling to bytecode, albeit it's still very dynamic

young knoll
#

What could go wrong

sly topaz
thorn isle
#

does pressing the drop item key while not looking at your inventory fire the inventoryclickevent with the drop_all/one_slot action?

mortal vortex
#

Just a question I have, might make sense with a pretend scenario: suppose we want to have a command which attempts to perform block modifications over a region, and this is run by regular members, i.e, we should respect claims provided by other plugins. For simplicity, we can analogise this to "WorldEdit for normies".

How would you ensure that every single block within that range, atleast from X, Z (disregard Y, as most claim plugins include alll Y ranges), is modifiable by the player running the command? Of course I am aware you can simulate a BlockPlaceEvent, with bogus data, providing atleast a Player and Location (and awiating its cancellation. - external), but is this really efficient? Iterating over the entire region, and firing an event per block?

eternal oxide
#

fire the bukkit event to change each block and only change if the event is not cancelled

mortal vortex
#

and again, as I asked, is that really the smartest solution?

eternal oxide
#

yes

#

any protection plugin will cancel the event

mortal vortex
#

Right, but you're also iterating over an entire region, which would be O(n), is there nothing smarter?

eternal oxide
#

no

#

you have to ask other plugins if they will allow you to change each block

mortal vortex
#

Alright, sounds about right.

wet breach
#

You need to learn graph math or vector math if you want to take the math approach and this requires no iterrating

mortal vortex
#

🫃

#

that would require me to assume all claims are WG regions, not player-made claims

thorn isle
#

It's either building against specific protection plugins to use optimized queries like whether your edit volume overlaps with a worldguard region, or using generic spoofed events that work with any plugin but perform poorly

#

Generally, building directly against protection plugins is better, but it's good to have the event trick as a fallback that an admin can enable from a config if they have unsupported plugins

sly flint
#

!edit

#

!help

#

!code

smoky anchor
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!

sly flint
#

ok i have Problem

[11:07:37] [Server thread/ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'ExcellentServerManager-2.6.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: net/luckperms/api/node/Node
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:127) ~[paper-1.20.4.jar:git-Paper-496]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.20.4.jar:git-Paper-496]
at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.20.4.jar:git-Paper-496]
at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.20.4.jar:git-Paper-496]
at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[paper-1.20.4.jar:git-Paper-496]
at org.bukkit.craftbukkit.v1_20_R3.CraftServer.loadPlugins(CraftServer.java:507) ~[paper-1.20.4.jar:git-Paper-496]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:274) ~[paper-1.20.4.jar:git-Paper-496]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1131) ~[paper-1.20.4.jar:git-Paper-496]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[paper-1.20.4.jar:git-Paper-496]
at java.lang.Thread.run(Unknown Source) ~[?:?]
Caused by: java.lang.NoClassDefFoundError: net/luckperms/api/node/Node
at java.lang.Class.forName0(Native Method) ~[?:?]
at java.lang.Class.forName(Unknown Source) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:78) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at

smoky anchor
#
  1. paper, I would advise you go to their discord
  2. do you depend on Luckyperms in your plugin.yml ?
  3. please tell me you do not have 1.6k lines long class
young knoll
#

Oh boy

#

Who doesn’t love a nice god class

quaint mantle
#

Is this a good way to check if two block locations are adjacent?
locationA.distanceSquared(locationB) == 1.00d

#

I couldn't find a built-in method on Bukkit api

wooden bay
#

Use Manhattan distance (sum of axis differences)

quaint mantle
#

you are right lol. I already had that method somewhere and forgot about it

#

return Math.abs(a.getX() - b.getX()) + Math.abs(a.getY() - b.getY());

young knoll
#

Don’t forget the Z

quaint mantle
#

I don't need the Z in my particular case, but thanks for reminding me. It's for stuff on a 2D plane

wooden bay
#
    public boolean areAdjacent(Block a, Block b) {
        return (Math.abs(a.getX() - b.getX()) +
                Math.abs(a.getY() - b.getY()) +
                Math.abs(a.getZ() - b.getZ())) == 1;
    }
#

This should work

quaint mantle
#

it's called Manhattan distance because of taxis 🚕 lol. it's fun

sharp dagger
#

Hello, is there a way to update or set water to not flow just in one direction, but be able to flow in other?
For example I have this code:

    @EventHandler
    public void onBlockFromTo(BlockFromToEvent e) {
        Island island = ((IslandStore)plugin.getIslandStore()).get(e.getToBlock().getLocation());
        if(island == null || !island.isIn(e.getToBlock().getLocation())) {
            e.setCancelled(true);
        }
    }

If I place water on the edge it calls this function just once and will not flow in other directions where it could flow?

sly topaz
#

what you can do is probably is place barrier blocks in the server side so it flows the way you want and send block changes to the players so they don't notice these are there

#

not ideal, but that's probably what you'll have to do

#

it is either that or directly modifying the server logic that deals with that, which wouldn't be easy on Spigot

thorn isle
#

It might almost be easier to toss out the vanilla water flow logic altogether and manually place blocks to create "flow"

#

But unless you really need this for some reason, I wouldn't bother, it will be super involved one way or the other

grand flint
#

wait how do u place a lower water block

#

is that a block property

thorn isle
#

I do kind of want to recreate terraria style water logic at some point

grand flint
#

or are they seperate blocks

thorn isle
#

Yes, it's a block property ranging from 1 to 8 iirc

#

Bubble columns are separate blocks, for whatever reason

grand flint
#

lmao what

#

gnore me

thorn isle
#

It can exist without magma or soul sand yes

grand flint
#

no i asked

#

if it could exist without that

#

seaweed in it

#

but then i forgot

#

u only place the seaweed

#

to turn it into a source block 😭

thorn isle
#

I'm not really aware of any association between weed and bubbles

grand flint
#

yeah ik there isnt any

#

yk when u place the water at the top

#

and let it go down

#

but then u place seaweed

#

all the way to the top to convert all the water into source blocks

thorn isle
#

Haven't heard of it but yeah that probably works

grand flint
#

how do u make ur water elevator

#

place the water one by one?

thorn isle
#

Waterlogged blocks can't tell apart source and non source blocks

#

I don't remember

#

Probably

grand flint
#

u put water at the top

#

it flows down

#

then u climb up with seaweed

#

which turns it into a source block

#

after u break the seaweed

thorn isle
#

I think I last played the game before waterlogging was a thing

#

But that makes sense yeah, sounds much easier

grand flint
#

seaweed is always underwater though

#

wait can u place seaweed without water

thorn isle
#

Seaweed was added in the same update as waterlogging

#

I don't think it has a not waterlogged state, no

sharp dagger
# sly topaz what you can do is probably is place barrier blocks in the server side so it flo...

I tried to do this, but it seem to not work. Barrier is set, but I want for player to instantly send packet that there is air. For some reason it does not work:

        BlockState blockState = block.getState();
        blockState.setType(Material.BARRIER);
        blockState.update(true, true);

        loc.getWorld().getNearbyEntities(loc, 20, 20, 20, entity -> entity instanceof Player)
                .forEach(player -> ((Player) player).sendBlockChange(loc, Material.AIR.createBlockData()));
sly topaz
#

as for the block change, I got no idea, maybe it is because it happens at the same tick?

sharp dagger
#

Entity::getTrackedBy will not work, because I don't have an entity 😄

#

Also is there no way to set block server side without sending to player?

sly topaz
#

I had assumed you were doing this in front of some player but yeah

sly topaz
sharp dagger
#

Will try that

sly topaz
sly flint
sly flint
left jay
#

hey so can someone help me figure out why this runnable task in this class that sends a message when a player is blocking only triggers when a player is looking at a block?
https://pastes.dev/3kUcQalFSI

mortal vortex
#

isBlocking implies there is something in front.

#

otherwise, could you not use interact event

left jay
#

or ig i should say not in the scope of the class

young knoll
#

You don’t have to look at a block to block

mortal hare
#
#show heading.where(level: 3): it => {
  if it.numbering == none {
    return it
  } else {
    let (body, numbering, level, ..args) = it.fields()
    let content = heading(
        ..args,
        numbering: none,
        level: 2,
        outlined: true,
        text(counter(heading).display() + " " + body, size: 1.333em)
    )

    block(spacing: 1.5em, content)
  }
}

man this is such a smart hack

#

it converts markdown typst headings:
###

into:
##, but leave styling from ### heading, meaning that table of contents will behave as heading is TOC level 2 when actually TOC level 3 heading was typed. neat

#

basically operator overloading but in markdown 😄

left jay
somber tusk
#

Hi, I have used Spigot Buildtools to download spigot file and added it to my Eclipse external libraries in Java Project. I can not import org.bukkit.plugin.java.JavaPlugin;
What should I do now (Im on version 1.21.8 - JDK 21)

sullen marlin
#

Did you add spigot-api

eternal oxide
somber tusk
somber tusk
#

i think im missing the shaded spigot api

eternal oxide
#

If you are using external libraries in Eclipse you do not need the API

somber tusk
eternal oxide
#

You built Spigot with Buildtools so you should have the full fat jar

#

but you only really need the API

#

Is there a reason to not use Maven? It would make life so much easier

eternal oxide
#

?maven Create a new Maven project in Eclipse, then follow the instructions.

undone axleBOT
eternal oxide
#

Spigot itself is a bootstrap jar so should not be used as a dependency

#

?bootstrap

undone axleBOT
#

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

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

somber tusk
#

May I ask. Where can I download spigot api

eternal oxide
#

Spigot/Spigot-API/target/spigot-api...

#

in the folder you ran buildtools

somber tusk
#

Oh okay, thank you so much

fading cairn
#

Hello, I want to create my first Java plugin using the Maven extension in Visual Studio Code. I haven't used Maven before, and the documentation seems insufficient. Where should I start?

mortal hare
#

honestly no one i think apart form maven packaging devs knows how it works from end to end 😄

#

you mostly go to maven central repository on the internet, search the package you want to and copy the xml configuration declarations inside your own pom.xml

#

unless you're working on some kind of CI/CD pipeline or custom packaging there's usually no need to configure it thoroughly

#

everything mostly works automagically

#

you just tweak some xml tags sometimes and thats it

drowsy helm
fading cairn
#

@mortal hare @drowsy helm
So, should I use Visual Studio Code or IntelliJ IDEA? Code completion is great in VSCode.

drowsy helm
#

IntelliJ

#

It’s much better suited for java

#

But you can get away with vscode

#

At the end of the day it’s just a preference thing, IJ just has a lot more java specific tools

hybrid spoke
wet breach
#

md_5 and myself use netbeans 🙂

pseudo hazel
#

or eclipse

#

💀

hybrid spoke
#

my personal favorite is the text editor

pseudo hazel
#

notepad all the way

#

or google docs, just like how they do at google

mortal vortex
#

damn neovim is enuff

mortal hare
mortal vortex
#

works for me dawg

mortal hare
#

im not questioning if it works

#

im questioning the brittleness of the configurations across version upgrades

#

i use vscode just because extensions and lsps are primarily designed for it

mortal vortex
#

Tbh I only installed one lsp and thats it

mortal hare
#

meanwhile LSP in neovim are just ports of vscode ones which might be not fully compatible

mortal vortex
#

Yuhp

slender elbow
#

wonder if it'd be possible to back that with jetbrains' intellij engine somehow

#

i mean possible yes, but the wiring is probably bleh

mortal vortex
#

literally skin intellij until its just bones

#

remove GUI

#

slap nvim on top

slender elbow
#

yeah I mean that's how they made Fleet, the engine is its own module, but the wiring is the fun part because it doesnt use standard lsp protocol

fresh coral
#

looking for a dev that knows what theyre doing and has time

slender elbow
#

protocol protocol

mortal vortex
#

But thanks.

fresh coral
#

no other channel with developers activly chatting

mortal vortex
#

Ok and?

#

What makes you think this is a place to recruit people?

mellow edge
undone axleBOT
rough drift
fading cairn
#

As a student, I have a Copilot Pro subscription. It predicts and displays the code I want to write in Visual Studio Code. Does it do this in IntelliJ IDEA?

chrome beacon
#

That does exist in IJ as well

#

I don't really recommend using that though

fading cairn
thorn isle
chrome beacon
fading cairn
thorn isle
#

there is a copilot extension for intellij iirc

fading cairn
#

After learning about class structures in C#, I will try to write my own plugin. After all, they work on the same logic in all languages.

thorn isle
#

that said yeah i'm not sure if learning with copilot is the best idea

fading cairn
thorn isle
#

programming is like 10% knowing the language and 80% being able to research the libraries/frameworks you have to work with

#

copilot entirely does away with the latter

fading cairn
#

I last wrote my helloworld command in 2016 using Eclipse. 🤣

#

I was a little kid back then, I didn't understand.

worldly ingot
#

It's better to learn the language without any tool assistance. Shouldn't really be using AI unless you can write all the code it's capable of generating to make your life faster

#

I only started using AI in the last like 9 months or so after 10 years of writing the code on my own

fading cairn
#

The area where I use Artificial Intelligence is very limited. I only use it when I get stuck on errors.

#

After learning about class structures, I will try writing plugins with IntelliJ IDEA.

thorn isle
#

be sure to ask it to actually explain out the errors in depth rather than just tell it to "fix the errors"

fading cairn
#

Basically, a Hello World, then I'll test the authorization system. I'll open the menus and such.

#

I'm asking about the problem. I activated Copilot Pro a few days ago. I haven't opened my membership. 😅

thorn isle
#

asking an actual person is probably still the best option but an ide-integrated ai is definitely easier to communicate with, since it'll see your project and the errors without you having to pastebin everything

fading cairn
#

My main field is 3D and CGI. But I still have a lingering interest in writing plugins for Minecraft.

quaint mantle
smoky thunder
#

Hello, I added support for nexo to the plugin, and since then I've been getting this message. Can you advise me on how to fix it?

thorn isle
#

add this to your repositories

worthy yarrow
#

Also that’s not nexo

thorn isle
#

i searched for "byteflux libby bukkit maven coordinates" on google, in case you want to try and solve future similar errors on your own

worthy yarrow
#

I searched up “why does the unresolved dependency error occur when compiling my project in IntelliJ” kek

lime mauve
#

Why is Java so hard without an ide

grand flint
#

Well all languages are mostly like that

#

lua and python has less keywords for example they would be easier

quaint mantle
#

Nobody memorizes them

dry hazel
#

import module java.base;

#

🙏

worldly ingot
#

Just import all modules. Problem solved

somber tusk
#

can someone help me pls. I added the spigot api jar but I cannot import JavaPlugins

sly topaz
#

anyhow, are you using maven/gradle or just the IDE's classpath functionality?

somber tusk
sly topaz
somber tusk
#

okay I will try

sly topaz
#

as for your current issue, I am not familiar with Eclipse's build system features so I can't really help much in that regard, but if you do end up using gradle then we can go from there

somber tusk
#

ty ❤️

old flicker
#

I am having a really strange issue that I cannot pinpoint. On my 1.21.1 test server, this code works fine and has worked on production in the past.


            if (clickedItem.getType() == Material.TNT) {

                kitsSelected.add(p);
                p.closeInventory();
                kitsSelected.remove(p);

                ItemStack stone = new ItemStack(Material.STONE, 64);
                ItemStack tnt = new ItemStack(Material.TNT, 32);
                ItemStack wind = new ItemStack(Material.WIND_CHARGE, 3);
                ItemStack slab = new ItemStack(Material.SPRUCE_SLAB, 4);
                ItemStack redstone = new ItemStack(Material.REDSTONE, 16);
                ItemStack lever = new ItemStack(Material.LEVER, 4);
                ItemStack bread = new ItemStack(Material.BREAD, 16);

                p.getInventory().addItem(bread);

                p.getInventory().addItem(new ItemStack(Material.TRIDENT));
                p.getInventory().addItem(wind);
                p.getInventory().addItem(new ItemStack(Material.WATER));
                p.getInventory().addItem(new ItemStack(Material.IRON_PICKAXE));
                p.getInventory().addItem(stone);
                p.getInventory().addItem(tnt);
                p.getInventory().addItem(new ItemStack(Material.FLINT_AND_STEEL));
                p.getInventory().addItem(slab);
                p.getInventory().addItem(redstone);
                p.getInventory().addItem(lever);

                p.getInventory().setHelmet(new ItemStack(Material.IRON_HELMET));
                p.getInventory().setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE));


            }

But, though I am getting fully working results on my test server: only 3 of the items in the code are actually given on the production server, also running 1.21.1 (with viva version for 1.21.8 clients). And its only this kit in particular, the others work as intended.. the others are identical code and work flawlessly.

#

im not sure if its the way my production server is setup that is affecting this or if there is something I am missing

#

I know on production it gives trident, pick axe, and wind charges as the three items.. not sure about the armor

#

OTHER KITS have a lot of these items that are not being given here...

#

im actually so lost and shocked that this is happening

chrome beacon
#

yeah that's not something we're going to able to diagnose from that

#

but what I can note is that you should avoid calling close inventory in the click listener

thorn isle
#

at face value this should work but you probably knew that already

old flicker
#

Yes it absolutely should. I am not sure how to go about diagnosing and fixing this issue.. maybe try naming the kit differently or changing the order of the items? but it doesnt make sense why it works on my test server and not production

thorn isle
#

print the inventory contents to sysout in between each add, and then maybe a tick later

#

ideally plug the thing into a debugger and see who's messing with the inventory but that might not be good on a production server

chrome beacon
#

Making a copy of prod and debugging there is an option

thorn isle
#

yeah that's the big guns

chrome beacon
#

Could start by making sure that it's not just client server desync

old flicker
#

eg. heres a working kit for anyone who might have a better idea with the why .. that stuffs always interesting to me:


            if (clickedItem.getType() == Material.IRON_CHESTPLATE) {

                kitsSelected.add(p);
                p.closeInventory();
                kitsSelected.remove(p);

                ItemStack bread = new ItemStack(Material.BREAD, 16);

                ItemStack stone = new ItemStack(Material.STONE, 64);

                p.getInventory().setItemInOffHand(new ItemStack(Material.SHIELD));
                p.getInventory().addItem(new ItemStack(Material.WOODEN_AXE));
                p.getInventory().addItem(stone);
                p.getInventory().addItem(bread);
                p.getInventory().addItem(new ItemStack(Material.WATER_BUCKET));
                p.getInventory().addItem(new ItemStack(Material.IRON_PICKAXE));
                p.getInventory().setHelmet(new ItemStack(Material.IRON_HELMET));
                p.getInventory().setChestplate(new ItemStack(Material.IRON_CHESTPLATE));
                p.getInventory().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));
                p.getInventory().setBoots(new ItemStack(Material.LEATHER_BOOTS));
            }

Anyways thanks for the help!

thorn isle
#

btw you can just do p.getInventory().addItem(new ItemStack(Material.STONE, 64)), there's no need for the random intermediate variables

worldly ingot
#

Even better, #addItem() takes varargs

player.getInventory().addItem(
    new ItemStack(Material.WOODEN_AXE),
    new ItemStack(Material.BREAD, 16),
    new ItemStack(Material.STONE, 64),
    new ItemStack(Material.WATER_BUCKET),
    new ItemStack(Material.IRON_PICKAXE)
);
short pilot
#

does anyone have code snippet or examples of how to shoot a ton of fireworks (randomized, like a celebration)

worldly ingot
#

Could break down the problem into parts which should make this problem easier:

  1. You need a min/max point to generate a random x/y/z for your firework's position
  2. You need a list of colours you want to randomly select from (one for the fade, one for the firework)
    a. Optionally, you can select multiple colours. Up to you
  3. You need a list of patterns you want to randomly select from
    Put those all together into a FireworkEffect.Builder and you're good to go
fallen elbow
#

is there any dutch developer here who i can contact?

quaint mantle
#

?services

undone axleBOT
misty ingot
#

is there a way to send fake packets for a bunch of blocks to the player at once or something?
i have a full region which i want to swap out for fake blocks for a player and i think looping through each x,y,z might not be the best way

thorn isle
#

there's sendBlockChanges on paper at least, i think it also exists on spigot

#

on either world or player, i don't remember

#

probably player since they're spoofed only for a specific player

chrome beacon
#

Player#sendBlockChanges does exist in Spigot

misty ingot
#

it requires a Collection<BlockState>
so to get all the blockstates do i still just go through every x,y,z? (but then the packet is sent only once, at the end)

worldly ingot
#

Yes

misty ingot
#

well damn

worldly ingot
#

It may still send multiple packets - in fact it probably will - but it will send less

#

But computers are good at iterating over numbers. You should be fine

misty ingot
#

i tried doing this async and that didnt exactly go very well either

worldly ingot
#

Yeah, async world reads aren't perfect. That's the reason we have chunk snapshots

misty ingot
#

well yeah computers are pretty good at numbers but what about a large number of players?

#

thats my primary concern with it being sync

#

actually, thinking about it, i dont think a few hundred players will do that much

quaint mantle
#

sending the packet should be async

quaint mantle
misty ingot
#

i am running it sync but even then its giving me this error

[18:29:14 WARN]: [HypingKOTH] Global task for HypingKOTH v1.0-BETA generated an exception
java.lang.NullPointerException: Cannot read field "captureTreeGeneration" because the return value of "net.minecraft.world.level.Level.getCurrentWorldData()" is null
Collection<BlockState> blocks = new ArrayList<>();
for (int x = region.getMinimumPoint().getBlockX(); x <= region.getMaximumPoint().getBlockX(); x++) {
  for (int y = region.getMinimumPoint().getBlockY(); y <= region.getMaximumPoint().getBlockY(); y++) {
    for (int z = region.getMinimumPoint().getBlockZ(); z <= region.getMaximumPoint().getBlockZ(); z++) {
      if (region.contains(BlockVector2.at(x, z))) {
        Location loc = new Location(hill.getWorld(), x, y, z);
        if (loc.getBlock().getType() != Material.AIR) {
          blocks.add(loc.getBlock().getState());
          loc.getBlock().setType(material, false);
        }
#

i ran it async then realised i cant (it was giving me the same error) so i made it sync and im still getting it

quaint mantle
#

Is world where region is from loaded?

misty ingot
#

a player is standing inside the region

#

and the region is quite small

fickle spindle
#

It's better if i divide the code in functions for example for the

p.sendMessage(ChatColor.translateAlternateColorCodes('&', m));

i make a function to something like that:

        p.sendMessage(ChatColor.translateAlternateColorCodes('&', m));
    }```
or that i leave the code as the first one?
#

I'm not saying that only for messages and stuff for like getting stuff in the config so that the code can look cleaner and that it's "easier" to reach faster something that i usually need / use

plush vortex
#

you should use HEX instead of normal &

thorn isle
misty ingot
#

the problem is solved now, i was using the wrong scheduler

short pilot
#

what's an efficient way to place schematics into a set place?

#

I assume it'd have to be nbt format but idk

thorn isle
#

depend on fastasyncworldedit and use it to paste the schematic

#

no point in reinventing and maintaining an incredibly hacky nms wheel

#

or i suppose more ideally, depend on worldedit rather than fawe, so server admins have the option to choose between the slow but reliable worldedit or fast but hacky fawe

young knoll
#

I mean it’s not actually that hacky when using NMS

#

The game has a built in method to load an NBT file, then you just need to parse the data

thorn isle
#

well yes but async this and that is always hacky

young knoll
#

?

wet breach
#

also if you are running the server or not

short pilot
#

i assume there's a way to do it within the api itself with nbt files (?)

#

maybe worldedit has api that supports it i dunno

wet breach
#

you will need to parse the NBT data yourself from the schematic and then set the block data using the API

young knoll
#

The api can use the vanilla structure format to do it, yes

#

But not the schematic format

wet breach
#

its not that hard to parse schematics

#

nor is it even slow

short pilot
#

would schematic format be better

wet breach
#

depends on you and your needs

#

personally I don't mind schematics

young knoll
#

They’re smaller

#

That’s basically the only difference

wet breach
#

wouldn't say the only difference

young knoll
#

Well, easier to make too I suppose

#

Structure blocks can only export 48x48x48

wet breach
#

schematics can't save some things if I recall unless you make a custom version, but structures can essentially save all data

young knoll
#

Though I believe fawe can export to the vanilla format for any size

short pilot
#

i just have a small structure i'd like to paste using a command im coding

#

but have like 0 knowledge on how to or which libraries can help

wet breach
#

well then I probably wouldn't worry about efficieny

#

and just worry about coding the ability to do the thing you want 😛

short pilot
#

(trying to make a minigame; although maybe just having a structure block in the world and pasting to reset the stage would be way easier)

wet breach
#

efficiency doesn't matter if you can't even get something working you know >>

wet breach
wet breach
#

delete the world the minigame is in, reload said world

#

the lobby of the minigame is the default overworld

#

minigames or game is a separate world that you can unload, remove and then paste the master world and then load up

#

and now everything is reset and you didn't have to mess with any pasting

short pilot
#

hmm

#

oop intent isnt to reset between games

#

it's to reset stage between rounds

#

within a singular game

wet breach
#

same concept

#

you just use a different room in the lobby world

#

so they appear as if they are somewhere else

#

or you could just use a different world for that too

#

used to run something like 100 minigames at a time per server

short pilot
#

hmm i see

#

im trying to minimize the amount of change that happens from the players' side so it appears smooth

wet breach
#

also breaking it up like that also allows you to run the minigames and the lobbies on different servers too

short pilot
#

hmm

wet breach
#

IE scaling becomes easier

#

players don't really care if they get teleported

#

as long as the teleporting isn't taking like 5 minutes lol

#

and given the recent updates its easier to transfer players between servers as well

#

or well its more native

short pilot
#

am pondering

wet breach
#

also minigame worlds are extremely small, probably no more then a few megabytes lol

#

which is also nice because you can stuff these worlds into a database

short pilot
#

ah

wet breach
#

well to get them small you have to prune the excess world to what you need

#

but the nice thing of having them in a database is that it didn't matter where the servers were located they always had access to the worlds and the data needed for them 🙂

#

so no worrying about accidentally deleting files from some MC directory 😛

#

We know a thing or two because we have done a thing or two here, anyways there is a lot of options at your disposal

short pilot
#

yus

#

is there any victory code i could peek at for minigame ending celebrations

#

fireworks/particles/sounds when someone wins the game

wet breach
#

someone here might have something

#

I don't have any of that stuff, or at least publicly available

short pilot
#

right now i just randomize all the effects which leads to varried results; idk if i should just hard code how the fireworks spawn

wet breach
#

just make everyone dance

#

shouldn't be that hard with display entities and armorstands etc lol

round finch
#

Hi people

I'm trying to help someone with world generation but I don't know entirely know how Minecraft vanilla handles chunks with trees and structures

thorn isle
#

do you have a question

fading cairn
#

@chrome beacon@thorn isle@wet breach@hybrid spoke

Firts Plugin 🥳

thorn isle
#

use intellij

#

vscode is garbage

fading cairn
fading cairn
#

I wrote the plugin in the picture.

#

It is currently working

thorn isle
#

looks pretty much alright, only nitpick i have is that coreCommands should be CoreCommands; java classes are always UpperCamelCase with a capital first letter

hybrid spoke
fading cairn
hybrid spoke
#

ohh, i didnt remember! nice, keep it going!

fading cairn
#

😊

wet breach
#

nice

#

on my phone thought it said flirts

#

and was like, oh, who is this spamming a flirt plugin

fading cairn
wet breach
#

well there was a spammer earlier today so I was thinking there was another person spamming but just pinging people XD

thorn isle
#

i'm glad the marriage plugin fad is all but dead

round finch
grand flint
#

but same chunk generation

#

if i find it ill send it to u

round finch
#

I see you command class mb

sullen marlin
young knoll
#

Is that like

#

Minecraft beta 1.0

round finch
#

some of it is taken by bukkit / fork

young knoll
#

The way the modern game handles it is by doing population for a chunk once all 8 neighbour chunks have been generated

thorn isle
#

chunks at the decoration stage can write to adjacent chunks at a lower generation stage

young knoll
#

Not back then :p

thorn isle
#

e.g. if a tree generates at the edge of the chunk, it will write those leaves and suchlike in the adjacent chunk the tree crosses over into

#

once the blockpopulator stage for the adjacent chunk runs, it will see those blocks and not spawn a tree or any other decoration that would conflict with them

#

strictly speaking this makes chunk generation non-deterministic and dependent on chunk generation order, but what can you do

oblique furnace
#

I am currently working on a plugin, that has custom helmets. How can I make the helmet have a armor trim?

grand flint
#

Do that first I'll respond with the rest later 🙏

oblique furnace
#

So you need to create an extra texture pack for that???

plush vortex
#

For custom items yeah

#

Unless you use default minecraft stuff you need a texture pack

#

iirc

grand flint
#

How else would you make your custom helmets

#

If you are asking how to apply an armor trim to a vanilla helmet it would be

#

i think its with ArmorMeta

#

yeah there look set trim

oblique furnace
#

Ok, change of plan😅 . Can I connect a texture I made (its a crown btw) with a specific (netherite) Helmet you can't obtain in survival(/without the plugin)?

#

And if yes, how can I do it?

grand flint
#

ofc u cant ❤️

oblique furnace
#

If I have a cool idea it obviously doesnt work -_-

quaint mantle
#

You could spawn item display crown when player is wearing the "special" helmet

grand flint
#

are u silly 😭

#

(without the plugin)

#

he wants it in vanilla survival

quaint mantle
#

Command blocks/Data packs 🗿

grand flint
#

eugh

#

he said in survival btw

#

thats creative

quaint mantle
#

Yeah then no way

oblique furnace
#

No, I want to do it with a plugin😅

#

The Item shouldn't be able to be obtained in vanilla without commands

#

So players dont get an item with a crown texture without it being a crown

grand flint
#

yeah so just use the custom model data or item model of the item

#

then give an item with that item model with a command

#

players cant het it

zealous scroll
#

afaik, with 1.21.5, itemstacks in packets are now hashed to cut down on duping and desync. I can't remap items from incoming client packets because I can't read the item data, haven't figured out how to fix this in a week, any ideas?

plush vortex
zealous scroll
#

a test snippet i made:
https://gist.github.com/braulio-dev/6595c19ecdbbe9d812471558b40c5dda

basically im making a packet-based item system, which just serializes a custom item type's ID and the item's individual data into its PDC and then re/maps it on packet events so lore, item name, attributes, etc can all be updated in real time. this also allows for a pretty neat versioning system and reduces the need for backpropagation for items that are 'outdated'

grand flint
#

or just update the item when the user interacts w it 🙏

zealous scroll
#

this implementation worked in 1.21.4, but in 1.21.5 items are hashed and i can no longer map them back to their 'original' state that the server holds.

server -> maps item ✅ -> client receives -> client sends packets -> remaps items ❌ (this doesn't work anymore, because the item sent by the client is hashed) -> server receives

grand flint
plush vortex
#

cache the item and then use the cache when processing the clicks

#

i guess

zealous scroll
#

just amount, type, and components added/removed (not useful)

plush vortex
#

yeah idk

#

wtf lol

#

cache the slot contents BEFORE you send them
then use the slot index from the packet to look up the item that you cached

since mojang made it like area 51 i think the only work around is you keeping the data alive and then use it

#

other than that idk

echo basalt
#

do any of you nerds have experience with nms containers

#

for some reason dragging looks weird and it tries to pick up items for a tick

remote swallow
#

that menutype guy thats no longer here might

echo basalt
#

removing a sendAllDataToRemote fixed the weird behavior

#

I wonder how much this is gonna suck

outer ember
#

How can i do a thing to all players in 10 blocks arround a pos?

eternal oxide
#

a thing

outer ember
#

and how to add a api LIKE WORLDEDIT to my project

dawn summit
#

Could someone help me? On my server, I have a ping of 90, but when I enter survival mode, it goes up to 9000. This only happens in survival mode. There's no problem in the lobby.

fickle spindle
#

i've multiple message that i want to send on different line it's better to do x p.sendMessage or there is a better way of doing it?

real crater
#

Can someone help me create a plugin that links different attributes

plush vortex
sly topaz
plush vortex
oblique beacon
#

My account has been compromised and my email address has been changed, so I can't handle this myself.
Where should I contact the administrators?

mortal vortex
#

?support

undone axleBOT
mortal vortex
#

@oblique beacon

#

email

oblique beacon
#

Thank you

oblique furnace
#

I have a plugin, that has crowns(netherite Helmet with Protection 5) but somehow it didn't show any armour points. I believe it gives armour tho.

smoky anchor
#

Do you mean it doesn't show the blue text on bottom
But still gives you armor points when you equipt it ?

mortal vortex
#

or do you mean it doesn’t show the chest plate icons?

thorn isle
#

applying any custom attributes to an item removes its default attributes

#

if you're on paper, you can check with /paper dumpitem

mortal vortex
#

didn’t you tell me a minute ago you found a dev?

cerulean cave
#

yeah

#

sorry

#

i forget

#

he was offline so i thoguth he left

wet breach
#

seems their memory is low and thus they can only remember limited things

young knoll
#

Offline = gone

#

It’s like when you hide the lollipop behind your back from a toddler and they think it’s gone

mortal vortex
wet breach
mortal vortex
#

it’s not.

#

2.3 trillion dollars really went missing.

wet breach
#

you are misrepresenting a speech that happened a day before 9/11. The 2.3 Trillion dollars didn't just disappear as in like it vanished. What was being referred to was that the accounting of 2.3 trillion was lost through undocumented transactions, outdated systems and the sorts

#

but I don't expect non-citizens of the US to actually know this and just misrepresent or misquote stuff all the time

young knoll
#

No no

#

We aren’t doing a 9/11 argument here

mortal vortex
wet breach
#

I am referring to the 2.3 trillion dollar thing

mortal vortex
#

Your wording reads exactly like the Reuters page

#

“Misrepresentation”

wet breach
#

because you are misrepresenting the facts and trying to say something happened that didn't

mortal vortex
#

I’m completely aware that it really happened like a year prior. And it wasn’t money that went missing suddenly, it was a statement of like decades of untraceable funds.

#

I’m just fucking around

#

Plus there is already way more viable counter arguments for 9/11 other than just the 2.3 trillion thing.

eternal oxide
#

Patriot act

wet breach
#

what about it?

mortal vortex
#

someone speaking facts

mortal vortex
#

Like yk how whenever congress wants to ban a firearm modification, like idk a supressor, there’s suddenly some kind of shooting involving that EXACT modification so they can skew voters into agreement.

wet breach
mortal vortex
#

that was an example.

#

I don’t know if it’s congress or what but you see these legislators get together, talk about how they wanna ban sometging and then suddenly there’s a real case, and it gets banned.

wet breach
#

you mean state representatives and you are referring to states banning something. Completely different then congress. States have their own legislative systems in which they can pass laws on stuff for their state.

mortal vortex
#

Like the luigi mangione ghost gun. How the body or, some portion of it was 3D printed. Right after there was a bill put forth to ban ghost guns.

wet breach
#

So California for example, can ban something, but it doesn't mean its banned in the other 49 states

mortal vortex
#

Yeahhh

mortal vortex
#

Federally?

wet breach
#

yes

mortal vortex
#

oh we in the wrong channel 😭

wet breach
#

You can not assemble or produce a weapon without a gunsmith license and weapons must all have a serial number on them and reported

#

that has always been the federal law since a very very long time, well before 3d printing was ever a thing lmao

mortal vortex
#

Oh right

wet breach
#

If there was anything that was done, was that the law that existed was broadened to specifically ecompass 3d printed weapons to ensure someone couldn't use 3d printing as some kind of loop hole which it never was but just in case

wet breach
#

which requires a federal prosecutor who is not the same person as the state prosecutor

#

IE, federal prosecutor could technically choose to not try the case even though the state wants that to happen

#

therefore, state law that mirrors federal one so that you can be charged under state law

mortal vortex
#

oh

#

Erm can we switch back to 9/11. that’s something I can actually regurgitate 4chan conspiracies on much easier.

wet breach
#

It just so happens not a whole lot of states actually had a lot of state laws on this matter

thorn isle
mortal vortex
#

YAYYYYY

main juniper
#

Anyone know how to properly fetch a users total payment (spent amount) amount from the tebex api, been trying for a few hours and keep getting met with 403 error.

#

I've read their docs, and so far I have still had no luck

wet breach
#

otherwise its good that you are getting forbidden message

main juniper
#

???

wet breach
#

if a user buys something from you, you should have the payment amount sent to you right?

main juniper
#

no duh, however I am working on a plugin showing tebex logs, and history for server admins

wet breach
#

so keep track of that yourself

#

not sure what is hard here

main juniper
#

I mean I could but wouldnt it be easier to not store all that data, and have the tebex api that can do it, do it itself?

wet breach
#

obviously it won't let you

main juniper
#

Stored data like that can be manipulated

#

I dont want that as an option

wet breach
#

manipulated by who?

main juniper
#

Are you slow?

wet breach
#

then I guess you just suck at security or you are worrying about something above your station

grand flint
main juniper
grand flint
#

When a purchase is made

wet breach
#

They don't want to store said data because someone with magic access will manipulate it

grand flint
#

its fine maybe he is just better than us

wet breach
#

Anyways the proper way to do this, is you have a service that pulls the data or stores it whenever it recieves it and puts in the DB

#

no one should have ssh access or the sorts, but even if they do you can make it so they can't alter with that

#

you make another user for the DB that can only read but never modify

#

this is the user you use if you want to read the data and thus ensuring it can't be manipulated

#

again as I said either you suck at security or you are worrying about something above your station

wet breach
sly topaz
#

they have an endpoint to retrieve payment, so there shouldn't be any issues on that regard. If you're getting a 403 then that probably means your game server secret key is wrong

wet breach
#

as in to figure out overall what a user paid

#

so like, the ability to grab all payments a user has ever made and then get a total for that

sly topaz
#

well, for the active ones

#

doesn't seem like they have anything for expired ones

wet breach
#

yeah, so wouldn't help in grabbing the overall

#

which they would need to just keep track of that themselves

slender elbow
#

joy joy_cat rofl

wet breach
#

which isn't all that hard

wet breach
sly topaz
#

you could probably get it from their API by using the sales endpoint but that sounds annoying

wet breach
#

possibly, but wouldn't know. I don't use tebex. However I did present them a solution which they arbitrarily said was no good lol

#

I suppose what you said could be another

thorn isle
#

looks like they already ragequit the server