#help-development

1 messages ยท Page 350 of 1

echo basalt
#

and make our own wrapper class that doesn't fetch chunk data

orchid gazelle
#

why can't Player#sendBlockChanges work with a BlockData too?

#

BlockData + Location

worldly ingot
#

Because it has no position associated with it

echo basalt
#

you can make a wrapper class that fixes that proble

#

OR

orchid gazelle
#

then make the user apply a Location

echo basalt
#

make a map<BlockPos, BlockData>

worldly ingot
#

You're welcome to PR

echo basalt
#

paper already has that pointandlaugh

#

I don't have access to bitbucket either

worldly ingot
#

This isn't Paper

#

Don't know why that's relevant

echo basalt
#

anyways I'll literally just copypaste you the code

orchid gazelle
#

wasn't there even a CLA thingy with spigot contributions? lol

echo basalt
#

and you can just PR that

worldly ingot
#

I can't contribute code I don't own

echo basalt
#

gplv3 go brr

worldly ingot
#

Doesn't matter

echo basalt
#

a

orchid gazelle
#

uhm guys

#

this is not gonna fix my problem rn lol

#

I'd love to see a method for sendBlockChanges with a BlockPos + BlockData

worldly ingot
#

I don't think you're going to see any noticeable performance gains from a Map<Location, BlockData> though tbh

orchid gazelle
#

I will

eternal night
#

tbh, probably worse

worldly ingot
#

It seems you're trying to set an astronomically large region of blocks

orchid gazelle
#

because then I do not need to get thousands over thousands of Blocks from the World per tick lol

echo basalt
#

well try it and seel

eternal night
#

Map and bucketing seems terrible

worldly ingot
eternal night
#

you don't need to index anything

orchid gazelle
eternal night
#

6000 kekw

worldly ingot
#

You think a Map with > 6k entries is going to be better?

viral temple
#

is NMS obfuscated now? cuz I can't find a solution to have a backup/default fallback of my methods

worldly ingot
#

At runtime, yes, nicuch

orchid gazelle
echo basalt
#

and can assure you this is a better solution performance wise

eternal night
#

idk what what world a Map<Location, Something> is ever better

echo basalt
#

Let's assume getType costs you maybe 300mu

viral temple
echo basalt
#

that can break everything

worldly ingot
#

Yeah, mappings change from version to version

viral temple
#

any way to automatically detect a few classes and methods?

echo basalt
eternal night
#

ye

#

but that is not the issue in that impl

#

the issue is that you cannot create a BlockState on demand

#

without fetching it from a world

orchid gazelle
#

^

vivid skiff
#

How can i place doors?

echo basalt
#

So you want me to make a blockstate wrapper

#

hm

eternal night
#

Map<Location, BlockState> is worse in every way that matters for this than a List

orchid gazelle
#

lol

eternal night
#

insert is worse, iteration is worse

echo basalt
#

List<WrappedBlockData> maybe

eternal night
#

memory is worse

#

why wrapped block data

#

what is the point

#

the server already issues non world placed BlockStates

echo basalt
#

it's just a record of Location-BlockData

eternal night
#

See BLockStateItemMeta

orchid gazelle
#

why not just create a Wrapper for on-the-fly blockstates?

worldly ingot
#

Alternatively, World#createBlockState(Material/BlockData, x, y, z, @Nullable Consumer<BlockState>) might be a viable solution

eternal night
#

BlockState is a wrapper of Location/BlockData

#

that is the entire point of that type

echo basalt
#

Hmm

echo basalt
#

I want to separate this blockstate

eternal night
#

why

worldly ingot
#

Convenience for general use case

viral temple
eternal night
#

no

worldly ingot
#

Like how #spawn() accepts a Consumer<Entity>

echo basalt
#

or maybe a createBlockState(BlockData, Location) method hm

eternal night
#

yes

echo basalt
#

How, where would that come ๐Ÿค”

eternal night
#

creating a secondary type that does literally the exact same seems useless

worldly ingot
#

World ideally

eternal night
#

RegionAccessor think

worldly ingot
#

Or RegionAccessor, whatever

#

Yeah

orchid gazelle
eternal night
#

tho what is the point of that being on world

#

not like the world supplies any data

worldly ingot
#

Could be under Server or Bukkit. idrc. If you're passing a Location it has a world

eternal night
#

Ye

worldly ingot
#

Block states have a world associated with them, no?

eternal night
#

yea

orchid gazelle
#

yes

eternal night
#

but not required

#

iirc nullable

worldly ingot
#

Right but think of the general use case

#

BlockState#update() should still be possible

eternal night
#

spigot maintainer team can decide kekw ยฏ_(ใƒ„)_/ยฏ

echo basalt
#

I wonder what the CraftBlockState int flag does

glacial shell
#

help plz.

ERROR] .... Could not pass event PlayerInteractEvent to mains.VanillaCustomItems v0.1

java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because "time" is null

at events.Events.onRightClick(Events.java:26) ~[VanillaCustomItems-1.0-SNAPSHOT.jar:?]

at

(only some of the error, not full thing)

I know time is null, but I tried to make it not null, but its null in that so it can't make it not null.
line 25:

                    Integer time = map1.get(Integer);

line 26:

                    if (time > 0 | time < 0);

how do I make it not null, but also let it later be set to an Integer that won't be overwritten? plz help

echo basalt
#

Integer is an object

#

you can check for nullability

orchid gazelle
#

so whats the TLDR now?

echo basalt
#

also use || instead of |, as it does some micro optimization

eternal night
#

use NMS

echo basalt
#

if(methodOne() | methodTwo()) executes both regardless if methodOne returns true

echo basalt
#

yes

orchid gazelle
#

you guys gonna PR a createBlockState(Location, BlockData)?

tall dragon
#

tbh i never even known you could use | instead of ||

onyx fjord
#

i didnt even know single | exists

tall dragon
#

thought | was only for catch statements

echo basalt
#

| is the binary OR

#

It's the opposite of &

tall dragon
#

should you use || in catch statements as well then?

echo basalt
#

0x111 | 0x222

#

type deal

tall dragon
#

u cant right?

worldly ingot
#

The flag in CraftBlockState is to do with the type of update to perform when setting the block in the world. You can set it to 3 as that's the default iirc

#

Or more appropriately, there are constants somewhere

#

It's like update light | update physics or something

orchid gazelle
echo basalt
#

it should

orchid gazelle
#

then why don't create that? xD

glacial shell
worldly ingot
#

Again, I still don't think this is going to have the noticeable performance improvements you think it's going to have. Unless you benchmark internals, I'm not convinced

#

You still have to create those BlockState instances somehow

echo basalt
#

That's not the problem, strictly

#

The problem right now is that we fetch data from the world and then override with our own

#

fetching data from the world takes time and is wasteful, we could just create the object with out own data to begin with

eternal night
#

or just use NMS

#

๐Ÿ‘

echo basalt
#

yeah that

#

you can just be a bit cheeky

orchid gazelle
worldly ingot
#

Little bit of an exaggeration lol

dry yacht
# worldly ingot You still have to create those BlockState instances somehow

While that's just one of the many issues, it's still completely crazy to needlessly create hundreds of thousands of these wrapper classes to just later be collapsed into chunk-segmented multi-block update packets again. Scattered heap allocations, good for nothing.

At this point I just want to advise @orchid gazelle again (xD) to create an application specific implementation for this pretty seldom use-case of block updates.

tardy delta
#

best if condition seen today java if (((regex.length() == 1 && ".$|()[{^?*+\\".indexOf(ch = regex.charAt(0)) == -1) || (regex.length() == 2 && regex.charAt(0) == '\\' && (((ch = regex.charAt(1))-'0')|('9'-ch)) < 0 && ((ch-'a')|('z'-ch)) < 0 && ((ch-'A')|('Z'-ch)) < 0)) && (ch < Character.MIN_HIGH_SURROGATE || ch > Character.MAX_LOW_SURROGATE))

worldly ingot
#

I had initially proposed a Consumer<BlockChangeDelegate> which would have avoided most of that, but the implementation was significantly worse as a result

glacial shell
worldly ingot
#

It's also awkward to work around a Consumer

echo basalt
#
public class CustomBlockState extends CraftBlockState {

  public CustomBlockState(Location location, BlockData bukkitData) {
    super(null, new BlockPos(location.getX(), logation.getY(), location.getZ()), ((CraftBlockData) bukkitData).getState());
  }
}
worldly ingot
#

Please don't make a child class

echo basalt
#

and yes you need to create this class to use the protected constructor

#

or just make this one public

worldly ingot
#

I want you to try that to see if there are performance improvements. Again, I still don't think there will be

#

At least nothing significant

echo basalt
#

@orchid gazelle benchmark time

orchid gazelle
#

Huh what?

#

Where?

dry yacht
# worldly ingot I had initially proposed a `Consumer<BlockChangeDelegate>` which would have avoi...

Yeah, no, I'm more thinking about cached packets with direct write into the block positions and the one combined ID field. That's all a block update really is. You'd have to segment into chunks ahead of time and when moving the virtual schematic they want to draw, check whether chunk boundaries actually changed.

Maybe it would be more performant to just send individual block updates, as the whole overhead of segmentation probably doesn't help that much. Would be something one needs to benchmark to find out.

echo basalt
#

stick it in your thing

#

and measure the improvement

orchid gazelle
#

Gimme 1sec

echo basalt
#

it has a network overhead

orchid gazelle
#

@echo basalt

dry yacht
echo basalt
orchid gazelle
#

oh wait you just misspelled

#

lol

echo basalt
#

It's the nms blockstate btw

orchid gazelle
#

logation

#

where?

echo basalt
#

3rd param

orchid gazelle
#
import org.bukkit.craftbukkit.v1_19_R2.block.CraftBlockState;
#

?

echo basalt
#

uhh

dry yacht
#

craftbukkit != nms

orchid gazelle
#

yeah

echo basalt
orchid gazelle
#

what?

#

CraftBlockState only exists for org.bukkit

#

obviously

echo basalt
#

I know

#

you're creating a CraftBlockState and passing an NMS blockstate as the 3rd param on the constructor

orchid gazelle
#

BlockState org.bukkit.craftbukkit.v1_19_R2.block.data.CraftBlockData.getState()

tardy delta
#

i hate how there are so much full paths

orchid gazelle
#

uhm

eternal oxide
#

why are you using CraftBukkit?

echo basalt
#

because performance

#

we're avoiding getting blockstates from the world :p

eternal oxide
#

oh

orchid gazelle
#

I am not passing any nms things rn

#

oh wait am i

#

well, the constructor works lol

#

and now im gonna create the object and pass it to sendBlockChanges?

echo basalt
#

just map each block to a CustomBlockState and send the thing

#

if it yells about world

eternal oxide
#

I'm not sure creating a state by CB is going to be faster that reading one from the world

echo basalt
#

just pass the world instead of null on the 1st param

orchid gazelle
#
BlockState blockstate = new CustomBlockState(new Location(player.getWorld(), block.getX(), block.getY(), block.getZ()), block.getBlockdata());
``` like that?
echo basalt
#

every time you call getBlockState it creates a copy anyways (and that copy then fetches the block type and all)

orchid gazelle
#

building

eternal oxide
#

yes a state is always a copy

dry yacht
echo basalt
#

basically we want to create a block state with pre-set block data

eternal oxide
#

ah

#

yeah I can see that may be slightly faster

orchid gazelle
#

bro lol

echo basalt
#

instead of fetching an snapshot from the world, changing the data anyways and sending

glacial shell
#

'time' (Integer) is null, but it won't let me check if it is null

orchid gazelle
#

"no improvement"

#

factor 100 XD

dry yacht
echo basalt
orchid gazelle
#

wait

echo basalt
#

1000 mu = 1ms

orchid gazelle
#

its 0,8ms

dry yacht
#

Those are ns

echo basalt
#

yeah

#

894.7mu

#

pretty decent

orchid gazelle
#

and air took 72ms

#

0.8ms->72ms

#

that is indeed a difference

echo basalt
#

@worldly ingot that's a decent improvement

orchid gazelle
#

btw. Illusion ty for giving me code I can use now XD

orchid gazelle
#

still too slow but better xD

echo basalt
#

out of that

#

what's the part that takes the longest?

orchid gazelle
#

wdym?

echo basalt
#

is it mapping the blocks

orchid gazelle
#

thats the full time im debugging:

#
    public static void showRendered(Player player, ArrayList<SchematicBlock> blocks) {
        if(blocks == null) return;
        
        ArrayList<BlockState> states = new ArrayList<BlockState>();
        
        for(SchematicBlock block : blocks) {
            BlockState blockstate = new CustomBlockState(new Location(player.getWorld(), block.getX(), block.getY(), block.getZ()), block.getBlockdata());
            states.add(blockstate);
        }
        
        player.sendBlockChanges(states, true);
        
    }
echo basalt
#

yeah but out of that

#

is it the top method

orchid gazelle
#

the sending or iterating you mean?

echo basalt
#

or is it the sendBlockChanges

#

yeah

orchid gazelle
#

imma debug that real quick ok?

echo basalt
#

watch me say "no that's not ok, you're going to jail"

#

just go for it

orchid gazelle
#

lmao

echo basalt
#

decent enough

orchid gazelle
#

why's it way slower now?

#

I mean still a huge difference but yeah

echo basalt
#

1.6ms is cool enough

#

the only way you can halfen that again

orchid gazelle
#

is?

echo basalt
#

is by doing it all yourself in a single loop

orchid gazelle
#

uhm

echo basalt
#

instead of converting it using NMS and letting bukkit organize it again

orchid gazelle
#

thats gonna take me forever if I do that lol

echo basalt
#

not really

#

you already have the nms block state

orchid gazelle
#

this is probably gonna be a problem

lost matrix
#

Whats being tried here?

echo basalt
#

you just need to put that into packets

orchid gazelle
#

because I want way more than 6000 blocks lol

echo basalt
orchid gazelle
echo basalt
#

nice time to try things out and learn

#

btw you can do this stuff async

lost matrix
#

If its a LOT. Just send chunk packets. Editing is quite hard but its very fast.

orchid gazelle
echo basalt
#

I honestly find doing chunk packets async to be a bit... slow

orchid gazelle
#

then I should not do it?

echo basalt
#

you could

#

try and see

#

thing is I've once done interception to inject "fake" blocks into chunk packets

dry yacht
echo basalt
#

and had some weird performance issues because fetching blocks from the palette would take anywhere from 0.1ms to 50ms

orchid gazelle
#

lol

#

I got an idea

#

would it be more performant to calculate which blocks are on the outline of the multiblock?

#

and only send those?

lost matrix
echo basalt
#

calculate changes yeah

orchid gazelle
#

oh wait thats dumb nvm

dry yacht
echo basalt
#

if you're sending a big square you only need to send the blocks that are actually being changed

#

so the middle blocks would probably not be sent

#

that's a bit painful to impl

orchid gazelle
#

ehh thats a lot just for edge-cases

echo basalt
#

computationally expensive type deal

orchid gazelle
#

its mostly not senseless fills of blocks lol

dry yacht
lost matrix
#

let me check

dry yacht
#

I think it's just the differential version of it. But I'd love to know, thanks for checking, was just about to!

eternal ivy
#

how to disable players' movement temporarily in implements CommandExecutor

echo basalt
#

MapChunk sends all non-empty sections from bottom->top

lost matrix
#

But you should probably approach this with a manager

echo basalt
#

setWalkSpeed(0) go brr

orchid gazelle
#

@echo basalt will it be faster when implemented into spigot actually?

echo basalt
#

or add some attribute, which is safer

orchid gazelle
#

Of what an improvement are we talking of

echo basalt
#

same as what you're already seeing

#

implementing it on spigot is basically what you did

dry yacht
echo basalt
#

each section is 16x16x16

#

aka 4096 volume

#

you can represent each block position in the section with a single short

dry yacht
echo basalt
#

Let's say that the heightmap says the highest block is always 128

#

the mapChunk packet will only send the first 8 sections

orchid gazelle
#

Is its gonna get PRed now that Choco saw that its a serious improvement?

echo basalt
#

idk ask him

dry yacht
# echo basalt always have been

Okay, nice, learned something new. So I guess when sending multiblock updates, you have to segment even harder... But it's probably still better than polluting the network with a thousand little packets. Not that their header is significant, but networking overhead is.

orchid gazelle
#

Ok

lost matrix
echo basalt
#

the Single block change packet

#

has 2 fields

#
  • long: Block position, as a long
  • varint: blockstate id in the global pallette
#

on top of the packet id

dry yacht
lost matrix
#

Why does mojang use 20 bits for a y coordinate? ...

echo basalt
#

In contrast, each multi block change packet has:

  • long: section position index, as a long

  • boolean: suppress light updates

  • long, containing the state id and the position, for each block

echo basalt
dry yacht
# echo basalt has 2 fields

What do you want to say by that? That it's not that big? I mean, again, it's not at all about byte size here, it's totally about the overhead of carrying that packet through a big number of buffers all throughout the world from computer A to B. Also, heap scattering again, the computer (server and client) just cannot process them equally as fast.

echo basalt
#

you only need 12 bits to represent where the block is at, in the section

orchid gazelle
#

JEEZ 200FPS while rendering 6000 new fake blocks every tick lmao

lost matrix
#

They use 22 for x and z respective and 20 for y

echo basalt
#

oh wait that's the section id

#

I was looking at this

lost matrix
#

Last time i checked mc worlds cant go beyond 2k or something

orchid gazelle
#

cmooon why is this lagging?

echo basalt
#

I guess it's for future-proofing?

orchid gazelle
#

I've done the same with air-undos and its still lagging like shit @echo basalt

lost matrix
echo basalt
#

yeah welcome to multi block change

nova niche
#

Does anyone know how to make EssentialsDiscord send a embed message when a player joins?

dry yacht
dry yacht
lost matrix
lost matrix
echo basalt
#

yeah you gotta watch out for bandwidth

#

server I worked for was sending like 80mbit worth of particles to each player :p

crimson relic
#

DoS over minecraft ๐Ÿ’€

echo basalt
#

made a very simple culler that worked directly on the network thread

#

went down to like 400kb

orchid gazelle
#

Idc about that for now since the function is only for builders rn anyways lol

dry yacht
orchid gazelle
#

Server 10Gbit should be enough lmao

lost matrix
#

Sry this was way in the past. But in the neighborhood of mb/s
But we also approached this very naively. Lack of experience

lost matrix
#

F

#

What are you doing?

eternal ivy
#

p.setWalkSpeed(1)

#

but it makes me faster than default

crimson relic
#

oh god

dry yacht
echo basalt
echo basalt
lost matrix
dry yacht
lost matrix
#

How are you streaming this? Whats your backbone? Kafka? Or Redis?

dry yacht
lost matrix
#

Well 30 fps on a 20 tick/s update loop is also questionable ^^

dry yacht
dry yacht
echo basalt
#

you could render the frames on the computer that's streaming, no?

dry yacht
lost matrix
#

Ah interesting so this is handled completely disjunct from the main thread

echo basalt
#

that way you're only sending 1 byte / pixel instead of like 4

dry yacht
# echo basalt compression go brr

Does the minecraft server compress it? And it can't compress around frame borders, as it's not aware of bigger areas and has no notion of an image.

dry yacht
echo basalt
#

now

dry yacht
echo basalt
#

what if you make it 2-way

#

and like

#

clicking on the maps

#

actually clicks on your pc

#

๐Ÿค”

lost matrix
#

possible

dry yacht
echo basalt
#

I'm working on a similar system

#

well

#

remaking it entirely

crimson relic
#

and then make a public server and let everyone click

dry yacht
#

But the browser is gonna be in a VM very likely

echo basalt
#

and pixel detection is a pain

dry yacht
dry yacht
#

This project really goes right to the edge of what can sanely be done on a server with many people. You literally gotta optimize the hell out of it.

lost matrix
echo basalt
#

anyways I'm starting to get the motivation to work on this stuff again

crimson relic
#

thats pretty cool

echo basalt
dry yacht
# lost matrix

Yeah, I know these. But most of them use custom GUI frameworks. I think that's stupid and want to stream a headless browser.

echo basalt
#

I want my new system to support abstract shapes

#

also there is a bug that lets you rotate maps

eternal ivy
#

how to execute method every 30minutes?

echo basalt
#

but you can't position them in the middle of a block which makes it look really bad

dry yacht
wary harness
dry yacht
lost matrix
#

Man my mc folder is full of unfinished projects which had a pretty decent start aPES_Cry

orchid gazelle
#

Continue them then lmao

echo basalt
#

I work on stuff like that too

tall dragon
#

i have the same issue lmao

echo basalt
#

but much stupider

dry yacht
tall dragon
#

i lose motivation and quit the project xd

atomic swift
#

how to i set the command doesnt exist message

echo basalt
#

Anyways let's see

lost matrix
echo basalt
#

how can I estimate a boundingbox based on just the direction it's facing and the block the top left corner is on ๐Ÿค”

wary harness
lost matrix
wary harness
#

with resoure pack

orchid gazelle
#

Nope

lost matrix
orchid gazelle
#

Its magic

wary harness
#

?

#

is on maps to

lost matrix
#

Yes those are invisible maps

wary harness
#

so they can be transperent

eternal ivy
#

how to execute method every 30 minutes?

orchid gazelle
#

use BukkitScheduler

#

With runTaskLater

dry yacht
lost matrix
# wary harness so they can be transperent

Jup this is all abstracted away. Its a bit like swing. You have a canvas to draw on
and a bunch of abstract widgets with events. Like a button where you can register
hover and click actions.

ruby mesa
#

How would I remove an objective at a score

like: If I had Online: 1 at the score 3. How would remove it?

vivid skiff
#

How can i check if a block is interactable in the interactevent because using Material#isInteractable() the ide says that it doesn' t exist the plugin is for 1.12

echo basalt
atomic swift
wary harness
echo basalt
#

imagine having actual alignment lmao couldn't be me

wary harness
#

๐Ÿ˜…

dry yacht
glacial shell
#

So umm, 'player1' is null but I tried to set it to the player but it is still stopping at line 32 saying that 'player1' is null, before it can get to the part setting it as the player.

lines 32 to 38:

                            Player player = event.getPlayer();
                            String player1 = map1.get(Player).toString();
                            if (player1 == null) {
                                player1 = String.valueOf(player);
                            } else {
                                player1 = map1.get(Player).toString();
                            }

How could I get it to go to the if and else and not just give an error an stop?

onyx fjord
#

bruh

echo basalt
#

at this point

#

?learnjava

undone axleBOT
lost matrix
orchid gazelle
#

Ah and Illusion, is there any other optimization I can do on my faking blocks?

onyx fjord
#
  1. get(Player)
  2. Player#toString???
wary harness
lost matrix
orchid gazelle
ruby mesa
echo basalt
onyx fjord
#

u can do without

lost matrix
ruby mesa
#

could I possiblity get the link?

eternal ivy
#

Should I have to put value as milliseconds to delay?

orchid gazelle
echo basalt
#

you can literally just make your buildscript run a command after compiling

lost matrix
lost matrix
#

1 tick = 50ms (ish)

eternal ivy
#

AH

orchid gazelle
#

Yes

eternal ivy
#

Um

echo basalt
#

that command can be a script that copies the plugin from your libs folder to a server folder

orchid gazelle
#

(With optimal performance)

echo basalt
#

and starts the server

eternal ivy
#

1 sec ==1000ms

#

1sec == 200ticks?

orchid gazelle
#

20

lost matrix
#

If you have a perfect 20TPS server

#

Then 20 ticks = 1s

eternal ivy
#

ok i understood

#

so 30mins == 1800s == 36000ticks

#

is it right?

onyx fjord
#

yeh

orchid gazelle
lost matrix
#

Give your schematic an anchor point and every block in it a relative position to that anchor point.
Then you can reuse the entire schematic as it is and only need to add the current position
of the 'display' schematic to each relative block positon. You can even reuse the packet. You just need
to change the right bytes which contain the new position

dry yacht
lost matrix
#

Hm?

eternal ivy
ruby mesa
#

๐Ÿ’€

lost matrix
dry yacht
dry yacht
# lost matrix Hm?

Ah, nothing, you just don't see people who actually understand computing everyday here, it's a relief. Others would ask a factory to create a wrapper for them, while you propose reuse of packets and wrappers, xD.

lost matrix
#

Yeah you will have to put in some work before its usable ^^

echo basalt
lost matrix
echo basalt
#

that's my brain when I'm looking for an explanation

#

minecraft's snapping doesn't match mine

#

I guess my first objective is to estimate what blockface it's actually going to snap to

orchid gazelle
#

"Just need to change" ia easier said than done lol

glacial shell
#

I had the plugin print 'player' and 'player1' to the console and they both are the same just its not executing the event?

old cloud
#

I've got a question about encryption if someone is familiar with it.
I want to encrypt a file with a password using AES. For the key generation you have the salt which has to be same for decryption - same for the IV. So is it just fine to store salt + IV together with the encrypted data? Everything else doesn't really make sense to me. Want to be sure tho.

quiet ice
#

alternatively you can also hardcode the salt

#

or depending on the usecase the salt can be something inferred from something else

#

storing the salt in the same file kinda makes the salt pointless

old cloud
#

true

#

what about the VI tho?

#

isnt it the same

hoary wing
#

what event causes redstone to change shape, cancelling blockphysics prevents redstone lvl from changing but not the shape, and also fences and similar stuff

glacial shell
#

Why is my plugin not doing the event? The final 2 things are equal ( 'player' = 'player1' ) in an if statement and it keeps going to the else...

part of the event not working correctly:

                            if (player.getName() == player1) {
                                player.sendMessage("gooooooooooooooooood!");
                                double maxhealth = player.getMaxHealth();
                                player.setHealth(maxhealth);
                                player.sendMessage("ยงcYou've been healed!");
                                map1.put(String.valueOf(Integer), Integer.valueOf(Math.toIntExact(currenttime)));
                            } else {
                                player.sendMessage("problem with player names, idk but ig they dont match or smthn..");
                            }

console print to confirm:

[INFO] .... [mains.VanillaCustomItems] [STDOUT] player = CraftPlayer{name=amazingmation} and player1 = CraftPlayer{name=amazingmation}

ive been working on this all day ๐Ÿ˜ซ

old cloud
glacial shell
#

okay ๐Ÿ™‚ thank you sm

#

hopefully after this it just works

old cloud
#

The == just compares the two objects addresses in memory. Strings are immutable (any operation on a string will return a new string and that new string will have an own memory address), thats why you should always compare with .equals because its comparing the content of the string, not only the addresses in memory.

glacial shell
#

is this right:

if (player.getName().equals(player1)) {
old cloud
#

Yes, if player1 is a string

glacial shell
#

yes it is

old cloud
#

If player1 is a Player then do: if(player.getName().equals(player1.getName())

old cloud
glacial shell
#

yeah its not a player because it doesn't let me do .getName() after it

old cloud
#

๐Ÿ™‚๐Ÿ‘

glacial shell
#

lemme retry rq cause it still went to else

#

also lemme check if i typed it wrong

old cloud
#

sure

glacial shell
#

ummm

#

its still doing the else

hoary wing
#

what event causes redstone to change shape, cancelling blockphysics prevents redstone lvl from changing but not the shape, and also fences connecting and similar stuff

old cloud
glacial shell
#

ye

echo basalt
#

this mf is just copypasting his question

glacial shell
crimson relic
#

yeah i dont understand people who do that like every 5 min

glacial shell
crimson relic
#

not u

glacial shell
#

oh k

orchid gazelle
echo basalt
#

lighting updates maybe

#

did you add the flag?

#

my fucking scroll wheei is sticky grr

old cloud
# glacial shell heres a pastebin: https://paste.md-5.net/simufiquli.cs
  String player1 = String.valueOf(player);``` will call Player#toString on your player variable, which is just the string representation of the player object, not the players name. Later you compare the players name with its string representation and this will not be true. I don't get why you want to compare the player with itself anyway.
orchid gazelle
#

I did add true

glacial shell
old cloud
#

Okay but player1 will be the player who caused the event

#

thats like doing if(1 == 1)

glacial shell
#

okay so i just dont need that if statemen then

old cloud
#

Not really, at least right now it doesn't achieve anything

glacial shell
#

okay thx ill try that rq

old cloud
#

But I still dont get what your actual plan is

glacial shell
terse ore
#

will this code stop the main thread for 2 ticks?

                Bukkit.getScheduler().runTaskLater(BlockBattles.getInstance(), () -> {
                    location.getBlock().setType(DIAMOND_BLOCK);
                }, 2L);```
orchid gazelle
#

no

terse ore
#

why would you preffer to run it async instead of in the main loop?

orchid gazelle
old cloud
old cloud
echo basalt
#

maybe just the sheer amount of blocks hm

terse ore
#

if I run that th emain thread will stop for 2 ticks?

quaint mantle
#

no, it will run 2 ticks later than when you called it

old cloud
glacial shell
old cloud
orchid gazelle
#

not that critical

echo basalt
#

"just 6k"

#

yeah no

quaint mantle
orchid gazelle
#

it's gonna be way more lmao

dry yacht
echo basalt
quiet ice
#

You could work with the multi block change packet to reduce bandwidth

echo basalt
#

he already does

#

but it causes fps spikes

orchid gazelle
dry yacht
orchid gazelle
#

that should not lag like actual garbage

quiet ice
#

Yeah at that point you can only resend all the chunks

echo basalt
#

mm this is not the hitbox I was hoping for

orchid gazelle
orchid gazelle
quiet ice
#

But gl resending all the chunks

orchid gazelle
quiet ice
# dry yacht Is that a clientside lag? D:

I've heard that the client's fps loop is dependend on the networking look and vice versa (or something like that). Would explain that if you send massive amounts of data

#

But 6k blocks aren't that many blocks

dry yacht
orchid gazelle
#

so 50x120

dry yacht
#

so I guess 12 packets max, right? If I'm not completely stupid rn

orchid gazelle
terse ore
#

hwo can I remove blocks async?

orchid gazelle
dry yacht
orchid gazelle
#

yes

dry yacht
#

I wonder how the client implemented this. Are you sure you are not spamming these packets?

dry yacht
orchid gazelle
#

but its already lagging when doing it one time

quiet ice
dry yacht
dry yacht
old cloud
orchid gazelle
#

I moved my cursor one time, and it did exactly one call

#

the interesting thing is that it is sometimes spiking and sometimes not

glacial shell
#

okay hopefully last question, no promises tho cause im bad, I am trying to set the Integer value in the HashMap to the current time, but (for some reason) it wants a string and not an Integer as the key and it wants an Integer instead of a long for the value. I had it this way before fig1 but it gave the error in the game console fig 2 but now its giving the error in the IDE fig 3

fig1:

map1.put(String.valueOf(Integer), Integer.valueOf((currenttime)));

fig2:
https://paste.md-5.net/puwafeqasu.cs

fig3:

map1.put(Integer, currenttime);

thx u have been so much of a help and given your time for my benefit, I can't thank you enough ๐Ÿ˜„
@old cloud

glacial shell
terse ore
#
    @EventHandler
    public void onBlockPlace(BlockPlaceEvent event) {
        Player player = event.getPlayer();
        Block block = event.getBlock();
        Location location = block.getLocation();
        BlockFace direction = player.getFacing();
        if (block.getType() == DIAMOND_BLOCK) {
            for (int i = 0; i < 5; i++) {
                Bukkit.getScheduler().runTaskLater(Data.getInstance(), () -> {
                    switch (direction) {
                        case NORTH -> location.setZ(location.getZ() - 1);
                        case SOUTH -> location.setZ(location.getZ() + 1);
                        case EAST -> location.setX(location.getX() + 1);
                        default -> location.setX(location.getX() - 1);
                    }
                    location.getBlock().setType(DIAMOND_BLOCK);
                }, 20L);
            }
        }
    }
``` Why does this code place all the blocks at once instead of placing them 1 every second
dry yacht
# orchid gazelle yes

So is the boolean you were talking about the trust edges thingy? Just want to make sure that you're not force updating lighting maps on all of these chunks.

orchid gazelle
dry yacht
old cloud
orchid gazelle
#

boolean suppressLightUpdates

dry yacht
#

Ok, so you don't have it flipped

orchid gazelle
#

yeah

#

ah and, would it be faster to directly use states.add(new CustomBlockState...); rather than

              BlockState blockstate = new CustomBlockState(new Location(player.getWorld(), block.getX(), block.getY(), block.getZ()), airData);
                    
              states.add(blockstate);
``` ??
old cloud
terse ore
old cloud
terse ore
#

dont worry

#
    @EventHandler
    public void onBlockPlace(BlockPlaceEvent event) {
        Player player = event.getPlayer();
        Block block = event.getBlock();
        Location location = block.getLocation();
        BlockFace direction = player.getFacing();
        if (block.getType() == DIAMOND_BLOCK) {
            for (int i = 0; i < 5; i++) {
                Bukkit.getScheduler().runTaskLater(Data.getInstance(), () -> {
                    switch (direction) {
                        case NORTH -> location.setZ(location.getZ() - 1);
                        case SOUTH -> location.setZ(location.getZ() + 1);
                        case EAST -> location.setX(location.getX() + 1);
                        default -> location.setX(location.getX() - 1);
                    }
                    location.getBlock().setType(DIAMOND_BLOCK);
                }, i);
            }
        }
    }```
#

this did the job

#

idk if it is the best way

old cloud
#

Thats one way you could do it, yeah

raw sky
#

How should I control multi user development on github for a free and premium version of a plugin? We want to have our free version open source to everyone but have our paid version closed source, but we need to be able to work on it at the same time. Our issue comes when we want to be able to update the free version and be able to push those code updates onto the private github repo? Hopefully that makes sense

crimson relic
#

just make it all opensource

raw sky
#

I dont wanna make the paid version open source though for obvious reasons

crimson relic
#

what reasons? tons of plugins do it

orchid gazelle
raw sky
#

because they can just steal the code?

willow widget
#

How can I do something like version: ${version} in my plugin.yml for gradle?

river oracle
sterile token
river oracle
crimson relic
#

if someone really wanted to they could steal it or replicate it anyway

sterile token
#

I mean if you selling the jar, you can ge tthe whole src from the plugin

tall dragon
#

indeed

sterile token
#

๐Ÿ’€

rigid loom
#

How would i make it so that this can be saved to the config.yml onDisable and restored onEnable?

               if (args[0].equalsIgnoreCase("claim")) {
                    if (plugin.getKingdoms().containsKey(player.getUniqueId().toString())) {
                        if (plugin.getCanClaim().containsKey(player.getUniqueId().toString())) {
                            if (plugin.getCanClaim().containsValue(playerKingdom)) {
                                if (plugin.isClaimedChunk(chunkID)) {
                                    player.sendMessage(ChatColor.RED + "Chunk is already claimed");
                                    return true;
                                } else {
                                    plugin.addChunk(chunkID, playerKingdom);
                                    player.sendMessage(ChatColor.GREEN + "Chunk claimed");
                                    return true;
                                }
                            }
                        } else {
                            player.sendMessage(ChatColor.RED + "You do not have permission to claim chunks");
                            return true;
                        }
                    } else {
                        player.sendMessage(ChatColor.RED + "You are not in a kingdom");
                        return true;
                    }
                }```
raw sky
#

but it will promote piracy, they can just put the code on some other market and not worry about deobfuscation

sterile token
tall dragon
#

any1 actually buying plugins hardly want to be bothered with compiling it themself.

river oracle
echo basalt
#

IT WORKY

crimson relic
orchid gazelle
hazy parrot
river oracle
orchid gazelle
#

they need to buy a copy to pirate it first lol

willow widget
river oracle
#

likely win

#

and you don't get anything

willow widget
orchid gazelle
#

wtf that would be dumb

sterile token
# raw sky obfuscation

"Everything that can be executed by a machine, can be interpreted by humans" -Take as u want
Dont lost ur time trying to hide your code because people who really want your code, will do everythint o deobfuscate it

old cloud
#

obfuscation is useless anyway

willow widget
#

The offer in a premium plugin is NOT the code, it's the support

glacial shell
willow widget
rigid loom
old cloud
raw sky
#

I mean the entire plugin is based off making GET requests to a rest api, if we make it mandatory to have a license key for that we can try and prevent abuse of piracy

river oracle
sterile token
raw sky
#

and just limit the amount of requests you can make

river oracle
sterile token
willow widget
hazy parrot
raw sky
terse ore
#

why spawnParticles method is is from player?

river oracle
echo basalt
raw sky
#

One sec I will read it

echo basalt
#

doing it on the player spawns client-sided particles

#

doing it in the world spawns particles for everyone

terse ore
#

oh tysm

sterile token
crimson relic
# raw sky One sec I will read it

All resources must run directly from downloaded file without any manual installation steps or access to a specific server. This means that licensing systems of any form are prohibited. This also means that all applicable code must fail-safe in the event of (web) server error.

glacial shell
willow widget
river oracle
raw sky
#

I guess we can create a not so updated version of a json file that just has like a few hundred thousand lines, still annoying to do though

glacial shell
willow widget
old cloud
sterile token
#

@raw sky dont lost your time obfuscating and using license systesm, they will be cracked. Take as an example Miscrosoft, they used to have a really secure licensing system and look some years ago, they OS not only get cracked, they also deobfuscated parts of code

glacial shell
crimson relic
#

obfuscation and drm is just not worth it

raw sky
#

whats so bad about storing data like that? sure 100k lines in json isnt the best but it doesnt get looked into consistently, it takes about 2 seconds to load

glacial shell
raw sky
#

and I cant use a database online because "no internet connection" or whatever

willow widget
river oracle
crimson relic
hazy parrot
raw sky
rigid loom
sterile token
crimson relic
#

good lord why

raw sky
#

if we have some of its data then it would be multiple hundred lines

#

its going to handle the management of plugins, it auto updates them and everything

hazy parrot
#

Just use proper database, it's wrong usage for json

raw sky
#

installs, updates, deletes

raw sky
#

depend on it*

hazy parrot
crimson relic
#

your entire plugin depends on it???

tall dragon
#

you can soft depend tho

willow widget
crimson relic
hazy parrot
#

And I'm also pretty sure it's not point of that rule on spigot

river oracle
#

though a moderator would have more insight than me

raw sky
river oracle
#

probably could ask optic or choco

sterile token
river oracle
echo basalt
#

optic is literally working on making it natively scan in runtime

raw sky
#

the ability to prevent anti-malware in the title is beneficial, we will host plugins from other sites too

echo basalt
#

so that any plugins trying to do foul stuff get stopped by the server itself

raw sky
#

we also need to store a lot of the data for a few new projects

sterile token
#

MCLicense?

river oracle
#

๐Ÿคท๐Ÿฝโ€โ™‚๏ธ

raw sky
#

nope

river oracle
#

probably not

raw sky
#

I know who owns it, I do not own it though

sterile token
#

Oh weird mainly his project is trying to be MCLicense-v2

#

Which wont success because of spigot rules and also you have to talk with md5 because he can take legal actions about the project because of their wrriten TOS

raw sky
#

mine?

river oracle
#

no

#

the MCLicense guy

willow widget
#

Anoyne know show to do that my plugin.yml works like this?

version: ${version}

becomes

version: 1.0.0
raw sky
#

MCLicense is just a licensing software though, wont be just for spigotmc or anything

eternal oxide
#

in resource section of pom <filtered>true

crimson relic
sterile token
#

If im not wrong Spigot TOS have something against hosting their platform resources im not sure tho

raw sky
willow widget
sterile token
orchid gazelle
eternal oxide
#

I don't gradle

crimson relic
raw sky
#

He is working alongside me on the project

#

We are not the same person though

sterile token
sterile token
orchid gazelle
sterile token
orchid gazelle
willow widget
#

is it a better idea to use gradle or maven for my projects?

ivory sleet
#

version?

willow widget
#

XD

river oracle
willow widget
#

I am thinking about the version of my plugin, sorryyyy

sterile token
willow widget
hazy parrot
#

both have down and upsides, whatever you like more

rigid loom
#

How would i save the chunk to config.yml onDisable and restore it onEnable?

sterile token
#

Well maven or gradle (Java building enviroments), are based on developers preferences we cant help you much there

crimson relic
#

id say try both, see which you like more

river oracle
#

I've used both maven and gradle and honestly I have no particularly strong feelings. I like the xml format of maven ๐Ÿคท๐Ÿฝโ€โ™‚๏ธ

crimson relic
#

i use maven because im just used to it

willow widget
#

alright, I thought there could be some important leads to take into consideration, but all of you point that it's preference based so I'll stick to that, ty ๐Ÿ™‚

hazy parrot
willow widget
river oracle
#

I'm switching over to gradle ๐Ÿคท๐Ÿฝโ€โ™‚๏ธ cuz why not its good to know both tools

orchid gazelle
#

got an idea

terse ore
#

Which is the breaking block particle=

#

I a mtrying BLOCK_CRACK but it doesn't spawn any particles

willow widget
terse ore
#

I mean

#

when I break a block I get the particles

tall dragon
terse ore
#

just checked, all particles on

sterile token
distant ridge
#

what's the best way to verify that someone has purchased my resource?

sterile token
terse ore
#

if not tell them to show you their paypal transaction id

#

and check if you have that same id

#

if you have they have paid

distant ridge
#

i want it to be automated

#

i just don't know what endpoints to check

sterile token
distant ridge
#

it won't depend on it

tall dragon
distant ridge
#

i'm making a bot in discord to verify purchases for support

terse ore
sterile token
#

Any idea why mongo shity logs still persist, while i already disable the full logger ๐Ÿ˜ก

willow widget
sterile token
distant ridge
willow widget
sterile token
willow widget
sterile token
willow widget
dry yacht
sterile token
crimson relic
distant ridge
willow widget
sterile token
distant ridge
#

In general I'm not worried about piracy

river oracle
willow widget
#

I wasted like 1h setting up gradle lol

river oracle
#

the version number doesn't matter to me

dry yacht
sterile token
river oracle
river oracle
distant ridge
river oracle
#

both are integrated equally

sterile token
#

Yeah

dry yacht
sterile token
#

They area already integrated, just need to tell IJ to download them

distant ridge
willow widget
river oracle
orchid gazelle
#

can someone join to my local server per dm rq and test if it also lags for them?

distant ridge
sterile token
dry yacht
# distant ridge Okay so how can I check?

Well, you need to bake a token into the plugin. No need to recompile, just patch the class's constantpool and change the string. No idea how to get spigot to execute this routine tho. Ask md5, lol

distant ridge
river oracle
#

smh verano he's not doing DRM

sterile token
river oracle
#

its a support token he wants

crimson relic
distant ridge
#

I don't want tokens

sterile token
river oracle
#

but otherwise not sure

distant ridge
#

I want my bot to check if someone has bought the plugin and then give them a role in Discord

sterile token
crimson relic
#

it is possible...

dry yacht
tall dragon
distant ridge
#

I can always verify through the PayPal API but that seems less effective than scraping info off Spigot

raw sky
crimson relic
#

use the minecraft intellij plugin if you arent already

willow widget
raw sky
#

OH

raw sky
willow widget
sterile token
#

๐Ÿ˜‚

crimson relic
#

makes the process super easy

willow widget
raw sky
sterile token
crimson relic
crimson relic
sterile token
crimson relic
raw sky
#

and the mc development sets it up for people

willow widget
sterile token
#

So let me explain you

willow widget
willow widget
digital nova
#

Does anyone know how i could go about implementing a custom save format, what general things would i need to do for that?

raw sky
#

wdym?

#

what are you storing

willow widget
crimson relic
willow widget
#

"Minecraft intellij"? or what?

raw sky
willow widget
digital nova
#

essentially replacing anvil

sterile token
#

Any alternative to disable mongo shity logs? I tried setting their shity logger to Level.OFF but didnt stop it. Its really disturbing that thing

sterile token
willow widget
raw sky
#

over using something like SlimeManager

echo basalt
orchid gazelle
#

yo Illusion lol

crimson relic
#

who needs ram anyway

orchid gazelle
#

@echo basalt you on your pc and able to test something out in mc rq?

echo basalt
#

I literally upgraded to 32gb ram to have more intellij windows open

orchid gazelle
#

I wanna know if its server issue or client issue

hazy parrot
#

what is this in spigot config api, list of configuration sections ?

digital nova
orchid gazelle
crimson relic
orchid gazelle
#

sent you the IP

willow widget
tall dragon
#

tf ru doing then

crimson relic
#

chrome, intellij, minecraft

tall dragon
#

im often with 3 intellij instances open, 2 servers, 3 minecrafts

#

and still at like 20

crimson relic
sterile token
hazy parrot
willow widget
tall dragon
crimson relic
#

chrome

digital nova
tall dragon
#

ahh yes chrome..

#

should use firefox

sterile token
crimson relic
tall dragon
#

firefox is superior

sterile token
crimson relic
tall dragon
willow widget
sterile token
orchid gazelle
#

google chrom like 5Gigs ram HAHAHAH

digital nova
#

3.5g chrome, 3.5g mc, 2.8 intellij

#

looks reasonable

crimson relic
#

chrome with a lot of processes

tall dragon
hazy parrot
orchid gazelle
sterile token
digital nova
#

i think its just a bunch of the apps that are smaller amounts of memory that are dragging it

#

like all the spinoff process of chrome

old cloud
# glacial shell now the required type is a string should I just make the current time a string?

A Map is a data structure to map a key to a value. Any time you call it with a specific key, you will always get that specific value that was mapped to the key. Since you want to store a timestamp that will be associated with a specific player, you need a map that maps Player->Timestamp. Best practice to identify a player is using their UUID and the timestamp is of type long. So your map should be Map<UUID, Long>. Now whenever a player wants to heal, you can get their last successful heal with Map.get(uuid). Calculate the difference to the current time and if your desired delay has expired, perform the heal and update the new timestamp (the new last heal basically) with Map.put(uuid, timestamp).

hazy parrot
crimson relic
#

this is actually my lower usage aswell, i usually have way more tabs open which eat up ram

echo basalt
tall dragon
#

but why would u have so many tabs open

orchid gazelle
#

I have never had more than 10 tabs open at the same time

crimson relic
tall dragon
#

but ...w hy

orchid gazelle
echo basalt
#

downloading 1.19.3 skullWazowski

#

also had some struggles with my private vpn

orchid gazelle
#

I like how database+webserver only take 4mb ram lmao

orchid gazelle
chrome beacon
#

The only times I've had over 200 tabs open was when I made modpacks

#

Before the curseforge launcher

tall dragon
#

thats fair enough

#

coulnt be me making modpacks

#

that wouldve been a painn

sterile token
#

Currently having 10 instances of Opera GX with 20-40 tabs each instance

#

๐Ÿ’€

orchid gazelle
#

@echo basalt how's it going?

echo basalt
#

it started out alright

#

but then like

tall dragon
#

opera gx ๐Ÿ’€

echo basalt
#

I clicked on it again and it's spiking

orchid gazelle
#

click?

sterile token
echo basalt
#

the gun

#

thing

#

unelss I'm an idiot

#

idk

orchid gazelle
#

the gun is irrelevant

echo basalt
#

ah ok

#

anyways

crimson relic
#

๐Ÿ’€

orchid gazelle
#

just another project lmao

echo basalt
#

it would be like 15x better

#

if you uhh

#

only sent changes

#

instead of sending air and blocks again

#

it can bring out massive improvements

#

like if I move side to side

orchid gazelle
#

but I gotta calculate that too, thats a lot of calculations

willow widget
orchid gazelle
#

and also, I gotta send air to remove the blocks lol

echo basalt
#

I mean

#

I'd probably make a mask

#

for each block type?

#

and see if the mask contains the new position

#

if it does, exclude

orchid gazelle
#

god what?

echo basalt
#

It's actually pretty chill ngl

echo basalt
#

probably takes forever to calculate but

#

what if you had a premade 3d shape

#

where everything is relative to itself

#

and then