#help-development

1 messages ยท Page 642 of 1

quaint mantle
#

brb

#

for hub server i mean bungeecord server
i will save this

  • globalmoney (special money for all server in bungeecord)
  • rank (rank for all server in bungeecord
  • last join
  • bantime
  • mutetime
  • isafk

for games in bungeecord

  • money
  • level

which one am i need cache with hashmap ?
am i need control some data query for hub server ?

eternal oxide
#

you can safely store all this on bungee

#

nothing is that time specific you could not query bungee as you need

quaint mantle
#

i don't need cache datas in hub server ?

#

and i need cache money ?

#

bcs money

#

all time changing

eternal oxide
#

constantly changing?

quaint mantle
#

This database also makes continuous queries.

quaint mantle
eternal oxide
#

for those values I'd not cache anything on the spigot server

quaint mantle
#

The database will always work.

eternal oxide
#

just send/request values/changes to bungee

#

if they sell something you send the amount of money they gain to bungee

quaint mantle
#

money isnot for bungee

#

is for server in bungeecord

#

but globalmoney is for all server i mean all server in bungeecord

eternal oxide
#

if they want to buy something you must already have some UI or something open so you should already know how much money they have.

#

yes

#

but they don;t have different money in each server

quaint mantle
#

it will be different on each server

#

i mean money

#

but not globalmoney

#

wait

#

choco said this

#

i will find

eternal oxide
#

if its only relevant for a specific server then it shoudl be stored on/by the server

#

if its global then store on bungee

quaint mantle
#

i save this datas in mysql

#

instead of constantly changing the money in the database

I should have added hashmap to money

after player on left server i need add money in hashmap to database

eternal oxide
#

the only issue you are going to have with caching values on a server is when switching servers

cinder abyss
#

Hello, how can I make a packet-based entity with ProtocolLib ?

eternal oxide
#

when using bungee and switching servers teh player will join the other server before you have finished processing the disconnect event

echo basalt
#

I got a gist on that

quaint mantle
#

Error occurred while enabling Skyblock v0.2AlphaBuild (Is it up to date?)
java.lang.NullPointerException: null

icy beacon
#

hey there, I've been working on my network with many custom written plugins for a while, and I've recently started questioning whether mysql databases are good for scalability and performance. I'm mostly storing generic player data like locales and per-gamemode stuff, and I only work with loaded caches, so performance is not largely problematic for me, but I'm worried that if the network ever takes off, I might need to learn more about scalability. are there any good resources and comparisons for databases MySQL vs NoSQL and where generally can I learn more detailed and technical information about databases? please provide your trusted resources and links, I'll be happy to get into it tomorrow morning ๐Ÿ™‚

quaint mantle
quaint mantle
#

how do I check for null thing?

quaint mantle
cinder abyss
quaint mantle
cinder abyss
#

copy paste the full error

quaint mantle
#

cmon I just got of the pc

#

fine

cinder abyss
#

all the stacktrace

quaint mantle
#

?paste

undone axleBOT
eternal oxide
austere cove
icy beacon
#

I don't think I'll grow to the sizes even comparable to say hypixel of course, but even so, I'd like to be prepared for the worst case scenario all the time. if you've got any place from where I can learn deeply about databases, I'd be happy to hear that

hazy parrot
#

Actually a lot of people shit so much on mysql (even tho I don't understand hate), calling it awful performance, unreliability etc

icy beacon
#

haha, I've seen the hate yeah, but I don't want to be influenced by it

quaint mantle
eternal oxide
quaint mantle
#

alright ty

hazy parrot
austere cove
#

Fundamentals of Database Systems by R. Elmasri and S. B. Navathe is a solid read

tender shard
#

my favorite java book is called "java also is an island", but i think its only available in german

shadow night
#

"Java ist auch eine Insel" or something like that? Dunno I'm bad at translating

tender shard
#

exactly

shadow night
#

Maybe I'll buy it

tender shard
#

i got the 2021 version as ebook

#

that one's up to date to java 17

shadow night
#

Fuck schnitzel

echo basalt
#

java is such an incel

shadow night
#

I keep forgetting lmao schnitzel

echo basalt
#

did no one proofread the title

#

cmon man

austere cove
#

who needs Java 17 when ~75% of Maven central is still <= Java 8

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

yes I know 1.8 is 200 years old

#

but

cinder abyss
#

Hello, I found this code:```java
private void spawnEntity(Location location, Vector vector, EntityType type) {
int entityId = 10000;

PacketContainer packet = new PacketContainer(PacketType.Play.Server.SPAWN_ENTITY);

// Crucial data, do not remove
packet.getIntegers().write(0, entityId);
packet.getUUIDs().write(0, UUID.randomUUID());
packet.getEntityTypeModifier().write(0, type);

packet.getDoubles()
        .write(0, location.getX())
        .write(1, location.getY())
        .write(2, location.getZ());
// -- section end --

// Velocity, remove this code section if you want to default to 0
packet.getIntegers()
        .write(1, convertVelocity(vector.getX()))
        .write(2, convertVelocity(vector.getY()))
        .write(3, convertVelocity(vector.getZ()));
// -- section end --

// Pitch and yaw, remove this code section if you want to default to 0

packet.getIntegers()
        .write(4, (int) (location.getPitch() * 256.0F / 360.0F))
        .write(5, (int) (location.getYaw() * 256.0F / 360.0F));

// -- section end --

// Send the packet to all players
try {
    for(Player player : Bukkit.getOnlinePlayers()) {
        ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet);
    }
} catch (InvocationTargetException e) {
    e.printStackTrace();
}

}```For creating a packet-based entity, but idk what to put into int entityId
Any idea
(I think if I use two times this code with the same entityId, there will be an error

tender shard
quaint mantle
#
meta.setDisplayName(statistics.getRarity().getColor() + specMaterial.getDisplayName(variant));```
tender shard
#

meta is null or statistics is null or statistics.getRarity() is null or specMaterial is null

#

add some debugging output to figure out which of those is null

#

probably it's the meta since ItemStack#getItemMeta() is nullable

cinder abyss
echo basalt
quaint mantle
#

could be statistics

#
  {
            if (material.hasClass())
                material.getStatistics().load();
            return;
        }```
tender shard
#

if you'd be using a recent java version, the stacktrace would contain the name of the variable that's null

quaint mantle
#

what is this platforms ?

tender shard
#

waterfall is the paper version of bungeecord

quaint mantle
#
assert statistics !=null;
        meta.setDisplayName(statistics.getRarity().getColor() + specMaterial.getDisplayName(variant));```
#

what this do?

tender shard
#

nothing

cinder abyss
tender shard
#

assertions are disabled by default

quaint mantle
#

hmmm

cinder abyss
echo basalt
#

The entity ID is a number that represents the entity's lifecycle

#

Like

#

If you say "Entity abc is 123" in the spawn packet and refer to it as 123 from there on, the client understands what entity you're talking about

#

And that's pretty much how entities work in the protocol

#

You just send a spawn packet with a numerical id and then reuse that id in later packets

#

I like to just start from 50000 and just increment for each new entity

quaint mantle
#

bungeecord projects only for bungee events ?
i mean if i add plugin non bungeecord to bungeecord plugins will work fine ?

cinder abyss
echo basalt
tender shard
#

spigot plugins won't run on bungee at all and vice versa

#

?jd-bc

tender shard
#

these are the bungeecord javadocs ^

gleaming grove
#

I had same issue today. To resolve it you should use ItemDisplay instead of BlockDisplay to display blocks. I know that sounds weird, but BlockDisplay has rotation origin at the bottom left block corner (0,0,0) while ItemDisplay origin is at the center point of block/item (0.5,0.5,0.5)

quaint mantle
#

but some plugins works on bungeeand spigot

#

like luckperms

#

they using two lib

#

in project ?

echo basalt
#

That's because they wrote multi-platform code :p

tender shard
echo basalt
#

They just write "generic" code and a bunch of interfaces and at the end make a "platform" for each server type

gleaming grove
tender shard
#

pleaaaase use the consumer when spawning entities like that D:

gleaming grove
#

good to know

quaint mantle
#

i wanna make api plugin for my other plugins
but my api is for bungeecord
and other plugins non bungeecord this will work fine ?

river oracle
#

does Chunk#getChunkSnapshot forcibly load a chunk given its not loaded already

#

doesn't look like it probably. Checked CraftBukkit code

lilac dagger
#

i didn't know about item display ๐Ÿ˜ฎ

#

they're so cool

quaint mantle
#

Anyone know how imagine fun handles so many entities, (more information past what Matt wrote on his blog)

shadow gazelle
#

How who/what handles so many entities?

quaint mantle
lilac zenith
#

Hello, does someone know if there is a way to show a player's 2d face in their screen using a Texture pack and a plugin? I know about negative spacing and such, but idk how to retrieve that player's face to show them in the screen.

echo basalt
#

You need to query mojang's servers

#

or use happyhud :)

river oracle
#

Okay so I have a little bit of a predicament I kinda am Having a hard trouble wrapping my brain around atm.

Essentially I need a bunch of ChunkSnapshots because I need to scan chunks for specific blocks. Doing this on the main thread would be rather expensive which is why I'm using Chunk Snapshots to search for all instances of these blocks. However you have to take ChunkSnapshots synchronously to my knowledge. So i setup some work distrobution from 7smile7's thread so I can run as many Chunk#getChunkSnapshot calls as possible without lagging the server. On each one of these calls I need to operate on the ChunkSnapshot asynchronously. To do this I added a method to my Worker interface which is called void completed(Object object) essentially its a consumer that executes after the Worker finishes getting the ChunkSnapshot. This approach is pretty flawed and I can shoot holes through it all day. I'm just not sure a better way atm my brain is busted and I haven't really taken any breaks on this

eternal oxide
#

you could push your finished data to a queue and process it in a single thread

river oracle
#

honestly I was thinking of something along the lines, you think after the data is finished I add it to another queue that sends data in for Asynchronous processing

eternal oxide
#

if you are going to be making any changes to a chunk based upon that data you will have to be sync

river oracle
#

from the ChunkSnapshot

#

so everything I do with it can be processed asynchronously once I grab it

eternal oxide
#

what do you do with the end data?

river oracle
#

I push it into my own Databases

eternal oxide
#

then just do as you are. multiple threads running async is not an issue

#

your system likely has a few thousand running at all times

river oracle
# eternal oxide then just do as you are. multiple threads running async is not an issue

my main struggle with this design is thinking of how to funnel all the data back into one BigInteger which eventually happens at the end. like how do I sync all of those asynchronous tasks into one number ๐Ÿค”. I mean pushing the finished data into the Queue makes sense to me, but how am I supposed to know when every single ChunkSnapshot has finished processing in the queue

eternal oxide
#

count them

#

you can see how many snapshot you took

river oracle
#

yk sometimes you overlook the simple things lol

eternal oxide
#

you shoudl have an equal number of resultsd

river oracle
#

yeah that's a completely valid point I have the beginning number of chunks I need processed just keep holding the task until they all finish

#

thanks ๐Ÿ˜† to think my issue had such a simple solution well its clear as day now

#

I tend to overthink these things huh

eternal oxide
#

I've written some terrible code in the past, many many lines.

#

only to replace it with a handful the next day

ivory sleet
#

same

#

extends to every dev

echo basalt
#

yeah p much

#

I've written shitty code

#

now it's all enterprise

quaint mantle
#

am i need connection.close and statement.close methods in hikaricp ?

eternal oxide
#

wrap in a try with resources and you won't

quaint mantle
#

What is the equal of "long" in sql?

#

i save discord user id with number

eternal oxide
#

INT or BIGINT, depending

quaint mantle
#

ty

#

what is float in mysql workbench ?

echo basalt
#

are you blind

wet breach
quaint mantle
#

i can't saw in docs

wet breach
#

Double is equivalent to float, just double precision or double wide

quaint mantle
#

float is like double ?

#

like this

#

5.1 ?

lunar wigeon
#

yes, it is floating point number. You can do 3.141f

wet breach
#

double is 2 floats. Basically its the long variant of floats

quaint mantle
#

omg

#

i thought the float was a variable
above int and long

#

._.

eternal oxide
#

int and long are whole numbers. No decimal point

#

float and double are floating point numbers

quaint mantle
#

i was think float is number ๐Ÿ˜„ not decimal point

#

mb

echo basalt
#

Is there no Configuration#getValues in bungee? I might need to do something recursive

sullen marlin
#

discord float โ˜ ๏ธ

echo basalt
#

Mhm there's also no Configuration#getName

#

I blame you, md

sullen marlin
#

Idk open a feature request

echo basalt
#

can't bother lmao it's much easier to write those 15 extra lines

sullen marlin
#

Wtf is getName anyway

young knoll
#

This is why the api never improves

echo basalt
#

it returns the name of the section

young knoll
#

๐Ÿ˜”

echo basalt
#

Or empty if it's a fileconfiguration

lunar wigeon
#

there is ConfigurationSection#getName

echo basalt
#

That's bukkit

#
joe:
  mama: "Hah! GOTEM!"
ConfigurationSection section = config.getConfigurationSection("joe");
assert section.getName().equals("joe");
#

I use getName for my multi-platform config section thing

wet breach
echo basalt
#

It's useful

wet breach
#

couldn't you just extract that from the path

echo basalt
#

In context, yeah

#

So what I'm doing in my bridge class is just add a name param

#

Mhm there's no saveResource method on bungee

#

funkjy

orchid gazelle
quaint mantle
#

someone check my codes to tell my mistakes
hikaricp class
https://paste.md-5.net/zuzijiqupe.java
and this dbmanager sry i can't paste this to md5

package me.vasir.manacore.database;

import org.bukkit.ChatColor;

import java.sql.SQLException;
import java.sql.Statement;

import static org.bukkit.Bukkit.getLogger;

public class DatabaseManager {


    public static void initializeDatabase(){
        try (Statement statement = HikariCP.getConnection().createStatement()){
            String sql = "CREATE TABLE IF NOT EXISTS global(uuid varchar(36) primary key, username varchar(16), discord int, crystals int, boost boolean, bantime int, mutetime int)";
            getLogger().info(ChatColor.GREEN + "Connected database");
            statement.execute(sql);
        }
        catch (SQLException ex){
            getLogger().info(ChatColor.RED + "There was an error in database -> ");
            ex.printStackTrace();
        }

    }
}
#

my sql code is right ?

#

for discordid do i int ? or bigint ?

hazy parrot
#

Discord ID go far more then 4000000000

compact haven
#

bigint

quaint mantle
#

for unixtime ?

compact haven
#

anything LONG in java -> BIGINT

echo basalt
#

bruh is there seriously no way to disable a bungee plugin

eternal oxide
#

unixtime is also long (ignoring other time data types) so bigint too

quaint mantle
#

ty

quaint mantle
#

where can i see hikariconfig default properties ?

#

i mean maxidletime

eternal oxide
#

you don;t call close ever using hikari

#

try with and thats it

hazy parrot
#

.

quaint mantle
#

but statics is cooll ๐Ÿ˜„

#

i only write class name after dot method or object

#

๐Ÿ˜„

young knoll
#

With Hikari you are meant to close connections

#

And presumably statements too

quaint mantle
#

am i n eed ?

#

hikari don't close auto ?

hard socket
#

how can I stop particles from going crazy I used flame particle btw

eternal oxide
#

add a speed

young knoll
#

Hikari uses a special connection object where the close method returns it to the pool

#

Rather than actually closing it

hard socket
#

speed?

eternal oxide
#

in the spawn

#

use the method which accepts a speed value

hazy parrot
hard socket
#

ok

cinder abyss
#

Hello, how can I translate this :java itemDisplay.setItemStack(itemStack); itemDisplay.setItemDisplayTransform(ItemDisplay.ItemDisplayTransform.HEAD); itemDisplay.setTransformation(new Transformation(itemDisplay.getTransformation().getTranslation(), new AxisAngle4f(0.0f, 0.0f, 0.0f, 1.0f), new Vector3f(1.0002f, 1.0002f, 1.0002f), new AxisAngle4f(0.0f, 0.0f, 0.0f, 1.0f))); itemDisplay.setBrightness(new Display.Brightness(15, 15));Into this```java
private void spawnEntity(Location location, EntityType type, @Nullable Vector velocity) {
PacketContainer packet = new PacketContainer(PacketType.Play.Server.SPAWN_ENTITY);

    ALOT.lastEntityId += 1;

    // Crucial data, do not remove
    packet.getIntegers().write(0, ALOT.lastEntityId);
    packet.getUUIDs().write(0, UUID.randomUUID());
    packet.getEntityTypeModifier().write(0, type);

    packet.getDoubles()
            .write(0, location.getX())
            .write(1, location.getY())
            .write(2, location.getZ());
    // -- section end --

    // Velocity, remove this code section if you want to default to 0
    if(velocity != null) packet.getIntegers()
            .write(1, convertVelocity(velocity.getX()))
            .write(2, convertVelocity(velocity.getY()))
            .write(3, convertVelocity(velocity.getZ()));
    // -- section end --

    // Pitch and yaw, remove this code section if you want to default to 0

    if(location.getPitch() != 361F) packet.getIntegers()
            .write(4, (int) (location.getPitch() * 256.0F / 360.0F))
            .write(5, (int) (location.getYaw() * 256.0F / 360.0F));

    // -- section end --

    // Send the packet to all players
    try {
        for(Player player : Bukkit.getOnlinePlayers()) {
            ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet);
        }
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    }

}```
echo basalt
#

That's probably part of the metadata

cinder abyss
echo basalt
#

uhh

#

if you look around enough

#

yes

cinder abyss
echo basalt
#

That's the fun part

cinder abyss
#

yes errorsystem

echo basalt
#

I'll just say I've talked about it a few times across spigot, git and here

#

And I can't bother explaining entity metadata for like the 9th time

cinder abyss
echo basalt
#

can't bother

#

I'm sleepy

cinder abyss
#

okay np x)

#

that's it

#

how can I enter my ItemStack ???

calm pasture
#

yo does anyone know bungeecord and how to make it so whenever u get kicked from a sub server it sends u to like the lobby or smth idk how to do it

quaint mantle
#

is that right ?

#

am i need do this ?

sullen marlin
#

There's plugins, hubkick, movemenow

#

Probably lots more

young knoll
calm pasture
quaint mantle
#

but someone was write

young knoll
#

Your connection is already closed by the try-with-resources

quaint mantle
#

ah

#

closing statement btw ?

young knoll
#

Actually you should make the connection a variable inside try with resources

quaint mantle
#

wdym

#

๐Ÿ˜ข

eternal oxide
#
Statement statement = connection...;) { /* code */```
quaint mantle
#

I do one thing and something else pops up.

calm pasture
eternal oxide
#

never call close yourself, the try with resources does it all for you

quaint mantle
#

i was used this

#
        return ds.getConnection();
    }``` in hikaricp
#

so other way better

eternal oxide
#

no thats fine

quaint mantle
#

but at this method

#

i can't close connection

eternal oxide
#

How many times are we goign to type, you do not close the connection

viscid egret
#
Could not find artifact com.comphenix.protocol:ProtocolLib:jar:5.0.0-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)

Getting this when I reload my pom.xml file after adding ProtocolLib as a dependency and as a repository

eternal oxide
#

NEVER call .close()

#

the try with resources does it for you

#

putting it in try (...) makes it auto close if it can when finished

quaint mantle
#

coll consufed me

eternal oxide
#

he was saying to do as I showed above

#

get connection and statement in the ()

eternal oxide
#

two variables it will try to close on both

dry forum
#

anyone know why im getting
java.lang.RuntimeException: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '435957781011496960' for key 'PRIMARY'

    public void createSeasonRow(String id, int x, int y, int z, String team) {
        try {
            PreparedStatement statement = TFI.getDatabase().getConnection()
                    .prepareStatement("INSERT INTO season(id, x, y, z, team) VALUES (?, ?, ?, ?, ?)");
            statement.setString(1, id);
            statement.setInt(2, x);
            statement.setInt(3, y);
            statement.setInt(4, z);
            statement.setString(5, team);
            statement.executeUpdate();

            statement.close();
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }```
the id is NOT in the table already, the table is brand new and ive deleted it and remade it
river oracle
dry forum
#

the id is NOT in the table already, the table is brand new and ive deleted it and remade it

river oracle
#

the error says otherwise there wouldn't be a duplicate entry error if the key wasn't in the table

#

my guess is you could be accidently running the code for the ID twice or you just aren't actually deleting the database

dry forum
#

that is 100% not in the database, ive tried deleteing the entire database and remaking it, same error

#

and its not being run twice so idk

river oracle
#

duplicate entries only happen if theirs a duplicate entry so you have falty logic somewhere

#

couldn't say more without more code. This section itself seems fine as their are no loops

eternal oxide
#

my guess, you are calling the method twice

#

You are calling it twice or it's already in teh database, those are your only options

echo basalt
#

I recommend every intermediate dev to check this

#

Abstract factories and adapters are useful for writing multi-platform code
Composites are nice for GUI utilities

river oracle
#

looks useful

livid dove
#

*outdated

echo basalt
#

no

#

I wasn't part of that debate

#

I said your books were outdated iirc

#

Nothing about facades

#

decorators are quite an interesting pattern

livid dove
#

The book by the authors of the design patterns is outdated?

echo basalt
#

ยฏ_(ใƒ„)_/ยฏ

livid dove
#

Guys, scrap Newton. Tomorrow fr fr

#

Too old*

echo basalt
#

fr fr

#

he expired by now

livid dove
#

Lol

#

It's been a few days so I can drop this here now for gigs

#

*oops

#

Am gonna try some singleton managers soon tbh. Honestly see no big reason for them not to be other than spigots deathly fear of static ever since the bad bad times of early bukkit

undone axleBOT
inner mulch
#

Which programm is the best programm for mysql databases?

remote swallow
#

to read stuff? to read/write from ur code?

inner mulch
#

everything, using it for a server as well as read the data of my code

remote swallow
#

i use hikaricp to read/write from code and mysql workbench if i need to check content

cedar brook
#

does anyone know if it's possible to embed my plugin's download count (or even the whole information panel) from spigotMC onto my website? ๐Ÿค”

remote swallow
#

if its cli i just open the db and run the commands to show data

river oracle
#

Is there anyway to get an EntityType of a spawner asynchronously or am I about to put myself through nested asynchronous synchronous multithreaded hell

sullen marlin
#

if you have the blockstate you can do whatever async

#

but you cant get a blockstate async

river oracle
#

๐Ÿฅฒ ChunkSnapshots only get you so far

sullen marlin
#

your internet is broke and cant reach mojangs servers

river oracle
#

what version you tryna get

sullen marlin
#

if you want the api, its all on nexus

remote swallow
#

?maven

undone axleBOT
river oracle
#

What's the difference between BlockData and BlockState I feel like CreatureSpawner should be in BlockData but its in BlockState

#

ahhh ic

#

nothing but the good old docs yk I was hoping this wouldn't be painful

young knoll
#

State contains the NBT data of block entities

#

Data contains the states

#

Because confusion

river oracle
young knoll
#

Well for a spawner

#

There are no states so yeah

river oracle
#

you can only create empty block states with BlockData

river oracle
young knoll
#

/shrug

remote swallow
#

epic /shrug fail

young knoll
#

I donโ€™t know if you can read the BlockEntity from the world async

#

Which contains the NBT data

river oracle
#

well pain

#

time to start over again at square one

young knoll
#

Why not pass all the states along with the snapshot to your async stuffs

river oracle
young knoll
#

How so

river oracle
#

how can I realistcally pass the states of thousands of blocks without causing lag

#

I need to do work dist on the block states as I'm doing with ChunkSnapshots atm

eternal oxide
#

you get them from teh snapshot. lag shoudl not be an issue

river oracle
#

you can only get BlockData from a snapshot

eternal oxide
#

you don;t use teh snapshot to read chunk data

river oracle
#

not BlockState

young knoll
#

You can easily get all the tile entities with Chunk#getTileEntities

river oracle
river oracle
#

I thought that was kinda the whole point

#

I frozen in time capture of the data in the chunk that ensures ThreadSafety

eternal oxide
#

Why do you want to read from teh chunk and not the snapshot?

river oracle
#

I would prefer to only read from the snapshot but the snapshot isn't able to get BlockStates

eternal oxide
#

correct, it gets BlockData

river oracle
#

unfortauntely blockdata is useless for my current issue which is getting spawner type

#

which is stored in the BlockState

#

since spawners are a TileEntity iirc

eternal oxide
#

ah yes, you can only get a default BlockState

river oracle
#

so if a Block is a spawner I'll need to queue a task on the main thread and retrieve the block state for the continual operation

young knoll
#

Yeah just grab all the spawners before hand and pass them along with the chunk snapshot

eternal oxide
#

there will not be many TileEntities, you could get them and pass at teh same time you do the snapshot

river oracle
# eternal oxide there will not be many TileEntities, you could get them and pass at teh same tim...

do you think that won't be an issue. I mean I feel like it'd be more graceful to go with my solution. Let's say I have to scan 1,000 chunks (idk how big towns can get in towny), but wouldn't passinng through all those tile entities be a waste if I won't use 90% of them most of the time I guess I could make some data class and have my mainthread task scan for spawners as well ๐Ÿค” , but idk how future proof that is if I start considering other tile entities as well. I'm open for feedback I'm kinda new to these levels of asynchronous logic lol

#

your main class

#

put the path to it

eternal oxide
#

you are scanning claimed chunks to do?

river oracle
eternal oxide
#

is there a reason?

river oracle
#

kinda like /is value in a lot of Skyblock plugins if yk what I'm talking about

eternal oxide
#

no clue

young knoll
#

You could also make your own snapshot that contains spawner data

river oracle
# eternal oxide no clue

it counts up all of the "value blocks" you have on your island and adds them to a total score and you're placed on a leaderboard based on that

#

I wonder if I could actually use NBT here instead ๐Ÿค” though I'd have to scan initially anyways

eternal oxide
#

Well I'd suggest just grabbing all the tile entities you need and passing with the chunk. It's really simple ```java
public List<Chest> getAllChests(Chunk chunk) {

    return Arrays.stream(chunk.getTileEntities()).filter(Chest.class::isInstance).map(Chest.class::cast).collect(Collectors.toList()); //newer Java .toList();
}```
river oracle
#

thanks for all your help

remote swallow
#

your main would be main: com.mcorsen.main.MainClass

#

ur missing a java and a main class

#

do you use maven

#

k, this is what the setups should look like

#

you should have one

#

are you not using an ide

#

@young knoll this is ur issue now

#

maven or gradle usually helps

young knoll
#

You donโ€™t have a main/java when you arenโ€™t using maven or gradle

#

Okay

quaint mantle
#

store like a Map<Material, Int> // int representing the amount of that type

young knoll
#

Decent until a block gets placed by some other means

#

(Or removed)

river oracle
lavish hemlock
#

To what degree does Mojang's anti-distribution licensing apply? If I were to maintain a non-public repository containing decompiled code, would that be against their policies?

#

Obviously publicly distributing a compiled jar is bad, but if one can privately "distribute" a compiled jar (from one of their servers to the next), should the same apply for code?

manic crown
manic crown
#

uhhhmmm XD

manic crown
lost matrix
#

Yes, now you just need to set the opacity of your text that should not have any shadows to 254 instead of the normal 255

lost matrix
#

Yes

#

The text, not the image (if i read this correctly)

sweet sonnet
#

What exception is thrown if reloadConfig(); fails?

lost matrix
#

Depends on what went wrong

sweet sonnet
#

So this should be fine?

try {
    SnowReports.getInstance().reloadConfig();
    sender.sendMessage("ยงaConfig reloaded!");
} catch (Exception e){
    sender.sendMessage("ยงcConfig reload failed! Check console for errors.");
    Bukkit.getLogger().warning(e.toString());
}
lost matrix
#

But there are not too many cases where it throws an exception.
One could be InvalidConfigurationException if the user just wipes the yml file with empty text.

lost matrix
#

Unless you need to handle exceptions in a special way here

#

This line will create potentially very confusing log messages

Bukkit.getLogger().warning(e.toString());
manic crown
lost matrix
#

No they are core shaders

manic crown
#

okay

#

can I specify a font for the shader?

opaque scarab
#

What packet tells the client health of the mount being ridden?

lost matrix
lavish hemlock
manic crown
opaque scarab
lost matrix
lavish hemlock
#

Okay so to reiterate, I can store decompiled Mojang server code in a private repository but it's a gray area so I should try and protect it?

#

Sorry for being repetitive, it's just an important topic, of course.

buoyant viper
#

as long as ur not distributing it u should be in the clear

lavish hemlock
#

Alright.

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

any reason this keeps happening?

fluid river
#

drunk free java lessons

fluid river
quaint mantle
#

thanks

#

rly helps

fluid river
#

what is this

quaint mantle
#

that seems to cause da issue?

fluid river
#

ig

#

i mean it's showing up kinda often

lost matrix
#

Im guessing there is a while loop or something similarly stupid in there

fluid river
#

yea

lost matrix
#

Show us some code pls

fluid river
#

if it's your plugin ofc

quaint mantle
#
  public void gyroWandActive(Player player, Location loc, int arg1, int arg2) {
        System.out.println("a1");
        Location sloc = loc.clone().add(loc.getDirection().multiply(10));
        if (sloc.getBlock().getType() == Material.AIR) {
            System.out.println("a1.1");
            Location cacheLocation = sloc.getBlock().getLocation();
            for (int y = cacheLocation.getBlockY(); y > 0; ) {
                if (cacheLocation.subtract(0.0D, 1.0D, 0.0D).getBlock().getType() == Material.AIR) {
                    y--;
                    continue;
                }
                gyroWand(player, cacheLocation.add(0.0D, 0.0D, 0.0D), arg1, arg2);
                cylinderReset(cacheLocation.add(0.0D, 0.0D, 0.0D), 10);
            }```
#

oh wait 286

remote swallow
#

you dont call y++

quaint mantle
#

holdon

#

286 doesnt even exist

#

lemme send da code

#

?paste

undone axleBOT
quaint mantle
#

line numero 286 is a }

lost matrix
#

This means you changed your code after this stack trace occurred.
Reproduce the error with your current code and send it again pls.

quaint mantle
#

alr

#

im gonna remove the y-- or y++

lost matrix
#

This loop is dangerous in general

quaint mantle
#

why though

#

o

#

loop

lost matrix
#

Because it doesnt have a hard limit

quaint mantle
#

I was told to remove the y--

lost matrix
#

this decrement is coupled to a condition. Thats not a hard limit

#

Why the fk is this method called "a"?

#

With b and c variables...

quaint mantle
lost matrix
#

code pls

quaint mantle
#

didnt I paste it?

#

oh wait I didnt

lost matrix
#

Is it unchanged?

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

na some changes

#
  me.superischroma.spectaculation.item.weapon.GyrokineticWand.a(GyrokineticWand.java:283)
[04:56:17 ERROR]:               me.superischroma.spectaculation.item.weapon.GyrokineticWand.startGyrowandAbility(GyrokineticWand.java:152)
[04:56:17 ERROR]:               me.superischroma.spectaculation.item.weapon.GyrokineticWand.onAbilityUse(GyrokineticWand.java:66)
[04:56:17 ERROR]:               me.superischroma.spectaculation.user.PlayerUtils.useAbility(PlayerUtils.java:426)
[04:56:17 ERROR]:               me.superischroma.spectaculation.item.ItemListener.onPlayerInteract(ItemListener.java:67)```
#

283

lost matrix
#

Alright, only need the code now

quaint mantle
#

283 is .runTaskTimer

#

thing

lost matrix
quaint mantle
#

thats for the animation though

#

the ability to pull mobs

remote swallow
#

judging the fact you run these 2 methods every tick forever, it doesnt surprise me why its crashing

lost matrix
#

Ok but why do you clone the location and then add 0 to it?

quaint mantle
#

hmm

lost matrix
#

You should not create a Runnable for every yaw. Create one Runnable that handles the whole circle.

lost matrix
remote swallow
#

oh i didnt see the cancel

quaint mantle
#

but is the issue with the cacheLocation or

#

the bukkit timer

lost matrix
#

Im seeing quite a few things that can crash the server or seriously tank the performance here.

#

The whole loops logic makes little sense to me

            System.out.println("d1.2");
            Location cacheLocation = sloc.getBlock().getLocation();
            for (int y = cacheLocation.getBlockY(); y > 0; ) {
                if (cacheLocation.add(0.0D, 1.0D, 0.0D).getBlock().getType() != Material.AIR) {
                    y++;
                    continue;
                }
                for (int i = 0; i < 40; i++)
                    a(cacheLocation.clone().add(0.0D, 0.0D, 0.0D), (i * 12));
                pullingMobsTo(cacheLocation.clone().add(0.0D, 0.0D, 0.0D));
            }
quaint mantle
#

I mean I added the d1.1 thing to debug
so only d1.1 is executed and the server then shits itself

lost matrix
#

Let me show you how i would tackle this

lost matrix
quaint mantle
#

the cachelocation right?

lost matrix
#

Explain to me in plain text what "startGyrowandAbility" should achieve.

quaint mantle
#

oh right

#

it should do something like this

#

the animation and pulling the mobs into the thing

lost matrix
#

Ok. So the first thing you need is the block the player is currently looking at.
This is done through a ray trace because the distance to the block will fluctuate greatly.

#

You can not just assume 10 as a gixed distance.

#

You are using 1.8 so ray tracing is not supported by spigot (The version is a decade old soon, why tf you use it at all)

quaint mantle
#

do I try cancelling the event

#

with taskID

#

bukkit.getSchedsaiosdio().

lost matrix
#

You are taking a step back and breaking down this ability into smaller pieces.
The first problem you need to solve:

  • How do i get the Block, a player is currently looking at.

After that we can continue with how to implement the effect

#

Do you have BlockIterators in 1.8 already?

#

Fk i hate this old garbage version. Why do people insist in using it?

lost matrix
quaint mantle
#

but man just have a bit mercy on my pc

#

?paste

undone axleBOT
sullen marlin
#

Minecraft 1.8.8 is 8 years, and 1 day old today.
(2924 days)

quaint mantle
#

hi md

sullen marlin
#

Omg birthday party!!!

lost matrix
quaint mantle
#

im gonna

#

recode the entire thing

#

gimme 40 mins

lost matrix
# quaint mantle gimme 40 mins

Pls... im giving you a proper approach to this with reusable code.
You really want to implement this method and reuse it for other abilities.

quaint mantle
gray saddle
#
@EventHandler(priority = EventPriority.HIGHEST)
    public void onNametag(PlayerInteractEntityEvent e) {
        Entity entity = e.getRightClicked();
        Player p = e.getPlayer();
        if (p.getItemInHand().getType() == Material.NAME_TAG) {
            if (getConfig().getInt("CharacterLimit") > 0) {
                if (entity.getCustomName() != null && entity.getCustomName().length() >= getConfig().getInt("CharacterLimit")) {
                    entity.setCustomName(colorize(getConfig().getString("LimitReplacementText")));
                }
            }
        }
    }

Hi this isn't applying the first time i use name tag

lost matrix
quaint mantle
#

I got nothing sry smile

lost matrix
quaint mantle
#

cant u use that

lost matrix
#

He is on 1.8

quaint mantle
#

1.8 didnt have that?

lost matrix
#

1.8 didnt have a ton of stuff. Cant even send an actionbar without nms

lone portal
#

Ban Items Plugin

lost matrix
#

Huh?

quaint mantle
river oracle
lone portal
#

Sorry

#

Sorry

quaint mantle
river oracle
quaint mantle
#

o

lost matrix
# quaint mantle yeah

I would help you but i dont have a 1.8 project setup.
You need to find threads from half a decade ago. This problem
was solved by someone in the past probably.

quaint mantle
#

asking the dev of the plugin would have helped but the dudes long gone

buoyant viper
#

i mean i got these API methods @quaint mantle @lost matrix idk

#

had a 1.8 plugin in intellj to try n help a guy with scoreboard stuff lol

undone axleBOT
buoyant viper
#

u were looking for uh

#

getTargetBlock in 1.8?

#

some form of them seem to exist in 1.8**.8** at least

quaint mantle
#

na its something else

desert tinsel
#

I know how to create recipes, but how to create recipes that works only in some cases, like you can craft a custom sword only if you are in a fight?

chrome beacon
desert tinsel
#

thanks

sterile breach
#

Hi, on spawner break i need to check if it is registered on the db.

What i do?

Load all data at start?
Just load spawner at chunkload?
Request the db at spawner break?

tender shard
#

i'd just use CustomBlockData to store your data in PDC

#

?blockpdc

undone axleBOT
sterile breach
#

What is PDC?

sterile breach
#

Yes but i need to store it il db for other interaction when my bloc hot breaked

tender shard
#

then I'd just use a Set<Location> on startup

desert tinsel
tender shard
#

you could also listen to chunkloadevent, then get a set of all blocks with custom PDC and add the spawners to your set then

sterile breach
#

Yeah can is a good idea

#

Byr i want know, excepted PDC. How to do?

torn shuttle
#

if my laptop keeps telling me that keeping my screen on hight brightness increases carbon emissions I'm going to have a conniption

cedar marlin
#

I want to get the item from a player hand, but when the player holds a Netherite item, I will get AIR as a type

@Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player player) {
            PlayerInventory playerInventory = player.getInventory();
            player.sendMessage(playerInventory.getItemInMainHand().getType().toString());
        }

        return false;
    }```
tender shard
#

set an api-version in plugin.yml

cedar marlin
#

oh

#

api-version: 1.20.1, right?

#

because I use the 1.20.1 Version

tender shard
#

no

#

just 1.20

remote swallow
#

in quotes

cedar marlin
#

okasy

#

but why would it effect my plugin

tender shard
#

you didnt set an api-version in plugin.yml and hence have legacy material support enabled

cedar marlin
#

ouhhhh

#

it throws me an error.

Unsupported API version 1.2

I wrote api-version: 1.20

tender shard
#

your spigot version is outdated

#

old 1.20 versions have a bug that require you to put "1.20" into quotes

#
api-version: "1.20"
cedar marlin
#

ah. okay.

#

ahhh it works! Thank you very much!

tender shard
#

np

cinder abyss
#

Hello, how does I enter my ItemStack for this ItemDisplay packet ?

cinder abyss
#

I think I found: net.minecraft.world.inventory.Slot

sterile breach
#

Hi, on spawner break i need to check if it is registered on the db.

What i do?

Load all data at start?
Just load spawner at chunkload?
Request the db at spawner break?

tender shard
#

I already answered this exact question

sterile breach
#

yes but as I am still learning spigot, I preferred to avoid going through your system.

vast ledge
#

@tender shard What was ur suggestion?

#

Delor

sterile breach
#

PersistentDataContainer

vast ledge
#

What are you tring to make

#

Yea

#

Persistentdatacontainer

#

would be the best approach

tender shard
vast ledge
#

i a green with mfnalex here

#

agree**

#

Another suggestion would be creating an Array wouldnt it?

sterile breach
#

my plugin is simple. When a palyer palce a spawner. The spawner got protected (if the spawner got break, the player can get it in a gui)

so, on spawner break i need to check

#

yes at the beginning I loaded the whole db in an array at the start

vast ledge
#

@tender shard Would there bea anything wrong with writing an array with the blocks to the Database, and on startup reading the Locations?

sterile breach
#

ah i can stock the owner name i the nbt?

vast ledge
#

You cant touch NBT

#

You would need nms to do that

sterile breach
#

well the problem is that if there are 1500, I can't load everything when I start and unload when I stop

vast ledge
#

What you could do, is create a custom Object, that stores block Locations, The player that placed it

sterile breach
#

I mean, in the data of the block like the nbt

tender shard
vast ledge
tender shard
#

I can only repeat myself: just use CustomBlockData

#

?blockpdc

undone axleBOT
sterile breach
vast ledge
vast ledge
sterile breach
#

ok i will try then

#

if i palce it

on break i can get the owner name for exemple?

lost matrix
# sterile breach Hi, on spawner break i need to check if it is registered on the db. What i do?...

I had an article about working with data.
Data is transfered from the in rest state (DB, File, etc)
to its in use state, when the session of the data starts.
It is written back to its in rest state when its session ends.
Some examples for sessions are:

Player session

  • Starts when player connects to server
  • Stops when player quits

Chunk session

  • Starts when chunk us loaded into memory
  • Stops when chunk is being unloaded

World session

  • Starts when a world is loaded
  • Stops when a world us unloaded

So in your case i would load the data when the Block (and subsequently its chunk) is loaded.
And saved back when its unloaded.

sterile breach
#

oups

sterile breach
lost matrix
#

If you want to use the PDC of your TileEntity, the PDC of the Chunk or a Database
is secondary in my opinion.

lost matrix
#

Which method you use also depends on the size of your data and how many instance you expect in one chunk.
Last thing you want is extra data significantly slowing down your chunk loading. This could occur with the PDC of
chunks or Blocks.

sterile breach
#

i just need to store the owner and the location but with pdc i don't need location because the block is placed

lost matrix
#

Why do you need a DB if you store half of your data in the PDC anyways?

#

Or vice versa.

sterile breach
#

yes, but in this case I have to query the db every time a new chunk is loaded? As I was saying, with 10 players, that would mean several dozen queries per second.

lost matrix
#

Why bother with the PDC if you store everything in a DB.

sterile breach
#

because then I need access to its data so that players know where their spawners are placed.

lost matrix
sterile breach
#

yes in async

#

so let's say I have 10 chunks loaded per second, that's 60 requests per minute, isn't that a problem?

lost matrix
#

Then create a table with chunkX and chunkY as two primary indicies

sterile breach
#

no in my db

#

euh

#

what i say

sterile breach
lost matrix
#

And a proper database can handle thousands of requeuests per second

sterile breach
#

ah okay I just learned it.

lilac dagger
#

cache where possible

sterile breach
#

I thought about it

lilac dagger
#

so you don't do db request for some frequent stuff

lost matrix
#

You can always batch request the chunks over the last N seconds. This way you dont have to
send too many requests.

lilac dagger
#

me.mcorsen.main.main

lost matrix
icy beacon
#

hey, i'm implementing a verification system for linking discord to minecraft. it's fine to not use a database if i do not care about losing the codes on restart, right? they only last 15 minutes and i just want to use an ExpiringMap and not bother working with yet another table

sterile breach
lost matrix
sterile breach
#

ah yes

lost matrix
remote swallow
sterile breach
#

ah okay

remote swallow
#

just make sure you setup the linking mc creates the code and discord recieves it

icy beacon
#

it's very handy

#

used it a couple times

remote swallow
#

looks useful

icy beacon
#

yup ๐Ÿ˜›

remote swallow
#

this is cool too

icy beacon
#

yeah i used it in my previous project and it was really convenient i wanna do it again

lilac dagger
#

is it thread safe?

lost matrix
icy beacon
remote swallow
#

it says its thread safe

icy beacon
#

yes

lilac dagger
#

otherwise is not that fancy

lost matrix
#

Use caffeine instead

icy beacon
#

A high performance, low-overhead, zero dependency, thread-safe ConcurrentMap implementation that expires entries. Features include:

icy beacon
remote swallow
#

caching library

lost matrix
sterile breach
lost matrix
#
LoadingCache<String, DataObject> cache = Caffeine.newBuilder()
  .maximumSize(100)
  .expireAfterWrite(1, TimeUnit.MINUTES)
  .build(k -> DataObject.get("Data for " + k));

Example

icy beacon
#

hm, that looks handy too

#

alright, i'll use this

lost matrix
#

A cache that requests data if its not in the local map

lilac dagger
#

wait builder? is it immutable?

sterile breach
lost matrix
icy beacon
lost matrix
#

Not for loading caches

#

Just the normal ones iirc

icy beacon
#

alrighty, i'll just try to start, if i'll be having problems i'll consult you ๐Ÿ™‚

lilac dagger
#

for caching it's pretty good

sterile breach
remote swallow
#

if the spawner is being broken, the chunk has to be loaded doesnt it?

lost matrix
lilac dagger
#

you can hold a reference in the db and store the data in pdc

sterile breach
ivory sleet
#

Pdc is fine

#

I mean if u wanna make a fkn data analysis or sth, good luck pdc trolled you, else its viable

golden wren
#

iโ€™ve got a bounty command that checks if the player has enough money in their account and if they do itโ€™ll remove a given amount via withdrawPlayer(). if the player spams this command, it just stops taking the money out, meaning that players can glitch money into existence. what can i do to fix this? iโ€™m using the vault API with essentials economy - both latest versions.

tall dragon
#

you could add a cooldown to the command

#

theres no reason for players to spam this command

golden wren
#

yeah thatโ€™s fair

#

is it just vault stopping it from repeatedly executing the same action then?

tall dragon
#

honestly woulnt be able to tell without directly looking at the code

#

could be a number of things

golden wren
#

yeah of course

#

alright iโ€™ll just add a 5sec cool-down, thank you lol

tall dragon
icy beacon
#
  1. you have not registered your command
#
  1. next time please send code walls with a pastebin like ?paste
#

np

eternal oxide
#

?codeblock

undone axleBOT
#

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

}

}```
Becomes:

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

    }
}```
icy beacon
#

yeah but it's for shorter codes

#

if it's a text wall there's no need to block the entire channel with it

#

just use a pastebin

eternal oxide
#

yep

sterile breach
#

if i palce a block, on break i can get the pdc?

undone axleBOT
shadow night
#

When the player crafts something, can I somehow leave a certain item in the crafting slot? Like crafting with buckets schnitzel

#

You have set the executor of the command to be the plugin (this) schnitzel

#

You need to set it to be the class of the command which has to implement CommandExecutor iirc schnitzel

#

It's spigot lol schnitzel

#

They only deprecate, they never delete or rename schnitzel

#

With what schnitzel

#

You need to have the command in your plugin.yml, but you also need to have a command class and register it schnitzel

echo basalt
#

There is but it's a bit advanced

#

Relies on reflections

shadow night
#

All I know is how you would do it usually schnitzel

sullen marlin
shadow night
#

What the heck is a feature request schnitzel

sullen marlin
#

?jira

undone axleBOT
sullen marlin
#

a request for a feature to be added

sterile breach
#

Hi, if i understand, PDC is for items. And TitleState for placed blocks?

echo basalt
#

?blockpdc

undone axleBOT
echo basalt
#

PDC is just a general container that's present in

  • Entities
  • Chunks
  • Items

But projects have been made for blocks as well

buoyant viper
#

then update them AbsoluteHalal

sterile breach
echo basalt
#

TileState is specific to tile entities and doesn't apply to all blocks

#

It is also only specific for managing that block's data instead of serving as a container for plugins only

#

A tile state, for example, is a furnace, where it manages burn time and its inventory slots

#

While with PDC it's basically just a fancy map that's saved in file

austere cove
#

Is there any way to force run all pending tasks for a given plugin

echo basalt
#

uhh

#

Don't think so

#

Unless you make your own scheduler

austere cove
#

what a headache

echo basalt
#

ยฏ_(ใƒ„)_/ยฏ

#

I've been writing multi-platform code lately and now I understand why worldedit has their own class for everything

#

it's a headache

austere cove
#

Suppose I do some db stuff in an async task, and the server shuts/disables my plugin before the task ran, then it will just get cancelled

icy beacon
#

ah

austere cove
#

potentially dropping data

#

its an edge case but still

echo basalt
#

Easy fix then

#

For DB stuff just use completablefutures

#

And put each future in a map/list/whatever

#

When they complete or give an exception, remove them from the collection

quaint mantle
#

is there a way to register permissions in code (so that it will show up on permission managers like LP)

echo basalt
#

And make a flush method that returns an allOf of the futures, and join it onDisable

austere cove
icy beacon
echo basalt
icy beacon
#

it'll show there

quaint mantle
icy beacon
#

i tried

quaint mantle
echo basalt
#

It has a weird injector thing that every time you call hasPermission it adds it to the possible permissions list

icy beacon
#

Bukkit.getPluginManager().addPermission(Permission("ab.cd", PermissionDefault.FALSE)) off the top of my head

quaint mantle
#

hmm alr

icy beacon
chrome beacon
#

Just don't create a new permission object every time you try and use it

#

Since creating one should register it

lost matrix
austere cove
#

oh ffs then I have to rewrite so much stuff

echo basalt
#

average concurrency moment

lost matrix
#

Why? This sounds like a design problem. Switching from my own scheduler to
the bukkit one would take me maybe 10mins reimplementing 3 methods with 5 lines or so each...

echo basalt
#

smile still hasn't realized he's a 10x developer

lost matrix
#

Those two

austere cove
#

because currently by data abstraction by design has blocking methods, which I purposely call using async tasks in commands n stuff

echo basalt
#

lmao yeah you're screwed

austere cove
#

time for non blocking callback hell ig

echo basalt
#

I should just write yet another guide about how IO should just use futures and not blocking methods

#

so you can properly join stuff

lost matrix
#

Come to the dark side

echo basalt
#

Dark side

sullen marlin
#

I don't think you need to

#

You can just send a runnable into the executorservice

#

Exactly same as runAsync

echo basalt
#

JฬดฬŽอŠOฬดอ‘ฬ’Iฬดอ›ฬ‘Nฬทอ‘ฬ ฬทฬฟฬšUฬดฬŽฬ Sฬตอ

lost matrix
# sullen marlin Exactly same as runAsync

If he uses Runnables and not an anonymous or concrete implementation of BukkitRunnable
with some internal cancel() logic then true. He can just pass the runnable to an executor instead
of the BukkitScheduler

#

So might not be so bad after all

echo basalt
#

le big CTRL + Shift + R

#

with some regex

#

and the need to adjust every single number from ticks to ms

austere cove
#

yea it's just runnables atm, but I'm contemplating life choices rn

icy beacon
#

coding well is cool but having stable mental health is cooler

#

i have neither

austere cove
#

coding is my escape, i dont want to go back to reality ๐Ÿ‘€

icy beacon
#

same ๐Ÿ˜ญ

#

welp then

echo basalt
#

Yo smile I have a minor question

#

So I made this crappy matchmaking thing for my skyblock core

#

But I'm not a fan of how I have to do a big query to get all the server data I need for the matchmaking to be accurate

#

And I feel like it can fill up the ram and be a point of failure

#

Any better way to do this without relying on a microservice?

#

I don't think it's going to be that bad

#

But I'm still not a fan

#

the big query

cedar brook
#

does anyone know if there's an api for the website? or some way to get the plugin information (specifically the downloads) from the site? ๐Ÿค”

icy beacon
pseudo hazel
#

spaget

cedar brook
#

thank you ๐Ÿคฉ

icy beacon
#

np

icy beacon
pseudo hazel
#

lol

sterile breach
quaint mantle
pseudo hazel
vast ledge
#

cross server maybe?

icy beacon
undone axleBOT
#

Itโ€™s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

tender shard
vast ledge
lost matrix
# echo basalt *the big query*

Im not 100% sure i understand why you need matchmaking for skyblock.
But you probably dont need this map to be a concurrent map.

For your problem: This is a common problem because you have no master server.
Describe to me what the matchmaking is for.

quaint mantle
#

i check

echo basalt
#

This skyblock plugin works as a sort of network, the "matchmaking" part would be for load balancing, to decide what server should be responsible for loading the player's island.

#

There's no singular server responsible for everyone, just a bunch of instances that load and unload island on demand

lost matrix
#

Load balancing is done on the proxy

echo basalt
#

Correct

#

I'm just afraid that fetching all the loaded island ids from redis is a bottleneck in scalability

cedar brook
lost matrix
echo basalt
#

Yeah but what if there are multiple proxies

echo basalt
#

You're telling me that instead of doing a request to get all the island ids, I should have it at all time?

#

That'd just constantly take up RAM

lost matrix
#

Maybe 2 MB for a thousand players

echo basalt
#

Well

#

So would my approach

#

But I don't see any skyblock network with a million players so this isn't a concern yet

lost matrix
#
  • the overhead of requesting everything
echo basalt
#

That's like 2ms on redis

#

maybe 3ms on mongo or whatever

lost matrix
#

Wait... you mean... all ids of all player, ever?

echo basalt
#

No

lost matrix
#

Not the currently loaded ids?

echo basalt
#

Just the ids of the loaded islands

lost matrix
#

Keep that sht in memory

echo basalt
#

Eh

#

Rather have redis

lost matrix
#

Your approach is fine

echo basalt
#

Or memcached

lost matrix
#

Thats in memory

echo basalt
#

couchdb? idk

#

Just some other cache database

#

It's just implementing an interface

#

But yay I can sleep at night

#

knowing the network won't explode due to this

lost matrix
#

Doesnt matter if its on the proxy or in redis.
Just a map in redis that knows where every island is loaded.
No need to request it every time a player wants to join.

echo basalt
#

This only runs if the player's island isn't loaded

#

If it's loaded it just picks that server

#

I also do some checks on player join to prevent duplicate loads

#

It's a bit icky because I have a profile system

#

But it works

#

(I think)

lost matrix
#

Ok but what prevents you from having a centralized Map<UUID, ServerName> in redis
where you simply let servers write in loaded islands and remove them if they unloaded the island.
Combined with a Map<ServerName, Integer> for the amount of islands which can be used for the load balancing.

echo basalt
#

Right now it's basically just a huge Map<UUID, ServerName> yeah

simple schooner
#

Hi! I started learning a while ago, can y'all give me simple tasks to do to test my knowledge?

simple schooner
lost matrix
echo basalt
#

the entire project is ยฏ_(ใƒ„)_/ยฏ

#

I want to add minestom <-> spigot interoperability for shits n giggles

lost matrix
#

How did you solve the unbearable lag when loading worlds?

echo basalt
#

as well as velocity <-> bungee

echo basalt
#

Entirely configurable

simple schooner
echo basalt
#

Go for it

livid dove
echo basalt
young knoll
#

Does that include the anti cheat bonus challenge :p

echo basalt
#

looks blurry grr

simple schooner
young knoll
#

I've been doing spigot for 10 years

simple schooner
#

Damn

young knoll
#

Still haven't touched anti-cheat

echo basalt
#

Been coding for 12, spigot for 6 years

young knoll
#

Don't really intend to either

lost matrix
#

Anti cheats are butchered beyond believe

echo basalt
#

I don't have the trig skills required for an anticheat

livid dove
simple schooner
#

Damnn so its that complicated to create an anti cheat

young knoll
#

Spigot took over in 1.8

echo basalt
#

Been reliably failing math class for like 4 years now

lost matrix
#

Ive been coding for 4.5 now i believe. Or even 5 at that point? PES2_SadGeRain

young knoll
#

I don't actually know when spigot initially forked

simple schooner
echo basalt
#

yeah but you got like 19 degrees

echo basalt
simple schooner
#

I mean u must learn from ur mistakes

simple schooner
livid dove
#

I've been coding for 2.

And because it works like golf, I win ๐Ÿ˜

echo basalt
young knoll
#

Idk about that

vast ledge
#

I started coding at 12

lost matrix
#

Dont make me feel old...

echo basalt
#

I was like 6 and had about 2 braincells working together

young knoll
#

I feel like it's easier to learn when brain is still deveoping

lost matrix
#

lol

young knoll
#

Idk I'm not a science

vast ledge
simple schooner
#

Im 15 I started coding 9 months ago in roblox

vast ledge
#

i almost commited unalive

#

imagine c++

young knoll
#

LUA moment

livid dove
simple schooner
echo basalt
#

Now I'm 18 and I look up to my elders :p

young knoll
#

When the array starts at 1

livid dove
echo basalt
vast ledge
#

theres nothign wrong with it

#

its a lovely language

young knoll
#

Arrays start at 1

#

Literally unusable

vast ledge
#

except that

lost matrix
remote swallow
#

how many roblix did you get

livid dove
echo basalt
#

bobux

sharp verge
#

Hello there, so im currently having a slight issue

So i've been struggling with getting a specific schematic file from my plugins resources to be saved in the plugins datafolder
https://paste.learnspigot.com/lisodemuye.csharp
This is the error im getting when trying to install the plugin

saveResource("schematics/standardplot.schem", false);```
The method im using to try and copy from resource to datafolder
https://i.gyazo.com/a5890287c8fd5cfea9ee80a451483c16.png
The Image shows the structure of the resource folder
https://i.gyazo.com/44277a324e628278ca57e7b17323e73a.png
And the second image is the structure in the target folder

LearnSpigot provides a free web-based pastebin service for storing and sharing code snippets with anyone. Powered by hastebin.

young knoll
#

Ah hell yeah lights and colors

echo basalt
#

15yo smile

remote swallow
sharp verge
vast ledge
# echo basalt

Anybody know how i can create documentation like this?

lost matrix
echo basalt
#

comments

lost matrix
#

But it was around 2k i believe

echo basalt
#

I wrote it all by hand

young knoll
#

Not even javadocs

#

Smh

vast ledge
echo basalt
#

different audiences ig