#help-development

1 messages · Page 1548 of 1

wary harness
#

hm

vague cypress
#

I have this: ``` @EventHandler
public void onPlayerClicks(PlayerInteractEvent event) {
Player player = event.getPlayer();
Action action = event.getAction();

    if (action.equals(Action.RIGHT_CLICK_AIR) || action.equals(Action.RIGHT_CLICK_BLOCK)) {
        if (player.getItemInHand().getType() == Material.NETHER_STAR) {

            player.sendMessage("This works");

}```

It won't send the message. I temporarilly removed all gui stuff just to test the listener.

vague cypress
#

Oh

#

Uhh...

#

Hmm

vital ridge
# wary harness hm

set a boolean to true when you start the runnable, and set the boolean to false where you end the runnable

quasi flint
#

Sounds like no

vague cypress
#

That might have been a good idea

wary harness
vital ridge
#

np.

tiny wolf
stone oak
#

ok, so ive been working on a plugin, and i need my on disable code to run when i update the plugin, but it does not run
it runs every time unless i replace the jar with a new version

smoky oak
#

Can't u call the onDisable function, then run the updater,then run your onEnable function?

dusty sphinx
#

How can I get the "name" of an Advancement?

#

Like "Stone Age" to "story/mine_stone"

#

I should be able to get an Instance of the class just fine, just not sure where to go from there

high pewter
#

I'm trying to make a joining animation thing when players join my server (it makes them jump out of a fountain onto the spawn area, I can't use setVelocity because the water prevents setVelocity from working) but for some reason, despite me not setting the player's pitch or yaw, the player is unable to turn their head. It also seems very laggy, despite being run every tick. Any ideas why? https://paste.pythondiscord.com/diyopexaka.java

cosmic patrol
#

Having a bit of a problem, I need to set the value of the field responsible for disabling armor stand slots. I got a value for 1.16.3 which is disabledSlots, but on 1.17 this field doesn't seem to exist. Does anyone know what it's supposed to be or how I can find out what it might be?

glossy scroll
#

@cosmic patrol if there are other fields that are truly only accessible by reflection that you need

#

I would run buildtools at 1.16.5

#

Go to the builddata folder

cosmic patrol
#

I want to fix ArmorStandTools I believe it's called and for that I need the name of the field. Though of a way by just dumping all the fields into the console so hopefully that works

glossy scroll
#

And look at bukkit-1.16.5-members

#

It will tell you the mappings

#

All fields were reverted to their obfuscated states

#

The members file should be correct for the most part

#

Otherwise you can use a decompiler to look in the class file

cosmic patrol
glossy scroll
#

But really

#

Use the api I provided

#

It was written for a reason

cosmic patrol
#

if I was making the plugin I would, just that I want to update an existing plugin and it uses reflections to accomplish it's multi version compatibility which gives some problems when updating.

dusty sphinx
granite stirrup
opal juniper
vivid token
#

Hey so I want to make a plugin that makes it so spawners don't drop xp, I've never made a plugin how would I do it?

chrome beacon
#

Do you know Java?

opal juniper
#

what the man said

#

do you know java

wraith rapids
#

listen to BlockBreakEvent, check whether the broken block is a spawner, if so, use setExpToDrop() to set the dropped xp to 0

jagged jacinth
#

i have this plugin source code

opal juniper
#

he is white tho NNYa, not a blue guy. chanced are he has never seen java

jagged jacinth
#

how i make it into a jar file

opal juniper
jagged jacinth
#

how

#

i found the source on githup

#

github

opal juniper
#

do you have an ide

jagged jacinth
#

yes

opal juniper
#

send the repo link

jagged jacinth
#

intelj

opal juniper
#

send the repo link

jagged jacinth
#

dm

opal juniper
#

ok...

edgy cape
#

whats the best way to drop a itemstack

jagged jacinth
#

ctrl+q

edgy cape
#

no like

earnest sonnet
#

xD

jagged jacinth
#

xD

edgy cape
#

create a itemstack

jagged jacinth
#

idk

edgy cape
#

and then drop it

#

ok

earnest sonnet
#

So, basically you want to create an itemstack and then drop it into the ground?

edgy cape
#

yes

#

like on a player

granite stirrup
#

l‫ol

earnest sonnet
#

World#dropItem

quaint mantle
#

Hello. Is there an easy way to check if a particular dimension is an instance of a World?

earnest sonnet
#

explain

#

?

quaint mantle
#

Or is there any link present between something like world, and world_nether

#

other than the name

earnest sonnet
#

well there is the 8 blocks thingy

#

not sure if you mean that

quaint mantle
#

I have a plugin that I'm making that will load an intance of a plugin based upon WorldInitEvent.

granite stirrup
#

void te‫st() { local l = {}; }

earnest sonnet
#

@granite stirrup I'm getting a lot of (edited)

granite stirrup
#

?

quaint mantle
#

I guess I could just make a function getWorldPrefix, and check if they are related based on the name :/

earnest sonnet
granite stirrup
#

;p

granite stirrup
earnest sonnet
edgy cape
#

how do you use the world interface

earnest sonnet
#

implement it ?

edgy cape
#

but then

#

wait like

#

implements World?

eternal night
#

the fuck

#

do not implement the world interface 😂

earnest sonnet
eternal night
#

Location has a getWorld method

#

so do Entity subtypes

edgy cape
#

World.dropItem(player.getLocation(), item);

#

so how would i do this

#

without the World?

eternal night
#

as stated, both player and player.getLocation() have a getWorld method

earnest sonnet
#

Bukkit.getWorld("world name or what ever")
edit: nope

eternal night
#

no

vital ridge
#

How can i set connection properties?

eternal night
#

player.getWorld().dropItem...

vital ridge
#

Id need autoreconnect=true

edgy cape
#

ok thank you

eternal night
#

what kind of connections are you talking about nuxoria

wraith rapids
#

interpersonal connections

eternal night
#

I'd love an autoreconnect on those 😭

earnest sonnet
#

man, this channel is getting crazy every night

eternal night
#

what connection pool are you using

vital ridge
#
public void openConnection() throws SQLException {

        if (getConnection() != null && !getConnection().isClosed()) {
            return;
        }

        connection = DriverManager.getConnection("jdbc:mysql://" +
                this.host + ":" +
                this.port + "/" +
                this.database + "?autoReconnect=true",
                this.username,
                this.password);

    }
#

This didnt work out for me

#

My connection times out

#

after like 20 mins

#

and my plugin stops working

#

?paste

undone axleBOT
vital ridge
#

thats the error

vague cypress
#

Why does this not set custom names for the items but rather only put them in a GUI? (point of interest lines noted out)

        Player player = event.getPlayer();
        Action action = event.getAction();

        if (action.equals(Action.RIGHT_CLICK_AIR) || action.equals(Action.RIGHT_CLICK_BLOCK)) {
            if (player.getItemInHand().getType() == Material.NETHER_STAR) {

                Inventory inventory = Bukkit.createInventory(new menuGUI("Menu"), 9, "Menu");
                ItemStack item = new ItemStack(Material.PAPER);
                ItemMeta meta = item.getItemMeta();

                //Paper
                //meta.setDisplayName(ChatColor.WHITE + "Welcome message!");
                List<String> lore = new ArrayList<String>();
                inventory.setItem(0, item);

                //Diamond
                item.setType(Material.DIAMOND_BLOCK);
                //meta.setDisplayName(ChatColor.DARK_BLUE + "Shop");
                inventory.setItem(1, item);

                player.openInventory(inventory);

            }
        }

    }

}```
vital ridge
#

you never set the item meta

#

item.setItemMeta(meta);

#

in the end

vague cypress
#

Ooh, thanks

earnest sonnet
#

@vital ridge I'm not from a PC to see it, but check out hikariCP it may come in handy at some point

eternal night
#

basically tells you why autoReconnect will not actually always reconnect

vital ridge
#

Well Idk what to do then

eternal night
#

either deal with a potential re-creation of the connection yourself

#

or use a pool like any normal human

#

e.g. hikaricp

vital ridge
#

So with hikaricp

granite stirrup
#

\💻

vital ridge
#

i dont need to set any special properties?

#

just wondering

eternal night
#

the pool should maintain open connections

#

you can set how long you want them open

#

but the pool maintains, well, a pool of x open and ready connections for you

#

creating new ones when old ones are closed

granite stirrup
#

vague cypress
#

How to you properly prevent a user from taking an item from a custom GUI?

young knoll
#

Cancel the click event

vague cypress
#

I thought so, but when I do this it doesn't work:


        if(event.getView().getTitle().equals("Menu")) {
            event.setCancelled(true);
        }```
young knoll
#

You shouldn’t compare with title

#

You should compare with the view returned by openInventory

#

Also make sure you have @fresh templethandler and that you registered the event

vague cypress
#

I'm pretty sure I registered the event. How would I compare using openInventory?

wraith rapids
#

@fresh temple

earnest sonnet
#

^

vague cypress
#

I have the actual inventory down, I just want to lock the items in it

#

and for some reason I can't find any helpful articles or videos online

wraith rapids
#

store the inventory instance somewhere

#

then check if the view involves that inventory instance

#

with f.e if (view.getTopInventory() == myInventoryInstance)

young knoll
#

Using views is the best

#

Add the view returned from openInventory to a hash set, and then check contains() in the event

wraith rapids
#

if you have multiple inventories that you're juggling around, that is an option

#

and remember that a player can modify an inventory even without directly clicking it

#

for example, if the player doubleclicks a dirt block in their own inventory, this will attempt to collect all of the dirt blocks in the inventory view onto the player's cursor

#

which will also pull from the top inventory

#

so just checking whether getClickedInventory() == myInventory isn't sufficient

young knoll
#

It’s always worked fine for me

#

I think that triggers a click event for the top inventory

wraith rapids
#

i don't remember that being the case

cold tartan
#

is there a way to get the weapon used in EntityDamageByEntityEvent?

young knoll
#

Get the item in the attackers main hand

wraith rapids
#

i think you can shoot a bow from the off hand

#

splash potions will also rekt you

#

i don't know if there's a good way of getting the weapon used, as I think even under the hood nms trips over this

young knoll
#

Yes but those would not be directly caused by the attacker

wraith rapids
#

it was a thing for a long time that your main hand item's looting enchant would be applied to all mobs you killed with a splash potion while holding it

young knoll
#

You can store the bow with the shootBow event, but potions are a bit harder

wraith rapids
#

sure, but they still fire an entity damage by entity event

eternal oxide
#

also if you switch weapons after firing a bow

wraith rapids
#

yeah you used to be able to get looting bonuses if you shot a mob and swapped to a sword with looting before the arrow hit

eternal oxide
#

you can at least get teh shooter from that though

wraith rapids
#

not sure if that still happens

young knoll
#

You can store the bow Itemstack with the shoot bow event

#

Into a map with the projectile

wraith rapids
#

for potions, I think the thrown itemstack is accessible in whatever event is fired when the actual splash happens

#

as for how to link the splash to the damage event, I'm not sure

eternal oxide
#

Potions have their own events

sage swift
#

le epic rename chest to inventory name and profit

cold tartan
sage swift
#

InventoryHolder

cold tartan
#

ohhhhhh i see

#

ok

#

thx

sage swift
#

oh right getEquipment

#

may be better for your purposes, @cold tartan

hazy vale
#

Quick bungeecord question. What event should I use to get the ProxiedPlayer when he joins the network (proxy). I don't want it it trigger when the player switches server but only when he joins the network.

cold tartan
digital plinth
#
  "parent": "minecraft:item/generated",
  "textures": {
    "layer0": "minecraft:item/snowball"
  },
  "overrides": [
          {"predicate": {"custom_model_data":101938483}, "model": "items/garlic"}
      ]
}```
#

why it dont work :/

#

resourcepacks are annoying bc theres like no means of debugging

hardy swan
digital plinth
#

im trying to

hardy swan
#

Also why items instead of item

digital plinth
#

bc my folder is named that way

#

pack

hardy swan
#

I would suggest you name it as item

digital plinth
#

roger

#

i changed it to item

#

it didnt fix it

hardy swan
#

ah ok, @digital plinth just saw your resource pack, you need a json of an existing minecraft item

#

your current garlic.json should be snowball.json

#

wait you dont even have a model file for garlic

#

as mentioned, you will need a snowball.json like so:

{
  "parent": "minecraft:item/generated",
  "textures": {
    "layer0": "minecraft:item/snowball"
  },
  "overrides": [
          {"predicate": {"custom_model_data":101938483}, "model": "item/garlic"}
      ]
}

and since you referenced the model to be item/garlic, you will then need to provide the model garlic.json:

{
  "parent": "minecraft:item/generated",
  "textures": {
    "layer0": "item/garlic"
  }
}
#

and there you go

digital plinth
#

hm

#

weird

#

i added the snowball and garlic.json

#
  "parent": "minecraft:item/generated",
  "textures": {
    "layer0": "item/garlic"
  },
}```
#

garlic

hardy swan
#

Your textures folder is still items

#

Change to item

hardy swan
digital plinth
#

its item

#

maybe i should relaunch mc?

hardy swan
#

Just need to reload textures, no need to relaunch game

#

Hmm

digital plinth
#

garlic.png

#

umm

#

do i need item/garlic.png

hardy swan
#

Yes you need garlic.png in textures/item directory

digital plinth
#

i have it

hardy swan
#

Oops try removing the trailing comma in garlic.json

#

Maybe it is cuz of that

digital plinth
#

okay

#

oh yes

#

it worked

hardy swan
#

lol

digital plinth
#

Tysm

hardy swan
#

npnp

wraith rapids
#

DEUS VULT

#

are you making a vampire plugin or something

digital plinth
#

indeed

#

alos what is DEUS VULT

#

oh nvm

#

google told me

#

lol

#

Btw apparently i Entity(progetile) dont have customModelData

#

theres .setItem for projectiles

#

is there like a .getItem?

#

dont think so

#

but why

#

:<

#

i want my garlic(snowball with custom model data) to deal dmg

hexed hatch
#

Cast to Snowball

digital plinth
#

okay

hexed hatch
#

Wait hold up

#

That’s not necessary

digital plinth
#

i need a try ctach?

hexed hatch
#

What? No

digital plinth
hexed hatch
#

The setItem method is accessible, right?

#

That will do it

digital plinth
digital plinth
hardy swan
hardy swan
digital plinth
#

entities

#

i can use .getUniqueID

#

after the .launchProjectile

#

but if i do that

#

then i cant use .setItem

wraith rapids
#

store it in a variable

#

then call the methods on the variable

#

in other words, learn java

hardy swan
#

Snowball implements Projectile

#

you can try using snowball for the projectile instead

digital plinth
#

fixed

#

thx guys

hardy swan
digital plinth
#

i can store it in a var

digital plinth
#

"Projectiles are not ItemStacks, you cant convert a projectile(entity) to a itemstack" --- someone on spigot forum

hardy swan
#

yea, just confirming that the model is gone

nova mirage
#

Hi, I'm trying to make the invisibility effect hide armor too (instead of the vanilla functionality where it still shows armor). I've searched around a bit and found a solution using ProtocolLib + NMS, but I can't seem to find a jar file for NMS. Does anyone know where I can find it (or build it myself if necessary)?

eternal oxide
hardy swan
digital plinth
#

wait so if i cast the entity to a projectile i can still use .getItem on it

#

cool

hardy swan
#

no need to cast entity to projectile

eternal oxide
hardy swan
#

if you use ProjectileHitEvent, the entity you get from #getEntity is of type projectile

nova mirage
#

in the spigot server jar?

hardy swan
#

^ you use this to generate a spigot jar

nova mirage
#

oh NMS is inside the spigot jar?

hardy swan
#

that spigot jar will contain nms, authlib, craftbukkit all those stuff

#

yea

nova mirage
#

ahhhh

#

got it, thanks!

hardy swan
#

you have to set your artifactId as spigot instead of spigot-api too, if you use maven for the spigot dependency

digital plinth
#

you can cast it to a projectile i think

hardy swan
digital plinth
#

wait fr?

#

i wasnt able to use .getItem on them tho

#

i can after i casted it to snowball

hardy swan
#

yes cuz snowball is also a ThrowableProjectile

#

so ThrowableProjectile is the interface that has this #getItem() method

#

not Projectile

digital plinth
#

ohh

#

so thats why

#

okay

#

btw does anyone know a pixel art software that let you upload a 16by16 picture and edit the pixels

hexed hatch
digital plinth
hollow river
#

so i had this very weird bug where spawning pillagers with nms pathgoals would give a nullpointerexception with no reference, despawning the pillager entity

#

does anyone know something about it? or things i need to watch out for when spawning pillagers?

hexed hatch
digital plinth
#

thx

quaint mantle
#

why the fuck is fastutil relocated

wraith rapids
#

i think paper un-relocates it

#

i'm not sure why spigot relocates it

quaint mantle
#

i am greatly disappointed

#

not like I wasn't before :^)

wraith rapids
#

welcome to the greatly disappointed club

sullen dome
#

okay, there's this method. can someone please explain me what uOffset and vOffset are? never heard that. i only know x and y tho

#

(has nothing to do with spigot. it's actually rather a question in general, bc i think u and v are something that i should know what they are?)

quaint mantle
#

uh what's the context

sullen dome
#

rendering a texture from a png

quaint mantle
eternal oxide
#

Whats the method from?

sullen dome
#

mc

eternal oxide
#

package?

sullen dome
#

if you want the exact class, AbstractGui

eternal oxide
#

do you have a package for that? can;t be bothered to search

sullen dome
#

net/minecraft/client/gui/AbstractGui.java

#

iirc

#

yea

eternal oxide
#

at a guess I'd say it was probably the offset coordinates for texture wrapping

sullen dome
#

so basically at which position the end-texture is located in the png file?

#

or am i getting that wrong

candid galleon
eternal oxide
sullen dome
#

what i'm doing rn is in general the dumbest and probably most complicated thing i've ever done lmao.
i see literally no way to implement custom fonts into the mc-system, and so i'm rendering the fucking letters from png files lmao.

candid galleon
#

you can customize the text font via a resource pack

sullen dome
#

i mean via code

#

for my client

#

i dont want to change all of the font. i want to have like a custom font for example for my buttons

#

like arial or smt different

#

but because the mc system itself renders from png files too... i cant simply render a normal font to the minecraft-existing display. because it doesnt use jlayer, or whatever exists out there.
either that, or i simply dont know how lol

eternal oxide
#

Afraid I've not played with the client at all

sullen dome
#

Slick util is incompatible with lwjgl 3.2.2

#

and there's probably no other library like slick

digital plinth
#

why does mcasset.cloud not have wooden sword's json

worldly ingot
#

Though you do understand that you have those assets, right? On your local computer?

#

%appdata%/.minecraft/versions/1.17.jar

digital plinth
#

🤷

hardy swan
#

jar is like a zip, it is a folder containing random shit, including default texture folder

digital plinth
#

ik i can open it with winrar

hardy swan
#

so you can get the wooden sword's json from there then

digital plinth
#

its a teeny bit more convenient to use mcasset

hardy swan
#

I mean I rather depend on sth given by default

digital plinth
#

sth?

hardy swan
#

something

digital plinth
#

what is something given by default

hardy swan
#

I rather depend on things that are given by default

digital plinth
#

like the jsons in the jar

#

okay

hardy swan
#

like minecraft providing you with the version jar

#

must as well use it, will not go wrong

sullen dome
#

why tf would you use an asset browser? tf...
just go to your versions folder, copy all of that into for example documents/assets/*
and there you have all your assets for all your versions (if you use multiple ones)

#

there's no reason for using an asset browser, except pure lazyness

hardy swan
#

Even with laziness, you can make a copy once and for all...

sullen dome
#

well thats what i mean with lazyness

#

or laziness idk

#

whatever..

hardy swan
#

Yea thats a comment for @digital plinth haha

sullen dome
#

for example i have all my assets in my documents for this cases. so i don't have to everytime open the jar and manually searching for it

digital plinth
#

im not really familar with winrar so

#

does shift clicking items into a crafting grid fire the inv click event

sullen dome
#

why be familar? all you need to do is open your jar with winrar. and it looks like a normal windows explorer

digital plinth
#

ohh okay

sullen dome
#

every click into your inventory fires that event.

digital plinth
#

even clicking on empty slots?

sullen dome
#

handled under InventoryClickEvent#getAction i guess? but idk

#

nvm, that was interactEvent

sullen dome
#

iirc, even outside of the inventory is fired. but idk for 100%

#

i mean like left and right of your screen when opened your inv

#

okay, question to everyone.

is there an EASY method to render text to the existing minecraft-client-window with a custom font? as minecraft uses its own (btw VERY complicated) bitmap-system, i cannot use that for it

#

[1.16.5]*

digital plinth
#

Action bar?

sullen dome
#

no, clientside

#

like one sec

digital plinth
#

isnt that mods then?

sullen dome
#

for example, i want to change the font of this buttons

#

it basically is mods, yea

#

but without a modloader/api lol

digital plinth
#

plugins can do that?

sullen dome
#

nothing but pure lwjgl 3.2.2

sullen dome
digital plinth
sullen dome
#

i want to change only specific stuff

digital plinth
sullen dome
#

like for example the buttons

sullen dome
sage swift
#

you can change the buttons

sullen dome
#

wdym

digital plinth
sullen dome
#

tf

digital plinth
#

he does that quite frequently

sage swift
#

for self-explanatory questions that can be searched, yes

sullen dome
#

ah nvm

#

i thought it was a front against me lool

digital plinth
sage swift
#

and then i even googled it for the retard

digital plinth
sullen dome
#

oh

#

so back to my question... is there a way? what i want is just render text in lwjgl 3.2.2

#

but like all util-libs are outdated or trash

digital plinth
sullen dome
#

and if i google it, all i get are links that are not working since like 2 years

#

wtf

digital plinth
#

ome engine

#

some*

sullen dome
#

it has smt to do with opengl i guess

#

not 100% sure tho

digital plinth
#

yea since it ends with gl

#

Gecko's weirdness rivals Lax

sage swift
#

i could send you the ip of a server whose texture pack changes some of the ui buttons

lucid jacinth
#

if i wanted to make a Vector that points in the direction the player is facing, how would i do that even if the player isnt looking in a cardinal direction?

sullen dome
#

god

digital plinth
#

👏

sullen dome
#

i really wanna hear that?

sage swift
#

posts random emojis

sullen dome
#

okay cmon, give it a go

#

oh wait

#

it was the one i already saw

digital plinth
#

oh you already saw?

sullen dome
#

wasnt this lax?

digital plinth
#

i didn;t know my video was that popular

#

also guys the anime of the year

#

its is

#

dun dun dun

#

dun dun dun

#

Record of Ragnarok

#

any disagreement

sullen dome
#

fully disagree

digital plinth
#

its unique and really good

sullen dome
#

because i dont watch anime

digital plinth
sage swift
sullen dome
#

looks like your humor is like from 2010

#

better you get out lol

digital plinth
#

no u

sullen dome
#

no u

digital plinth
#

anime arent bad, this one is like

#

historical

#

🤷

sullen dome
#

i never said

#

it would be bad

#

but i said i dont watch anime

digital plinth
#

whateverrrrr

sullen dome
#

and if your humor wouldnt be as old as my grandma, your would get that joke

sullen dome
digital plinth
sullen dome
#

lets get cancer out of the world

digital plinth
#

agreed

#

cant agree more

sullen dome
#

worse than covic

#

d

#

actually a german youtuber recently died to cancer.. thats saad

#

the thing is... if you have cancer, you know that you will die to like 90% or smt

#

i dont wanna be in such a situation tbh

digital plinth
#

soooo true

#

even scarier than HIV

sullen dome
#

imagine you know you only have a few days

#

never had hiv, so idk

#

never had cancer tho

digital plinth
#

you cant get rid of it

#

hiv = death sentence

#

but recently theres more effective drugs

sullen dome
#

tilidine 💉

#

best one

#

fully legal

#

but weed? noooo, highly illegal

digital plinth
sullen dome
#

ah miss those

#

just disable dm's from everyone

#

and you never get these again

digital plinth
#

:0

#

now no one can talk to you :/

sullen dome
#

or what even helps:

disable dm's from people from spigot/paper/forge/etc discord

#

thats where 90% from that people come from

#

miss those, ahhh

sage swift
#

an actual person joined my server and asked if I wanted dm ads

sullen dome
#

lol

#

do you advertise your server? like do you posted the link somewhere?

sage swift
#

not in an intrusive way

#

but yeah

sullen dome
#

its mostly even enough for such people if you just have it in your 300 follower instagram bio

#

god, my instagram is so full of sex bots lmao

digital plinth
#

report them to discord

sullen dome
#

its already deleted

#

that was like months ago

digital plinth
#

you've got the ss

#

discord's got chat history

#

probably

sullen dome
#

the account probably already got deleted by dc itself

#

idk

#

anyway, i disabled dms, and now i dont get those anymore

#

bc people have to send friendrequest first. and i dont accept friend requests without reasons lol

quaint mantle
#

imagine having DMs enabled to start with lol

sullen dome
#

i actually never bothered before i got those ad dm's

#

btw...
am i the only one who thinks that the logitech software is nothing but trash? holy fuck

#

you can only apply macros or whatever to the f-keys

digital plinth
#

arrows lose custom model data when shot and picked up

#

is there a way to keep the data

sullen dome
#

no idea

wraith rapids
#

i have dms enabled by default

#

i'm collecting a catalogue of stupid questions

sullen dome
#

lol

#

nny bro, you are good at java right?

#

i still dont know how to call you

digital plinth
#

nny

#

🤣

digital plinth
sullen dome
#

you want to everytime call him by his dc name?

digital plinth
#

sure

sullen dome
#

then you officially have too much time

digital plinth
#

@everyone call @wraith rapids NNY from now on

sullen dome
#

thats what he/she said

digital plinth
#

e

#

imma go work on math now

wraith rapids
#

nny is the intended shorthand yes

sullen dome
#

hah

wraith rapids
#

people from certain languages prefer nnyak

sullen dome
#

see

#

why even that name lol

digital plinth
#

NNYaKNpGms0eUVpiSdHx

wraith rapids
#

as some languages intuitively want to end things with consonants

digital plinth
sullen dome
#

my language just wants to call people idioten

#

at least i like that

#

like i said

#

too much time

wraith rapids
#

imagine if contributing bug reports and shit was so easy with everything as it is with towny

digital plinth
#

i dont think someone who is wasting their time talking on discord on random topics get to criticize anyone as having too much time

wraith rapids
#

you just go on their discord and have like vague screencaps of a spark report

#

and boom shit gets done

#

nobody even complains

sullen dome
digital plinth
#

i dont think theres anyone who knows about that stuff

sullen dome
#

thats java

digital plinth
#

maybe ask in minecraft official discord

sullen dome
#

really?

#

ask in minecraft discord how to modify their client?

#

great idea my dud

digital plinth
#

🤷

sullen dome
#

i'm sure they'll love to support that xd

wraith rapids
#

a pure java discord could server you better to that end

digital plinth
digital plinth
sullen dome
#

server you better best

#

so, you dont know?

#

sad

wraith rapids
#

i do very little pure java myself

sullen dome
#

wow

#

i was sure you were a pro

wraith rapids
#

imagine using java for literally anything if you don't have to

sullen dome
#

java is cool

wraith rapids
#

kind of crummy

sullen dome
#

never blame java

#

or ill give you some TOTALEN KRIEG

#

or smt

wraith rapids
#

what was that word that one oversensitive fuck tried to report me for

sage swift
#

what should i use instead, pythong?

digital plinth
#

and your telling ppl to learn java

#

cool

sullen dome
#

pythong ahahaha

#

that made my day, ngl

digital plinth
#

thon*

wraith rapids
#

ah yes

digital plinth
#

ew get that out of my face

wraith rapids
#

KONZENTRATIONSLAGER

sullen dome
#

yees

#

where do you even know that words from

wraith rapids
#

i have a catalogue of nazi-germany associated words

sullen dome
#

good

#

i mean

#

god with much o's

#

why would you have that

wraith rapids
#

to trigger people

sullen dome
#

oh wow

digital plinth
#

i have a bee movie spam bot

#

e

#

e

#

clearing that pic

#

oh good

sullen dome
#

uhm

#

clear

#

really..

#

that could get you banned easily

digital plinth
wraith rapids
#

the hyporcrisy of this new and modern, 'tolerant' world is laughable

sullen dome
#

you cannot use that phrase appropriatly

sage swift
#

im glad the discords are back to normal

sullen dome
#

i mean, i personally dont care. my humor is pretty dark

digital plinth
sage swift
#

no more gay plane

digital plinth
sullen dome
#

but maybe others do

sage swift
#

no more gay plane, no more gay worldedit

#

looks good

wraith rapids
#

why does someone caring about something make that something bad

hybrid spoke
#

would delete that gif

wraith rapids
#

i certainly don't like certain things

sullen dome
#

^

wraith rapids
#

that doesn't make people saying those things be in the wrong

sullen dome
#

godcipher, maybe you can help me? :(

digital plinth
sullen dome
#

no one can help me, i'm sad

digital plinth
sullen dome
#

java is dumb

#

omg

digital plinth
sullen dome
wraith rapids
#

i have gore of israeli bombs splattering children into bloody little giblets

sullen dome
wraith rapids
#

it's on my phone though

#

in the depths of my meme folder somewhere

sullen dome
#

such a legendary clip

wraith rapids
#

there's also a video of a cat being microwaved

digital plinth
#

disgusting

sullen dome
#

that channel got quickly converted into a meme channel

sage swift
#

these are not funny, supa

wraith rapids
#

a video of around 30 pigs being shoved into a pit, covered in gasoline, set on fire, and then buried alive

digital plinth
wraith rapids
#

that video that ran around recently of like a wolf or something being eaten alive in a zoo or something

sullen dome
#

if thats too dark for me

wraith rapids
#

i have all sorts of things

digital plinth
#

best joke ever

wraith rapids
#

i don't like all of the things I have either

sage swift
#

you want funny?

digital plinth
#

imma go 2 bed

sullen dome
sage swift
sullen dome
#

because i did

#

FOR THE LAST 3 DAYS

#

NOTHING BUT GOOGLE

#

NO ANSWERS

digital plinth
#

yes

#

thats live

#

thats life, kid

wraith rapids
#

go to bed

#

it's past your bedtime

digital plinth
#

u dont know my bedtime

wraith rapids
#

i know it was several hours ago

sullen dome
#

ooff

sage swift
#

is this funny to you supa

wraith rapids
#

been compiling this fucking maven project for 17 minutes 45 seconds

sage swift
#

bet its paper

digital plinth
sage swift
#

yeah but anime is retarded

wraith rapids
#

it's like a 40 source file project

sullen dome
digital plinth
#

yetis are retarded too

sullen dome
#

lol

#

weeb

sage swift
#

who was talking about yetis

digital plinth
#

frogs are bad

digital plinth
sullen dome
#

who talked about frogs tf

sage swift
#

what...

wraith rapids
#

you need better glasses

digital plinth
#

omg you have amnesia

sage swift
digital plinth
#

try to be more observative

sage swift
#

it's a fucking gecko idiot

sullen dome
#

everything's wrong in this

wraith rapids
#

you need better fucking glasses if that looks like a frog to you

sage swift
#

how stupid are kids these days

digital plinth
#

if you dont you wont survive in this harsh world

#

called earch

#

earth

wraith rapids
#

finally it's done

sullen dome
#

he's likely called frog10000 too

#

iirc

digital plinth
#

amnesia

#

amnesia

#

amnesia

wraith rapids
#

20 minutes 5 seconds and 285 ms

#

hhhh

sage swift
#

my server took 40 minutes to shut down today

sullen dome
#

oh wow

digital plinth
sullen dome
#

how long was it online

wraith rapids
#

now I can run it just to run into a NPE, do a 2 line change, and start over

#

i fucking hate development

digital plinth
wraith rapids
#

what did I even change

digital plinth
wraith rapids
#

what was even the issue

sullen dome
wraith rapids
#

what am I even doing

digital plinth
#

lol

sage swift
sullen dome
#

because my intellij doesnt like hotswaps

digital plinth
wraith rapids
#

you are being called to bed

digital plinth
#

you are a skeleton

#

you are dead

#

:>

wraith rapids
#

you really need to up the magnitude on your glasses

digital plinth
#

By the way I am not an AI program that has been assigned to keep chatting while my owner have a nice sleep

sullen dome
#

or am i getting smt wrong

digital plinth
quaint mantle
#

Would it be to intensive to do this ?

wraith rapids
#

brilliant

sage swift
#

there is nothing wrong with that code

wraith rapids
#

the move event is undoubtedly the best place to put any given logic

sullen dome
#

theres everything wrong on that

quaint mantle
#

I mean I query database each time player moves idk about that

sullen dome
#

why is that on iphone lol

wraith rapids
#

make sure that PlayerData.lives is a blocking network IO request

sullen dome
#

at least it looks like

sage swift
#

to spigotmc

wraith rapids
#

you definitely do not want to fucking query a database every time a player moves

sage swift
#

sure he does

sage swift
#

he just said so

wraith rapids
#

then he needs to get some concentrating action

#

in a camp

sullen dome
#

concentration is good

#

can help people

#

except me

wraith rapids
#

6 million concentration factor

#

try this simple trick today

sullen dome
#

lol

hybrid spoke
sullen dome
#

i need to render some text with a custom font inside my client.
but because minecraft has such a weird own window-system, i cannot use all that jlayer etc ways... and thats basically all i could find on google.
also i cannot use slick util anymore, because the old version depends on lwjgl 2. the new lwjgl 3 version is not compatible with 3.2.2.
and i know no alternative except rendering them all from png files, and thats nothing but a trash way to do it.
you got any ideas?

hybrid spoke
#

hm. never really dealt with clients. not sure if any client even does this. if so you could reverse engineer it and see how they do it.

sullen dome
#

i actually tried with badlion, but their code isn't really readable, and i have no knowledge about how deobfuscation or whatever works

#

i think it's more a generic java thing, than just client. i mean, i basically just need to draw a string with a custom font. and dont really know how to do that

sage swift
#

if i have two plugin files, with one version greater than the other, will it automatically load the newer one?

sullen dome
#

i mean, i wouldn't call that readable lol

wraith rapids
#

it'll load one arbitrarily

#

i don't think it really cares about version

lucid jacinth
#

how does one define an api in their plugin.yml

quaint mantle
#

Hello! I'm changing inventory's item. but it doesn't work

          Inventory inventory = event.getClickedInventory();
          inventory.setItem(47, new ItemStack(Material.LANTERN));
          player.updateInventory();
}```
sudden scaffold
sullen dome
#
  1. can you paste the whole event?
quaint mantle
#
    public void onInventoryClick(InventoryClickEvent event) {
        if (!event.getView().getTitle().equalsIgnoreCase("fryingpan")) return;
        if (event.getClickedInventory() == null || event.getCurrentItem() == null || event.getClickedInventory().getType() != InventoryType.CHEST) return;
        Player player = (Player) event.getWhoClicked();
        if (event.getSlot() == 46) {
            if (totoAPI.checkNameContainsInInventory(player, "oil") == 0) {
                player.closeInventory();
                player.sendTitle("§6cook", "§eyou don;t have oil");
                return;
            }
            totoAPI.removeNameContainsInInventory(player, "oil", 1);
            Inventory inventory = player.getInventory();
            ItemStack item = inventory.getItem(45);
            ItemMeta meta = item.getItemMeta();
            meta.setLore(Arrays.asList("§7click to start cook", "§ccheck recipe"));
            item.setItemMeta(meta);
            inventory.setItem(47, new ItemStack(Material.LANTERN));
                    player.updateInventory();
        }
    }```
sullen dome
#

where is ItemStack item = inventory.getItem(45); for?

quaint mantle
sullen dome
#

ah you just change the name of it, i see

quaint mantle
#

yes

hybrid spoke
quaint mantle
#

and I tested that I changed another slot like inv.setItem(1, new ItemStack(Material.STONE); and it doesn't work

sullen dome
#

if this returns true:

 if (totoAPI.checkNameContainsInInventory(player, "oil") == 0) {
                player.closeInventory();
                player.sendTitle("§6cook", "§eyou don;t have oil");
                return;
            }```
the code below doesnt run
#

maybe it does return there?

quaint mantle
quaint mantle
quaint mantle
sullen dome
#
  1. use a lambda
summer scroll
#

What slot is 47 in player inventory?

sullen dome
#

(looks cleaner)

quaint mantle
quaint mantle
sullen dome
#

can you maybe print out some stuff to see if it even runs? (the setItem(...);)

quaint mantle
#

nopo It's Inventory

#

not player's inventory

summer scroll
#

Well, you're getting the player's inventory.

#

Inventory inventory = player.getInventory();

quaint mantle
#

It's chest

#

omg wait

summer scroll
#

You need to get the top inventory then, because the inventory is a PlayerInventory.

quaint mantle
#

omg I was dumb

#

ty

sullen dome
#

interesting

quaint mantle
#

thanks you @ EVERYONE

sullen dome
#

dud. if i see your name, i always read angler. what is wrong with my eyes ahhhh

#

god

#

glad you had a space between the @ and everyone lol

summer scroll
#

kinda hate it tbh lmao

sullen dome
#

nah, my one eye is dead already, and my other one is probably dying soon too. at least i feel like

#

i mean, there is much stuff i cannot read/see properly lol

summer scroll
#

you use glasses?

sullen dome
#

nah, got one of that door thingys in my eye when i was a child. my left eye is fully dead lol

#

idk if there's smt for that case, but tbh, i dont wanna be a cyborg lol

#

these door opener things... still no clue how theyre called in english lmao

summer scroll
#

cyborg cool

#

so it's like a problem/disease since baby?

sullen dome
#

not that old

#

i was 8

#

my brother and me was beefing, i ran after him, he knocked the door in my face, boo

#

unlucky tho

summer scroll
#

still curious about the door opener things xd

#

can you show me like the images?

sullen dome
#

one sec

#

a door knob

#

thats it

#

like

summer scroll
#

in your eye?

sullen dome
#

dumb fucker

#

in my eye, yeah

#

how can this dumb fucker be so evil

#

such a small silver thing

summer scroll
#

what is that for?

sullen dome
#

opening the door? xd

#

you pull it down, and press

hybrid spoke
summer scroll
#

the door knob in your eye

quaint mantle
sullen dome
#

idk if that is called knob... translator said so

weak wasp
#

In English it's a door handle, or door latch. Knobs are always round

sullen dome
#

blame google translator lol

hybrid spoke
sullen dome
#

but ty

#

Türschnalle???
never heard that word in my entire life ahahaha

#

i guess google translator is really really bad

hybrid spoke
#

österreichisch

#

for türklinke

weak wasp
#

Honestly i feel like all the translators have degraded over the years. like how?

hybrid spoke
#

deepl is great

sullen dome
#

you weird austrians lol

summer scroll
hybrid spoke
#

what

sullen dome
#

lol

hybrid spoke
#

sounds like a bone or organ

sullen dome
#

osteoporosis is some sickness if i remember correct?

summer scroll
#

yeah lmao

#

i read it like that idk why

sullen dome
#

österreichisch means austrian in german lol

#

nothing with osteowhatever

#

and btw, if i read your name, i always read CodCipher lool

candid galleon
#

it also looks like that packet is only sent when the client right clicks in the air

#

it's not called for actual block placement

ionic reef
#

I'm getting this error when using HikariCP (API for MySQL):

java.lang.Exception: Apparent connection leak detected
        at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:100) ~[?:?]
        at net.geekxboy.apt.Database.isConnected(Database.java:220) ~[?:?]
        at net.geekxboy.apt.Database.query(Database.java:105) ~[?:?]
        at net.geekxboy.apt.MySQLDatabase.isPerkActive(MySQLDatabase.java:204) ~[?:?]
        at net.geekxboy.apt.PermTimer$1.run(PermTimer.java:196) ~[?:?]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.17.jar:git-Paper-46]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.17.jar:git-Paper-46]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1488) ~[patched_1.17.jar:git-Paper-46]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:477) ~[patched_1.17.jar:git-Paper-46]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1404) ~[patched_1.17.jar:git-Paper-46]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1180) ~[patched_1.17.jar:git-Paper-46]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[patched_1.17.jar:git-Paper-46]
        at java.lang.Thread.run(Thread.java:831) [?:?]```
 

Method that is erroring is: (on return dataSource.getConnection();)
```java
public Connection getConnection() {
        try {
            return dataSource.getConnection();
        } catch (SQLException e) {
            e.printStackTrace();
        }

        return null;
    }```
and I have these checks when I definite dataSource:
#

theres no errors, it prints is VALID

quaint mantle
#

well because it is valid

#

but you're leaking connections

ionic reef
#

oh also should probs mention

#

it spams that error

#

until the server dies

#

but its weird, because getting the connection gives that error

quaint mantle
#

probably because you've incorrectly configured hikari is why it spams

eternal night
#

Are you closing the connections after you are done with them

quaint mantle
#

doubt it

ionic reef
#

        config.setJdbcUrl(jdbcURL);

        config.setUsername(username);
        config.setPassword(password);

        config.setLeakDetectionThreshold(10000);
        config.setMaximumPoolSize(100);```
eternal night
#

Yeah seems like you are exhausting the pool

quaint mantle
#

seems to not fully understand what is happening with mysql pooling

ionic reef
#
        if (isConnected()) {
            Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
                @Override
                public void run() {
                    try {
                        preparedStatement.execute();
                        preparedStatement.getConnection().close();
                    } catch (SQLException e) {
                        e.printStackTrace();
                    }
                }
            });
        }
    }```
#

i am closing

quaint mantle
#

ohboy

ionic reef
#

Also there is this method, which may also be causing some form of issue

        if (isConnected()) {
            FutureTask<ResultSet> task = new FutureTask<>(() -> {
                return preparedStatement.executeQuery();
            });
            
            new Thread(task).start();
            
            try {
                return task.get();
            } catch (InterruptedException e) {
                e.printStackTrace();
            } catch (ExecutionException e) {
                e.printStackTrace();
            }
        }

        return null;
    }```
#

Those 2 methods arent fully mine

quaint mantle
#

i'd hope not cause they are horrible

eternal night
#

try-resource Blocks are crying

quaint mantle
#

the connection is definitely not closing in that execute

#

preparedStatement.getConnection().close();

#

this grabs a completely new one

ionic reef
#

right, wt should it be

quaint mantle
#

closing the actual connection making that prepared statement

#

but you can't do that with the current setup since you async the execute

#

it would close before that runs

eternal night
#

It isn't even async

#

Like

#

You are literally polling the future in the same method you throw it off onto a different thread

ionic reef
#

am a bit confused still sorry

eternal night
#

you should just rethink how your setup works. If those methods arent yours, who coded them and should you be using Smth like this ¯\_(ツ)_/¯

ionic reef
#

I don't know much abbt MySQL so i just need a simple-ish way to fix these messages

eternal night
#

Oooof 😭 the worse kind of updates. Well as of right now, the code does not execute anything off the main thread. While it runs the future on a new thread, Future#get will wait on the main thread until it's done

#

So you aren't gaining much here anyway

#

Concerning you are running a server with this, you might want to spend the time learning how the mysql pool/ it's connections work

ionic reef
#

yeah, i definitely plan to, this is just a plugin to manage some timed-perks & stuff for us which needs to be done ASAP ;/

eternal night
#

Well, an attempt would be to pass the Connection object around to the executor

#

To actively close it once you are done with querying it

#

Like, you are probably using it in some commands or listener

ionic reef
#

Prepare Statement method incase it would help

        try {
            PreparedStatement preparedStatement = getConnection().prepareStatement(query);

            int x = 0;

            if (query.contains("?") && vars.length != 0) {
                for (String var : vars) {
                    x++;
                    preparedStatement.setString(x, var);
                }
            }

            return preparedStatement;
        } catch (SQLException e) {
            e.printStackTrace();
        }

        return null;
    }```
eternal night
#

Oh god

#

So basically where you'd wanna go is whereevrr the getConnection methods are being called

ionic reef
#

right

#

i think i kinda follow?

eternal night
#

In there, after you are done using the result set you close the connection

quaint mantle
#
        ItemStack recipeBook = new ItemStack(Material.WRITTEN_BOOK);
        BookMeta bookMeta = (BookMeta) recipeBook.getItemMeta();

        BaseComponent[] page = new ComponentBuilder("Click me")
                .event(new ClickEvent(ClickEvent.Action.OPEN_URL, "http://spigotmc.org"))
                .event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Go to the spigot website!").create()))
                .create();
        bookMeta.setTitle("TEST");
        bookMeta.setAuthor("HELLO");
        bookMeta.spigot().addPage(page);
        recipeBook.setItemMeta(bookMeta);
        player.openBook(recipeBook);
    }``` Hello when I open book with this code, book looks like
#

how to fix it?

eternal night
#

what version are you using

quaint mantle
#

1.15.R1

#

(1.15.2 spigot)

#

(forked)

sage swift
#

remove parts til it works

eternal night
#

also 1.15.2 is not supported

#

especially not a forked one

#

your fork/old version might just be fucked

quaint mantle
#

omg

#

how to fix my spigot fork?

#

what should I fix

eternal night
#

idk fam 😂 you are on your own pretty much

#

try to re-create this on latest spigot

quaint mantle
eternal night
#

huh ? Just write a simple test plugin for 1.17

#

if this is still an issue, it would have to be fixed by spigot

#

it if isn't you are on your own

tribal holly
#

Hi ! I have a list of object implementing all the same interface and i want from an Enum get the linked Object how can i do this (if you need more detail i can give you)

#

and i wanna for example GodsEnum.ZEUS call Zeus()

#

like GodsEnum.ZEUS.getObject() return new Zeus();

eternal night
#
enum Gods {
  ZEUS(() -> new Zeus());

  private Supplier<God> factory;
  private Gods(final Supplier<God> factory) {
    this.factory = factory;
  }

  public God createGod() {
    this.factory.get();
  }
}
#

could work

tribal holly
#

okay thx i try this

candid galleon
#

if that works ive been overcomplicating it hella

hybrid spoke
loud island
#

it only seems to be used in those code snippets, my best guess is a typo of User

hybrid spoke
#

but i guess the supplier is redundant. you could probably just return new Zeus() and require God as a parameter

hybrid spoke
loud island
#

wdym?

hybrid spoke
#

DUser is just used to transfer datas which belong to the user from or to the database

#

so its a DTO

#

Data-Transfer-Object

loud island
#

I see

#

Thanks for the answer :)

quaint mantle
#

[HELP WITH NMS] 😄 Hello, When I open book with this method, the book looks like picture

        player.getInventory().setItemInMainHand(recipeBook);
        ((CraftPlayer) player).getHandle().openBook(CraftItemStack.asNMSCopy(recipeBook), EnumHand.MAIN_HAND);
        player.getInventory().setItemInMainHand(item);```
#

what is problem?

chrome beacon
#

So the thing is NMS isn't really supported

quaint mantle
#

asMnsCopy(recipeBook).toString works fine

#

and openBook method is of same as mine as 1.16.5 spigot

smoky oak
#

Are you even supposed to be able to read recipe books?

smoky oak
#

in minecraft

#

since you're opening a recipe book as a book

quaint mantle
#

??/

#

nop,,

#

recipeBook is just name xD

chrome beacon
#

It's probably just his variable name

smoky oak
#

ah

candid galleon
#

what's recipeBook?