#help-development

1 messages · Page 204 of 1

fierce whale
#

I wanna use crafting slot to menu

earnest forum
#

a regular inventory would mean 1-5 is the hotbar

fierce whale
#

menu button..?

fierce whale
short gulch
#

i'd recommend not, just make a chest inventory gui

fierce whale
#

so I used getInventory method but I can't find way to set 1~5 slots

#

Ahha using crafting slot is not fancy way...

short gulch
#

You could just keep an item in their normal inventory, since crafting items will be reverted to the main inventory when the inventory is closed by the client

fierce whale
#

Okay let me try making custom GUI

#

Okay got it thx 🙂

short gulch
#

I would have one menu item that you could click in top of their inventory, and then interacting with that would open a chest gui

#

granted, the player loses an inventory slot so not ideal for survival servers

worn tundra
#

Actually there are examples of servers keeping the items in the crafting slots

#

So it is possible to do

fierce whale
#

Umm?

worn tundra
#

Just experiment with it

fierce whale
#

But he said using crafting slot isn't good way

worn tundra
#

set the slots constantly

fierce whale
#

ahha

#

every 1 tick lol

#

I think it's better way to use custom gui haha

short gulch
#

1 tick schedulers are not a good idea unless absolutely necessary

#

Play around with setting the item using rawslot while the inventory is closed; with a command or random event you can control

#

See if it immediately reverts or if it stays

wet breach
#

the trick is to never actually close the inventory or get rid of the inventory object 😉

#

you can make the player not see it, doesn't mean the inventory had to actually close

short gulch
#

he's talking about regular survival inventories

timid jetty
#

anyone have sleek solution to getiting the block the player is looking at

short gulch
#

ray tracing

wet breach
#

even so, the server doesn't have to register it closing, just only the client

remote swallow
#

getFacingBlock iirc

#

might be called something else i cant remember

#

player#getTargetBlockExact(int maxDistance)

timid jetty
#

ah found it getTargetBlockExaact

#

yeah ty

#

:)

tender shard
wet breach
#

well I already stated the way to work around doing schedulers

#

just never close or get rid of the inventory object on the server side 😉

dull whale
#

how do I change the tip color of a tipped arrow?

tender shard
#

is that even possible? I thought the arrow will always have the base potion's color

cobalt thorn
#

Hi, im taking the lines of a sign and trying check them but the int start from 0 and goes to 4 but if i do i++ it goes from 0 to 1 and it change the line n.1

Code: https://srcb.in/WHXu8Kk5oY

Any way to fix it

tender shard
#

wdym? of course it goes from 0 to 1 if you do i++

cobalt thorn
tender shard
#

then just do lines.get(0) ?

#

I'm not really sure what you mean

cobalt thorn
# tender shard then just do lines.get(0) ?

if you check the code i loop all the line check them and then get the line number to do that i made externally a int called i and every time i loop one line it goes from 0 to 1 and continue if you check the code you can understand what im trying to do

remote swallow
#

so you need to check for all lines on a sign?

tender shard
#

I did check your code and tbh I have no clue what you're trying to do

cobalt thorn
#

and i loop them

remote swallow
#

for (int i = 0; i < 5; ++i) is what you want

cobalt thorn
remote swallow
#

so whats the issue

tender shard
#

yeah I also dont get it

cobalt thorn
# remote swallow so whats the issue

if i have 4 lines and for example the 0 one contains a swear word the i++ is called before the line change and the number change to 1 and it change the line 1

tender shard
#

then call i++ at the end of your loop?

#

or use i-1 instead of i?

#

or just set it explicitly, as Epic mentioned

for(int i = 0; i <= 3; i++) {
  String currentLine = event.getLines().get(i);
  ..
}
grim ice
#

Does no one actually know how to obfuscate forge mods

#

this is seriously bothering me

tardy delta
#

why would you

#

stash goes brr sometimes

#

and i thought it was pretty optimized

slim kernel
#

if I got a method that gets a random number between 1 and 10 and if its below 5 i want to return it. What do I do if its above 5? What do I return then? Is there a good way to do this?

#

what can I return so i know when using the method that it didnt work

native ruin
#

does spigot only allow mysql as database or can you also use sql server

tardy delta
#

you can use whatever you want

native ruin
#

ait ty

tardy delta
#

spigot includes sqlite as dependency too

#

or you just use another external dependency

tardy delta
slim kernel
tardy delta
#

recompute the value?

slim kernel
tardy delta
#

just get a new value and check if its below 5

slim kernel
#

and if its not what do I return

tardy delta
#

calculate another one?

#

idk i have no context

slim kernel
# tardy delta idk i have no context

Okay so if I got 5 shops with shop numbers from 1 to 5. And I want to get the smallest number of the shops that are not used by someone. Then I return the number. But sometimes all the shops are used so I cant return a number. What do I return then?

tardy delta
#

-1?

worldly ingot
#

Yeah, either -1 or 0

#

Some invalid value

#

Alternatively, you could use an OptionalInt

#

What you return depends on your intended use case for the method tbh

mighty pier
earnest forum
#

u have to set that on the constructor

#

leave the variable as null

mighty pier
#

ah ok

tardy delta
#

why is your main class called Utils?

mighty pier
#

plguin name is utils

tardy delta
#

thats what im saying

remote swallow
#

it should be called the main class name not plugin name

mighty pier
#

refractorered it to main

remote swallow
#

?main

worldly ingot
#

Well, not necessarily much better 😅

#

Ideally it should be the name of your plugin, and optionally prefixed or suffixed with Plugin

#

e.g. for my VeinMiner plugin my class name is VeinMinerPlugin

mighty pier
#

UtilsPlugin

worldly ingot
#

That'll do

#

Utils is just an odd name for a plugin is all because generally a class named Utils would be reserved for utility methods or something ;p

#

I think suffixing Plugin here is definitely needed

mighty pier
#

ok

#

is this good

#

or is calling the plugin.getconfig.getstring not that bad every time

echo basalt
grim ice
worldly ingot
mighty pier
quaint mantle
#

Whats the best api for guis? Because im lazy to use vanilla guis and lazy to make my own api for it 😅

#

Theres many apis but idk which one is good

tardy delta
mighty pier
#

is that not i9ntellij

quaint mantle
#

That looks like github to me

worldly ingot
#

Phoenix has a decent API

quaint mantle
mighty pier
worldly ingot
quaint mantle
#

Yeah

worldly ingot
#

Yeah, Stash has no dark mode

mighty pier
#

imports longer than all my classes

quaint mantle
#

That has dark mode

worldly ingot
#

Stash is awful

tardy delta
#

sad

quaint mantle
#

I have dark mode on

#

Tf

worldly ingot
#

You might have a Chrome extension

quaint mantle
mighty pier
quaint mantle
#

Dark mode 🤨

worldly ingot
#

Chromium* extension. Every single browser except for Safari is chromium based now-a-days

quaint mantle
#

Ohhh

worldly ingot
#

Including Microsoft Edge lol

quaint mantle
#

Makes sense

quaint mantle
#

Ofc it does

worldly ingot
#

I don't disagree. I've been using Vivaldi for a couple years

mighty pier
#

brave on top

#

'dont disagree' just say agree

#

bruh

#

confusing me

quaint mantle
#

How would one make a lambda then get code from that lambda in java? For an api

#

Idk anything on how to make a lambda

hasty prawn
#

() -> {}

tardy delta
#

:(){ :|:& };: hehehe

quaint mantle
#

Well how would i put that into my api?

tardy delta
#

where is context?

#

i guess your api does not only make a lambda

quaint mantle
#

A custom lambda like this. How would one make this?

#

Since i wanna add a lambda to my own api

tardy delta
#

Supplier<InventoryClickEvent> s = event -> {}

hasty prawn
#

Function<T, U> as the method parameter

#

Or supplier

tardy delta
#

oh ye it returns smth

hasty prawn
#

Depends if you want to pass something as well

quaint mantle
tardy delta
#

i still dont have any context

#

;-;

quaint mantle
#

Well technically that's all i needed but i wanted to make some custom lambda for my api to clean it up a bit

#

Map<Inventory, Map<Integer, Supplier<InventoryClickEvent>>> hm?

#

Integer is for the slot

tardy delta
#

could work

quaint mantle
hasty prawn
#

It will allow you to pass the integer and return a InventoryClickEvent

quaint mantle
#

Alr

tardy delta
#

assuming he needs multiple click actions, that wont work?

#

Map<Inv, Func<Int, InvClickEvent>>

hasty prawn
#

BiFunction if you need the inventory and int

worldly ingot
#

I mean so you at least understand what you're doing, a lambda is just syntax sugar for an interface implementation with only one method

#
public interface Something {

    public String test(Object first, int second);

}```
can be referred to as `(first, second) -> "Hello world!";`
#

Java just so happens to provide a shit load of default ones in the java.util.function package

tardy delta
#

my books from college explain it very well 🥺 but i already knew all the stuff

worldly ingot
#

I wish someone would have explained it to me the way I just did when I was learning lambdas

#

It would have made them a lot less mysterious

quaint mantle
#

Yo Guys there's a way to open SignEdit GUI?

tardy delta
#

yes

quaint mantle
#

Oh use packet?

tardy delta
#

ah bruh thought signEdit was some kind of library

worldly ingot
#

You would have to use packets, yeah. I tried adding API for it, just in the works

tardy delta
#

💀

quaint mantle
#

ps my version is 1.19.2

worldly ingot
#

You need a packet listener

#

sec

tall dragon
#
ChannelPipeline channelPipeline = ((CraftPlayer) e.getPlayer()).getHandle().playerConnection.networkManager.channel.pipeline();

anyone know why this would throw this error?
https://paste.md-5.net/miloxiwube.cs

i am using the exact same version as dependency as the one my server is running...

midnight shore
#

Hi, i remember someone sent here a spigot resource of how to set multiple blocks without crashing the server.. it was sth like "Thread Block Operations" but i don't remember the real name.. can someone send it?

worldly ingot
#

You need to listen to the PacketPlayInUpdateSign packet with ProtocolLib (or some other means of packet listening)

tall dragon
worldly ingot
#

And to open the sign, send a PacketPlayOutOpenSignEditor

tender shard
#

damn too late

#

fuck you EpicGodMC

tall dragon
midnight shore
#

ty all!

tender shard
#

D:

tall dragon
worldly ingot
quaint mantle
worldly ingot
#

It's under NMS. Depending on the mappings you use it might be named differently

tender shard
quaint mantle
tall dragon
#

i use no mappings at all

tender shard
#

what MC version is this

#

1.8.8?

tall dragon
tender shard
#

or 1.8.9

#

I have no clue about ancient versions

tall dragon
#

1.8.8

tender shard
tardy delta
#

how can sandals scream

tender shard
worldly ingot
#

(and for the record, these don't exist in 1.8 lol)

tender shard
#

1.8 should cease to exist anyway

tall dragon
#

i dont understand how the field would not be named the same

#

its the exact same version from BuildTools

tender shard
tall dragon
#

-,-

#

channel

#

?????? idk

#

here it does say its obfuscated name is 'k' but how would i then access that

#

since intellij sais its named channel

worldly ingot
#

It won't be obfuscated at runtime in 1.8. It should still be called channel

tall dragon
#

well aperantly its not...

worldly ingot
#

Are you accessing this directly or via reflection?

tall dragon
#

directly

#

ChannelPipeline channelPipeline = ((CraftPlayer) e.getPlayer()).getHandle().playerConnection.networkManager.channel.pipeline(); like this

worldly ingot
#

It's possible Paper remapped that or something?

tall dragon
#

currently not running paper

worldly ingot
# tall dragon

Is this a decompilation of the server jar you're using?

tall dragon
#

yes

worldly ingot
#

I mean the stacktrace you sent indicates you are

#

paper.jar:git-Spigot-21fe707-741a1bd

#

Unless you just called the file paper.jar ;p

tall dragon
#

yea i just renamed it to paper cuz thats how my start script has it named

#

xd

tall dragon
fresh timber
#

Why am I getting this error?

echo basalt
#

It's about time you learn about DRY

fresh timber
#

?

worldly ingot
#

The format you probably want is %$2s

#

not %2

split roost
#

Issue with a simple plugin (new to making plugins)

worn tundra
worldly ingot
#

Actually you don't even need that. You could just use %s both times because they're in the correct order

fresh timber
#

I thought %2 was the player and $s was the msg

worldly ingot
#

First %s is the display name, second is the message

fresh timber
#

ok

#

so I just do it twice

worldly ingot
#

<%s> %s is the default format, yes

fresh timber
#

ok

tall dragon
#

@worldly ingot

        try {
            for (Field field : Class.forName("net.minecraft.server.v1_8_R3.NetworkManager").getFields()) {
                System.out.println(field.getName() + " : " + field.getType().getSimpleName());
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }

even when i do this...

#

makes no sense

worldly ingot
#

¯_(ツ)_/¯

#

I've not dealt with 1.8 for 7 years

slim kernel
#

How can I get the side a sign is attached to?

tall dragon
#

and use #getRotation

fluid river
#

i guess

slim kernel
white dew
#

hiii

#

guys, what is a "final class"?

tardy delta
#

a class that cannot be extended from

white dew
#

oooooooh

tender shard
tardy delta
#

like the String class

tender shard
#

it's pretty useless tbh

#

making a class final doesn't add ANY advantage, it only has downsides

tardy delta
#

i would like to see what would happen if String wasnt a final class

white dew
#

so, like, a class1 extends another class2 when class1 is a subclass of class2, right?

#

like, class1 has everything class2 has and more

#

by inheritance

tender shard
#

yes

white dew
#

so a final class is a class which cannot have more subclasses

tender shard
#

yes

white dew
#

I understand It now, thank you

tardy delta
#

like class Something extends String wouldnt work cuz String is a final class

hazy parrot
#

Tbh most of the time your classes can be final

white dew
#

yea

#

ok! :)

tender shard
#

using "final" on a class does not give yourself ANY advantage, all it does is to restrict others

hazy parrot
#

I said that it won't make any difference

tender shard
#

but it does

hazy parrot
sacred mountain
#

if i have a scheduler with a runtasklater can i skip one iteration ? (Minigame where if all players die the code will skip to the next challenge instead of waiting the full duration)

tender shard
hazy parrot
#

That's true

tender shard
#

there's no reason for prohibiting it explicitly

sacred mountain
#

omitted the code for readability

torn badge
sacred mountain
#

it repeats bc i call the method inside itself

#

initChallenges() is the ss

#

i call it again instead of a screenshot because putting everything in a runnable makes it more difficult

torn badge
#

Well you can just not call it

#

I don't really understand your problem

sacred mountain
#

i think i may have come up with smn

#

thanks anyways

crimson terrace
#

I'm trying to make mob heads for display in a GUI from an EntityType.
any easy way to do that or do I have to set the owning player of the skull meta to a player who has that mobs head for a skin? (aka does anyone know any done factory methods for this?)

woven tide
#

hey guys does anyone know how to set the spigot scoreboard to everyone in the server

misty current
#

can you somehow execute code before world loading?

crimson terrace
#

I'm pretty sure your onEnable happens before the world loading. if you wanna be sure you can do onLoad()

misty current
#

it doesn't

#

i'll try

crimson terrace
misty current
#

interesting lemme try

quaint mantle
#

What's the best way of making player based boosters? I have an idea but that involves 1 runnable every booster which i don't think is the best option

crimson terrace
#

wym boosters? like speed boost?

quaint mantle
#

Like custom boosters for money, tokens, ect

#

You just right click the item in your inventory

crimson terrace
#

you could just tag the player with the time they activated the booster or the time it runs out, just tag their PDC so you can always check whether the booster should still be active

#

and then check whenever anything happens that a booster should be applied to

woven tide
#

nvm

quaint mantle
#

Okay, so i would need to use a runnable for it? I have an idea to check if the time is lower than 1 but i was wondering if i could get away with it without using a runnable

crimson terrace
#

by tagging the player with the time the booster runs out, the type of booster activated, etc. you can definitely make it event based instead of runnable based. I'm also not sure what you would be doing in the runnable

quaint mantle
#

By checking if the booster time is lower than 1, but i was thinking of making it event based too

#

BlockBreakEvent to be exact

#

hey, is there an way to stop some commands from being logged in console? i'm right now coding an login/account plugin for better player handling and bot prevention and i dont want the /register and /login command to be shown in log. this would completly break the password hashing i implemented.

crimson terrace
hazy parrot
#

And return result deny if log contains x

quaint mantle
#

okay, i try this

#

thanks

quaint mantle
#

It'll run every 1 second, shouldn't cost any performance

crimson terrace
#

the runnable shouldnt do anything to performance, no. if youre worried tho you can always just check on every BlockBreakEvent or whatever for whether the booster is still active

grim ice
#

?paste

undone axleBOT
grim ice
quaint mantle
crimson terrace
#

a runnable to check every online player once every second is basically nothing

quaint mantle
#

Yeah

tardy delta
#

is PlayerTeleportEvent::getTo nullable? i see its inherited from PlayerMoveEvent and its nullable there

autumn hedge
#

in spigot 1.19.2,how to use NMS?

quaint mantle
undone axleBOT
autumn hedge
#

I use idea to wirte my plugin, but doesn't have NMS class to completion。

#

must reflex?

quaint mantle
#

Buildtools...

fervent gale
#
homes:
  home:
    X: 188.1792827808719
    Y: 123.0
    Z: 255.72531835857524
    YAW: -37.127888
    PITCH: 16.359882
    WORLD: 0d33a718-67c5-47bc-bdba-be02bb43bcae
  spawn:
    X: 187.79888664684006
    Y: 124.0
    Z: 251.36866753177642
    YAW: -84.37789
    PITCH: 33.759888
    WORLD: 0d33a718-67c5-47bc-bdba-be02bb43bcae```

I've got this in a player data file, and I want to get the names of the homes into a string `Homes List: home, spawn` but I tried getKeys(boolean) and it doesn't map and Ideas?
quaint mantle
# hazy parrot You can add log filter to root logger
        getLogger().setFilter(new Filter() {
            @Override
            public boolean isLoggable(LogRecord record) {
                if (record.getMessage().contains("/register") || record.getMessage().contains("/login")){
                    return false;
                }
                return false;
            }
        });

is this right?

(edit: sorry for the ugly formatting, dont know how to copy it right)

night mirage
#

Does anyone know how i can get a message like this to display when an invalid argument is passed, this is not my command i'm just using it as an example

tardy delta
#

some command frameworks support it, i believe its done thro packets3

warm token
valid basin
#

So, how to remove certain player drops based on lore?
For example on death I want to remove all items with lore that contains "Bound" in it.
This is my current code but it doesn't seem to work.
Version 1.8.8

@EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        event.setDeathMessage(null);
        List <ItemStack> list = event.getDrops();
        Iterator<ItemStack> i = list.iterator();
        while(i.hasNext()){
            ItemStack item = i.next();
            if(item.getItemMeta().getLore().contains("Bound"))
                i.remove();
        }
}```
warm token
valid basin
#

Except it uses array instead of list

hazy parrot
#

but you would have to return true in any other case

#

and you would probably have to add it to root logger

#

try it

mighty pier
quaint mantle
#

Does anyone know how I could get hex codes to work with kick and ban messages?

#

My code currently:

@EventHandler
public void PlayerJoin(PlayerJoinEvent event) {
    Player player = event.getPlayer();

    if (plugin.getConfig().get("currentState") == "on") {
        if (!player.hasPermission("maintenancemode.exempt")) {
            player.kickPlayer(ChatColor.translateAlternateColorCodes('&',plugin.getConfig().getString("kickMessage")));
        }
    }
}
mighty pier
#

nesting if statements

#

shame

#

if (plugin.getConfig().get("currentState") != "on") return;

#

if (player.hasPermission("maintenancemode.exempt")) return;

#

i dont think you can use hex codes in kick messages

quaint mantle
noble forge
mighty pier
#

that is just normal color codes

#

someone on here used hex codes

#

or combined color codes

#

idk

quaint mantle
#

Not hex codes

#

I already saw that thread

red sedge
#

what is the font minecraft uses

quaint mantle
red sedge
#

yee found it

#

i was getting weird stuff

#

but i just had to hcange the seach a lil

tardy delta
smoky anchor
#

Hello ppl!
Is there any way to force a single chunk to save to disk ?

quaint mantle
dire salmon
#

isnt it only 1.13 tho?

dire salmon
smoky anchor
brave sparrow
#

It won’t work

#

You can’t unload a chunk a player is currently in

smoky anchor
#

but it will save it right

brave sparrow
#

I don’t think so no

#

I don’t think you can save a chunk a player is in

smoky anchor
#

I mean /save-all saves all chunks including the chunk a player is in

sterile token
#

Is there a way to serialize and deserialize items from/to Mongo documents?

thin delta
#

Is there a known plugin for returning crouching to the old mechanics (pre 1.16). I want to prevent players from being able to crawl under a 1.5block space

sterile token
winged anvil
sterile token
#

I will try doing it via Gson

winged anvil
#

saying something like mongo cant serialize it

sterile token
winged anvil
#

you tried making a custom mongo serializer?

#

idk lol

sterile token
#

I mean

#

Mongo allow working over json

#

Because its based on json for storing

winged anvil
#

right

#

i thought it would work too lol

#

just try it again

sterile token
#

So i can just do:

Document doc = new Document();
doc.set("item", gson.toJson(new ItemStack()));

winged anvil
#

maybe it will work

#

yeah that seems right, maybe i fucked something up before

sterile token
#

Or maybe you are right

#

Im not sure i will test it and let u know

winged anvil
#

ohhh i think it was the deserializer i was having issues with

brave sparrow
#

ItemStacks are going to have a reference to an NMS ItemStack that may or may not play nicely with straight up json serialization

brave sparrow
#

You may want to look into how spigot serializes/deserializes for the YAML configs

sterile token
#

🤣

#

I think that spigot api is not well designed

brave sparrow
#

You can’t avoid it interacting with NMS

sterile token
#

I have realize smth that i didnt know

winged anvil
#

i think i just got around it by creating a class i could serialize with json and storing info there, then rebuilding the object manually lol

sterile token
#

minecraft-server package works in parallel with mojang api

#

I didnt know that

brave sparrow
#

Those are the built in serialize/deserialize methods for item stacks

winged anvil
#

why do api's not delete deprecated methods? maybe a dumb question i just dont know

kind hatch
#

They eventually do.

kind hatch
#

It's for compatiblilty reasons.

winged anvil
#

in case an older user wants to see where the new implementation is?

sterile token
#

I mean admit it spigot api is not ell maintened

#

Its has a lot of weird things

kind hatch
#

It's mainly to give time for developers to update their projects.

winged anvil
#

yeah that makes sense

kind hatch
#

Then once they deem enough time has passed, they will remove it.

sterile token
#

And that make a bad experience for us developers

kind hatch
#

The spigot api is not the best example of proper deprecation usage. Just look at Bukkit#getPlayer(String name), it's been deprecated for years, but has valid usecases and just hasn't been undeprecated.

sterile token
#

Also shadow what is that stash thing i never seen that before

next plume
sterile token
#

Also mongo driver has some shity things too

kind hatch
sterile token
#

In the way of using updateOne() without first checking if the document exists or/not, create it and then yes update it

#

🤡

next plume
#

Sometimes it just means you should read the docs to make sure you're using it properly.

winged anvil
#

that puts me on another topic

kind hatch
winged anvil
#

why do people not like mongo?

next plume
#

I think deprecated is the only way the API can tell the IDE/developer to be careful.

winged anvil
#

i feel like i just like it cause im creating classes that can be represented well as JSON

sterile token
#

I really like mongo

kind hatch
next plume
sterile token
#

I mean i think the best mongo usage representation that everybody would like to use, would be Mongoose from JavaScript is the best driver representation you can find. Because is not a pain to save things

fluid river
#

can i spawn uncollidable Item

#

inside the block

sterile token
#

That is not a well design

next plume
#

And if you have a player name you typed into chat??

sterile token
fluid river
#

and velocity to new Vector(0, 0, 0);

sterile token
fluid river
#

and well it flies in random directions

sterile token
#

That you dont get damage?

fluid river
#

no

winged anvil
fluid river
#

which stays in the block

#

not moving

sterile token
fluid river
#

yeah

#

frozen even if block is placed right on it's location

#

cuz when you place a block where dropped item lies

#

it moves to free space

sterile token
#

what?

#

Are u trying to freeze items or what?

fluid river
#

yes

#

item = World.dropItem

#

item.freeze().setNotFreakingMovingAnyWhere().setNotInteractingWithBlocks().setNoPhysicsApplied()

sterile token
#

Ik that when you have items on a block and you break it, they move to the block under the one you break it

fluid river
#

block just forces all drops to "move out"

#

so drops go all around the placed block

#

to any block which is AIR

#

So they can continue endlessly rotating 🙂

sacred mountain
#

i cant think rn how should i make a method to generate locations based on the amount of players online that will give me evenly spaced coords with yaw and pitch all facing the center of a block

sacred mountain
#

yeah it is

#

i just cba to

#

my brain not working rn

fluid river
#

i tried to remove gravity and velocity, but items started to fly upwards out from the block in which they have been spawned

sterile token
#

I would like to see a library for loading/unloading structure simpliers that WorldEdit but atleast decent in terms of resources

#

Any idea? If you know anything like that let me know please

#

Because worledit library is really big library in terms of coding and uses lot of resources

fluid river
#

well no answer

winged anvil
fluid river
#

can i at least spawn armorstand inside the block

#

and make it frozen

kind hatch
#

Yes you can. I was going to suggest that, but it's such a workaround.

fluid river
#

cuz drops are unmaintainable

#

can i somehow make only armorstand's head glowing

#

without entire armorstand

kind hatch
#

Unsure, but in theory you could make the item it's holding glow.

fluid river
#

hmmm

#

gonna try it

#

there is also fishing hook

#

and EGG

#

hmm

#

can i make frozen falling_block

#

inside the real block

#

with no gravity and velocity

fresh timber
#

I'm getting this error when trying to add a large integer to a hashmap... anyone know why?

kind hatch
#

That number exceeds the integer limit.

fresh timber
#

oh

#

can I make the integer limit higher xD

kind hatch
#

No. lol
You can use different datatype though. (long or BigInteger)

fresh timber
#

ok

fluid river
#

can i make falling block invisible haha

#

the only solution which really worked

#

or can i make falling air

#

hey

#

about interface Damageable

#

when i do getDamage() on fresh item

#

would it return the durability

#

or 0

sterile token
#

How many ms is 1 tick?

kind hatch
#

50

sterile token
sterile token
kind hatch
#

1tick = 50ms

sterile token
#

I have a nightmare

#

😂

crimson terrace
#

1 second = 20 ticks; 1/20 = 0.05s per tick yeah

sterile token
#

ms

#

I need ms

crimson terrace
#

1000 ms is one second

#

a little bit of math doesnt hurt

sterile token
#

Because im make a TimeUtil class which converts a long duration and TimeUnit into ms

kind hatch
#

TimeUnit#toMillis(long duration)?

sterile token
#

I have broken my self

fluid river
#

how to get durability of the armor piece

#

getDurability() is deprecated

#

in Damageable there is only damage

kind hatch
tardy delta
#

Material#getMaxDurability() - Damagable#getDamage()?

dim bronze
#

What's the recommended way to use the mojang mappings with gradle?

tardy delta
dim bronze
wide fern
#

i see i can read the player permissions, but is it possible to set them?

torn badge
kind hatch
echo granite
#

Any android developers here?

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

kind hatch
#

I don't think that applies to that question. lol

echo granite
#

only in PMs.

tardy delta
#

hmm is this the new foodlevel or the old one?

#

have to test it ig

vocal cloud
#

It's the resultant which means it's the result of an action

sterile token
undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

sterile token
#

I mean here you ask your dought public or you will not get helped

#

Making ref that many ppl dont like helping dms

tardy delta
#

i seem to fuck up my database every time i add smth new to my plugin lol

knotty meteor
sacred mountain
#

hello my friends are all offline can anyone be a dummy player

#

u can be afk doesnt matter

wind blaze
#

does anyone know how to make durability on some items way better?

#

(not breaking in 5 hits against sharp 20+ items)

#

how tho, i tried different things like just stopping itemdamage event and damaging myself on entitydamagebyentityevent but it owquldnt rly work out

#

aint there any prebuilds to make durability enchant work way better

#

:/

#

you got any idea how i could achieve it? i been trying for so long, but i just cant get it to work lol

#

sharp 20 item

#

breaks armor within 5 hits#

#

i have special armor like the special sharp items which have like dura 8 but they still break easily

#

i want to make it like ultra durable

#

i tried but then it aint getting damaged from any sources but i just want on hit yk

#

ahhh ig ill try to find smth similar to my case online again, myself trying to find ways to cheat the system wont work lol

quaint mantle
#

why is this not working?

public void spawnParticleAlongLine(Location start, Location end, Particle particle, Particle.DustTransition dustOptions, int pointsPerLine, int particleCount) {
        double d = start.distance(end) / pointsPerLine;
        for (int i = 0; i < pointsPerLine; i++) {
            Location l = start.clone();
            Vector direction = end.toVector().subtract(start.toVector()).normalize();
            Vector v = direction.multiply(i * d);
            l.add(v.getX(), v.getY(), v.getZ());
            start.getWorld().spawnParticle(particle, l, 0, 0, 0, particleCount, dustOptions);
        }
    }```
#

it spawns particle but only at the 1 point

echo basalt
#

I hate those 1 line variables

quaint mantle
#

:)

#

but srs why no work

#

wait...

#

nvm

#

im just dumb

echo basalt
#
double distanceBetweenPoints = start.distance(end) / pointsPerLine;
Vector offset = end.clone().subtract(start).normalize().multiply(distanceBetweenPoints);

for(int index = 0; index < pointsPerLine; index++) {
  Location position = start.add(offset);

  ...
}
#

you can easily rewrite most of it

#

to be much simpler

quaint mantle
#

i c

#

1 more thing

#
random.getBlock().setType(Material.WHEAT);
Ageable ageable = (Ageable) random.getBlock().getBlockData();
ageable.setAge(6);``` why is this not working?
echo basalt
#

are you updating the data

quaint mantle
#
        at me.outspending.spending.Testing.farmTesting$1.run(farmTesting.java:40) ~[sandPlugin.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.19.2.jar:git-Paper-220]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[paper-1.19.2.jar:git-Paper-220]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1473) ~[paper-1.19.2.jar:git-Paper-220]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:446) ~[paper-1.19.2.jar:git-Paper-220]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1397) ~[paper-1.19.2.jar:git-Paper-220]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1173) ~[paper-1.19.2.jar:git-Paper-220]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-220]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]```
#

that's the error

static ingot
#

You're casting it to Ageable from the entity package

#

You need to cast it to org.bukkit.block.data.Ageable

quaint mantle
#

oh..

wind blaze
#

ig i found a ok working solution: if damage > 3 then i give it a 50% chance to lose 1 durability

brisk junco
#

How can I get the device id of a player in bungeecord?

quaint mantle
#

Just gotta make the armor stand move up and down which is super easy

lofty junco
#

hello does anyone how to point an compass towards a player

remote swallow
#

yeah

wind blaze
quaint mantle
hasty prawn
#

Reloading on a development server is fine

quaint mantle
#

Yeah

hasty prawn
#

Although PlugMan is still completely unneccessary

#

Since you can just do /reload lol

quaint mantle
#

Its faster with plugman

#

Since im reloading all plugins

#

With /reload

hasty prawn
#

I guess, usually I dont have many plugins on my dev server so doing /reload usually doesn't take that long anyways

onyx fjord
#

just use a debugger

#

or

quaint mantle
#

True, i only have 4 plugins but its faster and easier with plugman imo

onyx fjord
#

some ij plugin

quaint mantle
sterile token
#

Amazing bro

quaint mantle
#

Lol?

sterile token
#

Send pack

#

url*

quaint mantle
#

Damn lemonthonk

sterile token
#

What a shity word helper

#

😂

quaint mantle
#

Lol

sterile token
#

Idk why the keyboard recommend it

#

😬

quaint mantle
#

Im still working on it doe, im adding some things to the armorstand and adding distances, since the lines will appear 500 blocks away 😅

#

And tf you mean url, i never copied any of this i just ask dumb questions sometimes

#

anyone know whats wrong with this code?

  public final NpcTexture getNpcTexture(@NotNull String id) {
    Intrinsics.checkParameterIsNotNull(id, "id");
    Intrinsics.checkExpressionValueIsNotNull(config.getString("npc-textures." + id + ".texture-value"), "config.getString(\"npc-textures.$id.texture-value\")");
    Intrinsics.checkExpressionValueIsNotNull(config.getString("npc-textures." + id + ".texture-signature"), "config.getString(\"npc-te\")");
    return new NpcTexture(config.getString("npc-textures." + id + ".texture-value"), config.getString("npc-textures." + id + ".texture-signature"));
  }
eternal oxide
#

Intrinsics.checkExpressionValueIsNotNull does not stop a value being null

#

Caused by: java.lang.IllegalStateException: config.getString("npc-textures.$id.texture-value") must not be null

fresh timber
#

This line in my code (and ones very similar) are giving me tons of errors because its null. How can I make a null check for this?

int i = Integer.parseInt(player.getInventory().getItem(39).getItemMeta().getLore().get(1).substring(13, player.getInventory().getItem(39).getItemMeta().getLore().get(1).toCharArray().length));
echo basalt
#

💀 what the actual fuck

fresh timber
#

what

echo basalt
#

I hate it so much

fresh timber
#

xD

echo basalt
#

Like

#

That's... not how code works

#

not even ultrawide can fit that shiz

fresh timber
#

yea probably so

sterile token
remote swallow
#

whats that even meant to do

fresh timber
#

but how do I make a null checker for like .getitemmeta and .getlore.get(1)

fresh timber
eternal oxide
#

null checking is basic Java

#

always check for null before using if it can be null.

fresh timber
#

it gets the 2nd lore line of the item in the 39th slot of their inventory and turns it into a sub string from 13 to the length of a char array of the 2nd line of lore of the 39th item in the player's inventory

worldly ice
#

it auto substrings until the end if you don't supply it with the 2nd arg

fresh timber
#

ok well this is my first time using substring

#

I didnt know xd

worldly ice
#

yeah i was looking at the docs because i swore you didn't need it

fresh timber
#

what im confused abt in null check is if I do player.getInventory.getItem(39).getItemMeta.getLore().get(1) == null {return;}, it will give me error cus it cant get the lore or the meta or the first line of lore if those dont exist

echo basalt
#

The item can be null

#

Or the meta

#

Or the lore

fresh timber
#

ye i

#

k

#

and if I check and it is null its useless cus I cant check for the null checker

fresh timber
#

im good

#

ima make my whole plugin in 1 line

vocal cloud
#

Ctrl alt L will be your mortal enemy then

fresh timber
#

does it make it all tabbed out

vocal cloud
#

Yup

fresh timber
#

xD

white dew
#
@EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Bukkit.broadcastMessage("Welcome, " + event.getPlayer().getName() + " to the server!! :)");
    }
#

Hii!

#

I was hoping this would make so that when someone joins the server, every player online gets the message: "Welcome, <playerName> to the server!! :)"

#

But it looks like It doesn't do anything 🤔

#

When I joined at least

quaint mantle
fresh timber
#

u could use a for loop and loop online players and send them that msg

white dew
#

yeah, I could, I guess, but isn't that what Bukkit.broadcastMessage is supposed to do??

fresh timber
#

yea but apparently its not working

tranquil prairie
#

how do i make the order of the scoreboard not change when i set the score of something

white dew
worldly ice
#

maybe it's being sent before you join

fresh timber
#

tbh its prob cus the server sent the msg before u joined

worldly ice
#

try delaying it by like a tick or 2

fresh timber
white dew
#

oooh, that makes sense

#

thanks

tranquil prairie
#

how do i make the order of the scoreboard not change when i set the score of something

fresh timber
#

wdym?

#

maybe he wants it to send the join msg and the broadcast

fresh timber
#

it could be anything

#

I just want it to not spam console

#

literally I just want it to stop pasting any errors in console for this specific thing

#

its so annoying

#

and it crashes server

#

ik that

#

I am checking for the 2nd line

#

it just says this every tick

#

ik but I want it to not give error if I dont

#

and if I do i want it to run code

vocal cloud
#

Check if there is an item first?

fresh timber
#

thats what I wanna learn how to do

vocal cloud
#

And if it has a meta to get

fresh timber
#

yes thats the thing

#

when I check if player.getInventory().getItem(38).getItemMeta != null it gives me error cus it cant get the item meta in that if statement

#

I wanna know how to fix it

vocal cloud
#

Well you can use a hasitemmeta

fresh timber
#

ah ok there

#

is there a like "hasline"

#

for .get

quaint mantle
#

does anyone know what would be good for stopping something from being null

fresh timber
#

yea but .get(1) can give error

quaint mantle
#

basically to replace Intrinsics.checkExpressionValueIsNotNull

fresh timber
#

oh ok

#

how do I not get those

#

oh ye

languid flare
#

How can I get FirstLogin player (BungeeCord)?

fresh timber
#

bru why can hasItemMeta give error

#

so if the item is not null this will not give error?

#

k

quaint mantle
# desert loom https://docs.oracle.com/javase/8/docs/api/java/util/Objects.html#requireNonNull-...
  public final NpcTexture getNpcTexture(@NotNull String id) {
    Intrinsics.checkParameterIsNotNull(id, "id");
    Intrinsics.checkExpressionValueIsNotNull(config.getString("npc-textures." + id + ".texture-value"), "config.getString(\"npc-textures.$id.texture-value\")");
    Intrinsics.checkExpressionValueIsNotNull(config.getString("npc-textures." + id + ".texture-signature"), "config.getString(\"npc-te\")");
    return new NpcTexture(config.getString("npc-textures." + id + ".texture-value"), config.getString("npc-textures." + id + ".texture-signature"));
  }

is what i got

#

i have the src but my brains kinda fried

desert loom
#

actually I'm not sure what checkExpressionValueIsNotNull does so I can't say if it's a good replacement.

echo basalt
#

why not use Validate.notNull

late sonnet
#

now is Precondition (?

native nexus
#

or just use plain java

fluid river
#

true

#

if (i == null) return;

fathom plover
#

hello world
i wanna to check if world is null and create one
i try this code but not working

public static WorldCreator Create() {
   WorldCreator wc = new WorldCreator("oneblock");
   wc.type(WorldType.FLAT);
   wc.generatorSettings("0;"); // 2;0;1;
   return wc;
}

public static void CheckonWorld() {
  if (!(Bukkit.getServer().getWorld("oneblock").getWorldFolder().exists())) {
    Bukkit.createWorld(Create());
    Methods.CheckonBlockandSetSpawn();
    }
}

any idea

tender shard
#

wdym with "not working"?

#

getWorld("...") obviously might be null

river oracle
#

come on so obvious it just doesn't work

#

its up to you to figure it out

quaint mantle
#

Any errors, any more information?

fathom plover
#

wait pls

river oracle
#

I'm putting money on NullPointerException

#

also sadge C# developer spotted

fathom plover
#

okkay i'll try

quaint mantle
fathom plover
#

thx guys i'll try and come

#

it's working thx so much guys

mighty pier
#

how do i change the main class name?

#

i just refractored it but the plugin didnt load

remote swallow
#

make sure it changes on the rest of the stuff

mighty pier
#

where is the rest of the stuff

#

i changed it in all classses but dont i have to change something in the pom.xml

eternal oxide
#

plugin.yml

mighty pier
#

ah

remote swallow
earnest forum
#

no cos u have to put the class' name

#

not just the directory

mighty pier
#

i changed the main:

#

do i have to change the name:

#

?

eternal oxide
#

no, main

remote swallow
#

change it to the new main class name

mighty pier
#

ok

round finch
mighty pier
#
            try (PreparedStatement ps = c.prepareStatement("CREATE TABLE IF NOT EXISTS players (" +
                    "uuid varchar(255) PRIMARY KEY, " +
                    "modMode varchar(255) NOT NULL, " +
                    "muted varchar(255) NOT NULL, " +
                    "muteReason varchar(255) NOT NULL, " +
                    "banned varchar(255) NOT NULL, " +
                    "banReason varchar(255) NOT NULL);")) {
                ps.execute();
            }``` how to insert something into this table
#

i meant

#

insert plauyer

#

INSERT player INTO players?

#

or

#

insert uuid

#

or somethng

drowsy helm
#

Insert into TABLENAME values (1,2,3)

#

Google it

#

There’s multiple ways

mighty pier
#

thank

hazy parrot
#

Uuids are always 36 chars length, you can use just CHAR(36) or BINARY(16)

wet breach
#

less if you remove them

echo basalt
#

32 if you remove the dashes (truncate it)

hollow pelican
#

Is there a better way that I could pass in multiple of the same argument in my method?

crimson terrace
#

an array

#

or just do multiple or the same type parameter

hollow pelican
#

Currently I have 3 booleans for 3 different states and it's hard to read in the IDE due to how long it gets.

#

But they all do the same thing for each one.

crimson terrace
#

you could make a helper object

#

with setters instead of constructor parameters

hollow pelican
#

This is the issue I have: methodCall(5L, 10L, 15L, "string", false, false, true, false, false, false)

hybrid spoke
#

make a builder and pass settings

crimson terrace
#

goddamn, seems like you got more problems than a long constructor

hollow pelican
#

It's just an example.

echo basalt
#

wtf is that method

#

like

crimson terrace
#

appearently an example thats designed to give eye cancer 🙂

echo basalt
#

There's probably a better way to engineer it

crimson terrace
#

builder pattern seems like a good way to do it

hollow pelican
#

The first 3 booleans do the same thing but for different switch cases so I'm trying to figure out if there's a better way to pass those in.

echo basalt
#

enum maybe?

hybrid spoke
#

can you show us your code

#

otherwise we can just guess our advices

hollow pelican
#

The idea is that for case 1, It checks the first boolean argument and does the same for all 3 cases going along those 3. (the first 3 booleans in there, the others are for a similar use case)

#

It has to be a different value for each one due to the way that it works.

echo basalt
#

You are being very vague

hollow pelican
#

That's not intentional, I'm just not sure how to say it.

hybrid spoke
#

code speaks more than thousand words

crimson terrace
#

a screenshot of your code or a paste of it

hybrid spoke
hollow pelican
#

Alright, I've removed variable names since they're not necessary to this. (I'm paranoid lol)

#

And also removed the try catch stuff since that's not part of this example.

crimson terrace
hybrid spoke
#

im pretty sure noone actually would want to steal your code

hollow pelican
#

Is there a better way of passing in those 3 booleans and also the other 3? (such as using an array?)

hybrid spoke
#

i still have no idea what your intention there is

hollow pelican
#

The switch statement checks an integer that should only be from 1 - 3 and for each case, there's 2 booleans.

crimson terrace
#

you wanted help with how to pass in those values. we gave you multiple ways

#

now youve gotta decide on one

hollow pelican
#

bool1 and bool4 are for Case 1

#

and so on

#

I'm guessing an array would be the best option for this.

crimson terrace
#

not the best, but one of them

hybrid spoke
#

probably not

#

the best option would be to remove the unnecessary boilerplate

hollow pelican
#

Sorry by the way, I know I could've labeled this more clearly.

#

What do you mean by boilerplate, exactly?

hybrid spoke
#

all im seeing right now is that you are probably doing 3 times the same

hollow pelican
#

Long1 - Long3 are for each one and are used in the actual methods that are called depending on the number.

hybrid spoke
#

we are spinning circles

#

can you show us your actual method

crimson terrace
#

you could use composition and combine the longs and bools in an object each

hollow pelican
#

The actual method calls a custom method in one of my utility classes so it's not really too helpful.

crimson terrace
#

then give the method both objects and check on those or give them an execute() method. as cipher is saying we literally dont know your use case

hollow pelican
#

It is just basically calling the same thing over but with each number

crimson terrace
#

knowing your intention would help figuring out how to get there

hybrid spoke
hollow pelican
#

Well, I have no clue how to simplify it, I'm still quite new.

mighty pier
#

it says redundant close() statement, do i not have to close the preparedstatement?

hollow pelican
#

I'm just trying to figure out if there's a cleaner way of passing in the variables other than just spamming them over and over.

mighty pier
#

ok

#

how do i know if its in an auto close

#

without the error

hybrid spoke
#

you are inside a try resource

#

that ensures by the end of the scope that the resource is closed

#

á auto close

mighty pier
#

ok thanks

#
    public void addPlayer(UUID uuid) {
        try (PreparedStatement ps = c.prepareStatement("INSERT INTO players VALUES (uuid, modMode, muted, muteReason, banned, banReason) VALUES (?, ?, ?, ?, ?, ?)")) {
            ps.setString(1, uuid.toString());
            ps.setBoolean(2, false);
            ps.setBoolean(3, false);
            ps.setString(4, "");
            ps.setBoolean(5, false);
            ps.setString(6, "");
            ps.executeQuery();
        } catch (SQLException e){
            Bukkit.getLogger().info(e.getClass().getName() + ": " + e.getMessage());
        }
    }``` the query causes an sqlexception
#

the sql code

proven sierra
mighty pier
#

java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (near "VALUES": syntax error)

#

database there

proven sierra
#

remove the first values

mighty pier
#

ok

#

do i have to put the ; at the end

#

im gonna put the ; at the end

crimson terrace
hollow pelican
#

I don't know what you mean exactly, I'm confused.

crimson terrace
#

you know what an object is and that it can have attributes?

hollow pelican
#

It's the way it's worded, I'm just confused.

crimson terrace
#

and I'm confused by why you wont tell us what youre trying to reach. youre asking us about your attempted solution and how to fix it instead of giving us what we need to help you find an actual solution

hollow pelican
#

I'm trying to figure out a better way of passing in the longs such as in their own array and then 3 booleans possibly in the same way and then another 3 in that way too. (or just in 1 array for them)

crimson terrace
#

for example: what do those 3 booleans do exactly

hollow pelican
#

The array one is just an example.

echo basalt
#

I'll blame it as XY problem

crimson terrace
#

if the values cant be automatically generated you will need those 3 booleans somewhere

crimson terrace
echo basalt
#

the booleans could belong to the object in the switch, for example

hollow pelican
#

It's because I have so many different booleans that basically do the same thing but have to be separated.

echo basalt
#

this sounds like a data structure issue

#

?xy

undone axleBOT
glossy venture
crimson terrace
#

thats what I said cant you read

echo basalt
#

nah mfs tryna shame you

crimson terrace
#

not letting him

hybrid spoke
#

shots fired

glossy venture
#

nah no hate just funny

hybrid spoke
#

wouldnt let that sit on me

echo basalt
#

no one can shame mfs that help people

crimson terrace
#

not gonna take shame from someone who says orbyfied instead of orbified

echo basalt
#

bad name either way

hybrid spoke
echo basalt
#

flexing his bobux profile on his bio smh my head

crimson terrace
#

the correct english way to arrange letters

glossy venture
#

orbies

mighty pier
#
        try {
            Class.forName("org.sqlite.JDBC");
            c = DriverManager.getConnection("jdbc:sqlite:" + dataFolder);
            try (PreparedStatement ps = c.prepareStatement("CREATE TABLE IF NOT EXISTS players (" +
                    "uuid varchar(255) PRIMARY KEY, " +
                    "modMode varchar(255) NOT NULL, " +
                    "muted varchar(255) NOT NULL, " +
                    "muteReason varchar(255) NOT NULL, " +
                    "banned varchar(255) NOT NULL, " +
                    "banReason varchar(255) NOT NULL);")) {
                ps.execute();
            } catch (Exception e) {
                Bukkit.getLogger().info(e.getClass().getName() + ": " + e.getMessage());
            }
        } catch (SQLException | ClassNotFoundException e) {
            Bukkit.getLogger().info(e.getClass().getName() + ": " + e.getMessage());
        }```
```java
public void addPlayer(UUID uuid) {
        try (PreparedStatement ps = c.prepareStatement("INSERT INTO players VALUES (?, ?, ?, ?, ?, ?);")) {
            ps.setString(1, uuid.toString());
            ps.setBoolean(2, false);
            ps.setBoolean(3, false);
            ps.setString(4, "");
            ps.setBoolean(5, false);
            ps.setString(6, "");
            ps.executeQuery();
        } catch (SQLException e){
            Bukkit.getLogger().info(e.getClass().getName() + ": " + e.getMessage());
        }
    }``` `java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (table players has 7 columns but 6 values were supplied)`
glossy venture
#

singular orby

mighty pier
#

md5 paste doesnt work

echo basalt
#

bruh that code

crimson terrace
#

you have 7 columns I asssume

echo basalt
#

grr

#

I hate it so much

mighty pier
glossy venture
echo basalt
#

sure it's good as a first attempt at sql

glossy venture
#

try to drop the table

#

and rerun the creation code

mighty pier
#

uh oh

echo basalt
#

or... just delete the sqlite file

mighty pier
#

oh right

#

cause

glossy venture
#

oh bruh sqlite

mighty pier
#

i changed some stuff

echo basalt
#

🤦

hollow pelican
#

SQLite is really weird.

echo basalt
#

it's... pretty easy to debug stuff like this

#

no need to ask questions every time you have an error

mighty pier
#

spigot discord is best problem solver

echo basalt
#

save our brain power for client crashes due to nms

hybrid spoke
#

what about solving your own problems

mighty pier
#

funny joke

glossy venture
#

error says what the problem is and how to solve it 90% of the time

hybrid spoke
#

?bing it otherwise

undone axleBOT
crimson terrace
hollow pelican
#

(related to earlier) I'm just going to try using an array, idk at this point.

glossy venture
#

at least you should be able to derive how to solve it from the error after a while

echo basalt
#

I can't fuckin type today

earnest forum
#

bing 🤣

glossy venture
#

learn psychology

mighty pier
#

the error said the table players has 7 columns but 6 values were supplied

hybrid spoke
echo basalt
#

supreme court of therapists

#

can't wait to get home tonight and have to run away again

hybrid spoke
#

infinite recursion

glossy venture
#

therapist overflow

hybrid spoke
glossy venture
hybrid spoke
#

dont

#

just

#

dont

crimson terrace
#

wont tell us either way

echo basalt
#

just use a bitmask and pass a single byte

#

to pass all 3 booleans in 1

crimson terrace
#

fancy small size boolean array

echo basalt
#

simple n effective

hybrid spoke
#

put everything into one long and evaluate it

glossy venture
#

depends on how often it will be used

#

why a long

crimson terrace
glossy venture
#

you could use a nibble

mighty pier
hollow pelican
#

The number can be higher than 2147483647 so..

echo basalt
#
boolean isPositionEnabled(byte mask, int position) {
  return ((mask) & (1 << (position - 1))) != 0;
}
hollow pelican
#

I had to use a long in-order to do so.

echo basalt
glossy venture
#

funny how its like bit byte kilobyte etc but then between bit and byte theres actually mf nibble

echo basalt
#

or make your own Hybernate

glossy venture
#

yeah

echo basalt
#

minecraft uses nibbles for lighting

glossy venture
#

4 bools

mighty pier
echo basalt
#

a bool is just a bit

hybrid spoke
glossy venture
echo basalt
# mighty pier explain in fornite terms

The battle bus (query) gets populated by gamers (data) that drop into the world (mysql database), through the matchmaking system (data -> query auto builder)

glossy venture
#

best analogy

echo basalt
echo basalt
#

I never played fornite so fuck off

mighty pier
#

lol

#

me neither

echo basalt
#

cringe game

#

I still play flash games to this day

hybrid spoke
#

boomer

earnest forum
#

even after it doesnt work anymore? wow

echo basalt
#

half the serious game companies have their own launcher

#

I did waste like 5 hours yesterday playing flash games

#

rest of the day was spent helping a friend move

hybrid spoke
#

do you know battlemechs