#help-development

1 messages ยท Page 363 of 1

tender shard
#

why would this take hours?

#

you would just do SELECT (whateverINeed) from TABLE where WHATEVER = WHATEVERINEED

sterile token
tender shard
#

please show me a real life example of "mongo"db

#

I am actually curious

proper notch
#

I would say mongo is quite easy for beginners. At a small scale you can get away with knowing zero of its query syntax and sure, ur small enough to probably just not know indexes exist right now and your performance will massively suffer but that's an issue for later you.

lost matrix
#

Oh i tuned off at the wrong moment. Discussion time? hypers

tender shard
#

is it not possible that anyone would just show a tiny example of how "mongo"db works?

lost matrix
#

Yes one moment ๐Ÿ˜„

proper notch
#

I really don't have any good java code for it any more. Do you just mean how you interact with it?

tender shard
#

no

#

just

#

like

#

ANYTHING

#

?

river oracle
#

MongoDB drivers have great docs

proper notch
#

They're simple and easy to use, apart from some small hassles (e.g no automatic UUID type in golang)

tender shard
#

can somebody show me a screenshot of how a random "mongo"db table looks like?

lost matrix
#

Lets make a concrete example. Like a toplist query or storing user data of players.
So i can show some code.

river oracle
#

its not sql

proper notch
#

There's no exact schema. You add data as and when you want.

tender shard
# proper notch

how is that different from sql? there's a table called "player". is has the fields "_id", "currentUsername", etc etc. and then there's a few entries, and they all have values for each of those fields

sterile token
# proper notch

How are you saving uuids as UUID, in my case they are saved a BinData

proper notch
#

All data is stored in their version of JSON called BSON which adds extra types

tender shard
tender shard
proper notch
#

Your choice what you want

tender shard
gleaming grove
#

Mongo is great when you have not much relations in database and your system is build to be mostly readonly. So there you can pretty simple to just push Json payload data without mapping it to tables types

proper notch
tender shard
proper notch
#

Haven't used the java client in around a year now so I'm not 100%, but it's something like that

tender shard
#

instead of having a fixed scheme like "id, name, uuid, etc etc" it just has "id, <blob of data>"

#

yeah that would also totally be doable with normal sql

lost matrix
#

Here is how a toplist search would look like

  private final MongoCollection<PlayerData> collection;

  public List<PlayerData> getTopKills(int amount) {
    List<PlayerData> values = new ArrayList<>();
    Bson sort = Sorts.descending("Kills");
    collection.find().sort(sort).limit(amount).into(values);
    return values;
  }

You can literally use objects because with a half decent Codec you can serialize anything to json/bson

proper notch
#

And you would use skip to do pageability

sterile token
tender shard
#

everything you people sent just confirms my assumption that "mongo"db wasn't called "mongo" for no reason, it's just a normal relational databse, but instead that it maps "a" to "b" and "c" and "d", it just maps "a" to "some random blob of data" and hence the owner called it "mongo", which, as I already said, is racial slur against disabled people in at least 20+ languages, including the language of the dude who invented it

sterile token
#

hee?

proper notch
#

I'm convinced you're just both insane and have some kind of personal vendetta against Mongo.

sterile token
#

No mongo doesnt mean that

tender shard
#

in java we'd just call it a List<Object>

#

or maybe a Map

sterile token
#

Mongo is a simple HashMap talking about java terms

tender shard
#

Redis is a key<>value

sterile token
tender shard
#

but it at least has stuff like a pup/sub system

proper notch
#

Each document is a hashmap, mongo itself is not a hashmap.

tender shard
#

what is a "document"?

lost matrix
proper notch
#

Mongo is a document database. It stores data in documents.

sterile token
tender shard
#

a "document" is basically "whatever" right?

sterile token
lost matrix
gleaming grove
lost matrix
#

Please Verano

proper notch
#

A document is not a field...

sterile token
tender shard
sterile token
#

Sorry smile, Im just over thinking how to fix my issue with mongo whilre working with int

tender shard
#

I'd understand it if the inventor of MongoDB would NOT be german. But he is

#

anyway, discussion ended for me today. All you people explained to me is that "MongoDB" is just a poor man's version of SQL. It seems to just be "key<>whatever". And nobody seems to care that the dude who invented it used a racial slur for his system despite knowing that it's a racial slur in his ow nlanguage

lost matrix
#

Mongo is only a slur if you use it like one. We are responsible for what is being perceived as offensive.
And we should not be offended by every little word like "mongo". Nobody uses this word as a slur anymore.
Only people with room temperature iq.

tender shard
#

what you people call "document" is what is called "blob" in mysql

real fable
#

I'm looking in spigot's forums and the google in general for the best way to make a "dummy" NPC that is just an entity with a player skin (if too complicated, I'll go with a Villager)
That just teleport someone who right clicked it on a specific location.
I'm not asking on how to make an Interact listener but on how to make this entity ?
Can someone help me with that ?

lost matrix
tender shard
#

well, what else is it?

sterile token
#

Smile are you currently free? Because with collermar and mfalex, we couldnt fix the issue while wortking with int in mongp

lost matrix
sterile token
#

So i would love to you take a look and try to help

tender shard
#

mind explaining it in a bit simpler english for me please?

lost matrix
#

I mean that a bunch of kids blurted out words like keys and blobs and you didnt look
at how credible the source is. If we focus on technical details then i can explain where mongodb
has its strenghts and weaknesses compared to relational databases.

real fable
#

I m looking in spigot s forums and the

sterile token
#

Yeah because you cant say that a db is bad or not, without an specific contaxt

#

That is what we learn the the first month at our database subject

tender shard
#

I am always open to learning new things

#

I still dislike the idea of a german dude calling sth "mongoDB"

#

that's like me inventing sth and calling it "n**gadb" but anyway

#

I'd love to learn about the advantages of mongo, so if you could explain to me, that'd be nice

lost matrix
#

If it was good then i would literally not care...

#

And if it was "WhiteCrackerTrashDB" i would also not care

#

Anyways

echo basalt
#

"CancerDB" sounds cool

#

acutally no wait

#

firebase seems odd because people die in fires

#

cancel them

tender shard
#

so what's sth that mongodb does better than mysql?

#

to me it looks like mongodb is just a weird redis

sterile token
upbeat hornet
#

can someone connect to my server (1.19.2) to tell me what they see (on their side) dm me if you can

echo basalt
#

redis dies when you restart the machine

#

mongo is persistent

proper notch
#

Off the top of my head:

Because Mongo is a document database, it scales significantly easier than an SQL database. Mongo can shard and scale out of the box if you want.

Having no schema can both be a positive and negative for many reasons.

tender shard
lost matrix
echo basalt
#

well that's the main out of the box change

#

redis being persistent is a bit weird

#

it's like making snapshots n all

sterile token
tender shard
#

if so ,where's the difference to a mysql table that just stores a table like "id"=int and "data"=blob?

echo basalt
#

Mongo and redis both shard out really easily

#

sql is a lot more complex when sharding

#

Mongo is a big Map<String, whatever>

proper notch
#

Yh I remember in the end google made ProxySQL or something like that to make it scale

echo basalt
#

sql is all structural and linked together

#

redis is special

lost matrix
#

MongoDB stores its data as Bson, which is similar to Json but has some benefits regarding
the DB architecture. It allows to query objects by their properties without having
to directly iterate every document on every query.

proper notch
lost matrix
#

In my books the ease of use of mongodb is a big plus.
Designing robust and scalable relational data models is very labour
intensive and error prone.

tender shard
proper notch
#

Well then that's a big reason why that's different.

lost matrix
#

MongoDB has a closer depiction of the actual objects you would use in your runtime environment.

proper notch
#

You can index whatever field in mongo you want.

tender shard
lost matrix
#

This means that serialisation of Objects for MongoDB is very powerful because
you can take the same approaches as you would for Json.

proper notch
#

So in this:

_id is a forced index that is unique. Your _id field must be a unique index and every document must have an _id field
currentUsername is indexed, but uniqueness is not enforced.
currentlyOnline is indexed, uniqueness also not enforced

tender shard
#

it still seems to me like it's not very different from a mysql table that just maps <someKey> to <someJsonData>

lost matrix
#

Well you cant search through the <someJsonData> in a SQL database

tender shard
#

ofc you can?

lost matrix
#

In mongodb you can efficiently query for every property and even index every property you want

tender shard
#

oh wait

#

I understand it now

#

Okay, yes, I do undertsand it now

#

thanks for clarifying

proper notch
#

Well the big difference there is there is no schema. There are no rows and columns, there is no table.

Any document can have any fields and values it wants, the only restriction is it must have a unique _id field. The same is not true for SQL, the columns have predefined names and types.

tender shard
#

I am still upset about why they called it "mongo"db, that's like calling it "retarded"db

#

but yeah, so be it. at least now I understand how it works

wheat flint
#
public class PlayerCloseMenu implements Listener {
    Plugin plugin;
    @EventHandler
    public boolean onPlayerCloseMenuEvent(InventoryCloseEvent event) {
        if(event.getInventory()!=new WelcomeInventory(plugin).getInventory()){
            event.getPlayer().sendMessage("Wrong inventory");
            return false;
        }
        Inventory delayInventory = new DelayInventory(plugin).getInventory();
        Player player = (Player) event.getPlayer();

        int id = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
            @Override
            public void run() {
                player.openInventory(delayInventory);
            }
        }, 0, 10);

        Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
            @Override
            public void run() {
                player.openInventory(delayInventory);
                Bukkit.getServer().getScheduler().cancelTask(id);
            }
        }, new GetPluginInfo(plugin).getDelayTime());

        return true;
    }
}

I'm trying to open new inventory after closing the old one, im detecting it via InventoryCloseEvent and then rapidly opening new one until scheduleSyncDelayedTask cancels task, it looks like event is not even working, because even on fail compare it do not send any message. does anyone know otherway of making it work? (dont mind awfull way of getting data, working on it)

lost matrix
tender shard
#

^

proper notch
#

Oh and ofc, like JSON, you can have complex document structures still. Those can be indexed as well, e.g here I can index permissions.node still.

wheat flint
#

so how can i be shure that the closed inventory is the one i want

sterile token
tender shard
lost matrix
wheat flint
sterile token
#

Now smile i need your help

#

Because you now lot about mongo

lost matrix
tender shard
#

that is not ONE inventory. that's like 1-2 new inventories per event

lost matrix
tender shard
lost matrix
lost matrix
tender shard
#

hmmm yeah in theory, you are right

wheat flint
lost matrix
#

Yeah... Please dont

tender shard
#

btw if an instance method ever always returns a static "thing", your design is flawed in the first place

lost matrix
#

Someone recently bashed me on this discord because i proposed a design change to a functional problem

tender shard
lost matrix
#

Always like the "Ill make it work and refactor later" mentality. Never happens.

lost matrix
wheat flint
#

i dont understand rn. In one class i have defined delayinventory that i want to be opened when player is closing welcomeinventory, the delayinventory should be opening all the time until the specified delay ends.

tender shard
#

but yeah you are right

lost matrix
#

Its basically the same thing in most cases XD

tender shard
#

exactly haha

#

just 12 hours ago, I copied the whole "autoCondenseToggle" method to "autoSmeltToggle" in my D2I plugin. I should have just made it generic, using a "autoToggle<WhatEverIsToggleable>" method, but I cba

lost matrix
#

Anyways i wanted to be productive for at least 2h today and all i did was fight with gradle and argue on discord.
So im out for today ๐Ÿ‘‹

eternal night
tender shard
#

good night lol

#

(btw 27 hectars is not very much)

lost matrix
#

Meh

#

I mean not for a bunch of sheep

tender shard
#

I have now just read a bit of things about mongodb, and I learnt many new things, and I can confirm that I was wrong ealier, when I said "mongodb is just a sql table with key<>blob" stuff. However I still stand my ground that "mongodb" is a weird name lol

proper notch
#

it comes from humongous with db tagged on the end

tender shard
#

yeah I know, I've read that too

#

however you also gotta take into account that the dude who invented it was german, and that in geman, the word "mongo" is a bit like the word "re..:82..retarded"

#

but yeah, that probably wasn't his intention

#

still, it's always weird when I read this word

#

it's a bit like if you're english and you'd read "retardedDB"

#

but yeah, I hereby take back everything I said against MongoDB, everything I said against it was because of my own lack of knowledge, and the only thing I now have against it is the poor choice of naming. Other than that, mongodb seems to be a nice thing.

sterile token
#

Smile

#

please stop ignoring my dms

#

I really ant to fix my issue

remote swallow
#

hes not online

tender shard
#

lol

primal goblet
#

how can i force open the "Enter Title Book" menu to a player and get what the player type in it?>

trail lintel
#

yo gamers, is there a way to get around this? FileConfiguration returns a List<?>, any way to get around this warning?

primal goblet
trail lintel
#

But it is a list of lists

primal goblet
#

like this?

a:
- not a
- not b also
```??
trail lintel
#
key: [
  ["D", "diamond"],
  ["E", "ender_eye"],
  ["C", "ender_chest"]
]
#

like so, array of arrays

primal goblet
#

thats json?

trail lintel
#

it is json, that line is parsing the json in the config

#

it works fine, its just annoying having that warning lol

primal goblet
#

idk if you can put data like this in yml file tbh

hazy parrot
#

valid json is valid yaml

trail lintel
#

oh sorry, yeah its yaml not json lol

primal goblet
trail lintel
#

but yeah the parsing works fine, its just annoying getting that warning

hazy parrot
primal goblet
#

i'm lazy to spell the word :/

trail lintel
#

gotcha, so just ignore it in the ide, no way to tell java itself to ignore it huh

hazy parrot
trail lintel
#

ah yeah, fair point

primal goblet
primal goblet
trail lintel
#

When you guys write update checkers, do you typically just check for updates once when the server starts or do you run a repeat task to check say every 24 hours?

eternal oxide
#

at startup only

worldly ingot
#

Yeah you only ever really need to do it on startup

#

It's not very likely someone's going to see an update popup in console or in chat mid-runtime and be like "OKAY! Time to shutdown and update!"

trail lintel
#

My only worry is that some people (myself included) may only restart their server once every like 2 weeks lol

#

But yeah, you definitely right about that

worldly ingot
#

They'll be the type of people to keep their servers running as long as possible anyways lol

trail lintel
#

Lolol yeah, your right. I'm just going overboard with my first plugin I think ๐Ÿ˜‰

#

Will keep the update check on startup only

remote swallow
#

i set my update checkers to run on startup and normally every 2 hours

hazy parrot
#

is best way to send server-icon over rest to convert it to base64 ?

compact haven
trail lintel
#

Yeah haha after I thought about it more I was like oh yeah thats just the IDE

#

I just wanna make the file not yellow in vscode anymore ๐Ÿ˜‰

#

my ocddddd lol

compact haven
worldly ingot
#

The only plugin that needs to have an update check every other hour is EcoEnchants which seems to update at that frequency

hazy parrot
#

not sure if its intellij specific tho

remote swallow
#

the one i have doesn thave update checker

trail lintel
#

sweet relief

#

I'm going to release a plugin that checks for updates FOR the update checker but requires an update checker lib that checks for updates every 30 seconds

remote swallow
#

perfect

trail lintel
#

๐Ÿ˜‰

remote swallow
#

make sure to send the update message atleast 300 times if one is found

#

and every 5 minutes in game

#

to all players

trail lintel
#

Hahhaha, the ultimate troll plugin

remote swallow
#

with a title

compact haven
#

๐Ÿค“ Players please bug your server administrators to bug the developer of EbicPluginX to update the update checker inside of their plugin.

remote swallow
#

yeah

dire marsh
#

add a command that allows players to live reload to update it

remote swallow
#

YES

compact haven
#

just forcefully install PlugMan

remote swallow
#

plug women

trail lintel
#

Man these plugin description pages are insane. People have like all these fancy custom banner images with decorations, and im just out here with plaintext and bold/italics formatting lol.

compact haven
#

ask midjourney to design your plug-in page graphics

trail lintel
#

I actually just picked up a 4090, I could stable diffusion it up haha. Although its not so good with text

remote swallow
#

give me some money

#

thanks

#

totally need it

compact haven
#

stop flexing

trail lintel
#

chatgpt + stable diffusion time

#

Lolol and I use it to play minecraft and factorio, definitely not money wasted

#

It is nice being able to generate ai waifus in 10 seconds tho ๐Ÿ˜‰

remote swallow
#

are you a discord mod on any serve

trail lintel
#

Does my own server count lolol

remote swallow
#

ye

#

4090 well used

primal goblet
#

how can i open this menu to a player and get the text when sign?

trail lintel
#

I figure once kerbal 2 and the forest come out in 9 and 10 days I might get a little bit more use out of it lol

#

Like to open a book without actually having a book in your hand?

primal goblet
#

all the nicksystem in book gui and its awful if the nickname inserted in anvil

trail lintel
#

Ohhh so you only want the screen to pop up for signing the book

trail lintel
#

not the book itself

primal goblet
#

exactly

#

i need the player to put the title as the nickname

dire marsh
#

isn't book signing clientsided

primal goblet
dire marsh
#

I always thought you could only make a player open a written book

primal goblet
#

is there's another way? like open a book and quill and receive the text?

trail lintel
#

this site is outdated a bit but good starting point

dire marsh
#

it's not

#

it's 1.19.3

trail lintel
#

I don't think it is, the Open_Screen is outdated, I had to decompile and its quite different than whats listed there

dire marsh
#

then update it ๐Ÿ˜„

#

some sections may not have been looked at

trail lintel
#

Oh snap can I do that? I will if I can =]

#

I learned a lot having to do the decomp myself though haha

primal goblet
#

@trail lintel the same ๐Ÿ˜ฆ

dire marsh
dire marsh
primal goblet
dire marsh
#

there's also sign guis

primal goblet
trail lintel
#

If you are trying to do nicknames though why do it through the book gui? Why not just a command?

primal goblet
trail lintel
#

I see, hypixel does it through a book gui? It must be possible then ๐Ÿ˜‰ keep crackin at it

#

persistence is key haha I had to dig for ages to get the info I needed

primal goblet
hazy parrot
#

wait, is Bukkit.getWorldContainer() just returning root directory

#

as all worlds are there

#

?

dire marsh
#

yes

primal goblet
dire marsh
#

let's hope we get a worlds folder one day

primal goblet
#

you can just make a path .

#

as the spigot instance path

#

anyone have a good signgui api?

dire marsh
dire marsh
#

last two replies there

trail lintel
#

what is this black magic o.o

#

displayGuiScreen?!?

#

ohh its not part of the spigot api ok

upbeat hornet
#

What could cause this?

the player that placed the block (that initializes the hologram) sees it right, but other players see an armor stand

remote swallow
#

is it a real armor stand or packet created

upbeat hornet
#

It's this:

 ArmorStand hologram = (ArmorStand) gen.getLocation().getWorld().spawnEntity(gen.getLocation().clone().add(0.5, -0.75, 0.5), EntityType.ARMOR_STAND);
#

Which is an actual armor stand I suppose

atomic swift
#

i have getCommand("enchant").setExecutor(new Enchant()); but the command doesnt execute at all

upbeat hornet
#

add it to plugin.yml

atomic swift
#

it is

upbeat hornet
#

can I see it?

atomic swift
#
commands:

  enchant:
    default: true
    permission: enchant.command.enchant
    description: allows the user to open the enchant menu
    permission-message: You do not have permission to use this command.
    usage: "Usage: /<command>"

remote swallow
#

thats not how that works

#

you cant set a permission true in the command seciton

atomic swift
#

but in all of my other plugins it doesnt matter

remote swallow
#

it wont work if you do that

#

so its just pointless

atomic swift
#

i have this command and it works

  menu:
    default: true
    permission: kot.command.menu
    description: allows the user to opne the cosmetics menu
    aliases: kotmenu
    permission-message: You do not have permission to use this command.
    usage: "Usage: /<command>"
upbeat hornet
#

@atomic swift your class is defined like this right?

public class Enchant implements CommandExecutor 
remote swallow
#

also naming conventions where

upbeat hornet
#

me?

remote swallow
#

jman

atomic swift
remote swallow
#

its like 2 buttons?

atomic swift
#

ye ik

remote swallow
#

so hard to rename Enchant to EnchantCommand

atomic swift
#

ye

#

bc its 3 clicks

#

better

remote swallow
#

yeah

atomic swift
#

this is my full class


package info.sokobot.enchant.commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import info.sokobot.enchant.guis.Table;

public class EnchantCommand implements CommandExecutor {

    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!(sender instanceof Player)) return false;
            Player player = (Player) sender;
        System.out.println("1 dollar, one dollar, one dollar foot long");
        Table.openGui(player);
        
        return true;
    }
}
remote swallow
#

@Override where

atomic swift
#

hm idk

#

oh

remote swallow
#

override the method

atomic swift
#

it said @ Override cant be used

trail lintel
#

how did it even let you do that without an override o.o

atomic swift
#

last tiem

atomic swift
upbeat hornet
trail lintel
#

yeah but you implementing an interface

#

it should bitch that you arent implementing the required methods

atomic swift
atomic swift
remote swallow
#

if this is 16 or higher you can remove the cast

#
if (!(sender instanceof Player player)) return false;
#

then you can use player where you need it

atomic swift
#

idk y

remote swallow
#

is it java16 or higher

atomic swift
#

no i set it to java 16 or higher and it just dies

remote swallow
#

are you running java 16 as the server

atomic swift
#

idk

#

17

remote swallow
#

should work then

#

sounds like

#

?Xy

#

?Xy

#

?xy

undone axleBOT
royal bane
#

Can't use spigot (not api) in build.gradle? I get this error:
Could not find org.spigotmcspigot1.16.5-R0.1-SNAPSHOT.

remote swallow
#

have you ran buildtools

#

and do you have mavenLocal() in ur deps

atomic swift
#

why does Main.getInstance().getDataFolder() return the jar

remote swallow
#

?main

remote swallow
atomic swift
#

YamlConfiguration cfg = YamlConfiguration.loadConfiguration(
new File(Main.getInstance().getDataFolder(), "panel.yml"));

trail lintel
#

Damn epic out here bein ebic he knows everything haha

remote swallow
remote swallow
atomic swift
#

java.lang.IllegalArgumentException: The embedded resource 'panel.yml' cannot be found in plugins/enchant-0.0.1-SNAPSHOT.jar

remote swallow
#

are you calling JavaPlugin.saveResource

atomic swift
#

before you ask yes i have saveResource("panel.yml", false);

upbeat hornet
#

lol

remote swallow
#

does that file exist in resources

#

if not theres your issue

royal bane
atomic swift
remote swallow
#

make sure its in the jar

atomic swift
#

time to boot up recaf

remote swallow
#

winrar be like

#

or just changing the extension to .zip works

atomic swift
#

recaf is easier

#

its there

remote swallow
#

that is the wrong place

#

it should be in the base jar

#

not in sub folders

atomic swift
#

it is

#

files just takes files that are NOT .class files

#

fine ill open 7zip

remote swallow
#

somehow the jar cant be found

atomic swift
#

idk

remote swallow
#

send the full stacktrace

#

?paste

undone axleBOT
atomic swift
royal bane
#

Can I send my build.gradle?

remote swallow
#

yeah

#

paste it

remote swallow
atomic swift
#

ye saveResource("panel.yml", false);

royal bane
remote swallow
#

have you considered reastarting, not using plugman

remote swallow
atomic swift
#

why does it die if the resource exists

remote swallow
#

plugman at a guess

atomic swift
#

bc panel exists

remote swallow
royal bane
#

Yes I am using arclight for a server with mods + plugins recommended to me on the pixelmon mods discord

#

How do I run it as buildtools? I am using Intellij

river oracle
#

What

#

That doesn't make sense, also you will see no support for mod and plugin servers a lot of times they plain suck

#

If you need essentials use FTBUtils

royal bane
#

I'm not asking for server support, I just want to know how I can solve that the build.gradle does not find the spigot (no api) even in a project that does not have forge

undone axleBOT
sterile token
#

Hi im back, im still having integer isssues with mongo db๐Ÿ˜ก

#

Im really stressed i have lost 1d day of hard working caused of this shity issue

real fable
#

This happen when someone die, I used <Player>.spigot().respawn() in a PlayerDeath Listener
https://streamable.com/ybt2mt
It respawn the player, but right after, the death screen appear...

sterile token
#

๐Ÿ˜ฌ

delicate lynx
#

why not just use the doImmediateRespawn gamerule?

real fable
#

thanks ig ^^'

delicate lynx
#

I believe it skips the death screen

sterile token
royal bane
# remote swallow ?bt

I was just seeing that, do I run it in any folder or should it be inside the project?

delicate lynx
#

I'm famous then

remote swallow
#

you can delete the folder after

royal bane
#

Okok thank you!!

quaint mantle
#

Does anyone know a plugin that can prevent VPN / Proxies? Even if the plugin costs money its all good!

sterile token
#

Can someone explain me why my player time counter is negative?

#

This is a really stupid question but i cant understand why haha

wet breach
quaint mantle
#

Do you store it as a long?

#

If not you should

sterile token
#

yeah im storing as long

#

And working directly over documents

solemn compass
#

a

quaint mantle
#

hm,

#

so @sterile token I use gson but I had to set my long serialization policy

#

GSON stores longs as a string

#

try that

#

Let me know if that works

#

these are all mongo types

sterile token
#

Kotlin i dont understand it

#

I fixed

#

Thanks man

#

But now issues with Material#getMaterial() and the material im passing is not null

#

Im currently confused

wet breach
sterile token
#

No no i mean, played time not related to word mainly how many time the player plays in the server

wet breach
#

Playtime is connected to world time.

#

Or well used to be, may not be the case anymore lol

sterile token
#

Hee?

sterile token
#

Im just trying to count the total timehe has played inside the network

smoky oak
#

?paste

undone axleBOT
smoky oak
#

alright so paste.md5 doesnt work for this bruh

#

my question is why'd buildtools fail when i ran it for 1.8.8

sterile token
smoky oak
#

but its an issue if i cant even build the damn server

sterile token
#

Hmnn

smoky oak
#
[WARNING] The requested profile "remapped" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.4.1:jar (default-cli) on project bukkit: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - D:\Creation\Minecraft\Bukkit\src\main\java\org\bukkit\material\Door.java:194: error: reference not found
[ERROR]      * @see Material.WOODEN_DOOR
...
[ERROR] Command line was: cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_341\jre\..\bin\javadoc.exe" @options @packages @argfile"
[ERROR]
[ERROR] Refer to the generated Javadoc files in 'D:\Creation\Minecraft\Bukkit\target\apidocs' dir.
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Exception in thread "main" java.lang.RuntimeException: Error running command, return status !=0: [C:\Windows\system32\cmd.exe, /D, /C, D:\Creation\Minecraft\apache-maven-3.6.0/bin/mvn.cmd, -Dbt.name=582a, -P, remapped, javadoc:jar]
        at org.spigotmc.builder.Builder.runProcess0(Builder.java:976)
        at org.spigotmc.builder.Builder.runProcess(Builder.java:907)
        at org.spigotmc.builder.Builder.runMaven(Builder.java:876)
        at org.spigotmc.builder.Builder.main(Builder.java:693)
        at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
sterile token
#

Send your command please

smoky oak
#

"C:\Program Files\Java\jdk1.8.0_341\bin\java.exe" -jar Buildtools.Jar --generate-source --generate-docs --remapped --rev 1.8.8

sterile token
#

oh you are using remppaed

smoky oak
#

so?

sterile token
#

remapped doesnt exists on 1.8

smoky oak
#

ah

#

so its all direct nms in that version?

sterile token
#

build it directly with command

#

without remapped

smoky oak
#

uh

#

i excluded remapped

#

it failed again

#

its complaining about missing references

#
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.4.1:jar (default-cli) on project bukkit: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - D:\Creation\Minecraft\Bukkit\src\main\java\org\bukkit\material\Door.java:194: error: reference not found
[ERROR]      * @see Material.WOODEN_DOOR
sterile token
#

just use only -rev argument

smoky oak
#

i kinda sorta want the javadocs lol

#

is there an archive of previous versions somewhere

sterile token
#

you can look for them only

#

or download it and index then via IDE

smoky oak
#

thx

#

wtf

#

@sterile token

sterile token
#

what issue?

#

Did you download latest build tools? And please paste the issue in paste

smoky oak
#

well idk why it fails just that it does with above message. Also since 1.8 is so old i assumed i wouldnt need buildtools but imma try

#

yup broke again

sterile token
#

Wait

#

Do you ant me to send you the things?

#

I already build them

smoky oak
#

well i need the .m2 stuff

#

you know

#

to build plugins

tender shard
#

is there a way to get a list of ALL generated chunks in a world, no matter whether currently loaded or not?

eternal night
#

Not without you iterating over the region files manually

tender shard
#

that's no problem

tender shard
#

how many chunks does a region file include?

eternal night
#

^ that method is your friend

tender shard
#

hm I just thought, it's probably easier to just start in the center, then do a "spiral" loop or sth

eternal night
#

1 << 5 I believe?

#

That's was the conversion

#

64x64 then

tender shard
#

damn 4096 chunks in one region?

#

I thought it was less lol

#

haha ACF is so funny, this will spam the chat so much when someone enters an invalid material name

#

this plugin is going to be funny

#

yo everyone I need help with basic 3rd grader's math

#

imagine these are chunks, 1 is the center chunk. now I need a x,z for loop that iterates over all the surrounding ones

#

but I cannot come up with anything

#

I probably need a three-way nested for loop but tbh I have no clue how

#

it's too early for my brain to work. if someone could tell me how, that'd be nice

hybrid spoke
#

i would see the surrounding chunks as a layer which you can magically add to the initial chunk location and bitshift them by 4

tender shard
#
            int offset = 0;
            while(true) {
                for(int x = -offset; x<= offset; x++) {
                    for(int z = -offset; z<= offset; z++) {
                        Chunk chunk = world.getChunkAt(x, z); // Yeah I know this would load the chunk, just an example
                    }
                }
                
            }
#

this should probably do what I was asking for I hope?

#

(except that I forgot to offset++)

#

no wait

#

bullshit

hybrid spoke
#

this would just brute force in one direction

tender shard
#

that would also loop over all the already done chunks again

#

hmmm

#

I just need a loop that does it like this:

hybrid spoke
#

probably the best way to do this would be to use the diagonals

tender shard
#

but I cannot come up with any math

hybrid spoke
#

chunk1 << 4*layer if im not dumb

tender shard
#

the actual order is not important, I just need to loop over all chunks, from the center unwards, until I hit a "layer" where there is no more generated chunk

sullen marlin
#

Harder than it looks

tender shard
#

damn md_5 do you want to kill me?

smoky oak
#

hold on for 2 mins pls

sullen marlin
#

The below answers are less mathy more cody

tender shard
#

sure, I got time haha

#

hm unfortunately all these answers relies on a given array where he just needs the indexes for

hybrid spoke
tender shard
smoky oak
#
HashSet<Point> checked = new HashSet();
for(int i=1;i++;i<radius){
  for(int x=coordx-i;x++;x<coordx+i){
    for(int y=coordy-i;y++;y<coordy+i){
      Point p = new Point(x,y);
      if(checked.contains(p)) continue;
      checked.put(p);
      //check chunk here
#

this is a very stupid solution

#

but it is likely to work

tender shard
#

I basically just need to loop over all existing chunks. to do that, I thought I just start at the spawn, then do some spiral loop over the nearby chunks, until I hit a "layer" where no chunk is generated, then I'm done

tender shard
tender shard
# hybrid spoke

but I don't know whether "3" is the end point, I need it to start in the center

hybrid spoke
# hybrid spoke

that would be just a linear function to get the corner chunks from which you can then loop through

tender shard
#

oh I wanted to answer to @smoky oak

#

as said, it's too early for my brain to work

tender shard
#

just a tiny thought... imagine a world is 50kx50k... and a chunk is 16x16... that'd mean it has 10 MILLION chunks?!?!

#

because in that case, Moterius' solution is not very optimal haha

smoky oak
#

well

#

contains is o(n)

#

also as said

#

stupid solution but works

tender shard
smoky oak
#

if i have more thann 30 seconds i can do the math for a proper spiral

tender shard
#

sure, I'm going for a smoke anyway haha

#

take your time, much appreciated โค๏ธ

#

This seems to be way harder than i originally thought itd be

smoky oak
#

btw

#

only ring order important

#

or has it to be a spiral

tender shard
# tender shard

The ring order is irrelevant but it should be at least spiral like, like this

#

The order in each layer is irrelevant

#

Only important thing is โ€žring 1, then the next outer ring, etcโ€œ

#
currentRing = 0;
while(!doneYet()) {
  for(everyChunk : allChunksOfCurrentRing(currentRing)) {
    // do something
  }
  currentRing++;
}

sth like this lol

smoky oak
#
int shift=0;
while(true){
  shift++;
  int checkx_1 = startx - shift;
  int checkx_2 = startx + shift;
  int checky_1 = starty - shift;
  int checky_2 = starty + shift;
  for(int checkx = startx - shift; checkx++; checkx < startx + shift){
    if(!chunkLoadedAt(checkx,checky_1) || !chunkLoadedAt(checkx,checky_2) {}
  }
  for(int checky = starty - shift + 1; checky++; checky < starty + shift - 1){
    if(!chunkLoadedAt(checky,checkx_1) || !chunkLoadedAt(checky,checkx_2) {}
  }
}
```  @tender shard
tender shard
#

thanks, lemme try this quickly

smoky oak
#

this excludes the origin chunk btw

tender shard
#

oh okay, no problem

#

I'll try this quickly

smoky oak
#

it also is missing your check and return logic

#

return shift, its the 'radius' of the current ring

tender shard
smoky oak
#

tldr

#

it runs down the sides in 4 steps

tender shard
#

see the comment in the first for loop pls

smoky oak
#

oops

#

int

#

forgot the int for the loop counters

#

also you have to add the function to check if the chunks loaded and what you do if that happens, this is only the math

#

current x,z is cuz i forgot that y is up

tender shard
#

yeah the "is chunk generated" check is no problem etc, I am just wondering on how to do the actual math for this loop

smoky oak
#

well replace all y with z

#

chunk coord is checkx with checkz_1 checkz_2

#

heres how the coords in the first loop work

#

and the second loop is the same thing for the outermost columns instead

#

the +1 -1 is to exclude the corners since they've been checked in the first loop

#

does that make sense?

tender shard
#

haha sorry but I still dont get it, however I think I got an idea, which I'll try in 10 minutes

smoky oak
#

ok

hybrid spoke
tender shard
#

I am now approaching a lazy solution by just getting each side individually

#

I think that's the easiest solution and I would even get the chunks in the correct order

#

if a corner is checked twice, that's not an issue for me btw

#

btw, maybe it's helpful to tell my actual attempted solution: I need to loop over all chunks in a world to get rid of a certain block type

#

and it should be a "one-time" running plugin, instead of constantly listening to chunk loads

smoky oak
#

aint that what ive been doing with lists

tender shard
#

why the fuck have I not peeked at dynmap's code yet

tender shard
smoky oak
#

well originally

tender shard
#

I am currently just returning a List for every "side" of the current "ring"

smoky oak
#

the second variant just runs through all coordinates, first the along the x sides then along the z sides

tender shard
#

oh then I probably misread your first suggestion :X

#

sorry D:

timid jetty
#

so ive got this velocity code and it works sometimes beauitfully and sometimes its absolutely shit lol

        Vector v2 = e.getEntity().getLocation().toVector().clone();
        Vector normalized = v2.clone().subtract(v1.clone()).normalize();
        Vector destination = v2.subtract(normalized.multiply(1.5));
        Vector velocity = destination.clone().subtract(p.getLocation().toVector().clone());
        p.setVelocity(velocity);```
for an entity damage by entity event
timid jetty
#

yeah i was wondering if anybody could improve it lol

#

sometimes it sends you directly to the enemy

#

other times you get shot straight up or far to the left

tender shard
#

just fyi everyone, I came up with this now:

#

?paste

undone axleBOT
tender shard
#

Haven't tested it yet but I guess that does what I need to

timid jetty
#

i dont know why it only works half the time

warm mica
#

You didn't say what it is supposed to do

drowsy cloud
#

If I create a /ban command in my plugin, which command will be executed in games? ( My command or the default /ban Minecraft command )

quaint mantle
#

one command name can probably have several executors.

rotund ravine
#

What

quaint mantle
#

you can probably assign more than one command executor to one command name?

eternal night
quaint mantle
#

ok.

#

only one callback per command?

eternal night
#

they are different commands

quaint mantle
#

then

rotund ravine
#

One executor per command by default.

eternal night
#

if you create a ban command in your plugin simpleban

quaint mantle
#

/yourpluginname:commandname

eternal night
#

then you get the command /simpleban:ban

#

yea

quaint mantle
#

something like that.

#

namespaced by your plugin name.

drowsy cloud
#

Ok

quaint mantle
#

nvm.

#

i probably should not overcomplicate things if i am trying to help someone lol.

smoky oak
#

uh whats a maven archetype

eternal night
#
In the context of software development using the Apache Maven build system, an archetype is a template or a set of templates for creating a new project.

An archetype defines the project structure and its initial contents, such as source code directories, resource directories, configuration files, build scripts, and other project artifacts. It provides a quick and easy way to set up a new project that follows a certain standard or best practice.
#

thanks chatGPT

smoky oak
#

so which one do i select

#

im assuming plugin?

eternal night
#

just the default

smoky oak
#

it isnt giving me a default

#

i wouldnt be asking if it were

eternal night
#

where are you creating the project...

smoky oak
#

empty folder?

#

why

eternal night
#

with maven ?

smoky oak
#

yea?

eternal night
#

if you are running archetype:generate you get a default option

#

idk what cursed command you use to create the maven project

smoky oak
#

button

eternal night
#

that is for developing a specific archetype

#

I presume that is not what you are trying to do

#

just click new project ?

smoky oak
#

i did

#

ah im dumb

eternal night
#

๐Ÿ˜…

next stratus
#

How do people learn to use bungee stuff? I'm trying to work out how to send data from server a to server b ๐Ÿ˜…

eternal night
#

bungee is maybe not the best way to share data between servers

#

as you need players on both servers for it to work

next stratus
eternal night
#

Well is server b guaranteed to have players on it

eternal oxide
#

if yoru servers are on teh same box/subnet you can use sockets

next stratus
#

I mean, it'd be under the same bungee network

#

Is sockets hard to use?

eternal oxide
#

no

#

plenty of java tutorials

next stratus
#

I mean, I want to make a copy of my private mines plugin into a bungee supported system

rotund ravine
#

Donโ€™t mind me

#

?1.8

undone axleBOT
next stratus
rotund ravine
#

I wanted the link

next stratus
#

I just found it funny how it seemed random

rotund ravine
#

It was random indeed

broken lynx
#

whats the name of the respawn anchor entity

river oracle
#

I don't think the response anchor is an entity

#

I mean actually its probably a TileEntity

#

But it's just be called respawn anchor

broken lynx
#

So if i want to stop anchors from exploding items i have to look for tnt prime event?

river oracle
#

Player interact event and check if it's a respawn anchor

broken lynx
#

also do i use event.blockList().clear();
or event.blockList().remove();

twin venture
#

Hello , just a stupid question xd
so i want to broadcast a message to all online players(i know how to) ,
but what i dont know how to is make a player click on the message , and he will execute a custom void method (Not COMMAND!)

i know it ask for a String , but i want to use custom method is it possible?

eternal night
#

you cannot

#

the client needs to execute a command

twin venture
#

thats sad xd

eternal night
#

the basic concept is the following:
send a message that on click runs /commandName <UUID specific to the command callback you wanna run>
lookup the uuid in an expiring cache and get the Consumer<CommandSender> from it, then execute that

twin venture
#

alright thanks

#

i can do this ?
arneMessageJoin.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "joinarena " + arenaSumo.getName()));

#

correct?

lilac dagger
#

the players keep crashing if i send a message while the the receiver has me as a hidden player

#

everything is in the api

hybrid spoke
lilac dagger
#

No custom client, there's no log to give, only a client error message, code that triggers it is to have a player.hidePlayer and sending a message, the player that can't see the other crashes when the message is received @hybrid spoke

#

i think it's specific to 1.19.3

eternal night
#

spigot oversight I presume when implementing chat signatures

#

are you running spigot or paper ?

lilac dagger
#

spigot

cunning canopy
#

Is there any way I can make a minecart invisible?

lilac dagger
#

where do we report spigot bugs?

eternal night
#

?jira

undone axleBOT
lilac dagger
#

thanks

viscid lotus
#

How to change width of custom inventory

#

Help

#

i need something like Bukkit.createInventory(holder, height, width, name)

grave plover
lilac dagger
#

you can't, minecraft is 9 per row

#

you could try a crafting bench

#

but it's not really an inventory

viscid lotus
lilac dagger
#

i don't know exactly how you could get one, search the forums for custom workbenches

wet breach
lilac dagger
#

that you can do with a texture pack

wet breach
#

I meant without a texture pack

regal scaffold
#

How can I add a maven dependency if the plugin I need to depend on doesn't have maven support and I can only have a .jar file

eternal night
#

You can manually install the jar into a repository

dire marsh
#

Is there a way to get the slot you are shift clicking an item into?

regal scaffold
#

That seems annoying to do

#

Alright, gonna attempt to

#

Songoda is terrible. So annoying

#

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>

#

What's packaging

eternal night
#

jar

#

You can deploy differently packaged things into a maven repo

#

E.g pom or jar

#

You want jar

regal scaffold
#
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.106 s
[INFO] Finished at: 2023-02-15T12:05:04-03:00
[INFO] ------------------------------------------------------------------------

#

$ mvn install:install-file -Dfile=FabledSkyblock-2.5.1-DEV.jar -DgroupId=com.songoda -DartifactId=skyblock -Dversion=2.5.1-DEV -Dpackaging=jar

#

Hover over the error first

remote swallow
#

no implements Listener

cold field
#

Does anyone uses ormlite?

lost matrix
#

Not in a while. Whats your concern?

cold field
#

After version 5.0 its generating a log folder even if logging is disabled (it doesn't write anything) but the folder and a file named latest.log is created, do you happen to know an easy fix?

lost matrix
#

Hm no idea

cold field
#

Ty, anyway. Just wondering what are you using now?

lost matrix
#

When working with relational DBs then Hibernate.
But i switched to document based DBs for spigot.

cold field
#

Mh, ok ty

primal goblet
#

how to get a file content in resources folder?

tender shard
#

getResource

#

returns an InputStream

#

myPlugin.getResource("myFile.txt");

#

if you need it as List<String>: throw the inputstream into a inputstreamreader, then throw that into a bufferedreader, then you can loop over lines()

regal scaffold
tender shard
regal scaffold
#

This dumb thing of needing to add .jar to local repo

tender shard
#

wait wait wait

#

are you trying to add someone else's jar to your local repo?

#

or your own maven project?

regal scaffold
#

local repo

#

I need to add a dependency

tender shard
#

someone else's jar, or your own project?

regal scaffold
#

It's what I was told to do

#

Someone elses jar to my own project

tender shard
#

yeah then, what you tried to do, is actually correct

regal scaffold
tender shard
#

what's the output of "mvn -version"?

regal scaffold
#
Apache Maven 3.9.0 (9b58d2bad23a66be161c4664ef21ce219c2c8584)
Maven home: C:\apache-maven-3.9.0
Java version: 19.0.2, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-19
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

#

You know what, that plugin is full abandoned, I'm just not even gonna add support for it

tender shard
#

hm weird, I do not reall yunderstand why it fails for you

#

HOWEVER

#

easy fix:

#
  1. Clone this repo: https://github.com/brunyman/EconomyBank
  2. Open it in IntelliJ
  3. run "mvn install"
lost matrix
#

Did you manually tinker with the pom inside your maven repo?

tender shard
#

they just run `mvn install:install-file", there is no pom

regal scaffold
tender shard
#

mvn install:install-file shouldn't require nor create nor whatever care about any pom file

regal scaffold
#

But since resource is dead. I'm not gonna support it

#

And leaving a 1 star review while im at it

tender shard
#

do not leave a 1 star review

lost matrix
#

Songoda has its own website now iirc

regal scaffold
#

Songoda makes me wanna pull my hair out

tender shard
#

if you rate sth one star, you'll get a one star rating back from the dude lol

regal scaffold
#

But the dev was kind enough to literally zip his local repo and send it to me privately

tender shard
#

if you upload plugins yourself, just refrain from giving out 1 star reviews yourself

lost matrix
#

Did the plugin have anything offensive in its name? Then you can leave a 1 star review trollface

regal scaffold
#

Nah I was joking. I won't leave a 1star for any reason

lost matrix
#

Was just mocking alex a bit

tender shard
#

yeah yeah, very mature

#

oh you probably do not have permissions to view it

#

you're not mocking me, but just defending people who on purpose still continue to use that word

river oracle
#

I keep forgetting that Is a considered a slur bow

#

Im going to end up getting cancelled on Twitter one of these days

tender shard
#

how was this dude called again that kacper is so obsessed with?

#

this dude who looks like a penis and thinks he's the greatest because he owns like 5 cars?

#

erm

#

i dont remember

remote swallow
#

mvn install wants all the values in quotes now

tender shard
#

no

remote swallow
#

someone else had that issue and putting them in '' fixed it

tender shard
#

then they had some weird symbols in their path

#

maven itself doesnt care, it just processess what gets passed to it

#

I know this from experience since it was a pain to get mvn archetype:generate to work from javas processbuilder

#

(although tbf I can only speak about maven 3.6.3)

lost matrix
#

So a windows issue

elder wren
#

Hello guys, i would like to setup spigot and maven for Minecraft 1.7.10 but I don't know how to write the dependencies, can someone know how to do it ? Thanks for your answers

rough drift
#

Holy fuck 1.7.10?

#

That's like

#

ancient

#

it's history

#

even BUILDTOOLS doesn't support it

#

you need to use plain bukkit

#

if you can get a build of it that is

frank kettle
#

1.7 ๐Ÿคฃ

elder wren
#

i'm an arcaic people

rough drift
#

well you can try get a bukkit build

frank kettle
#

just out of curiosity, why 1.7?

rough drift
#

tbh it was a great version

lost matrix
elder wren
#

I just love this version ๐Ÿ˜‚

frank kettle
#

๐Ÿค” ~yeah but things in 1.7.10 are also in 1.19.3 for example

rough drift
#

on 1.17.10 I got 9 essence collectors stolen from me (avaritia)

never again

frank kettle
#

i was asking in case you were running a 1.7 server cause u wanted to have multiple versions and maybe you thought the server had to be on the "oldest" version possible.

elder wren
frank kettle
#

if u want it cause u want it, sure, nothing against

rough drift
#

minestom

#

it's basically just the bare network protocol

#

and you can change everything

#

(includes world and stuff)

elder wren
frank kettle
#

oooo

#

minestom

#

let me check that out

lost matrix
elder wren
#

no

proper notch
#

I love Minestom hehe

#

You just gotta bear in mind it's for certain kinds of projects. Don't try make a survival server in it unless you're truly ambitious and willing to sink years

primal goblet
#

whats the Command Dispatched Async error?

hasty prawn
#

Exactly what it says

#

You dispatched a command on an async thread

#

it no like that

primal goblet
#

cuz i fetched data from mysql?

#

how can i avoid this issue?

rough drift
primal goblet
rough drift
primal goblet
#

and i tried this:
new Thread(() -> { skinMenu(player, args); }).start();

rough drift
#

oh no

#

oh no no no

primal goblet
#

what? xd

rough drift
#

you should never do that on spigot unless you have a good reason

#

?paste some code so I can help you better

undone axleBOT
orchid gazelle
#

hi, how do I send fake-blocks fast like structure-blocks do it?

primal goblet
orchid gazelle
#

I am currently using multiblock-change-packets but they are waaayyy too slow, lagging out the client all the time

primal goblet
#
@Override
    public boolean execute(CommandSender sender, String arg1, String[] args) {
        if(!(sender instanceof Player)) return true;
        Player player = (Player) sender;
        if(!Major.hasPerm(player, "pgxpo.nick")) {
            player.sendMessage(Major.MU("&cOops.! You do not have enough permissions"));
            return false;
        }
        
        NickStep step = Major.getStep(player.getUniqueId());
        switch (step) {
            case SKIN_INVALID:
            case SKIN:
                new Thread(() -> {
                    skinMenu(player, args);
                }).start();
                break;
            case RANK:
                rankMenu(player, args);
                break;
            default:
                acceptionMenu(player, args);
                break;
        }
        return true;
    }

@rough drift

rough drift
orchid gazelle
primal goblet
#

i'm too lazy to open the browser ๐Ÿ˜…

rough drift
rough drift
#

that's literally packets

orchid gazelle
#

this sends a packet for every block changed, taking extreme amounts of bandwidth exploding the client on higher scale

rough drift
rough drift
#

that is actually changing

orchid gazelle
#

actually changing would not hurt the client as much, but fake-blocks do

rough drift
#

fake blocks hurt the client less

primal goblet
# rough drift what does skinMenu do
if(args.length > 0) {
            Pattern pattern = Pattern.compile("^[a-zA-Z0-9_]{3,16}$");

            String name = args[0];
            if(name.equals("-r")) {
                new SignGUI()
                    .lines(new String[] {
                        "", Major.C("&eName Here &lโฌ†"), "", Major.C("&0NickSystem")
                    })
                    .onFinish((p, lines) -> {
                        Major.NICKS.put(player.getUniqueId(), nicker);
                        Bukkit.getServer().dispatchCommand(player, "/nick");
                        return null;
                    })
                    .open(player);

                return;
            }
            
            if(pattern.matcher(name).matches()) {
                Major.NICKS.put(player.getUniqueId(), nicker);
            } else {
                Major.setStep(player.getUniqueId(), NickStep.SKIN_INVALID);
            }

            Bukkit.getServer().dispatchCommand(player, "/nick");
            return;
        }

        String randomSkinName = Major.mySQL.randomSkin();
        BookUtil.openPlayer(player, BookUtil.writtenBook()
            .author("PGxNick")
            .title("PGxNick")
            .pages(
                new BaseComponent[] {
                    Major.getStep(player.getUniqueId()).equals(NickStep.SKIN) ? new TextComponent(Major.C("&0Please choose how you look?\n\n\n")) : new TextComponent("&0Please choose how you look?\n&cInvalid Skin Name!\n\n\n"),
                    yourSkin,
                    alexOrSteve,
                    random,
                    custom
                }
            )
            .build()
        );

String randomSkinName = Major.mySQL.randomSkin(); this fetching random data from mysql

hasty prawn
#

I mean you just throw out the bits that actually change it, but it has the methods they just need to be modified for a specific use-case.

rough drift
primal goblet
#

i removed some vars cuz the message is too long

rough drift
#

running the method itself in a synchronized place won't do anything

#

just do

primal goblet
orchid gazelle
rough drift
#

Bukkit.getScheduler().runTask(plugin, () -> { Bukkit.getServer().dispatchCommand(player, "/nick"); })

rough drift
rough drift
#

everything else should be fine

primal goblet
#

the issue comes from the dispatchCommand method?

rough drift
#

yea

primal goblet
#

i hate java

rough drift
#

you hate spigot

#

not java

primal goblet
#

but yep thanks you dude u helped me a lot

rough drift
#

spigot is doing these weird things

orchid gazelle
rough drift
#

one chunk at a time

primal goblet
rough drift
#

not blocks at a time

orchid gazelle
rough drift
#

rather than making everything work nicely in multi threaded environments they just lock it

rough drift
orchid gazelle
#

you would need to calculate a completely new chunk temporarely and fakely

rough drift
#

do you have the slightest clue about the protocol?

primal goblet
#

sad

orchid gazelle
#

and then send it

rough drift
#

No

#

dude

orchid gazelle
#

that would lag out the server then

rough drift
#

It's not really expensive

orchid gazelle
#

it is indeed expensive to copy a few chunks and overwrite the clone of them with the blocks that should change

rough drift
#

since you'll be using NMS for it anyways you can just access the raw array

#

make a copy of it using System.arraycopy and edit it

#

there is no faster way

orchid gazelle
#

then I gotta iterate through millions of blocks

rough drift
#

NO?!

#

what the fuck

#

no iteration is needed

orchid gazelle
#

the array includes all blocks

#

?

rough drift
#

Yes ofc

#

all of the data

orchid gazelle
#

oh wait

rough drift
#

and edit the index

#

like blocks[15]

orchid gazelle
#

translate the blocks to edit into the index?

rough drift
#

basically

#

that's the fastest way

#

though how many blocks do you need

orchid gazelle
#

hmm ok imma try ty

orchid gazelle
rough drift
#

hm

#

Wait don't system.arraycopy

#

there is a better way

#

I'll tell you once I am back home if you want

#

gtg now lmao

orchid gazelle
#

ok

#

cya, ty

rough drift
#

cya

orchid gazelle
#

just ping me then

sly forge
#

is there maven artifacts or something to get BuildData for any version?

#

I need to get spigot mappings in an application

eternal night
#

tough one

#

from there you can get yourself the build data ref

sterile token
#

Any idea why a counter is negative, its a stupid question but doesnt make sense

pseudo hazel
#

what counter?

sterile token
#

A player time counter, which counts how many time he has played

wet breach
#

have you tested out what I said earlier

sterile token
#

I dont use anything related to world nor spigot, its a custom counter