#help-development

1 messages · Page 1159 of 1

river oracle
#

Oh my xD

slender elbow
#

I got it from my personal stash lol

river oracle
#

👀 stash?

#

Spigot reference

#

Emily uses spigot stash confirmed

slender elbow
#

god no

#

hydrus

sly topaz
#

goated site

river oracle
#

I'm not good at anything

#

Yet they still keep me around

slender elbow
#

you're good at being the inventories person

river oracle
slender elbow
#

except for that one method

river oracle
slender elbow
#

squint

#

its*

#

🤓

river oracle
#

K. Yk I shouldn't

#

But fuck you anyways

slender elbow
#

🫂

young knoll
#

wtf did you do

#

What is this method

river oracle
young knoll
#

Ah

old flicker
#

I cannot seem to reproduce this issue I am having. I already tried the other sqlite driver as suggested here. I cannot even produce it spamming /sethome and other commands, trying to log off at awkward times, etc.... but the database doesn't fail.

It only fails after the plugin has been running for a few hours with databases being locked:

Caused by: org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)

Even trying to repoduce events leading up to this issues are proving inadequate. Anyone have suggestions on how I can debug? Its so annoying that it works for awhile and then it just doesn't.

young knoll
#

But it’s useful :(

river oracle
young knoll
#

If Mojang removes that quirk I’ll just tell my contact to tell their contact to revert it

slender elbow
#

it has brakes?

#

wowzers

river oracle
#

It's just scuff as hell

#

Hey but it kinda works great sometimes

#

So!!!!

blazing ocean
#

I may have a legitimate use case for getTitle actually

text width for font fuckerisation

slender elbow
#

maybe if there was an option to change the displayed title in an event, or a method to reopen the inventory with a new title

#

that'd be super

river oracle
#

Dw!!

slender elbow
#

Player#openInventory(Inventory, String)

#

Sorry, HumanEntity

#

because ???

#

abstraction over a class that doesn't exist on the server even

blazing ocean
#

truly a bukkit moment

old flicker
# old flicker I cannot seem to reproduce this issue I am having. I already tried the other sql...

It seems to occur with specific commands, ex /sethome and /rank .. but others work like /home and /spawn all using databases. Could it be beacuse I am doing it like this?

                String insertUsername = "INSERT OR IGNORE INTO homes (username) VALUES ('" + name + "')";
                String insertX = "UPDATE homes SET x=" + x + " WHERE username='" + name +"'";
                String insertY = "UPDATE homes SET y=" + y + " WHERE username='" + name +"'";
                String insertZ = "UPDATE homes SET z=" + z + " WHERE username='" + name +"'";
                String insertPitch = "UPDATE homes SET pitch=" + pitch + " WHERE username='" + name +"'";
                String insertYaw = "UPDATE homes SET yaw=" + yaw + " WHERE username='" + name +"'";
                
                statement.addBatch(insertUsername);
                statement.addBatch(insertX);
                statement.addBatch(insertY);
                statement.addBatch(insertZ);
                statement.addBatch(insertPitch);
                statement.addBatch(insertYaw);
                statement.executeBatch();

Why does this work for a few hours but then not?

sly topaz
#

please use prepared statements

#

or I'll personally abuse of your database

blazing ocean
#

shit I love that one

river oracle
quaint mantle
old flicker
#

Okay but this doesn't help explain why my program is not working after a few hours. Is it not using prepared statements.. also, it says sqlite is BUSY not cannot find table

quaint mantle
old flicker
quaint mantle
#

In sqlite you can have one connection iirc

river oracle
#

Your db still is locked check for a lock file or another program which is using it

#

This can happen if your server doesn't fully close

old flicker
#

Thats likely why it fails after a few hours

quaint mantle
#

Also use PreparedStatments

river oracle
#

Try with resources

#

💯

old flicker
#

                String insertUsername = "INSERT OR IGNORE INTO homes (username) VALUES (?)";
                try (PreparedStatement psInsertUsername = connection.prepareStatement(insertUsername)) {
                    psInsertUsername.setString(1, name);
                    psInsertUsername.executeUpdate();
                }
                
                String updateHomes = "UPDATE homes SET x = ?, y = ?, z = ?, pitch = ?, yaw = ? WHERE username = ?";
                try (PreparedStatement psUpdateHomes = connection.prepareStatement(updateHomes)) {
                    psUpdateHomes.setDouble(1, x);
                    psUpdateHomes.setDouble(2, y);
                    psUpdateHomes.setDouble(3, z);
                    psUpdateHomes.setFloat(4, pitch);
                    psUpdateHomes.setFloat(5, yaw);
                    psUpdateHomes.setString(6, name);
                    psUpdateHomes.executeUpdate();
                }

Like this?

#

(and obv I got all the try catch statements, one set to try to close the connection)

worldly ingot
#

Why isn't that one statement, I don't understand PES_Think

#

Or are those two separate blocks of code, you just joined them together into one snippet?

old flicker
#

Seperate blocks, I should probably use pastebin or something.

worldly ingot
#

No no that's fine, I'm just throwing myself into this conversation with no context haha

#

If they're separate, it's fine

old flicker
#

Yep! I am new to databases.. just trying to figure out why it works for about 4 hours and then returns that its busy later on 😅

#

Its just probably my execution of it

worldly ingot
#

As long as your connections themselves are getting closed, you're okay

#

You could do that with a finally statement at the end if you'd like

#

Or throw it too into your try with resources

#
try (Connection connection = getConnection();
        PreparedStatement statement = connection.prepareStatement(string)) {
    // Do stuff
}
#

Format however you'd please

old flicker
#

finally {
                if (connection != null) {
                    try {
                        connection.close();
                    } catch (SQLException e) {
                        e.printStackTrace(); // Handle exception
                    }
                }
            }

Which I got at the end. I think I fixed it, I was executing in batches before which turns out is probably a janky and not safe way to do it. Whether that's the problem or not, either way atleast I made my code better 🥲 ... will push the update and see if it works. I only code for my small university community so its not a huge deal if it doesn't work again after time, I have lots of ways to remedy any issues.

worldly ingot
#

If you're adding multiple homes in a single method call then batches are fine, but prepared statements do actually have a way to add and dispatch batches

#

(see the Statement#addBatch() method)

#

You can prepare multiple queries (the same query string, different parameters) and it will send them all together in a single batch

old flicker
#

Yeah, I feel like that might have caused my sqlite exceptions last time ... it was specifically for any method that ran in batches. as I have said, they worked great for many hours after the sevrer started, but eventually they stop working. I am guessing it had something to do with memory or threading... Tried a different database driver but that didn't fix it.. so heres hoping using try with resources solves it

young knoll
#

We love try with resources

#

vs try catch finally and then try catch again

sly topaz
#

Also, if you don't like the single connection nature of sqlite, you'd want to enable WAL journal mode, with a NORMAL synch mode preferably as well as a multithreaded threading mode

wet breach
patent onyx
#

are you able to do IoC in any way with a plugin, like with the spring framework?

sly topaz
#

potato potato

#

it is a connection by sql standards

wet breach
#

Its not

sly topaz
wet breach
#

Anyways. Good news

#

You can toss that sqlite file into memory to speed it up lol

sly topaz
#

bloating your plugin with something like spring doesn't sound like a good idea

sly topaz
#

say bye bye to the persistence part of the java persistence API

#

one power outage and your data is gone

wet breach
#

Minor issue in my opinion lol

sly topaz
#

for plugins probably

#

for anything mildly important, it is critical

patent onyx
sly topaz
#

but yes, sqlite offers pragmas to be memory-only

#

but at that point, just use redis

wet breach
sly topaz
#

I know what you mean, but that's the dumb way of doing it

#

when sqlite has the feature by default

wet breach
#

Lol

sly topaz
#

at best, you'll see some plugins playing around with guice

patent onyx
#

if you want one plugin to have the capability to swap between multiple persistence implementations, say flat file, mysql, and mongodb (depending on the user's needs), how would a plugin handle swapping those kinds of implementations?

#

like a factory maybe?

sly topaz
#

most plugins will stick with one persistent storage solution

#

if not, hikaricp

young knoll
#

Hikari doesn’t support mongo :p

sly topaz
#

eh, not a big deal considering how not popular mongo is for plugin dev

remote swallow
#

you could make an interface with the interaction methods and then each storage impl has its class with interaction stuff

young knoll
#

Anyway, make an interface for your database access and have different implementations for each option

sly topaz
#

it used to be at some point, don't know what happened with it now

young knoll
#

Then just pick the right implementation based on what the user selects

patent onyx
#

in like a config?

remote swallow
#

yeah

sly topaz
#

if the plugin even allows it, since supporting multiple database options means having to dynamically download, or shade in a bunch of sql drivers

remote swallow
#

cough libraries feature

sly topaz
#

neither is a good option since the average plugin dev doesn't find this to be trivial enough for it to be sensible

sly topaz
remote swallow
#

load them anyway, or use something like libby

sly topaz
#

while it wouldn't be much of an issue to just load the ones you support, it is eh

#

still as said, the vast majority of plugins will just stick to one solution rather than providing the choice

remote swallow
#

yea

sly topaz
#

it'd be interesting to see more IoC in plugin dev, but due to the fact that there's a huge percentage that starts out in plugin dev, they find things like Spring rather daunting

#

besides, Spigot/Paper as a platform covers one pretty well, that for the longest time people would rather use yaml configs as storage rather than well, an actual persistence solution

patent onyx
remote swallow
#

include them inside your jar

sly topaz
#

uber/fat jar

patent onyx
#

ahhh

young knoll
#

Spigot already has MySQL and SQLite drivers

sly topaz
#

for better or worse

#

at least we don't have some old ahh version of ebean around anymore

remote swallow
#

i remember when spigot updated the one sqlite driver and it broke hibernate

marble moth
#

i assume it's impossible, but is there any way to generate a client-like render from some position on the server side?

sly topaz
#

what?

#

please elaborate, I can't comprehend the question

marble moth
#

that's mb

#

i just thought again and i was being stupid lmao

#

i was trying to generate a render of the world from a pseudo-client from the server side

#

that makes no sense tho

#

im dumb

young knoll
#

You could do like a buttload of ray traces to get what blocks the fake client would see

#

Other than that not really

echo basalt
#

didnt cmarco do that shi

#

render the faces it traces with

#

basically you just need to know the camera position, fov and all of that

marble moth
#

wouldn't it be an issue with transparents and stuff though?

#

like i don't want to put the whole minecraft rendering pipeline into a plugin

echo basalt
#

yeah gl with that

marble moth
#

i think this was just a bad idea from the start lol

quaint mantle
#
for (int i = (number == 100 ? number : 0); (number == 100 ? i >= 0 : i <= 100); i += (number == 100 ? -1 : 1)) System.out.println(i);
    }``` i hope this is okay
river oracle
#

what the

#

what the actual

worthy yarrow
#

So if the number is 100 it counts down and if the number is 0 it counts up...?

drowsy helm
#

Bros allergic to if statements

quaint mantle
#

so real

rough ibex
#

i would discipline you for this, if you worked for me

river oracle
rough ibex
#

depends on if he got a signing bonus

sly topaz
# quaint mantle ```java for (int i = (number == 100 ? number : 0); (number == 100 ? i >= 0 : i <...
public static IntStream countDynamic(int start, int end) {
  var actualStart = Math.min(start, end);
  var actualEnd = Math.max(start, end);
        
  return IntStream.rangeClosed(actualStart, actualEnd)
      .map(i -> start > end ? (actualStart + actualEnd - i) : i);

// or without making end configurable
private static final int END = 100;
public static IntStream countDynamic(int start) {
  if (start > END)
    throw new IllegalStateException("start exceeded the end, end: " + END);

  return IntStream.rangeClosed(0, END)
        .map(i -> start == END ? (END - i) : i);
}

countDynamic(0, 100).forEach(System.out::println);
countDynamic(100).forEach(System.out::println); // countdown since we start at 100
rough ibex
#
for (int i = 1; i <= 100; i++) {
  System.out.println(i);
}```
#

you've made 2 lines of code into 10

#

congratulations

cold pawn
#

Does anyone know how to create a respawn packet in 1.20.6 using protocolLib? The old way of doing, using the internal structure, doesn't work anymore.

sullen marlin
#

?xy

undone axleBOT
cold pawn
#

There is no problem, im just asking if anyone found a way to create a respawn packet in 1.20.6 using ProtocolLib.

sullen marlin
#

Why though?

cold pawn
# sullen marlin Why though?

It's to change the skin of the player. Its been the way ive been refreshing the players skin once the game profile is modified.

dawn plover
#

Lol 😵, i maybe should yea.
I normally copy over the same gradle every time i create a new plugin. But the gradle i copy over is a few years ols now

lilac dagger
#

altho it might be more complicated than it sounds

cold pawn
lilac dagger
#

no, with packets

#

change their world but it's the same world

#

something like what bungee does

#

it triggers a load screen which i think should update the client's game profile

harsh ruin
#

How to send message to player in action bar ???

lilac dagger
#

player.spigot.sendmessage chatmessagetype.actionbar message

harsh ruin
#

It's not work for me, i use 1.21

lilac dagger
#

show code

harsh ruin
#

Sry i dont have code for the moment

smoky anchor
#

Then how do you know it doesn't work for you ? 🤔

lilac dagger
#

oh yeah i forgot

#

message has to be new TextComponent(message)

#

i assume action bar doesn't use hover/click events

chrome beacon
#

Yeah they're just ignored when present

thorn crypt
#

Hello, how could I put data in a block ? I tried using metadata but they are gone after a restart, and PDC are not available in 1.12.2 (version i work with and can't change)

proud badge
#

Idk if it exists for 1.12.2

thorn crypt
#

Not certain of what version NBTAPI has NBTBLOCK working, but not 1.12.2

lilac dagger
#

it's the best way to handle it

thorn crypt
# lilac dagger use a database of your own

I was thinking of it but idk for some reason im unsure, for example a player use WE to replace a block, or fill command, the block wont be known as destroyed so i cant really handle it can I ?

lilac dagger
#

if a block has changed state you could invalidate data

#

and run a purge every so often

thorn crypt
#

Okay, thanks

chrome beacon
#

Assuming you save on chunk unload you can just block check the state there

proud badge
#

Even in newer versions

#

Use chunk NBT to store data in blocks

chrome beacon
#

TileEntities do have NBT but that's just a small amount of blocks

#

but I do believe you need to mess with NMS to get it to save properly and even then loading will be a problem

#

so storing it in your own database is the best option

lilac dagger
#

so that means even on newer versions WE caused state changes won't reflect in the pdc

chrome beacon
#

You mean with BlockPDC?

#

custom block data*

lilac dagger
#

ye

#

because i remember slightly that block pdc works with nbt from chunk

chrome beacon
#

It does

#

It probably leaves some dead tags in the nbt

#

Could give it a try and see

glossy venture
#

anyone knw why its not js blocking for more data

#
    public static int readVarIntFromStream(InputStream stream) throws IOException {
        return readVarInt(() -> {
            int r = stream.read();
            int t = 4;
            while (r == -1 && t > 0) {
                r = stream.read();
                t--;
            }

            if (r == -1) {
                throw new IllegalArgumentException("Unexpected end of stream while reading var int");
            }

            return r;
        });
    }
``` ive tried adding retries as u can see here
slender elbow
#

end of stream means end of stream

#

no amount of retries is gonna make new data appear

glossy venture
#

ok so this means the connection was closed

#

or what

#

bc it should block for data if the socket is open

azure zealot
#

Connection is closed

#

Fin packet was received

glossy venture
#

interesting

#

could be some concurrency shit that im like closing the connection myself but after i check whether its open on the read thread

#

unless mc servers sometimes just close connections without a packet

wet breach
glossy venture
#

i mean in normal operation of a minecraft server specifically but ye

wet breach
#

yes its routine, players make it happen all the time

glossy venture
#

oh

wet breach
#

if you close the client via the x button or task manager, the server closes the connection after a period of not receiving anything back

glossy venture
#

yk what triggers it?

#

yeah but thats when the client is already closed

wet breach
#

sometimes routes die that the connection was using, and you won't get packets for that either

glossy venture
#

im confused bc its happening randomly somtimes while connected to hypixel, also like never after the same amount of time or anything

wet breach
#

you could have a flaky route

glossy venture
#

i feel like something in my protocol impl could be fucking it up but idk

wet breach
#

try changing your dns servers to something else to see if you can force a different route for connection

glossy venture
#

it connects fine on a normal client tho

wet breach
#

oh well it could very well be your implementation then lol

glossy venture
#

only difference is that im using std sockets not netty

wet breach
#

shouldn't make a difference really as long as you are sending those heart beat packets at the appropriate times

glossy venture
#

hm

wet breach
#

not only do you have to send a keep alive packet but you need to respond to the servers keep alive as well

glossy venture
#

oh wait

#

i think im only responding to server keepalives rn

#

not sending my own

#

yeah im only doing this i dont think i saw anywhere that i needed to send my own heartbeats on the wiki.vg

#

might just be blind tho

wet breach
#

but I think there is a couple of other packets that get sent too

#

might want to go through them to see which ones need to be sent routinely

#

and you are right, seems it change maybe but you only need to respond to the packet

#

but you only have 15 seconds to do so

#

otherwise server dc's you and if the client doesn't receive one in 20 seconds the client dc's

glossy venture
#

ye i do it as soon as its received so im pretty sure thats not it

#

im on 1.8.8 ver of the protocol btw

#

so maybe i do have to send them frequentyl

#

not sure why i decided to implement protocol 47 it has some weird choices of field types and shit

glossy venture
#

oh wait

#

dude this shits so confusing because ive also ran it for like 10 minutes without issues multiple times

#

its just completely random

wet breach
#

well, try sending that packet every so often

glossy venture
#

yeah

#

aight ty

#

ill try once im home

wet breach
#

forgot about that one

#

server sends a ping packet as well lol

grand flint
#

where do i find spigot devs 😭

eternal oxide
#

Have you looked in the closet?

ivory sleet
blazing ocean
river oracle
worthy yarrow
#

Just come out miles

valid burrow
#

why are these not the same when i compare them ```
Location{world=CraftWorld{name=world},x=-90.0,y=-59.0,z=-15.0,pitch=0.0,yaw=0.0}
Location{world=CraftWorld{name=world},x=-90.0,y=-59.0,z=-15.0,pitch=0.0,yaw=0.0}

grand flint
valid burrow
#

they are the exact same

#

why does java disagree

#

im loosing my mind over this

eternal oxide
#

are you comparing with == or .equals?

valid burrow
#

==

glad prawn
#

bruh

valid burrow
#

does it make a difference here?

glad prawn
#

yes

eternal oxide
#

== is checkign instance

valid burrow
#

ah

magic schooner
#

Is bro making a gambling plugin

valid burrow
#

yea

magic schooner
#

Great 👍

valid burrow
grand flint
magic schooner
#

What are you onto

grand flint
#

me?

magic schooner
#

ye

grand flint
#

wdym

magic schooner
#

#general if it's not development related

#

¯_(ツ)_/¯

eternal oxide
#

?services

undone axleBOT
inner mulch
#

is a hashmap as or almost as fast as direct access?

eternal night
#

wat

#

no

inner mulch
#

:(

fathom silo
#

Hi, someone asked for a refund saying he did not download the plugin. Is there a way of verifying if they downloaded the jar?

magic schooner
#

Scam

#

I don't think so there is

river oracle
#

You have to go through the hash function than it's O(N) over the linked list if there are any conflicts

#

Hash functions themselves could be O(N) or greater

inner mulch
#

okay, is there an average speed difference?

eternal night
#

no

river oracle
eternal night
#

depends entirely on your map load, the speed of hashCode() and yea, collision

inner mulch
#

okay

river oracle
#

If you have a bad hash function your map will be slower

inner mulch
#

is the auto generated one bad?

river oracle
#

No it's pretty good

inner mulch
#

okay

river oracle
#

In some cases a for loop is actually faster than a hashmap 🫡

inner mulch
#

how many elements in the for loop?

river oracle
#

Depends 💯

inner mulch
#

ok

river oracle
#

Don't design for speed though design for best practice

#

Unless you're working in embedded systems such thoughts aren't necessary

inner mulch
#

im developing serialization

#

to bytes

river oracle
#

Considering you're not using C on a low level system any performance gains you get by these micro optimizations aren't worth while

inner mulch
#

i heard java was pretty fast nowadays and in some cases close to languages like c++

#

so its still probably worth it

river oracle
#

It's not lol

#

You're saving nano seconds

inner mulch
#

seems worth it 💯

river oracle
#

Go run jmh on it you'll hate yourself

inner mulch
#

jmh?

river oracle
inner mulch
#

how many nanos should it take?

#

with 11 fields

river oracle
#

Don't overcomplicate things

#

Design a good api

#

If it's slow to a detrement fix it later

#

Computers are stupid fast take advantage of that by prioritizing dev UX over computational speed

inner mulch
#

ok

patent onyx
#

You will find chatty / unoptimized use of persistence usually far most impacting to performance

#

Async profiler can make some cool flamegraphs for you to see the distribution of cpu samples

sly topaz
inner mulch
#

it does

sly topaz
#

it does not, the only place where it may matter is embedded systems since you have to save every bit you can

#

other than that, modern hardware has pushed the performance boundary to memory-bound operations, so in the end it only matters how efficiently you can store data to get as much cache hits as you can

sly topaz
#

you can argue that in the grand scheme of things, languages like Java might make that harder considering the Object header is like 76 bytes, however it makes up by leveraging the flattening as well as techniques to avoid fragmentation to the GC

#

so in the end, it truly doesn't matter

blazing ocean
#

no

#

💀

slender elbow
#

is 1.21.2 safe to run?

worthy yarrow
#

No you’ll get hacked

eternal oxide
#

It will make your cooker explode

slender elbow
#

not the cooker

ashen ferry
#

Hi, i was ask. I have ClearLagg i want add with items adder. Config - 'time:400 msg:&4 %img_serverlogo% &cWarning Ground items will be removed in &7+remaining &cseconds!' i want this img_serverlogo as a rank prefix?

#

and its work?

peak depot
pseudo hazel
#

clearlagg is useless anyways

#

but you would have to use a resource pack if you arent already

#

also please try using something like google translate or some AI to make coherent sentences

#

not to hate but its hard to help when I dont really know what you mean

eternal oxide
#

@worldly ingot as you look online ^

worthy yarrow
#

So you give me 100 grand and I give you 15k back?

remote swallow
#

they meant to say give me 15k

spiral light
#

Does someone know how to modify TagKey's from Minecraft via code ? or at least where the data from the tags are stored (in code)?

runic kraken
#

hey, does anyone have any helpful code that will help me create an npc using mns for version 1.21.1?

spiral light
runic kraken
spiral light
#

in the newer version you need to create a new entity type and register it.... and i think i modified packets to send packets directly for the player for the npc

chrome beacon
proper cobalt
#

Hey guys, is editing item meta broken?
I have this

     item.editMeta(meta -> PhoneKey.PHONE_INSTANCE.set(meta, phone));

set just does this

    default <T> void set(@Nullable PersistentDataHolder holder, T value) {
        if (holder != null) {
            PersistentDataType<Object, T> type = this.getType();
            holder.getPersistentDataContainer().set(this.getNamespace(), type, value);
        }
    }

And it was working fine yesterday, the meta/pdc was being updated, but today it doesn't work, afaik the code wasn't changed
If I debug Phone#getNumber() before and after, it is changed successfully but the pdc isnt changing anymore

#

Is this like an unstable api?

hard socket
#

How can I disable shif clicking items into an invventory

#

cancelling the event doesnt seem to cover this case

chrome beacon
#

It does

#

Show your code

#

?paste

undone axleBOT
hard socket
#

inserting items manually doesn't get placed and the message fires

#

but not shift clicking

chrome beacon
#

Inventory holders 🔫

#

Also the clicked inventory won't be yours since they're clicking the player inventory

hard socket
#

Ahhh shoot

#

yeah true true

proper cobalt
#

oh // Paper start

#

paper really deprecates some pretty nice methods that work on spigot and then introduces broken methods

#

nice

#

/j

lapis mulch
#

Hello, did you know how to get tag in the new data system 1.21 ? I try to get a new registered enchantment with NMS and i need to get the enchantment on an item, all spigot/bukkit methods to verify enchantments use the base minecraft registery, so i want to verify by the data component item.

net.minecraft.server.v1_21_R1 doesn't exist, CraftItemStack.asNMSCopy(itemStack); return net.minecraft.world.item.ItemStack

NBTTagCompound doesn't exist anymore too. (Logic 🤓 )

chrome beacon
#

to register your enchantment

river oracle
#

@worldly ingot do you have any tips to to deal with patch merge conflicts I'm like dying from skill issues out here

chrome beacon
#

No need to modify the internals

worldly ingot
#

Patch merge conflicts are always annoying tbh. There's really no great way to clean them up lol

worthy yarrow
#

Choco should join the NDG team

river oracle
#

I feel like I'm clearly just not taking the master patch

young knoll
#

Normally I just cry

#

And then redo the patches

worldly ingot
#

Yeah, way I do it is basically just delete the patches I've generated (i.e. if there are any new ones, discard them), merge in master and make sure the patches align with the master branch, apply patches so you have the newest source, then re-make your changes and regenerate your patches

river oracle
#

well with how little diff their is I feel like their has to be a way to automatically do it no? I mean I could manually redo the patches, but I can't even get that far right now

worldly ingot
#

You're probably just not doing an applyPatches after you pull in the master patches

river oracle
#

I do, but I end up getting malformed patches for the ones I've changed

#

I just have to delete them before merge ig like you said

worldly ingot
#

Yeah

river oracle
#

is their seriously no tool for merging patches though?

young knoll
#

There is no patch patcher

river oracle
#

sadge :(

shadow night
#

Weird

#

Lets write our own one

slate siren
#

What can I use to permanently set 64 lapis lazuli in the enchantment table

young knoll
#

InventoryOpenEvent probably

#

And the close event to remove it, otherwise it will be given to the player

pallid idol
#

Hey how can i get a hotkey like the SwapHandItems

young knoll
#

What

chrome beacon
#

You can't add keybinds

pallid idol
#

no

pallid idol
#

But I can still get which one the player has occupied. So what he put sprinting on or something like that

chrome beacon
#

No

#

Keybinds are clientside

young knoll
#

Well

pallid idol
#

Ah ok

young knoll
#

We’ll have an input api soon™️

pallid idol
#

👍 I like it

river oracle
pallid idol
#

but I know that from other servers that show my hotkey and like F for changing item to off hand so that doesn't work yet?

chrome beacon
#

If you want to show the keybind in text you can do that

#

That's part of Minecrafts text component system

pallid idol
#

ah ok do you have a documentation then I can take a look at it and found nothing.

chrome beacon
river oracle
#

md_5 is doing it ig

chrome beacon
#

Not quite the same as what they were asking for

inner mulch
#

why does my code run faster if there are print statements and its slower if there arent?

im sending 1 million packets per test, when i print the number received and number sent, it takes 4700ms, but without prints it takes 6100ms? I've ran it multiple times

shouldnt it be harder for my pc to also print to console?

chrome beacon
#

The time can vary depending on background tasks that your system has running

pallid idol
inner mulch
young knoll
#

At least you should be able to make a nice double jump now

#

Without relying on flight

inner mulch
#

has this something to do with my cpu cache

river oracle
#

World's most useful packet

   @Override
   public void handleBundleItemSelectedPacket(ServerboundSelectBundleItemPacket serverboundSelectBundleItemPacket) {
      this.player.containerMenu.setSelectedBundleItemIndex(serverboundSelectBundleItemPacket.slotId(), serverboundSelectBundleItemPacket.selectedItemIndex());
   }```
#

no event for selection items ig, well maybe actually I didn't realize you have the player in this class

young knoll
#

Oh yeah I forgot about bundles

#

They fixed the dupe I assume

river oracle
#

hopefully 👀

#

yeah they fixed it it seems

remote swallow
#

or merged the pr

river oracle
#

pain

#

this must be new [16:26:21] [Server thread/INFO]: Server empty for 60 seconds, pausing

young knoll
#

Aren’t all packets managed async

river oracle
#

they are all sent and recieved asynchronously but not all process asynchronously

#

only packets with PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinteleportaccept, this, this.player.serverLevel()); are forced async afaik

#

seems like This is gonna take more than one brancell to figure out

eternal oxide
#

I can lend you one, but I want it back

brave ice
#

Hello, I have this error with ProtocolLib. Anyone knows how to solve it ? Thanks.

here is the code:

public static void sendCooldownPacket(Player player, Material material, int cooldownTicks) {
        try {
            PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.SET_COOLDOWN); // Use PacketType instead of int
            packet.getIntegers().write(0, material.getId()); // Item ID
            packet.getIntegers().write(1, cooldownTicks); // Cooldown Ticks

            protocolManager.sendServerPacket(player, packet);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
river oracle
#

1.9.4 wild ah release

brave ice
brave ice
chrome beacon
brave ice
#

ah

chrome beacon
#

Check the 1.9.4 version

river oracle
#

@young knoll This is wild but you can actually get a packet on hover for bundle

chrome beacon
#

Or just use your IDE and see what the packet contains

river oracle
#

which means you could technically have an ItemHoverEvent that only works for the bundle

#

very strange but very awesome

young knoll
#

Huh

#

Well I know what I’ll be using for buttons in the future

river oracle
#

it only detects hover off though from the looks of it

#

still better than nothing

young knoll
#

Ah, not as cool

river oracle
#

yeah very not as cool :(

young knoll
#

But a gui button that can be scrolled through for more options is kinda neat

river oracle
#

I put it in an if statement that excluded that

blazing ocean
river oracle
#

I think taking stuff out of bundles might be client side

#

gotta double check the full server but the code is like never used

blazing ocean
#

why are you using 1.9.4 anyway

brave ice
#

bc i want to make a freebuild server working only between 1.9.4 and 1.11

#

to have only blocks in these version

#

and honestly

blazing ocean
#

crazy fucking versions

brave ice
#

even if its bad

#

i have more exp in old versions 🤣

young knoll
#

What did modern blocks do to you

remote swallow
#

i wouldnt be able to survive without concrete

blazing ocean
#

I wouldn't be able to survive with F3+F4 anyway

#

when did they add taht again

#

1.19?

remote swallow
#

atleast 2 weeks ago

brave ice
blazing ocean
#

that's old

young knoll
#

Bullying the waxed lightly weathered cut copper stairs

blazing ocean
#

4.5 years ago

blazing ocean
river oracle
#

"I don't like them" Don't use them tehn

#

like you have a choice you know

#

no one is going to kill you if you don't

brave ice
#

ik

#

but

#

like

#

my goal

#

talking in this channel

blazing ocean
#

is stupid

river oracle
#

is to understand 1.9.4 isn't supported?

#

oh

#

man I was so close

#

?1.9

#

damn

blazing ocean
#

?outdated

#

wow

#

?1.8

undone axleBOT
blazing ocean
#

almost the same

compact haven
#

bro what

#

were u not here or smth for 1.8 because how could you mistake 1.9.4 for 1.8.8

river oracle
wet breach
#

your comment suggests that 1.9.4 is somehow the current version

blazing ocean
#

@ phoenix616 make howoldisminecraft194.today

wet breach
#

maybe I live in an alternate universe

blazing ocean
#

of course you do

compact haven
#

1.9.4 is very far from the current version

#

but I couldn't ever see someone mistaking 1.9.4 for the 1.8.8 command and site

wet breach
#

right so your argument is moot on whatever point you were trying to make in regards to 1.8

compact haven
#

like that was just too iconic to forget

remote swallow
#

i love playing on that random version like people on 1.20.1 still

compact haven
#

girl shut the fuck up

#

legit the point wasn't that 1.9.4 is new or supported

#

it's that 1.8.8 and 1.9.4 are not the same

wet breach
#

they are both outdated

river oracle
#

yeah I think rad knew that kekw

compact haven
#

are you lacking reading comprehension

remote swallow
#

"almost the same"

wet breach
#

not sure why you are trying your hardest here to win this finite detail argument

remote swallow
#

there is no 1.9.4 site so they send the 1.8 site as they were released at similar times

blazing ocean
river oracle
#

don't dis 1.11 come on

#

iconic version

wet breach
compact haven
#

no it was moreso that they did ?1.9 as if to send the 1.8.8 site (as in they thought that 1.9 was 1.8.8)

#

but whatever not important

blazing ocean
blazing ocean
cedar saffron
#

im older then minecraft

wet breach
compact haven
blazing ocean
compact haven
#

apologies then boy

cedar saffron
blazing ocean
#

lies

river oracle
cedar saffron
#

apologize, boy

compact haven
#

my tiny joke remark about how you could possibly mistake the two was not being an ass

remote swallow
#

i love 1.8.2 and 1.16.2

compact haven
#

frost just had to come in and yap

wet breach
#

indeed

river oracle
#

@young knoll it honestly doesn't seem like this event is cancellable 😭

cedar saffron
#

stfu dominick 🗣️ 🔥 ‼️

river oracle
#

cuz its async

wet breach
#

its the equivalent of coming in and slapping someone in the face

cedar saffron
#

frost is amazing!

compact haven
#

im not sure that mine was somehow slapping Y2K but okay

#

like I would say that in front of his face if he made that mistake in front of me

compact haven
#

deadass

young knoll
#

We just need a ?howold

compact haven
#

and then I would apologize if he told me that I was wrong in thinking he meant 1.9 was 1.8

#

deadass x2

wet breach
young knoll
#

With a site that shows how old each version is live

compact haven
#

oh yes that is what it felt like

river oracle
young knoll
#

Someone get on that

#

Webdev scares me

wet breach
compact haven
#

x.x.x.minecraftishowold.today?

young knoll
#

Can you do a live timer without js

compact haven
#

1.9.4.minecraftishowold.today?

blazing ocean
compact haven
#

that's one domain and easy af to program

#

can probably do it with just nginx

#

kekw

wet breach
blazing ocean
compact haven
#

oh

#

tf when did that exist

blazing ocean
#

@young knoll do you have permissions to add CCs

#

if so

#

please

compact haven
#

if you took an extra minute or two I would've been convinced you just spun that up

#

also lmfao today 1.21.2 birthday

blazing ocean
#

i only found it out this way

young knoll
#

Oh neat

#

Shame it isn’t all on one page tho

blazing ocean
#

can you not put args in CCs

#

because

#

?cba works

undone axleBOT
#

radstevee definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.

remote swallow
#

cba has no args

blazing ocean
#

tbf that's not an arg

compact haven
#

im not sure that it does args, it could* match spaces though

remote swallow
#

cba just uses ur name

compact haven
#

ah

blazing ocean
#

but it does replace {author}

#

?about

#

?botinfo

#

?info

undone axleBOT
young knoll
#

?howold 1.20.4

undone axleBOT
river oracle
#

?howold 1.9.4

undone axleBOT
blazing ocean
#

yay

river oracle
#

coll magician

remote swallow
#

?howold urmom

undone axleBOT
blazing ocean
#

lmao

young knoll
#

Now someone find the author of that website and make them add embeds

blazing ocean
river oracle
#

@young knoll I have a very lame discovery., Seems like bundles are mostly client sided

remote swallow
#

i cant find any whois for it

orchid gazelle
#

1.12.2 is undoubtly the best version out there

blazing ocean
#

shut the fuck up feist

blazing ocean
orchid gazelle
#

No u

young knoll
#

Ooh it has an embed

#

I like

#

?howold 1.16.4

undone axleBOT
blazing ocean
#

W coll

young knoll
#

Wonder how far it goes

#

?howold 1.0

undone axleBOT
blazing ocean
#

?howold infdev

undone axleBOT
orchid gazelle
#

We don't need that command it's only annoying

blazing ocean
#

You#re annoying with saying 1.12 is the best version

orchid gazelle
#

Can't wait to see idiots spamming ?howold 1.12.2

river oracle
#

I can't wait to do that to you!

young knoll
#

?howold 1.12.2

undone axleBOT
blazing ocean
#

Gonna be spamming that into your fucking face

orchid gazelle
#

If someone of you spams ?howold 1.12.2 fuck you

river oracle
#

its 7 years old!

young knoll
#

Dang that’s almost as old as epic

orchid gazelle
#

7 years old and still the best, what an achievement!

remote swallow
river oracle
#

can confirm epic is above TOS age

#

can not confirm the same with neon

blazing ocean
#

can confirm miles is above TOS age

young knoll
#

Yeah idk if it can do pre 1.0

#

If it can idk the syntax

wet breach
river oracle
orchid gazelle
#

I'll now once in a while regex the discord chat through with ?howoldis just to write a message recommending to use 1.12.2 for everyone that wanted to make it look bad by typing that command

wet breach
#

guess it don't work

river oracle
#

Check the piston meta

young knoll
#

?howold b1.2

undone axleBOT
young knoll
#

Nice

remote swallow
#

cant believe 1.0 is 5 years older than neon

young knoll
#

The oldest one on piston meta is

#

?howold rd-132211

undone axleBOT
remote swallow
#

does it do snapshots

young knoll
#

?howold 15w37a

undone axleBOT
young knoll
#

Yes

remote swallow
#

?howold 1.21.2-pre3

undone axleBOT
remote swallow
#

?howold 24w39a

undone axleBOT
remote swallow
#

fancy

#

it is def just parsing the piston data and getting the date

blazing ocean
#

?howold

undone axleBOT
#
CafeBabe Help Menu
Syntax: ?howold <text_final>
Custom command.

Created via the CustomCom cog. See ?customcom for more details.

blazing ocean
#

?howold 1.21.2

undone axleBOT
chrome beacon
#

?howold 1.8

undone axleBOT
blazing ocean
#

yooo also 10 years now

remote swallow
#

?howold choco

undone axleBOT
young knoll
#

The world may never know

blazing ocean
#

younger than 33

sweet pike
#

does anyone know how to calculate the number of characters before a TextDisplay cuts to the next line?

For ex. my text display lineWidth is set to 300, but the display cuts off characters well before 300 characters are in the line

#

the javadocs are the poorest for display entities, so there's also no infomation on what set/getLineWidth does

blazing ocean
#

Wiki also just says this: line_width: Maximum line width used to split lines (note: new line can be also added with \n characters). Defaults to 200.

sweet pike
#

for context im trying to get centered text along with text that's aligned to the left

#

so like

                 Some Cool Text!
  • Hello World
  • Hello Minecraft

etc

#

if that's rendered by the client that seems pretty impossible to do that if Some Cool Text! changes from string to string

blazing ocean
#

You could do it like this but keep in mind that this assumes the font the client uses:

  • append your centered text
  • append newline
  • append your text to be left aligned
  • append (maxWidth - widthOf(leftAlignedText) / widthOf(" ") spaces (pseudocode)
sweet pike
sweet pike
blazing ocean
blazing ocean
sweet pike
#

appending centered text? how do i do that if i dont know how many pixels to centre it in

blazing ocean
#

Oh it's just centered by default

sweet pike
blazing ocean
#

Yeah

#

I mean to be honest tho

#

I'd just use multiple text displays with diff alignments

#

(I just found out about them lmao)

sweet pike
#

finna be a nightmare with what im trying to do, but thanks, i'll look into it

sweet pike
#

or is that affected by client GUI components?

blazing ocean
sweet pike
#

or all using the same texturepack is enough

sweet pike
# blazing ocean Not necessarily

so everyone using the same resource pack is enough to have the manual width calculations be consistent with everyone? such that my 100px is everyone else's 100px?

blazing ocean
sweet pike
thorn crypt
#

Hey, that might be really dumb but for some reason, I can't put an item in a chest, i debugged and it's technically supposed to have an item in it, but it doesn't.
Here is the code and the debug in the console :

public static void chestFill() {
        Location location = new Location(Bukkit.getWorld("world"), -17, 62, -5);
        Block block = location.getBlock();

        block.setType(Material.CHEST);

        Bukkit.getScheduler().runTaskLater(MyBattle.getInstance(), () -> {
            if (block.getState() instanceof Chest) {
                Chest chest = (Chest) block.getState();
                Inventory chestInventory = chest.getBlockInventory();

                // Créer un ItemStack avec les informations de l'objet que tu veux placer
                ItemStack itemStack = new ItemStack(Material.DIAMOND_SWORD, 1);

                // Placer l'objet dans l'inventaire du coffre
                chestInventory.setItem(0, itemStack);

                // Mettre à jour l'état du coffre
                chest.update(true);
                Bukkit.getLogger().info("Chest has been filled with a diamond sword.");
            } else {
                Bukkit.getLogger().severe("The block at x=" + location.getBlockX() + " y=" + location.getBlockY() + " z=" + location.getBlockZ() + " is not a chest.");
            }
        }, 1L);
    }

[01:31:44 INFO]: Chest has been filled with a diamond sword.

drowsy ginkgo
thorn crypt
fading drift
#

is there a way to prevent players from tabbing in chat to see the players online

worldly ingot
#

Not unless you hide the players from the client

#

The client is aware of all online players

young knoll
#

getBlockInventory returns the live chest inventory

fading drift
#

ah

#

I want to show the player but hide their name

thorn crypt
young knoll
#

The update method overrides the chest with whatever it contained when the snapshot was made

worldly ingot
#

Yeah I don't think you can remove name suggestions. That's all client-driven. No server communication there

thorn crypt
#

thank you !

fading drift
#

doesnt hypixel do it

worldly ingot
#

We do not

#

That I'm aware of anyways lol

young knoll
#

I believe there is a getSnapshotInventory if you want to use the update method

fading drift
#

what if I modify the packets that are sent to the client regarding the player's name

worldly ingot
#

None are sent

#

The client has a list of all online players. It just knows about them

#

The way they know is with the add player packet lol

#

As long as they exist in the world to the client, their name can be tab completed

young knoll
#

Modify every add player packet to report the players name as poopbutt

fading drift
#

hypixel does do it somehow

#

you cant queue a bedwars game and tab to find player names

worldly ingot
#

Oh, that's because we hide the players themselves lol

#

The players themselves have fake profiles, basically

fading drift
#

how does the client see them then

#

oh wtf

worldly ingot
#

(not leaking anything, that's just literally the only way that can work)

#

They have custom skins and their names are random

fading drift
#

so theyre technically just like

#

npcs

worldly ingot
#

I mean yeah basically

fading drift
#

with the player's skin and the jumbled name, copying their movements

worldly ingot
#

Well an NPC is just a player that doesn't move, cause there's no associated server-sided player

#

These are players, their game profile is just swapped with some other game profile on the client

fading drift
#

I see

#

then how would you get them to look like theyre moving

young knoll
#

They are moving

worldly ingot
#

They're normal players. When the players are added on the client, their profile is just changed. That's all

fading drift
#

I see

young knoll
#

The player is still mirroring a real player, they just have their name and skin changed

worldly ingot
#

Basically listen to this outgoing packet and if the action is "add player", change the profile property

fading drift
#

and then at the start of the game you have to reset their profiles

worldly ingot
#

Yes. You have to remove those profiles and re-add the regular ones

#

(there's a player info remove packet)

young knoll
#

Does the skin have to be signed

worldly ingot
#

I believe so but that's not hard to do. You can get it from Mineskin

young knoll
#

Yeah

worldly ingot
#

I think we just have one skin that's signed and reused

young knoll
#

Is it a maid skin

#

It should be

worldly ingot
#

No it's a black skin with a question mark on its head I think lol

young knoll
#

Aww, Boring

worldly ingot
#

I will be sure to bring up internally: Change the skins to cat maids

young knoll
#

Excellent

slate siren
#

I made a system where the player loses redstone when he gets hit, but there is a problem with pvp, it also gives redstone in closed areas

fading drift
#

wait hypixel has bedwars games in seperate spigot servers than the lobby whereas my stuff is all running on the same spigot server so it doesn't send an add player packet when changing worlds

#

I have an idea

young knoll
#

You can manually send packets

#

In this case send a remove and then another add

#

Or just hidePlayer and showPlayer which should do the same

fading drift
#

I think theres a way around that

remote swallow
sly topaz
#

there's no way they have a separate server for each arena, they have a ton of them

#

most likely like x amount for each server rather, but I wouldn't know

fading drift
#

no they have about 5 or so lobbies running on a server, and maybe like 30 bedwars arenas running on one server, etc

#

those numbers are guesses

sly topaz
#

I am always amazed at how they have a well-built archquitecture behind it yet bedwars is the one gamemode where lag is a constant lol

#

goes to show just how MC isn't made for that kind of scale I guess

young knoll
#

Skyblock:

sly topaz
#

well, skyblock is more understandable with all the farms and shit

#

bedwars shouldn't be an expensive game to run

nova notch
young knoll
#

Funny

fading drift
#
[11:49:51 INFO]: UUID of player BuckyBallsTV is 4fc626ce-f01a-4312-ab11-2eeed4a0cdf3
[11:49:51 INFO]: Player join event: CraftPlayer{name=BuckyBallsTV} Location{world=CraftWorld{name=lobby},x=2.4291644106742267,y=99.0,z=26.19026505980617,pitch=53.849976,yaw=-270.74948}
[11:49:51 INFO]: action: ADD_PLAYER
[11:49:51 INFO]: [PlayerInfoData[latency=0, gameMode=ADVENTURE, profile=com.mojang.authlib.GameProfile@2e707093[id=4fc626ce-f01a-4312-ab11-2eeed4a0cdf3,name=BuckyBallsTV,properties={textures=[com.mojang.authlib.properties.Property@5cba55b4]},legacy=false], displayName=null]]
[11:49:51 INFO]: newData: PlayerInfoData[latency=0, gameMode=ADVENTURE, profile=com.mojang.authlib.GameProfile@6713ac88[id=1b7b6c60-dd98-4748-a5e9-4bb21feaffc1,name=aaa,properties={},legacy=false], displayName=null]      
[11:49:51 INFO]: action: ADD_PLAYER
[11:49:51 INFO]: [PlayerInfoData[latency=0, gameMode=ADVENTURE, profile=com.mojang.authlib.GameProfile@2e707093[id=4fc626ce-f01a-4312-ab11-2eeed4a0cdf3,name=BuckyBallsTV,properties={textures=[com.mojang.authlib.properties.Property@5cba55b4]},legacy=false], displayName=null]]
[11:49:51 INFO]: newData: PlayerInfoData[latency=0, gameMode=ADVENTURE, profile=com.mojang.authlib.GameProfile@48a66463[id=1b7b6c60-dd98-4748-a5e9-4bb21feaffc1,name=aaa,properties={},legacy=false], displayName=null]      
[11:49:51 INFO]: BuckyBallsTV[/127.0.0.1:32454] logged in with entity id 4140 at ([lobby]2.4291644106742267, 99.0, 26.19026505980617)
#
            protocolManager.addPacketListener(new PacketAdapter(
                    this,
                    ListenerPriority.NORMAL,
                    PacketType.Play.Server.PLAYER_INFO
            ) {
                @Override
                public void onPacketSending(PacketEvent event) {
                    EnumWrappers.PlayerInfoAction action = event.getPacket().getPlayerInfoAction().read(0);
                    System.out.println("action: " + action);

                    if (!action.equals(EnumWrappers.PlayerInfoAction.ADD_PLAYER)) {
                        return;
                    }

                    List<PacketPlayOutPlayerInfo.PlayerInfoData> newPlayerInfoData = new ArrayList<>();


                    List<PlayerInfoData> playerInfoData = event.getPacket().getPlayerInfoDataLists().read(0);

                    System.out.println(playerInfoData);

                    playerInfoData.forEach((data) -> {
                        // we can now change the profile here
                        GameProfile profile = new GameProfile(UUID.fromString("1b7b6c60-dd98-4748-a5e9-4bb21feaffc1"), "aaa");

                        PlayerInfoData newData = new PlayerInfoData(WrappedGameProfile.fromHandle(profile), data.getLatency(), data.getGameMode(), data.getDisplayName());

                        System.out.println("newData: " + newData);

                        newPlayerInfoData.add((PacketPlayOutPlayerInfo.PlayerInfoData) PlayerInfoData.getConverter().getGeneric(newData));
                    });

                    if (!newPlayerInfoData.isEmpty()) {
                        event.getPacket().getModifier().write(1, newPlayerInfoData);
                    }
                }
            });```
#

this sets the name in the tablist to aaa, changes the skin to alex/steve (which isnt actually the skin of player aaa) but still when I tabcomplete in chat itll show the real player name

mortal hare
#

r/programminggore

#

this screams c++ templates

#

too bad the language is based on JVM

#

sure you can use interfaces, but then you have cancer of implementing interface for each data type, also delegating each type at runtime if you want to use one generic vector class

#

all of this just because kotlin doesnt implement operator arithmetic under Number type

#

but delegates it to each concrete type (Int, Short, etc.)

#

maybe you guys any have ideas

#

how to achieve this, but in like clean code

#

because this sucks

rough ibex
#

the good thing is that it's readable and I can understand it

sly topaz
#

the way to do it is to stop trying to be clever and overriding operators

#

it is the worst thing modern languages allow

mortal hare
#

the only one solution to this i can think of is probably to implement Vector1D interface for each data type (IntVector1D, Long...) then create

class VectorialVector2D<T : Vector1D<T>>(val component1: T, val component2: T)

class which constructs Vector2D from two Vector1D's

then afterwards i could probably create

@JvmInline
value class IntVector2D(private val vector: VectorialVector2D<IntVector1D>) {
  constructor(component1: Int, component2: Int): this(VectorialVector2D(IntVector1D(component1), IntVector1D(component2))
}

which would create compile-time object, which at runtime will consist of only VectorialVector2D type (basically fake class, it gets erased when program gets compiled)
and create such type for each of the type

but extension functions allow me to create any numeric type from one type

var vector = Vector1D(4.toByte())

thus the need of implementing every type of Numeric type is not needed but then you get this bulky mess, also i need to import the functions i use

sly topaz
#

I believe what you are doing in the first screenshot

#

if you try to be more clever about it, you'll just drown your code in rather unnecessary abstractions

#

sure, it is repetitive, but repetitive doesn't mean bad, it just means there's no clean way. But simple beats clean any time of the day

echo basalt
#

Glorified array

mortal hare
graceful oak
#

When saving values like a currency is there anything wrong with using the minecraft scoreboard rather than storing it in a file?

I would figure this would save time because minecraft would already be saving and handling these value for you when the server goes down

mortal hare
#

but if i was cutting corners for private plugins

#

that's what i would do 😄

graceful oak
#

I mean its not really the end of the world just was wondering if there was any downside to doing this.

sly topaz
#

if your server crashes, your scoreboard data can and will be lost considering it is most likely saved on world save rather than on write

graceful oak
#

That's fair

sly topaz
#

besides, it would be hella awkward to work with them in such fashion, I wouldn't personally recommend it given that they do not have a pretty API either

graceful oak
#

I mean with currencies I probably wouldnt save on every action but rather on a timer with the world so would that be no different? I feel like updating a file every time a currency is spent/changed would be intensive based on the player size no? But in this case I guess I couldnt force save the world without restarting the server

sly topaz
#

why are you trying to make this work, what's wrong with using a database

#

if you don't feel like coding an economy system, then use an existing solution

graceful oak
#

Im just exploring different options when making something

elder hazel
#

Does anyone have the updated versions / locations of these dependencies
Project..

<repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
        </repository>
    </repositories>

Module..

<dependencies>
        <dependency>
            <groupId>org.github.paperspigot</groupId>
            <artifactId>paperspigot</artifactId>
            <version>1.8.8</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.md-5</groupId>
            <artifactId>bungeecord</artifactId>
            <version>1.12</version>
        </dependency>
graceful oak
#

Im not trying to get around making something but rather think of better ways to make it

sly topaz
#

it is certainly a radical idea, I'll give you that. However I assure you anything that depends on Minecraft's own systems doesn't scale at all since it often goes far and wide to what its intent is

sly topaz
#

?1.8

undone axleBOT
graceful oak
#

Thats fair thanks for the help

quaint mantle
#

booom

#

double combo

elder hazel
sly topaz
#

paperspigot is definitely not

quaint mantle
#

ask in paperspigot

#

not here

#

:D

elder hazel
#

Bungeecord

quaint mantle
#

again

#

?whereami

quaint mantle
#

omg the real message

sly topaz
#

also the artifact should be bungeecord-api

elder hazel
# sly topaz isn't bungeecord on sonatype?

Heres the full repositories chunk in my POM:

    <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>dmulloy2-repo</id>
            <url>https://repo.dmulloy2.net/nexus/repository/public/</url>
        </repository>
    </repositories>
#

This is a old project, years old - just trying to rewire it so it compiles

#

been a while since I touched java or anything maven just going off the errors when trying to compile now

sly topaz
#

not the one for luckperms either

#

for bungeecord it does, but the artifact id is wrong

#

ah, luckperms is in maven central so it should be fine

brittle gate
#

any plans on adding the new consumable component?

sly topaz
#

you mean the FoodComponent?

summer scroll
#

I think he’s referring to the new nbt data that’s present in 1.21.2?

slate siren
#

Now players right click on the compass and When they select a game, we teleport them with mvtp. I want them to be teleported back to the location they left from. How can I do this?

summer scroll
slate siren
# summer scroll Store the location somewhere

Everyone says this, yes I know I can save the location but players are teleported to the world with the mvtp command multiverse core, if we save the location, should we teleport again with this command?

#

Or what

summer scroll
sly topaz
#

is this question development related?

#

because I don't understand why you would use mvtp if you were using the API and not the teleport method as aglerr suggested

sly topaz
summer scroll
#

That open a lot of customizable options

vague swallow
quaint mantle
#

😱

#

hes the one from

#

?whereami

old flicker
#

I have a weird one for yall ... recently I am having an issue where whenever anyone exits the end through the center portal, my PlayerRespawnEvent keeps getting triggered. This did not occur previously.

Why exiting the end is calling PlayerRespawnEvent, I have no idea... but it keeps replacing the first item slot with a claim tool as it thinks the player has respawned

#

Does exiting the end through the middle portal have something to do with respawning 🤔

young knoll
#

It has triggered that event for a long time

#

Check the respawn reason in the event

old flicker
#

weird

#

why would minecraft ever count going through the end center thing as respawning?

#

going to the nether or the end in the first place isnt respawning

#

I cannot find anything online for this, not sure If I am searching correctly. I keep searching for things relating to the end and PlayerRespawnEvent Do you know what it is?

sullen marlin
#

I think it's because the end is special and the first time you go through the portal and get the credits screen that is kind of like dying - it's not an instant teleport, you're waiting to respawn

#

Philosophically the end is the afterlife and you're being reborn, obviously

old flicker
#

I suppose, but as a developer I always assume it only happens on death.. you only respawn when you die. Did not know the game logic worked this way for real.

old flicker
#

Sounds like a very notch thing that was done, the end is very old afterall. Im sure notch would want to make the code consistant with the story :P

nova notch
#

Why exiting the end is calling PlayerRespawnEvent, I have no idea
they were lazy and didnt feel like extracting the "teleport to your spawnpoint" code out of respawning
thats it

#

mojang moment 👍

brittle gate
sly topaz
#

ideally, I want the current component API to be re-thought tbh, as having those getters which aren't actually getters in the ItemMeta isn't going to scale at all with the phase MC is adding all these components

#

then again, it is a lot of work so one can only hope

cold pawn
lilac dagger
#

i'm sure there's a change world packet

#

you don't respawn when you change worlds on bungee

#

at least i think so

#

the world can have the same uuid and name and it just works

#

unless bungee pads those

pine forge
#

Hey so my plugin sometimes throws this error when the server is closed,
Im closing a websocket connection in my onDisable

Does anyone know if theres a way to suppresss or fix this?

#

Is this happening because the disconnectioon is async and my plugin is already unloaded while the disconnection has not yet finished

#

so some kind of race condition

lilac dagger
#

most likely yeah

#

i really like Executors for this, you can shutdown them on stop and have them finish all the work in sync

#

which is true for futures too i guess

brave ice
young knoll
#

You know we have api for that right

#

Unless ur on 1.old

quaint mantle
#

does spigot's event system use adventure lib in any way?

blazing ocean
undone axleBOT
quaint mantle
#

?howold 1.7

undone axleBOT
quaint mantle
#

fuck

blazing ocean
#

paper adds adventure

quaint mantle
#

ok then I need to ask paper lads

blazing ocean
#

spigot barely has any component & custom font support

quaint mantle
#

i forgot.

remote swallow
#

the pr is open rad

#

calm down

quaint mantle
#

so spigot does not add adventure? D:

blazing ocean
#

no

remote swallow
#

the pr will add bungee components to everything

blazing ocean
#

rn

young knoll
#

Except the async chat event iirc

blazing ocean
#

💀

#

that's the stupidest thing ever

quaint mantle
#

do u think its a mistake to make a minigame lib that supports both minestom and paper?

young knoll
#

@Choco couldn’t quite figure it out iirc

#

@worldly ingot

#

Idk how I managed that

eternal oxide
#

haha

pseudo hazel
#

adventure comes with paper

#

you are asking in the wrong server bro

quaint mantle
#

no it was a general question

#

since I did not knew spigot did not have adventure

#

and just noticed it

pseudo hazel
#

well that doesnt change anything about your question

#

isnt minestom a completely separate implementation?

#

in that case its only a good idea if you know how to do it properly