#help-development

1 messages · Page 531 of 1

peak jetty
#

the logs stop at "entity is item"

#

meaning it cant check if the cause was an ender crystal

young knoll
#

Because a cause will never be an entity type...

tardy delta
#

e.getCause()

peak jetty
#

how can i check if it was a crystal then?

young knoll
#

Iirc a crystal will call the entity damage by entity event

peak jetty
#

like this?

tardy delta
#

compare e.getCause()

peak jetty
#

?

tawdry echo
#

Yes

tardy delta
#

dont

#

dont

#

enums have reference equality

peak jetty
#

ok it works now thanks

#

also why would .equals make a difference?

young knoll
#

It's an extra method call!!!!!

tardy delta
#

default equals impl just does == internally

young knoll
#

Muh performance

tardy delta
#

one wasted context switch

#

ye imagine wasting a few nanoseconds

worldly ingot
#

It actually needs updating now that signs changed slightly

#

I'll update it tomorrow probably

young knoll
#

Also the new setTitle

#

Mayhaps

worldly ingot
#

InventoryView#setTitle()? Already did that before I committed

remote swallow
#

bet its gonna be merged after 1.20

#

5 cookies

worldly ingot
#

Most likely

remote swallow
#

yeah

#

well

#

1.2.1

#

minecraft is progressing backwards

#

imagine 1.80

chrome beacon
#

1.88

tardy delta
#

2.0

remote swallow
#

will we ever get to 2.0

grim oak
#

2.0 Would imply the game would be entirely reworked

young knoll
#

Yeah Mojang has no plans of going to 2.0

#

At least atm

#

Public Service Announcement: Version numbers are not decimal numbers. 1.7.10 is no more impossible than 1.7.9. 1.7.banana is also acceptable

grim oak
#

Ye exactly

young knoll
#

I'm still sad they didn't actually release a 1.7.banana after that

#

With banana trees

grim oak
#

Could have more i guess, like with snapshot versions i think

#

So is there a way to set the title with Paper without needing to use NMS currently in 1.19?

grim oak
#

O

#

A gui

#

Using a component

quiet ice
#

So inventory?

grim oak
#

Instead of string

#

yeah inventory i mean

young knoll
#

Sure

#

You can have them anywhere

grim oak
#

How do i do it

young knoll
#

We have just been lacking API for it for a long time

grim oak
#

Is there API for it rn?

#

For inventory titles

young knoll
#

No

grim oak
#

So how else would I do it? Using NMS?

quiet ice
#

Not even paper has an API for that strangely enough

young knoll
#

Like I said I think it's because setTitle is <1 month old

quiet ice
#

Well it has a InventoryView#title() method for getting Components but not for writing it

young knoll
#

Yeah that method is much older

chrome beacon
#

uh I have no idea what you're trying to say

quaint mantle
#

nvm i do this

remote swallow
#

im guessing you mean adding the exceptions to the method, so you have to wrap it in try catch

quaint mantle
remote swallow
#

dont make that a one liner

quaint mantle
#

why

remote swallow
#

it will make everyone who reads your code hate you

quaint mantle
#

😄

#

so that there is no image pollution

quiet ice
#

Then don't send it as an image?

quaint mantle
#

Does what I do make sense?

quiet ice
#

Also why not use try-with-resources here?

quaint mantle
#

wdym

quiet ice
#

You could also have done

Connection connection = null;
public void onEnable() {
  try {
    connection = getConnection();
    getLogger().info(ChatColor.GREEN + "Database successfully connected");
  } catch (SQLException ex) {
    showError(exception);
  } finally {
    connection.close();
  }
}

instead of sending an image

quaint mantle
#

ah is good

quiet ice
#

With try-with-resources (Should Connection implement AutoCloseable) you can do:

Connection connection = null;
public void onEnable() {
  try (Connection conn = getConnection()) {
    getLogger().info(ChatColor.GREEN + "Database successfully connected");
  } catch (SQLException ex) {
    showError(exception);
  }
}
quaint mantle
#

😄

quiet ice
#

Well I included the AutoCloseable

quaint mantle
#

acutally i need close mysql ?

quiet ice
quaint mantle
#

what is try-with-resources

quiet ice
#

Remember: the finally {} block is ALWAYS called should the try {} block get executed.

quiet ice
quaint mantle
#

ah

#

understood

quaint mantle
#

t-w-r will close ?

#

or

#

wait

#

i need add close method to ondisable ?

#

if i do t-w-r ?

remote swallow
#

you should close on disable if the connection isnt null, if you dont use a connection pool

quaint mantle
#

you are an npc

remote swallow
#

wanting to run a 1.7 server

quaint mantle
#

problem?

native ruin
#

could it be that some of the protocols in https://wiki.vg/ are outdated or just a completely different type than in actuality?

remote swallow
#

you have hundreds of bugs and exploits

quaint mantle
#

Ok

remote swallow
#

and someone can join ur server and almost entirely hijack ur computer

untold jewel
#

Seen some tutorials on the AnvilGUI by WesJD which I presume is the most common Anvil API. The problem is however that they all use the #onComplete method which does not exist anymore. Could someone please explain to me how I would achieve the same with some different method thats currently available?

fathom prism
#

This plugin is supposed to create a inventory for each person and basically when using /badges give <playername> <badgetype> it must add the badge (in this case a diamond) to the players badge inventory. When firing the command it works perfectly but when restarting/reloading the server or the player leaving the inventory does not get saved. Anyone a idea why?

I've already tried seperating the classes where it saves the data but that did not help

https://pastebin.com/u4fV3G8L

quaint mantle
remote swallow
#

no, just check if the connection isnt null and close it

#

idk what you want try-with-resources there for

quiet ice
#

Well it was in direct response to them using the finally block

quiet ice
remote swallow
#

the finally without twr would be called as soon as your try block is done, not when the server closes if thats what you wanted

#

or be smart and use hikariCP with its connection pools

#

true

undone axleBOT
lavish cliff
quaint mantle
#

i need get player uuid for offline server
or only getname is fine ?

remote swallow
#

you should always use uuid, but if you are forced to use name use it

quaint mantle
remote swallow
#

what

quaint mantle
#

i mean if my uuid is = 4545 if connect to another server my uuid will be = 3535 ?

remote swallow
#

that isnt a uuid

quaint mantle
#

i know

#

just example

remote swallow
#

your account uuid never changes

quaint mantle
#

Is the uuid generated when entering the server?

hazy parrot
#

No

quaint mantle
#

for offline server ?

remote swallow
#

no, its generated when you create ur mc account

hazy parrot
#

It's generated when account is created

quaint mantle
#

alright

#

thx

remote swallow
quaint mantle
#

i have 3 minecraft ac

#

😄

remote swallow
#

for offline server ?

hazy parrot
#

You don't need offline server then

quaint mantle
#

if i be good dev

subtle folio
#

does anyone have a command framework example that doesn't need the command in the plugin.yml for me to look at? I'm alittle curious about it.

remote swallow
tardy delta
#

acf

quaint mantle
#

and i be customer and he wanna plugin for offline server

subtle folio
#

Simpilar than ACF

remote swallow
#

yeah you dont want to willingly do offline mode

#

you loose all support

tardy delta
#

just want source code?

subtle folio
#

yeah

tardy delta
#

how to insert into commandmap?

quaint mantle
#

im in hypixel

subtle folio
#

mhm

remote swallow
tardy delta
#

smth like this

tardy delta
#

too lazy to write it myself

tardy delta
subtle folio
tardy delta
#

isnt #setTabCompleter in PluginCommand?

subtle folio
#

it has the tabComplete method

#

but for some reason my tab completions aren't working

crisp forum
#

Which one should I use in my configs (yml files)
kebab case (no-permission) or
lower snake case (no_permission)

subtle folio
#

kbab

remote swallow
#

kebab imo

tardy delta
#

^^

tardy delta
# subtle folio

i have no clue actually, would help if i had access to the internals

#

dont have any spigot project on this pc

subtle folio
#

all good, thanks

hazy parrot
#

til that is called kebab case

fathom prism
#

Does anyone here have a bit of experience with saving data to .yml files when the server restarts/

eternal oxide
#

?ask

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!

tardy delta
#
BukkitWiki

The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...

chrome beacon
#

?configs

undone axleBOT
quaint mantle
#

i need use char or varchar for uuid why ?

tardy delta
#

nah that one sucks (atleast the last time i looked at it)

quaint mantle
#

for mysql

tardy delta
#

doesnt mysql have UUID support?

remote swallow
#

TEXT or varchar(36)

fathom prism
#

So i'm trying to save data on the player when the player receives a badge. For some reason the data does save when the player restarts so leaves and joins back again but when the server restarts the data gets lost and the inventories are empty again.

https://pastebin.com/vAVAFfYr

quaint mantle
tardy delta
#

probably want binary object though, storing text in a db is awful anyways

#

nah doesnt seem so

#

varchar is probably fine

young knoll
#

I use a binary object

chrome beacon
#

UUIDs should be stored in binary

young knoll
#

But iirc it does have a uuid type

chrome beacon
tardy delta
#

i use blob but thats sqlite

chrome beacon
#

I use UUID but thats PostgreSQL 😎

tardy delta
#

i only use postgres in college

remote swallow
#

i wonder if mysql/sqlite has a way to define var type saving

tardy delta
#

instead of explaining why they use a certain db they just say "use it"

#

college nowadays

tardy delta
remote swallow
#

like how you can make type adapters for json

#

does that exist in some form for mysql/slite

#

sqlite

tardy delta
#

sql pojo mappers

#

smth like hibernate or jooq

quaint mantle
#

i do null to balances, is true ?
0 is null ? or not null ?

remote swallow
#

you probably dont want to save their name, as it may change and no longer be correct

tardy delta
#

i believe primary keys are implicit indices

eternal oxide
quaint mantle
tardy delta
#

that primary keys are a lookup index by default

#

not sure about this in mysql, i dont use that db

fathom prism
eternal oxide
#

you are complaining that there are no inventories.

tardy delta
#

and primary keys must be unique too

eternal oxide
#

You save playerBadgeData but nothing about the inventories

fathom prism
#

Well not complaining, the inventories open up as normal it's just that the stuff inside the inventories dissapear.

remote swallow
eternal oxide
#

Line 99 is when the server is fresh, no inventories

#

It will create a new empty inventory

#

are there supposed to be badgeItems in that inventory?

fathom prism
#

Yeah it's basically supposed to be a general inventory that every player can open but they're personal. So when a player earns a badge it gets added to their personal badge inventory. And then it adds the badge item

eternal oxide
#

then you'd probably do as Epic said, don;t store the inventories. populate a new one from the playerBadgeData when needed

#

You save and load the badge data fine, you just do nothing with it after

fathom prism
#

So i would have to just create a new inventory from playerBadgeData when the player fires the command and if it receives a badge then save it?

young knoll
#

mhm

fringe yew
#

how do i constantly check if a player has an effect?

#

check if a player has an effect...

#

i don't need to provide context

opal carbon
#

use runnables

fringe yew
#

it's irrelevant

fringe yew
opal carbon
#

runtasktimer

#

use javadocs

#

the repeatedly bit

#

code that runs once isnt repeatedly

fringe yew
#

it wasn't really needed so nah

young knoll
#

I would just use the event to check when they get the effect

#

And/or when they lose it

fringe yew
#

the issue is that other plugins/people will just simply override it

opal carbon
#

if he wants to do it constantly he wants to dp it constantly

fringe yew
#

override the effect...

opal carbon
#

why are you trying to correct him on his use case

#

.

#

i dont bother trying to tell people they have no clue what they are doing most of the time

fleet imp
#

how do i instantiate a villager

opal carbon
#

people tend to take that as a challenge and i dont feel like arguing with people

opal carbon
fleet imp
#

how

#

the entity part

opal carbon
#

World.spawnEntity

jagged bobcat
#

Villager villager = (Villager) x

young knoll
#

You can skip the cast if you use the method that takes a class instead of an EntityType

round finch
#

i want to store entity.. remove it and respawn exactly the same entity

#

what is the way to go about that?

young knoll
#

The only real way you can do it with the api is to manually store all the data for the entity

#

Or you could be kinda janky and save it into a structure

round finch
#

just manual code like entity name and etc?

#

do i have to create a new entity right?

young knoll
round finch
#

i thought thanks! @young knoll

young knoll
#

You'd need to store name, health, and any entity specific data

#

Sadly we don't have a good way to copy entities yet

opal carbon
#

that feels like the kind of thing that would be good

hybrid spoke
round finch
opal carbon
#

to actually fully serialize an entity

round finch
#

like magic

opal carbon
#

i actually had another project i worked on once trying to do something like this

#

ended up having to just use nms

round finch
#

before i'm teleporting the entity... i should make it immortal

opal carbon
#

make sure it isnt and cant be unloaded when you try and tp it

#

otherwise itl null

round finch
#

dam i wish i could just copy the entity and set uuid to a different uuid

hybrid spoke
#

what even are you trying to do

round finch
#

storing entity into a inventory

#

to carry around

young knoll
#

It's quite easy with NMS

round finch
#

😨 NMS

young knoll
#

Sadge, I know

opal carbon
hybrid spoke
#

yeah well in that case just store the stats

#

or serialize it

opal carbon
#

entities arent by default serializable iirc

hybrid spoke
#

otherwise just keep the entity instance

#

and respawn it

round finch
#

maybe Entity MNS API?

hybrid spoke
opal carbon
round finch
opal carbon
#

copying all the traits and everything

hybrid spoke
#

anyways, to just keep your entitys instance could be the best way

#

otherwise make your own value object which you can serialize and deserialize with everything you need

round finch
#

teleport the entity to shadow realm

hybrid spoke
#

why

round finch
#

and return them later

hybrid spoke
#

you can just remove it

round finch
#

😂

hybrid spoke
#

and respawn it

young knoll
#

You can't re-add an entity if you remove it

hybrid spoke
#

nothing is impossible

opal carbon
#

without nms

#

unfortunately

#

some things arent

round finch
#

dude i wish there was an api for this shet

hybrid spoke
#

just force yourself into craftregionaccessor and add the entity manually back to the world

round finch
#

😮 woaw

obsidian plinth
#

Whats a good library for 1.19 to change the users display name above their head

chrome beacon
#

NameTagEdit

hybrid spoke
#

how pathetic of me asking, but whats a good pathfinder lib

round finch
#

PAPER

#

lol

opal carbon
#

u got smthn against paper or smthn?

hybrid spoke
#

yes

round finch
#

?whereami

hybrid spoke
#

paper's shit

opal carbon
#

All im saying is it exists in paper's api lol

#

if you want to use that or not is ur choice

round finch
#

👍

slim wigeon
#

Wanted to know as well

#

But these are accessed using the player instance

obsidian plinth
#

That doesn’t replace the users name above their head

#

Only chat and tab

slim wigeon
#

You tested it?

obsidian plinth
#

Yes

slim wigeon
#

Can you show me a screenshot along with source code?

slim wigeon
eager jacinth
obsidian plinth
#

Tab allows to set the name above the players head?

#

And yea but protocol is a lot of work

eager jacinth
obsidian plinth
#

I didn’t know tab allowed that ngl

opal carbon
#

does setdisplayname not work for the name above head?

#

damn it doesnt thats weird

obsidian plinth
#

Yea it’s just how mc works

#

I need to read up and see if tab can

#

If not I’ll go the other route

blissful wagon
#

how can i use hex color code in chat or title ?

slim wigeon
#

I want to know where Jeff went

remote swallow
#

who

slim wigeon
#

He might be recovering, he comes here sometimes and help with the development

remote swallow
#

oh alex

slim wigeon
#

Yes, that is who I meant. I seen Jeff somewhere, it might be on his discord server

remote swallow
#

his company

#

jeff_media

slim wigeon
#

You seen him here recently?

remote swallow
#

he was here a few days ago, most likely just sleeping a lot

round finch
#

it is like 1:22 rn for him in germeny

wet breach
remote swallow
#

oh

wet breach
#

10 hours ago

ripe flint
#

anyone in here know coding
im trying to compile java code into a plugin and i was wondering how

remote swallow
#

do you use maven or gradle

ripe flint
#

no idea lol

#

i had someone write me up something real quick and i wanted to test it out but i really dont know how

#

i can sent a .txt if you want

remote swallow
#

do you have a pom.xml or a build.gradle

ripe flint
#

all they gave me was java code

ripe flint
#

can i send the code and you like glance over it and see if it would like work first?

hazy parrot
#

Idk why would they send you uncompiled source lol

remote swallow
#

?paste it

undone axleBOT
hazy parrot
#

Just ask them to compile for you ig

ripe flint
remote swallow
#

bet chatgpt wrote that

ripe flint
#

you would bet right

#

is it good though?

#

like would it work?

remote swallow
#

probably

ripe flint
#

so the article you sent above should get it to work

remote swallow
#

it would help, you would also need to make a plugin.yml for it

ripe flint
#

<maven.compiler.target>1.8</maven.compiler.target>

#

should it be 1.19.4 instead of 1.8 because thats the version i want?

remote swallow
#

that is java target

#

1.8 is java 8,

ripe flint
#

so it should remain the same?

remote swallow
#

yeah

ripe flint
#

<version>1.19.4</version>

#

is this correct it said syntax errors when i tried reloading

remote swallow
#

its 1.19.4-R0.1-SNAPSHOT

ripe flint
#

Thanks

#

<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
now it has this whole bit red which is mostly just pasted in from the article

remote swallow
#

are you using intellij

ripe flint
#

yes i did something wrong and copied a bit of text its working now

#

alright so i followed the guide and tried to compile and it says "illegal start of type"

tepid thicket
#

Why returns getVelocity() always 0 on boats? (land, water, ice)

echo basalt
#

because their movement is sent by the player instead of being like

#

processed by the server

#

which is why Player#getVelocity also returns 0 when a player is moving

#

unless the server actually applies a speed to it

tepid thicket
#

Ok.

#

I try to change the speed of boats. Is there any good way?

tepid thicket
#

It seems that there is no way. Setting the boat's velocity works, but is very clunky.

#

Though it might be still good enough for my use case.

#

Still thx.

upper vale
#

Isn’t there like an actual boat speed variable you can set or am I remembering incorrectly

subtle folio
#

Let's say I have a library that does some code. Is it possible for the library to know what the name of the spigot plugin that ran the code is called? Or would I need a function argument.

worldly ingot
#

It would be preferred to pass in a Plugin instance or something, yeah

subtle folio
#

got it

worldly ingot
#

At least then you could use .getName()

subtle folio
#

yep yep

#

I just have to refactor a lot of code now

#

wouldn't mind reflection fuckery rn

wary topaz
worldly ingot
#

You could probably do some disgusting reflective shit through the call stack

subtle folio
#

Oh thats genius

#

thank u choco 🙂

worldly ingot
#

I'm not advising that lol

#

but it's an option

subtle folio
#

you are now

worldly ingot
#

I DO NOT CLAIM RESPONSIBILITY

opal carbon
worldly ingot
#
    private static final StackWalker STACK_WALKER = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE);

    public static Logger getLogger() {
        return LoggerFactory.getLogger(STACK_WALKER.getCallerClass());
    }```
#

Mojang does this in their LogUtils lol

#

StackWalker API is Java 11+

#

Oh, sorry, 9+

subtle folio
#

since when did itemstacks gain legs

opal carbon
#

oh thats not even that disgusting

#

forgot abt stalk walker

worldly ingot
#

I mean the fact that it's caller sensitive is pretty fucking gross

#

but it's API

opal carbon
#

true

wary topaz
#

File updateFolder = Bukkit.getUpdateFolderFile();

Never knew this was a thing

hybrid spoke
wary topaz
#

oh crap

#

well I need it to be private so how can I use this ?

opal carbon
#

cause if you call in any class except main class it would probably be a pain

hybrid spoke
#

or get a file server

wary topaz
#

google?

hybrid spoke
#

google it

#

no, better

#

?bing it

undone axleBOT
echo basalt
#

just have like

#

a private repo or something

subtle folio
#

why is that a command

wary topaz
#

can I use like github tokens or webhooks?

wary topaz
#

well not works but ill try it

hybrid spoke
#

since its private

wary topaz
#

frick

#

I can run this from java

hybrid spoke
sullen marlin
#

can you limit a token to just downloading releases

wary topaz
#

it can pull

#

and if you want to configure it to push you can

sullen marlin
#

well then people could just use the token to get your source

wary topaz
sullen marlin
#

so this seems like a bad idea

wary topaz
#

well than im out of idea

#

ideas*

sullen marlin
#

make a public repo and put releases there?

#

if you're really bent on an updater

hybrid spoke
#

or ✨ get a file server ✨

#

or upload it to google drives

#

or whatever

wary topaz
#

I want something that only the plugin can access but it will be on the same internet so can you do that with ftp?

hybrid spoke
#

people can just modify your plugin

wary topaz
#

for example going to 10.1.2.84 will just download the plugin

#

but I will also need a easy way to upload releases too

hybrid spoke
#

workflows

#

there you can build the jar and deploy it

wary topaz
#

whats that?

hybrid spoke
#

github workflows

sullen marlin
#

what issue are you trying to solve

wary topaz
#

an auto updater on restart

hybrid spoke
#

f.e.

sullen marlin
#

but not a manual updater?

hybrid spoke
sullen marlin
#

why cant you just make a public github repo for the releases

wary topaz
#

hmm

#

ughh I now dont see a reason to not

worldly ingot
#

You could also just open source your code 👀

#

Keep things all in one repo

wary topaz
#

its technically a private plugin for a server I own

hybrid spoke
#

then make it a public private plugin for a server you own

sullen marlin
#

then why does it need an auto updater

worldly ingot
#

Wait... yeah

#

lol

#

Most established networks will have some form of version controlled distribution. Whether that be a Git repo, CI like Jenkins, Docker, etc.

wary topaz
sullen marlin
#

normally youd have an out of band system to do the update

#

like a script, or all plugins loaded from a single source

#

not built into the plugin jar

wary topaz
#

I wanted to do that with a localhost connection

worldly ingot
#

you lost me

hybrid spoke
#

+1

wary topaz
#

like lets say you go to 10.1.2.84/LManager/ it will send you the jar file

sullen marlin
#

youre just describing a web server with a jar now?

wary topaz
#

well yeah

hybrid spoke
wary topaz
hybrid spoke
wary topaz
#

im confused

hybrid spoke
#

go to sleep

#

after 30 mins of rolling around your brain will find the solution

sly trout
#

hey guys

#

how do i cast inventory to anvilinventory

#

knowing it is an anvil inventory

sullen marlin
#

AnvilInventory anvil = (AnvilInventory) inventory;

#

same as any cast

sly trout
#

I get this error

lethal coral
#

should I account for users 1.8-1.12 when developing my plugin

worldly ingot
#

no

sly trout
#

does someone know ?

hard acorn
#

For my custom zombie horse entity, I'm trying to replace its AI with a zombie's. I begin it by removing all the goals that AbstractHorse gives the ZombieHorse class, but it doesn't do anything. What am I doing wrong?

public void clearHorseInstinct() {
    this.goalSelector.removeGoal(new PanicGoal(this, 1.2D));
    this.goalSelector.removeGoal(new RunAroundLikeCrazyGoal(this, 1.2D));
    this.goalSelector.removeGoal(new BreedGoal(this, 1.0D, AbstractHorse.class));
    this.goalSelector.removeGoal(new FollowParentGoal(this, 1.0D));
    this.goalSelector.removeGoal(new WaterAvoidingRandomStrollGoal(this, 0.7D));
    this.goalSelector.removeGoal(new LookAtPlayerGoal(this, Player.class, 6.0F));
    this.goalSelector.removeGoal(new RandomLookAroundGoal(this));
    this.goalSelector.removeGoal(new FloatGoal(this));
    this.goalSelector.removeGoal(new TemptGoal(this, 1.25D, Ingredient.of(Items.GOLDEN_CARROT, Items.GOLDEN_APPLE, Items.ENCHANTED_GOLDEN_APPLE), false));

  }```
hard acorn
#

Another thing, I can't make horses move whatsoever when they have a passenger. I'm pretty sure it's because of their method isImmobile(), which checks to see if its saddled and has a passenger, which then sets its velocities to 0

#

I keep trying to override the method but it doesn't affect anything

obsidian plinth
#

Anyone have any better way to set the players name that displays above them besides pro bc i keep messing it up and not getting it to work.

charred blaze
#

any plugin ideas?

sullen canyon
buoyant viper
tepid thicket
chrome beacon
tardy delta
#

ah yes they using unsafe to allocate an uninitialized packet

vast ledge
#

Why not

fierce whale
#

?paste

undone axleBOT
fierce whale
fierce whale
#

I didn't remove entity before world deleted
I'll try it after delete entity.

tardy delta
#

doesnt unloading the world do that?

fierce whale
#

idk 🤔

#

The reason I assume entity can be error is because only entity file remained

tender shard
#

anyone know where ~/.m2 or ~/.gradle is located on Jetbrains Spaces?

#

I'm using this where I basically got an IJ running but it's connected to the space, everything actually runs on spaces

#

the website is more like gitlab or sth where you can only see the files of repositories

#

anyone got any idea how I can avoid the duplication of declaring repo + credentials here?

subprojects {

    // ...
    publishing {
        // ...
        repositories {
            maven {
                credentials {
                    username = System.getProperty("jeffMediaRepoUser")
                    password = System.getProperty("jeffMediaRepoPassword")
                }
                url = 'https://repo.jeff-media.com/public'
            }
        }
    }
}


publishing {
    // ...
    repositories {
        maven {
            credentials {
                username = System.getProperty("jeffMediaRepoUser")
                password = System.getProperty("jeffMediaRepoPassword")
            }
            url = 'https://repo.jeff-media.com/public'
        }
    }
}
eternal oxide
#

With maven you set it in the config/settings file

remote swallow
eternal oxide
#

ignore me. not awake

tender shard
tender shard
remote swallow
#

id guess just add the name of it

#

def repo = maven {
    creds
    url
}


publishing { 
    repos { 
      repo
    }
}
``` mayb
tender shard
#

tried that, it claims it cannot find "rep"

remote swallow
#

idk if its not that, ask chatgpt

tender shard
#

chatgpt tells me something that doesn't work

#

I have now tried to define it like this at top level:

def publishRepo = repositories.maven {
    credentials {
        username = System.getProperty("jeffMediaPublicUser")
        password = System.getProperty("jeffMediaPublicPassword")
    }
    url = 'https://repo.jeff-media.com/public'
}

the definition works

#

I then try to call it like this:

#

but it just errors out ```
12:35:12: Executing 'build'...

FAILURE: Build failed with an exception.

  • Where:
    Build file 'C:\Users\mfnal\IdeaProjects\lunatic\build.gradle' line: 121

  • What went wrong:
    A problem occurred evaluating root project 'lunatic'.

Could not find method call() for arguments [] on object of type org.gradle.api.internal.artifacts.repositories.DefaultMavenArtifactRepository.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 1s
12:35:16: Execution finished 'build'.

remote swallow
#

uh idk, see if it outside of the repositories section works

fringe yew
#

i'm trying to schedule a task to check if a player as an effect. it doesn't work:


        BukkitScheduler scheduler = getServer().getScheduler();
        long duration = ConvertFromIntToTicks(config.getInt("delay"));
        scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
            @Override
            public void run() {
                App.getInstance().getLogger().info("hello");
                final FileConfiguration config = App.getInstance().getConfig();
                List<String> players = config.getStringList("players");
            
                for(String name : players) {
                    Player player = Bukkit.getPlayerExact(name);

                    if(player == null) {
                        continue;
                    } else if(name != player.getName() && player != null) {
                        player.removePotionEffect(PotionEffectType.NIGHT_VISION);
                    }

                    player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 255));
                }
            }
        }, 0L, duration);

note: duration is 4 in this environment

#

it's in app.java too

remote swallow
#

that is the wrong way to use the scheduler api

fringe yew
#

i have tried to follow a wiki but it just doesn't make sense. can you assist me in making this work?

remote swallow
#

does it log the hello

fringe yew
#

no

remote swallow
#

add a sysout before the scheduler and see if that runs

hazy parrot
remote swallow
#

that isnt what hes trying to do

fringe yew
#

i'm removing the night vision if the player is no longer in the config, else ensure it's still added

tender shard
#

however I still have the issue with javadoc.jar being contained in javadoc.jar and it becoming 127gb in size 🥲

hazy parrot
fringe yew
#

then i can fix that later.

hazy parrot
#

i mean no cuz its string

#

strings should be compared with equals

#

not ==

#

also second && player != null is never gonna be false

fringe yew
#

yea it does work

#

my bad lol

#

also it does work as intended

#

so

remote swallow
#

you will get an npe though

#

oh wait

#

there isnt a need for the != null, and use #equals for strings

hazy parrot
#

name and player.getName() will always be same

#

it doesn't make sense to make that check

fringe yew
#

alright

remote swallow
#

a lot of that looks flawed tbh

tawdry echo
#

How can get spanwer type by digging it up and then make itemstack with that mob type

fringe yew
#

is this good

                    if(player == null) {
                        continue;
                    } else if(!(name == player.getName())) {
                        player.removePotionEffect(PotionEffectType.NIGHT_VISION);
                    }
remote swallow
#

use uuids not names, and use offline player insteada

remote swallow
#

name.equals(player.getName())

fringe yew
#

what do you means equals

remote swallow
#

its basic java

#

?learnjava

undone axleBOT
hazy parrot
#

name and player.getName() will always be true, dont make that check

fringe yew
#

i'm new to java but i know the basics from cs

#
                    if(player == null) {
                        continue;
                    } else if(name.equals(player.getName())) {
                        player.removePotionEffect(PotionEffectType.NIGHT_VISION);
                    }
hazy parrot
#

you are getting player from name here Player player = Bukkit.getPlayerExact(name);, thenfore, their name and variable name will always be same

remote swallow
#

save their uuid to string instead, and use get offline player

fringe yew
#

no? the 'name' variable is from a string list

hazy parrot
#

and you are getting player from that "name"

fringe yew
#

oh yeah

remote swallow
visual laurel
#

how do i update by spigot build?

tender shard
#

wdym?

#

the dependency for coding?

visual laurel
#

yeah

tender shard
#

you change the version in your pom or build.gradle

#

are you using maven or gradle?

visual laurel
#

maven, whats the latest version?

tender shard
#

1.19.4-R0.1-SNAPSHOT

visual laurel
#

yeah im using that but was told to update to latest to fix an issue yesterday but didnt have time to

tender shard
fringe yew
tender shard
#

they probably wanted you to update the actual server software?

visual laurel
#

.

#

im on paper latest im pretty sure

tawdry echo
remote swallow
#
FileConfiguration config = App.getInstance().getConfig();
Bukit.getScheduler().runTaskTimer(this, () -> {
    List<UUID> playerUUIDs = config.getStringList("players").stream().map(UUID::fromString).toList()
    for (UUID uuid : playerUUIDs) {
        Player player = Bukkit.getPlayer(uuid);
        if (player == null) continue;

        player.addOptionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 1200, 255));
    }
}, 0l, 1200l);

``` @fringe yew
remote swallow
#

if you only add it for a minute you never need to remove it bc it would have expired by the next time the code runs

vast ledge
fringe yew
#

btw what import is UUID

vast ledge
#

or smth that tells you what mob is in the spawner

tardy delta
#

java util one i believe

tender shard
# tawdry echo I want to pick up spawners by block breaking

in BlockBreakEvent, get the block. get the state. cast it to Spawner. get the entity type and save it in a variable. then create a new itemstack of type CREATURE_SPAWNER or however it's called. get the itemmeta. cast the itemmeta to SpawnerMeta. set the entity type. set the meta back to the itemstack. drop the itemstack

fringe yew
#

and no semicolon!!!!!

remote swallow
#

so you arent trying to get a uuid from a playe rname

vast ledge
#

@fringe yew
import java.util.UUID;

tender shard
tender shard
#

so what's the issue you are facing

visual laurel
tender shard
#

so the issue is that you place a custom item in the result slot, but it disappears after a tick or sth?

visual laurel
tawdry echo
#

when i place it spawner is empty

#

nvm i have to be on creative to place it and not be empty

tender shard
visual laurel
tender shard
#

huh, why?

lavish cliff
tender shard
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

lavish cliff
#

lmao

pseudo hazel
#

did you register it?

lavish cliff
#

ye Bukkit.getPluginManager().registerEvents(new DuelCommand(), this);
this.command("duel" , new DuelCommand());

tender shard
lavish cliff
flint coyote
#

💀

tender shard
#

okay this is leading nowhere, all you keep saying is it "doesn't work"

#

btw you never even register it

#

you only register DuelCommand as listener

#

also you create two instances of it, that's pretty pointless

lavish cliff
#

Excuse me then how should I record it being that listeners are in the same class?

flint coyote
#

It's a different class

#

public class DuelListener implements Listener

public class DuelCommand implements CommandExecutor, Listener

tender shard
#

you should have one listener, and one commandexecutor. and of both, you should always only create exactly one instance

lavish cliff
#

oh ok thx guys

quaint mantle
#

how hard is it to make these clickable nps and is it worth it making them on your own

lavish cliff
pseudo hazel
visual laurel
quaint mantle
#

with a libary or without

#

what do you recomend

#

alright i will try that then thx

tender shard
#

@remote swallow if you're bored, wanna try to check out my javadoc issue again 🥲

onyx fjord
#

i guess

tender shard
#

i don't think so

#

yeah anyway kacper you use gradle too right?

#

do you know how I can create a "fat" javadoc.jar that includes all submodules?

#

that's the issue I'm currently facing

tender shard
#

the aggregateJavadocJar plugin is broken

#

there's also a few issues about this on github but none has been answered

onyx fjord
#

i saw it being done with the built in javadoc support

tender shard
#

that's why I hate gradle, you gotta rely on third party plugins to do simple things that maven has builtin, and then it simply doesn't work

#

and those plugins are abandoned, nobody ever answers or fixes issues

#

the funny thing is, it works on macOS but not on windows

onyx fjord
#
def exportedProjects = [
        ":",
        ":module-a",
        ":module-b",
        ":module-c"
]

task allJavadoc(type: Javadoc) {
    source exportedProjects.collect { project(it).sourceSets.main.allJava }
    classpath = files(exportedProjects.collect { project(it).sourceSets.main.compileClasspath })
    destinationDir = file("${buildDir}/docs/javadoc-all")
}

from stackoverflow

tender shard
#

that does not create ANY javadocs for the whole project

#

all this does is create one javadoc folder per module. But I need a javadocs .jar for the whole project

visual laurel
quiet ice
#

That plugin creates nothing but issues

#

also where the hell is the source of the plugin?

tender shard
#

yeah very hard to find lmao

#

I used github's file search to look for it

#

and yeah the plugin is annoying as hell

#

I wish I could go back to maven but... paperweight

#

oh no wait, wrong one

#

why the heck is that class deprecated

quiet ice
#

Probably because it is broken

#

If I had to guess it is including itself (via Copy#from) and thus the Jar task JiJ's the outputs of the aggregateJavadocJar jar (which is itself).

#

But I wouldn't know where the issue lies even if my assumption was true

tender shard
#

yeah very annoying haha

#

the weird thing is, it works on macOS

#

and it worked for lynxplay on linux, but I also tried on linux and epic tried on linux too, didnt work for us (created a 10518261 gb jar)

#

so I wonder, why the heck did it work for lynx on linux

#

@eternal night or do I remember this incorrectly? the aggregateJavadocJar thing, you remember?

eternal night
#

Yea it worked for me

fringe yew
#

how do I add this /lang/ folder into the plugin folder?

eternal night
#

I can clone it again if you want

#

on macos now

tender shard
#

haven't changed anything in 5 days

eternal night
#
gradle aggregateJavadocJar
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/8.0/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
:executing 'download minecraft manifest'
:executing 'download minecraft version manifest'
:executing 'download vanilla minecraft server jar'
:executing 'download mojang server mappings'
:executing 'extract libraries and server from downloaded jar'
:executing 'filter vanilla server jar'
:executing 'generate mappings'
:executing 'remap minecraft server jar'
:executing 'fix minecraft server jar'
:executing 'access transform minecraft server jar'
:executing 'decompile transformed minecraft server jar'
:executing 'apply patches to decompiled jar'
:executing 'apply mojang mapped paperclip patch'
:installed server artifacts to cache
:done setting up paperweight userdev workspace for minecraft 1.19.4

BUILD SUCCESSFUL in 1m 47s
21 actionable tasks: 21 executed
tender shard
#

yeah it also works on macOS for me, as said

#

but not on windows nor linux

#

so weird haha

quiet ice
#

Welp I'll clone on linux then

tender shard
#

thank you

#

I'd really love to get this fixed, I switched to gradle for paperweight and somehow it worked... but not on windows, it's really weird haha

quiet ice
#
[geolykt@fedora lunatic]$ ./gradlew aggregateJavadocJar
bash: ./gradlew: Permission denied

💢

tender shard
#

chmod it

quiet ice
#

Yeah I was joking. The bigger annoyance is that I don't have the publication props set

tender shard
#

just remove the publications part

#

it's there twice, on top level and on subprojects

fringe yew
#

how do i put a folder in the plugin folder?

tender shard
#

or just set it to "asd"

quiet ice
#

Already done. Now it fails to resolve the deps due to mismatching java versions....

tender shard
fringe yew
#

tysm

tender shard
#

oh no wait you run it from CLI. yeah it needs java 17+

quiet ice
#

Yeah realised

#

And now

* What went wrong:
Could not determine the dependencies of task ':nms:1.19.4:compileJava'.
> Could not resolve all files for configuration ':nms:1.19.4:remapper'.
   > Could not find tiny-remapper-0.8.6-fat.jar (net.fabricmc:tiny-remapper:0.8.6).
     Searched in the following locations:
         file:/home/geolykt/.m2/repository/net/fabricmc/tiny-remapper/0.8.6/tiny-remapper-0.8.6-fat.jar

Guess I'll add the fabric repo to the plugin repos

tender shard
#

that shouldn't be needed

#

weird

#

anyway, I got a response from someone else about this issue:

#

haha

quiet ice
#

Okay... adding the repo doesn't work. Guess I'll have to compile from source

#

?bt

undone axleBOT
vast ledge
#

?paste

undone axleBOT
vast ledge
#

Quick question, im currently using https://paste.md-5.net/orelabovog.cpp but when i run it in my console it turns into an unknown char, is there anything im doing wrong, or does the console just not like icons/symbols

vast ledge
#

cmd windows

tender shard
#

oh then no clue

eternal oxide
#

windows cmd does not support UTF8

vast ledge
#

😦

quiet ice
#

The issue you have is that the input and output directories of the aggregateJavadocJar task are the same @tender shard

tender shard
quiet ice
#

MacOS probably uses a different FS where this is not an issue

quiet ice
tender shard
#

I already tried to exclude "**.jar" from the aggregateJavadocJar but that didn't help

ocean hollow
#

why it doesn`t work? it gives my nothing

desert loom
#

pretty sure you're looking for map#put not map#replace

vast ledge
#

Yea

vast ledge
#

you cant replace something that doesnt exist

#

You should also check on the getPasswordPlayer(), if that player exists in the HashMap

tender shard
tardy delta
#

hmmyes passwords in string form 🤓

#

putIfAbsent exists

quiet ice
#

@tender shard Add

aggregateJavadocJar {
    getDestinationDirectory().set(file(getBuildDir().toPath().resolve("docs")))
}

to the end of the buildscript file

brave pivot
#

Without it, you will first put the password and then replace it

tender shard
brave pivot
#

Is there a way to create a configurations section from a class without the !!org.joml.AxisAngle4f?
To do what is shown in the image I did config.set("leftRotation", new AxisAngle4f())

I guess I could create the section and the properties myself, but that would take longer and even more if there are multiple sections I want to create...

quiet ice
tender shard
tender shard
#

quickly checking, gradle decided to re-decompile paperweight stuff

quiet ice
#

oof

tender shard
#

Dude! It works! Thank you so much ❤️

#

I have been struggling with this for days

#

I will comment this on all the GH issues I found about this issue, what's your github name?

quiet ice
#

I'm currently making the comment on your issue

tender shard
#

great, thank you!

#

@remote swallow geol found a fix for the javadoc issue

#

see above

quiet ice
#

Though to be honest a bit of luck was involved because I had a vaguely similar issue a week or two ago

tender shard
#

I do not exactly know why MacOS isn't affected by this issue, but I assume that it is due to differences to when the OS commits files to disk.

that makes sense, that also explained why it worked for lynx on linux, but not for epic and me. @eternal night which filesystem do you use? I tried on ext4

#

you probably used sth else, I guess?

quiet ice
#

It can also be due to caches

tender shard
#

I usually ran clean before trying

#

I'm just happy it's working now haha

quiet ice
#

Cleaning wouldn't have an effect as the Jar task would read and write the same file at the same time

tender shard
#

ah ok

#

I am very unfamiliar with how gradle works and how the cache etc works

quiet ice
#

Only if the OS keeps a complete copy of the jar in memory you won't have the issue.

tender shard
visual laurel
tender shard
#

then I have no clue, sry

visual laurel
onyx fjord
#

@tender shard did you figure out javadocs?

tender shard
#

yes, geol came up with a fix, see the github issue above

brave pivot
tardy delta
#

infinite file :o

tender shard
#

and then to load it again, you do it like this:

Map<String,Object> serialized = (Map<String, Object>) myConfig.get("translation");
ConfigVector3f myObject = ConfigVector3f.deserialize(serialized);
onyx fjord
#

and how do you publish that later on

tender shard
#

one sec

tender shard
onyx fjord
#

epic thanks

#

i was like

#

why is the task running to slow

#

and then i saw the 10 gig jar

tender shard
#

haha yeah it runs until the hard disk is full

onyx fjord
#

wouldnt do much harm to me

#

my home partition is not the same as /

wary topaz
#

idk why this is happening

hazy parrot
#

10.1.2.7776

#

you put wrong ip

wary topaz
#

crep

tender shard
#

hardcoding IPs is a bad idea, do you not have any domain name?

wary topaz
#

[11:02:11] [Server thread/INFO]: Latest file:

#

its going to be a local server but yes I do

#

its a static ip

#

running nginx ubunti

wary topaz
onyx fjord
tender shard
#

Thank epic and geol, not me 😄

visual laurel
#

how can i stop a smithing table copying the lore of an item? and then use the lore of the result itemstack

keen ferry
#

I want to send a fake block to a player using NMS, the ClientboundBlockUpdatePacket constructor takes a BlockPos and BlockState. How do I create the default block state for an oak sign?

kind hatch
#

Why not just use Player#sendBlockChange()?

keen ferry
#

I mostly just want to practice NMS, trying to do stuff without the protocol for the sake of practice

kind hatch
#

Fair enough.

keen ferry
#

(Material.OAK_SIGN.createBlockData() as CraftBlockData).state
I can do this apparently (kotlin code)
why does CraftBlockData have getState() but BlockData does not?

worldly ingot
#

It does

hard acorn
#

What is keeping most livingentities from moving when they have a non-player passenger?

worldly ingot
#

Oh, sorry, you mean API vs implementation. BlockData is the API. Bukkit has no knowledge of NMS whatsoever. So having a method that exposes that field (which is exclusive to server internals) wouldn't make sense

worldly ingot
#

I would imagine this is to do with how behaviours are controlled. They likely won't have anything in their AI to handle a passenger. Think a chicken jockey for instance. The chicken just moves towards a player so the zombie's AI can be satisfied. I don't think the same will be true however if a zombie rides a pig.

hard acorn
#

they still have AI, but they just can't move

hard acorn
keen ferry
worldly ingot
#

No. BlockState is implemented by CraftBlockState, CraftBlockState wraps an NMS TileEntity

#

Any interfaces you find in Bukkit will be implemented by CraftBukkit

keen ferry
#

I see, the names confused me. Thanks

#

I now have this block state of a sign: var blockState = (Material.OAK_SIGN.createBlockData() as CraftBlockData).state (kotlin, again)
How would I set one of its lines?
if it were a org.bukkit.block Sign I'd just do .setLine() but how would I do this seeing as it's NMS?

eternal oxide
#

why are you using CraftBukkit to just set lines on a sign?

keen ferry
#

I'm sending a fake sign to the player to get input, using NMS for practice

opal carbon
#

Wdym "use the lore of the result itemstack"

#

i cant tell what you are actually asking

visual laurel
silent belfry
opal carbon
keen ferry
# keen ferry I'm sending a fake sign to the player to get input, using NMS for practice

This is what I tried:

                var blockPos = BlockPos(player.location.blockX, -64, player.location.blockZ)
                var blockState = (Material.OAK_SIGN.createBlockData() as CraftBlockData).state
                var craftSign = SignBlockEntity(blockPos, blockState)
                craftSign.setMessage(1, net.minecraft.network.chat.Component.literal("test"))
                var packet0 = ClientboundBlockUpdatePacket(blockPos, craftSign.blockState)
                val packet1 = ClientboundOpenSignEditorPacket(blockPos)
                listener.send(packet0)
                listener.send(packet1)

But the sign remains empty.

silent belfry
silent belfry
#

Does anyone know a Hibernate alternative that works with plugin libraries?

chrome beacon
#

You could just use Hibernate

#

Nothing prevents it from working

pseudo hazel
#

lmao -64 would be inside the bedrock xD

chrome beacon
#

You can always shade it

silent belfry
#

So make the plugin from 1 mb to 17 mb?

#

closer to 18 mb really

chrome beacon
#

You can probably minimize that a bit

silent belfry
#

i can research it. just figured i would ask

chrome beacon
#

<minimizeJar>true</minimizeJar>

#

It's just a setting in the shade plugin

#

It will try to strip unused classes

#

Which usually works fine, but it can cause issues when a class is only accessed via reflection

silent belfry
#

That stripped my API which needs to be shaded but thanks for the right direction

#

oh nevermind threw an error ha

#

I see that brought it down to about 16 mb which is better but still large. Would be nice if I could include hibernate in the libraries to begin with ha

restive mango
#

hrm

#

Anyone know how Synched Entity Data works?

#

nvm

#

it's like this btw

#

// List<SynchedEntityData.DataItem<?>> eData = new ArrayList<SynchedEntityData.DataItem<?>>();
// eData.add(new SynchedEntityData.DataItem(new EntityDataAccessor<>(6, EntityDataSerializers.POSE), Pose.SLEEPING));
// if
//
// craftPlayer.getHandle().connection.send(new ClientboundSetEntityDataPacket(entityID, new SynchedEntityData(craftPlayer.getHandle())));

molten hearth
#

does IJ not allow you to rename a package to just a singular word

heavy mural
#

What is the best event to take when it comes to an arrow popping a chorus fruit?

hazy parrot
quaint mantle
#

im confused this command works bcs they is gray ?

remote swallow
#

iirc its CREATE IF NOT EXISTS TABLE

#

might be wronfg

quiet ice
#

I mean it is DROP TABLE IF NOT EXISTS so CREATE TABLE IF NOT EXISTS would make more sense

hazy parrot
warm mica
quiet ice
#

But I always use DROP X IF NOT EXISTS; CREATE X instead of CREATE X IF NOT EXISTS

remote swallow
#

sus

silent belfry
#

just confirming if anyone knows an alternative to Hibernate that works with the plugin.yml libraries flag?

flint coyote
#

Does that lead to an error?

quiet ice
#

Guaranteeing a pristine slate

flint coyote
#

Well how would it drop if it doesn't exist? Or do you get an error and catch that?

quiet ice
#

Ah I see

#

I meant DROP X IF EXISTS

quaint mantle
#

idk

flint coyote
#

Well to get a pristine state that is fine. For anything persistent, not so much

quaint mantle
#

im using last version of mysql

#

code no errors btw

#

just gray words confused me

#

can i ignore ?

quiet ice
#

Tbh I haven't gotten further than the prototyping phase when working with databases

quiet ice
#

If it runs it runs.

flint coyote
quaint mantle
#

alright

fringe yew
eternal oxide
#

if you are saving resources from teh jar you don't need to make folders. just include the whole folder in resources and when you saveResource it will preserve the directory structure

fringe yew
#

thanks

sharp bough
#

does anyone know if theres a event when a wall or a fence sets direction with nearby blocks?

#

im trying to prevent this from happening

eternal oxide
#

place it without physics

sharp bough
#

and only allow it when you place the fence agains another fenc

sharp bough
raw prairie
#

How can I get the motivation to relearn Java?

buoyant viper
#

u dont, learn C.

raw prairie
quaint mantle
#

i have a psychological problem i don't wanna se intellij warnings

#

but when i do try with resource

#

i got variable is never used warning

#
 public void runDb() {
        try (Connection connection = connectDb()){
            getLogger().info(ChatColor.GREEN + "Database successfully connected.");
        }
        catch (SQLException exception) {
            showError(exception);
        }
    }```
remote swallow
#

so show your code

#

yeah, you dont use the variable

#

that code is entirely pointless

quaint mantle
#

but i don't need ?

#

rly ?

remote swallow
#

you never use the connection

#

there isnt a point of doing that just to say it connected

#

once again you should use something like hikari cp with its connection pools

#

without it iirc you have to use 1 connection and keep it open

quaint mantle
#

what is this?

#

clear the db warnings ?

remote swallow
#

no idea

#

check javadocs

quaint mantle
#

what warnings ?

remote swallow
#

no clue

tardy delta
#

why the = null

remote swallow
#

coll made it

quaint mantle
#

actually i don't know hikari

#

and i need look

#

what is this

remote swallow
remote swallow
quaint mantle
#

i will write example 1m

remote swallow
quaint mantle
#

i know but i wan't to learn connection pool

#

1m

#

if i have connectionpool i can connect my database from two program or plugin ?

remote swallow
#

you would have 1 instance of that class per plugin

#

you would call getConnection() when you want to get, update or add stuff to the database

#

and you would do it async

wide coyote
#

yeah, just don't forget to close the connection

quaint mantle
#

alright

#
    public void runDatabase() {
        String userName = "root";
        String password= "12345";
        String dbUrl= "jdbc:mysql://localhost:3306/players";

        try (Connection connection = DriverManager.getConnection(dbUrl,userName,password)){
            Statement statement = connection.createStatement();
            String sql = "CREATE TABLE IF NOT EXISTS playerstats(test int)";
            statement.execute(sql);
            getLogger().info(ChatColor.GREEN + "Database successfully connected.");
        }
        catch (SQLException exception) {
            getLogger().info(ChatColor.RED + "There was an error in database -> ");
            exception.printStackTrace();
        }
    }```
#

i change my code to this

remote swallow
#

just because you take the info doesnt mean you use hikari

#

without hikari or a lot of effort you dont have a connection pool

quaint mantle
#

i will add hikari

#

but before i need understand connection pool

remote swallow
#

if anything you should shade hikari and copy the class i sent

remote swallow
quaint mantle
#

i didnt find
explanation for my language