#development

1 messages · Page 85 of 1

high sigil
#

oh okay

#

worked ty

#

@dusky harness why i can use mini messages

#
    @Override
    public String onRequest(OfflinePlayer player, String identifier) {

        switch (identifier.toLowerCase()) {
            case "prefix":
                Component prefix = MiniMessage.miniMessage().deserialize(configManager.getConfig().getString("general-settings.server-prefix"));
                return prefix;
            case "domain":
                Component domain = MiniMessage.miniMessage().deserialize(configManager.getConfig().getString("general-settings.server-domain"));
                return domain;
            default:
                return null;
        };

    }
dusky harness
broken elbow
orchid otter
#

Is there a way to place a block as a player, in the paper api

torn heart
#

... why?

orchid otter
#

so other plugins handle it how it should be handled (jobs)

#

trying to create the right click harvest mechanic but dont wanna break jobs

dense drift
#

You can try to set the block and fire the BlockPlacsEvent ig

minor summit
#

constructing and calling api events isn't supported simon_peek

orchid otter
#

so im hearing no

orchid otter
#

but didint do mega debugging so not sure if it even gets dispatched etc

dense drift
#

You can see if the plugin provides an api for stuff like custom blocks

torn heart
#

mayhaps

clever ember
#

Can I create a page within the menu or am I forced to create another menu to make the other page?

minor summit
#

what is bro yapping about

orchid otter
dense drift
#

Just call a fake event and call it a day

#

I think the constructor is public anyways

orchid otter
#

I tried that, didint work

dense drift
#

Why? Do you get an error?

thorn thistle
#

hi quick question, im trying to code a scoreboard in my own plugin. I currently face the issue that the custom coded placeholders aren't updating in the scoreboard i made. Do i just have to use the Teams method or is there a different way?

tulip robin
#

Hey so I'm having problems importing the library, here's the rp/dep i use

            <groupId>me.clip</groupId>
            <artifactId>placeholderapi</artifactId>
            <version>2.11.6</version>
            <scope>provided</scope>
        </dependency>
        <repository>
            <id>placeholderapi</id>
            <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
        </repository>
#

the dependency isn't being recognized by my ide, though

dusky harness
#

if the problem is that the text is red, make sure you reload maven (ctrl shift O i think?)
I've seen this issue so many times - IntelliJ really has to fix this

#

if that's not the issue, send the entire pom.xml

tulip robin
#

lmaoo this is rigged i reloaded it earlier but when u did it it reloaded like the god u are

dusky harness
#

🥲

#

yeah I would just go based off the actual maven errors

#

intellij is funky with the red dependencies

sharp hemlock
wild wigeon
#

how to fix this?

package com.sk89q.worldguard.bukkit does not exist

tight junco
#

add worldguard as dependency Thumbs

wild wigeon
tight junco
#

are you sure you're not supposed to do worldguard-bukkit

wild wigeon
#

yes maybe yes

#

1 second

#

Lol that worked but still got this problem
\

pure crater
#

worldguard is the common module

#

worldguard-bukkit is for the Bukkit platform

wild wigeon
pure crater
#

Yes

wild wigeon
wild wigeon
sterile hinge
#

What is this code

wild wigeon
sterile hinge
#

Yes and WG 7 is not WG 6 because code that worked before doesn’t work anymore

wild wigeon
#

i got these 2 errors any one nows how to fix it?
symbol: method getRegionContainer()
location: variable worldGuard of type com.sk89q.worldguard.bukkit.WorldGuardPlugin

and

java: no suitable method found for getApplicableRegions(com.sk89q.worldedit.util.Location)
method com.sk89q.worldguard.protection.managers.RegionManager.getApplicableRegions(com.sk89q.worldedit.math.BlockVector3) is not applicable
(argument mismatch; com.sk89q.worldedit.util.Location cannot be converted to com.sk89q.worldedit.math.BlockVector3)
method com.sk89q.worldguard.protection.managers.RegionManager.getApplicableRegions(com.sk89q.worldguard.protection.regions.ProtectedRegion) is not applicable
(argument mismatch; com.sk89q.worldedit.util.Location cannot be converted to com.sk89q.worldguard.protection.regions.ProtectedRegion)

This one 6 times

dense drift
#

this is the wrong channel to ask for configuration help, stick to #general-plugins @hardy sonnet

prisma briar
#

Yo @scenic vapor the custom UI you made with display entities seems pretty cool, is that open source? I’m interested to do some experiment with it

timid coral
#

Hey does somebody know how i can remove the Armor Tool Infos with Paperspigot 1.21 ?

dense galleon
#

I know that all database operations should be done async to avoid them blocking the main thread, but isn't it a better idea to have startup and shutdown DB operations be on that main thread?

#

Since if something goes wrong on startup, I'd want the server to not start or have a delayed start - while if something's wrong on shutdown, i'd want that shutdown to be delayed too

dense drift
#

For trims, one of the ItemFlags should work.. idk which

timid coral
dense drift
#

What is that?

#

Tool component?

timid coral
#

Leather Boots. I want to remove the "+1 Armor"

dense drift
#

Remove or hide?

#

Remove = remove the attribute
Hide = use ItemFlag#HIDE_ATTRIBUTE

timid coral
#

That doesnt work on 1.21

dense drift
#

Try ItemMeta#setHideAttribute

timid coral
#

Found it

hoary scarab
#

Any reason Inventory.addItem(ItemStack) won't add the full amount of the item anymore?
Example;java Inventory inventory = ...; ItemStack gold = new ItemStack(Material.GOLD_INGOT, 640); inventory.addItem(gold); //Main.getLogger().info("Debug >> "+gold.toString()+": "+inventory.addItem(gold).toString());Seems to only ever place 430 items but when debugging the returned hashmap is empty.

Debug >> ItemStack{GOLD_INGOT x 640}: {}

#

This case should return 64 gold in the returned hashmap...

tight junco
#

the return for add item has always been really strange to memory

dense drift
#

Do you add the items twice, one before the debug and inside the debug?

dense galleon
#

Has anyone made an annotation processor for a paper plugin before? I don't understand if it should be in a separate sub project or if it should be in the same project.

sterile hinge
#

What is your understanding of project

#

But typically APs are separate modules

dense galleon
#

Yeah I meant sub-modules

#

What I am struggling to understand though is how I can get the annotation processor to work

#

Do I need to have the annotations in that same module?

#

So I'd have an annotation processor class, and the annotations that it should be responsible for?

#

And then I add that sub-project as an annotation processor, in the dependency block of my build.gradle?

sterile hinge
#

That’s where it gets tricky, you most likely want to have the annotation as a dependency of both the normal module and the AP

dense galleon
#

Yeah exactly that is what I was struggling with

#

The thing is that, the annotation also uses an object of type DataType

#

Which I need both in my annotation and my plugin

#

But it's related to SQL operations, it's weird to have it in the annotation module

sterile hinge
#

If it is closely related to the annotation, it‘s not that weird

#

And if it isn’t closely related to the annotation, the annotation shouldn’t use it

dense galleon
#

So:
AP would depend on annotation
plugin would depend on AP?

#

Or annotation and AP

dense galleon
hoary scarab
#

But no I just put the debug line there to show an example.

dense drift
#

I think that addItem mutates the stack, I remember having an issue with a give-all plugin because I didn't clone the stack before giving it.

prisma briar
scenic vapor
#

there's quite a few features that I would love to implement

prisma briar
#

So I saw that you hover with cursor? I'm not really sure.

scenic vapor
#

the movement is calculated by player's yaw & pitch

prisma briar
#

So the top left display that you show is just a display entity placed really far away from player so it looks like a notification popped up?

scenic vapor
#

it is 1 block away

#

the display is just scaled down

prisma briar
#

Like what if I want to make it so there will be several buttons, whether to accept or deny the invitation?

prisma briar
scenic vapor
#

this is the reason

#

am planning adding Zooming tho

#

so you can zoom in/out

prisma briar
scenic vapor
#

I mean it can be pretty great if you wont have like whole screen UIs

#

otherwise it is gonna look like this

#

FOV just breaks whole scaling

prisma briar
# scenic vapor

Yeah I saw that too, so those are one display entity as the base and there are gonna be another 5 display entity as a button, correct?

scenic vapor
#

basically ye

#

this is the current API

#

am using resolution of 1920 x 1024

prisma briar
scenic vapor
#

no

prisma briar
# scenic vapor no

That's pretty cool, for interacting do you use ray trace on click or just use PlayerInteractEntityEvent?

torn heart
torn heart
#

he can just compare mouse cursor position

scenic vapor
#

just import a custom font into RP

#

and set the font using Minimessage

#

into a text display

#

lol

scenic vapor
#

ye

prisma briar
#

Ah, because he has that system already.

torn heart
#

cause no anchor

scenic vapor
#

what

torn heart
#

what part is unclear

scenic vapor
#

why would it have issues

torn heart
#

if you show elements with text displays and you decrease FOV then wouldn't some stuff be cut off

scenic vapor
#

you can left/center/right align it

scenic vapor
#

the FOV does not change size of text

torn heart
scenic vapor
#

no it is text display

torn heart
#

how do you align text displays to screen space

scenic vapor
torn heart
#

how does that work if text displays are entities in the world

scenic vapor
#

what? 😄

torn heart
#

Can you show a picture?

scenic vapor
#

I dont have it ingame currently

torn heart
scenic vapor
#

item displays are entities in the world as well

#

I dont get you o-o

torn heart
#

yea and they're not aligned to screen space

#

they don't scale with FOV

scenic vapor
#

yea

#

uhm

torn heart
#

they get cut off if you make your FOV smaller

scenic vapor
#

but am using item displays o-o

torn heart
scenic vapor
#

yea

#

well I dont want to use shaders sooo

torn heart
#

so how would text displays solve that issue

scenic vapor
#

Oh Ive misread I guess

#

for some reason I thought that someone is talking about Font generation xD

#

Ive just misunderstood

#

it is almost 1AM, sorryyy

torn heart
#

ah 😭. I was saying you could just recreate cursor and all the other GUI stuff with action/bossbar custom font stuff, and that wouldn't break with FOV or GUI scale

scenic vapor
#

yeaaa but

#

I dont really want to use shaders

#

and

torn heart
#

u don't need shaders

#

tho

scenic vapor
#

well uhm

#

RIP performance then?

#

xD

torn heart
#

they're jus different solutions ig

#

item displays have 3d capabilities

#

id recommend u capitalize on those

scenic vapor
#

and also how would you handle different resolutions

#

it would still cause some issues

#

but it is surely still better

#

however

#

having a pixel generated for 1024 different Y levels

torn heart
torn heart
scenic vapor
#

why cursor

#

u still need to handle the UI

#

how would you fix the rest?

torn heart
#

well you don't really need the other elements to move do you?

scenic vapor
#

now am confused again

#

I do want to move w them

#

and also

torn heart
#

well unless they're moving dynamic ally all over the screen all the time, you only need to generate fonts for a few possible y levels

scenic vapor
#

if I would use the actionbar & such

#

the UI scaling would break it

torn heart
#

you mean like the anchor point would look weird?

scenic vapor
#

well

#

UI scale would also zoom into the UI overall

#

if actionbar would be used

torn heart
#

you'd probably want that though. that's like the reason the setting exists if I'm understanding you right

scenic vapor
#

that would not work tho

#

bcs

#

you dont know the UI scale of player

#

the math would be off

#

imagine generating 1024 y levels

#

for each height right

#

but player would be able to see just 600 pixels

torn heart
#

you don't need to though. the elements only need to have the right position relative to themselves. it would be really weird if GUI scale didn't scale those properly

scenic vapor
#

what o-o

torn heart
scenic vapor
#

just a random number

torn heart
#

and why 1024 then

scenic vapor
#

Ive just calculated it ingame

#

but as mentioned

#

you need to generate each pixel for Y level

torn heart
#

why

scenic vapor
#

for the movement

torn heart
#

for the movement of the cursor yea

#

why anything else

#

you don't need to draw the UIs dynamically, use sprites

scenic vapor
#

bcs why would you handle the cursor w actionbar and the rest w displays?

#

well no

#

people do not know how to use them

torn heart
scenic vapor
#

and

#

I want to support scrolling

#

scaling

#

animations

#

& such

torn heart
torn heart
#

that's the big one

scenic vapor
#

yea

#

but ye

#

still

#

if you would change scale of ur UI

#

its gonna break completely

torn heart
#

Im gonna test that cause I'm not sure

scenic vapor
#

I am sure

torn heart
#

I feel like the relative positions of the elements to each other should stay the same

scenic vapor
#

when you scale up ur UI

#

then also ur chat, actionbar, etc. scales up

#

including sprites

torn heart
#

yea but their distances get nudged to match

#

Sec

prisma briar
#

@scenic vapor Is it possible to make the background of the display entity visible at all times? For example if I set the width and height to 1920x1024 then I want the black background to be visible even if there's no text?

scenic vapor
#

am using item displays for that

prisma briar
torn heart
#

you spawn an item display.

#

and have it be of a certain item model

prisma briar
#

Like make the item larger but don't show anything?

scenic vapor
#

yea

#

the showcased stuff is done using resource pack

torn heart
scenic vapor
#

using pixels

#

it is doable

#

theres unicode char for the square

#

just upsale it

#

remove BG

torn heart
#

okay, how else you would reasonably do that

scenic vapor
#

xDDD

torn heart
#

lmao

scenic vapor
#

no idea but it is doable xD

prisma briar
torn heart
#

the thing at the bottom is 2 different characters

#

they stay together throughout

#

so i'd assume there wouldn't be problems with ui stuff in that way

#

the anchoring is what might cause a problem

scenic vapor
#

what?

#

I dont see anything o-o

#

or do you mean that

scenic vapor
#

which changes the resolution then

torn heart
torn heart
#

it's rendered exactly the same

#

ohhh well yea that would be weird with the cursor

scenic vapor
hoary scarab
scenic vapor
#

so I guess thats why am having issues w giveall in my plugin

#

xDDD

#

well lets fix that I guess

scenic vapor
#

Ive had some issues with giving as well

#

bcs Ive had stacks of 100 items

#

instead of 64

#

maybe it could be somehow bugging out?

#

if you want to give the 10 stacks

#

try to just separate the ItemStack into the stacks

#

and give it like one by one

#

however ye the latest changes in 1.21 are pretty buggy

#

as well in papermc

#

for example item flags do not work to me till now

timid coral
#

Does anyone here know how I can create a sidebar display board with packages for Minecraft version 1.21.1? I don't know how to do that with this version. I last did it in 1.16.5

scenic vapor
#

using packets?

tight junco
#

packets aren't really necessary for scoreboards

cloud panther
#

Holographic displays, i have a visual timer, but everytime i call "updateHologram" method, it seems to be effecting the server performance. Is there a performance friendly way to update the hologram?

scenic vapor
#

I dont think that this is the correct place to ask that tbh

#

I would recommend using a custom system for holos I guess?

cloud panther
#

alright

#

well thank you i guess

scenic vapor
cloud panther
#

java

scenic vapor
#

oh well rip then

#

I wanted to tell u to try using my lib

#

Ive got packet based holograms there

#

w view conditions, conditional lines and animated lines

cloud panther
#

😭

scenic vapor
#

but it is in Kotlin

#

so it may be confusing to u

#

if you dont understand kotlin

#

I dont have docs done for it yet

#

you can see the holo here

#

(Ive been showcasing animated UIs in the video, so ignore that kek )

cloud panther
#

that looks awesome

scenic vapor
#

it is not handled Async yet tho

#

however thats not gonna be too hard

dense drift
scenic vapor
#

wrapped string/json

#

used to support Minimessage in spigot plugin

dense drift
scenic vapor
#

so I can use the kyori component in entity names, inventory titles, itemstack, etc.

#

Spigot rules are spigot rules

#

welp

tight junco
#

surely it interops with java fine though

scenic vapor
#

huh?

#

you mean the lib?

tight junco
#

yeah i understand what you mean though

scenic vapor
#

well not all the stuff tho

#

bcs

#

Ive got some serializers there right

#

that are using reified keyword

#

which is not supported in java

#

am trying to make it work in java tho

dense drift
#

Is it not compiled to something like reified0?

scenic vapor
#

I have no idea tbh

#

I havent checked it

#

however the methods w reified are not visible in java

#

and u cannot use them basically

dense drift
#

ah I see, i thought you meant the name is reified

scenic vapor
#

nah

#

am using <reified T>

#

am also working on a system that automatically generates ingame editors

#

will be painful ngl

dusty frost
#

what kinda serializers do you need reified generics for lol

scenic vapor
tight junco
#

ingame editors Aware

scenic vapor
dusty frost
#

not like kotlinx.serialization?

scenic vapor
#

no

#

like serialization from FileCOnfiguration, etc.

#

I basically got a system for Prices

#

Actions

#

Requirements

#

etc.

#

however instead of binding it all to Player

#

Ive got <T> to set the binder type

dusty frost
#

oh I just use Hoplite for that, super easy, just make kotlin data classes and it fills it in

scenic vapor
#

Uhm

#

no not certainly useful to me

#

I dont need data classes

dusty frost
#

yea?

#

you're saving shit to flatfile? lmao

scenic vapor
#

ccshrug basically that

dusty frost
#

yeah I mean that just seems like a very manual config setup lol

#

data classes can have methods and stuff, you know

scenic vapor
#

yea but I dont get why I should use the Hoplite lib hahah

#

Ive just got a generic actions class

#

that can have different binders

dusty frost
#

cause you don't need to write the serialization logic

#

you just make an object hierarchy and it knows how to map stuff

#

best thing i've ever used for config stuff

scenic vapor
#

how would that handle polymorphysm tho

dusty frost
#

polymorphism in what way

scenic vapor
#

well uhm

dusty frost
#

if you have different options, you can use sealed classes as sum types to have it pick one or the other

scenic vapor
#

it is an action in meaning of being able to send actions when you do something ingame

dusty frost
#

so yeah you'd just have like a List<Action> and it would match any of them depending on the structure of the data

#

or i think you can use a discriminant string

scenic vapor
#

interesting

dusty frost
#

yeah i use it for a custom block plugin, so you can either have noteblock blocks or like regular minecraft blocks

#

and it knows which is which based on the fields, like a noteblock one has a note and instrument field, and a normal one has a material field

#

that's my whole config class

#

and then it can load it from any json, yaml, hocon, toml, etc. file you give it

scenic vapor
#

interesting, however I may not be able to use it anyways as I wanna make it so it generates the ingame editor automatically

#

😅

dusty frost
#

how would it not be able to generate the ingame editor

pulsar ferry
#

Kotlinx.serialization is so good

dusty frost
#

it literally just gives you kotlin classes lol

scenic vapor
#

am using custom class that handles the editing and the real value

dusty frost
#

okay, so make your custom classes with the classes that this binds for you

#

you can exclude fields and stuff too iirc, so you can just use that as your wrapper class

dusty frost
#

ah, always hated ingame editors

scenic vapor
#

ye same here

#

but like my customers do request it a lot

#

and my plugin is already quite advanced

dusty frost
#

yeah i mean obviously not for this kinda stuff

#

but if you ever want a simple configuration loader, hoplite is as good as it gets

#

the most declarative you could possibly be lol

scenic vapor
#

interesting lib, ty for sharing B)

pulsar ferry
#

I have a really neat config system in a project I'm working on, basically you do something like

@Serializable
data class MyConfig(val name: String)

Then all you need to do to load it is

val config: MyConfig by config("/path")

I don't care about editing it at runtime, just reading so didn't add much more, but could easily be done in a neat way

dusty frost
#

yeah that's pretty much hoplite lol

dense drift
#

Ah it seems like it is just a class/interface that overrides an operator

pulsar ferry
#

It's a property delegate, basically contains operator function getValue and/or setValue, once you use it it's the same as calling the method but you don't need to reference it
Easiest way which is the way I'm doing is to just use a lazy wrapper around it

dense drift
#

Cool

hoary scarab
# scenic vapor is that 1.21?

Yes it is (1.21.1). And I was trying to limit how many times I use the addItem method because it takes a lot based on profilers.

scenic vapor
#

there's still quite a lot of bugs on 1.21.1 from my experience

hoary scarab
#

Yeah might just have to write my own inventory methods anyways. Especially firstEmpty (-1 if inventory is full)

icy shadow
#

what's wrong with that?

dense drift
#

Is that not how a lot of things work in general? x.indexOf("Hi") != -1 => x contains Hi
The method always worked like that iirc, if your problem is the -1 for full inv

hoary scarab
#

It's taking a decent percentage per tick when ran alot.

hoary scarab
scenic vapor
#

yea if am not wrong, this content is even used in the packets then

hoary scarab
#

I was only using that method as an example the others aren't great either.

dense drift
#

Doesn't it just check if the item is null or air? What could take so much resources?

scenic vapor
#

ye am actually thinking abt this too

#

lol

#

but ye Yappery mentioned that he uses the method just as an example

hoary scarab
#

^^^

#

Pretty sure it tests for something else too. I'm not currently looking at the code though.

stuck hearth
stuck hearth
#

Like if I wanted to use hocon over yaml, or if yaml there's two node styles for how the config is presented (single line or block indentation)

pulsar ferry
#

I only use hocon but you could easily make it use a different serializer depending on the file extension
As for node style that's all handled by kotlinx serialization

stuck hearth
#

Ah gotcha, I like the default hocon thank you for your service

pulsar ferry
#

I love hocon, been using it for everything

stuck hearth
#

It was the first config I had to use so yaml was quite the downgrade for me

junior shard
#

There any good guides for Brigadier commands with paper?

dusty frost
#

in what way

#

like doing them raw? there are a ton of libraries to make it nicer to use

junior shard
dusty frost
#

commodore like one step above raw, but there are lots of full command frameworks that can do brigadier stuff

dense galleon
#

How do I refresh gradle dependencies/cache? I deleted the caches file in my .gradle on my macbook, but doing that broke all my projects and I can't get them back on their feet

#

Something about not being able to read workspace metadata

nimble vale
dense galleon
dense galleon
river solstice
dusty frost
dense galleon
dusty frost
#

Oh, then I should probably change the Github README lol

dense galleon
#

I mean at this point I have the whole API memorized, is it a bad idea to just stick to it for the time being

dusty frost
#

cause that link is borked

dense galleon
dusty frost
#

oh I mean if you're already using it then yeah it's no problem

dense galleon
#

I suppose it's not worth learning now is that what you mean

dusty frost
#

Yeah possibly not, idk honestly

spiral prairie
#

LAMP is my favorite as well, going into v4 (iirc) with user feedback, real nice

silk quarry
#

what is the best way i can manage my submodule project? i am making a plugin, which will be supported on multiple platforms (e.g paper, minestom, velocity), i looked into dependency injection using guice but couldn't really understand what that was about

ivory swallow
#

For saving player data should i have a folder and each player with its own json file? Only issue i see is that if i want to add a new value to players it wouldnt update. Like if i have money and xp and then after a week i add gems for example. Is there a way to check if user on join is missing a specific value in this case gems and then automaticly add it

dusty frost
#

I mean, does it even matter if it's missing? Surely you can just add the default value (likely zero) and then add whatever you need and save it and it will override and lazily update

neat pierBOT
ivory swallow
worn jasper
ivory swallow
#

Example a player joins and the json is this

money:
xp:

But after many updates they join back and the default json template is now

money:
xp:
armorlevel:
toollevel:
playtime:
gems:

Want it to see that some are missinge and it puts a default value on

ivory swallow
worn jasper
#

so?

#

ah

#

what library are you using for the json files?

ivory swallow
#

No idea?

#

default idk

worn jasper
#

.-.

ivory swallow
ivory swallow
worn jasper
#

there are so many libraries

#

why are you not using a db though

#

?

ivory swallow
#

Having to make a set and add functions and routes for each value you add gets too much when you have 20+ that needs to be changed

#

It just pain

#

SQLite i beleave

#
  • i cant esely manualy change data
dusty frost
#

I mean yeah, ideally you'd use a database library to make that stuff wayyy easier and just do migrations to get the DB to a known-good state

#

but if you want to do JSON, it should be pretty trivial to just read the data from the file and initialize an object that has all the default values you want, then just immediately save that object

#

that way it overwrites the defaults with anything they have, but also adds whatever it needs

ivory swallow
dusty frost
#

How could there possibly be that many files lol

#

Surely you'd have like one class per table? and then just getters/setters for each thing and a save() method that saves it to the db?

ivory swallow
#

A file for setters and getters and then a parent file for saving that table and then times that with how many tables you got

dusty frost
#

Why a file and then parent file?

#

Or do you mean like a record and then the actual class that handles that table?

#

Also why do you have so many tables, surely you're just storing singular playerdata if you are just putting it all in a JSON file?

ivory swallow
dusty frost
#

Yeah it seems like you might want to learn database fundamentals at some point to best manage your data

#

For now I suppose the JSON thing will work, it's just less than ideal for anything but a single server setup

ivory swallow
#

Just want a clean way of doing it. An example or something

dusty frost
#

I mean it just depends on what databse library you use

#

They all have their nice ways of doing stuff and make it easy to work with

#

But even if you just wanted to use like raw JDBC, it should be pretty simple to make a single classfile that contains instances of the table and has get/save methods

#

And from the sound of it, you could get away with just one table easy peasy

#

Or a manager class + data class combo, also works

split notch
#

Hey guys, I am creating a placeholder expansion in my plugin, which is found successfully ([PlaceholderAPI] Successfully registered expansion) although for example this code:

if (params.startsWith("team_topraidable")) {
                    int copy;

                    try {

                        copy = Integer.parseInt(params.split("team_topraidable")[1]);

                    } catch (Exception e) {
                        return "Error: " + e;
                    }

                    List<PlayerTeam> teams = getInstance().getTeamManager().getTeamSorting().getTeamTopRaidable();

                    if (copy <= teams.size()) {
                        PlayerTeam pt = teams.get(copy - 1);
                        return Config.HOLOGRAM_FTOP_RAIDABLE
                                .replace("%team%", pt.getName())
                                .replace("%number%", String.valueOf(copy))
                                .replace("%raidablepoints%", String.valueOf(pt.getRaidablePoints()));
                    }

                    return Config.HOLOGRAM_EMPTY.replace("%number%", String.valueOf(copy));
                }

Doesn't work when I add a hologram with the line {team_topraidable1} for example, why is this?

#

If you need to see more of my code please let me know

worn jasper
split notch
worn jasper
#

it is normal you can't post images

neat pierBOT
worn jasper
#

^^

split notch
dusky harness
#

in this case it's top_1 not team_topraidable

#

can you show the whole class?

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

dusky harness
#

or

#

what hologram plugin is it?

#

maybe sure you look up how to put PAPI placeholders in there since some plugins do it differently I think

split notch
split notch
dusky harness
#

so it goes %azurite_killstreak_top% for example

split notch
#

oh i thought the identifier was for something else

dusky harness
#

ah

split notch
#

still doesnt seem to work

dusky harness
#

it seems to be {papi: azurite_killstreak_top}

split notch
#

yes! that works, thank you

dusky harness
split notch
#

yeah well, im on legacy and theres not really any supported hologram plugins for legacy

#

thanks for keeping lookout though

ocean raptor
#

for some idiotic reason my delete queries don't work with mariadb driver

#

any idea why that could be?

#

when I execute the same query on heidisql it works without issues

#

at first I though it was related to database encoding and the value stored was an uuid

#

and then I changed it to an auto increment int

#

still the same

#

I debugged everything, from the id to query itself

#

I am stuck with this issue for the last couple days

pulsar ferry
#

Might need to show both the query and the code to execute the query, can't really tell what's going on with just you telling it doesn't work

ocean raptor
#

sure

#
    @Override
    public void removeRefundAsync(int id) {
        EXECUTOR.execute(() -> {
            try (Connection connection = dataSource.getConnection();
                 PreparedStatement statement = connection.prepareStatement(Queries.DELETE.getQuery(refundsTable))) {
                statement.setInt(1, id);
                statement.executeUpdate();
                plugin.getLogger().info(id + "");
                plugin.getLogger().info(Queries.DELETE.getQuery(refundsTable));
            } catch (SQLException e) {
                plugin.getLogger().log(Level.WARNING, "Database thrown an exception!", e);
            }
        });
    }

DELETE("DELETE FROM %s WHERE id = ?;"),
SAVE_REFUND("INSERT INTO %s (issuerStaff, playerName, item, server, time) VALUES (?, ?, ?, ?, NOW());"),
    CREATE_REFUNDS_TABLE("CREATE TABLE IF NOT EXISTS %s" +
            " (id INT AUTO_INCREMENT NOT NULL, issuerStaff varchar(32) NOT NULL, playerName varchar(32) NOT NULL," +
            " item TEXT NOT NULL," +
            " server varchar(64) NOT NULL, time DATETIME NOT NULL, PRIMARY KEY(id));"),
#

and the getQuery method is just:

    public String getQuery(Object... variables) {
        return this.query.formatted(variables);
    }
#

just something I came up with to replace the table name

pulsar ferry
#

Hmm that is a bit odd because it does look fine and should definitely work on mariadb thonk

ocean raptor
#

how do I check if the auto commit is true or not

#

maybe its something related to that or my database

ocean raptor
pulsar ferry
#

SELECT @@autocommit apparently, according to SO

#

Might be worth trying it out on a fresh database as well

ocean raptor
#

it is quite new, actually

#

I created it specifically for this plugin lol

#

on cPanel

#

yeah it seem to be true

#

I tried taking it outside of the try statement, just in case if the connection was closed before the query was actually executed

#

did not solve the issue either

#

solved, it was infact an idiotic thing

pulsar ferry
#

What was it?

ocean raptor
#

well

#

prefer to not say it kinda idiotic

pulsar ferry
#

It's fine we all do idiotic things, just curious ;p

ocean raptor
#

I have another table for logging the refunds, which has the same schema with the refunds table

#

remember the getQuery method? I passed the refundsTable variable instead of the logsTable

#

lmao

pulsar ferry
#

Oh I see, honestly understandable mistake

ocean raptor
#

I can't believe this is what I've been stuck with this for days sadblob

river solstice
#

sometimes to solve a problem you need to ask someone about it

#

and you usually find the problem yourself

#

happened to me like 90% of the times when Im stuck with something lol

spiral prairie
#

For that exact reason I have a Sherlock Holmes rubber ducky beside my table

shell frost
#

Good day, I am faced with a problem that when you make more than 100 different menus, they begin to replace each other, that is, if I make 101 menus, the menu that already existed will be replaced with menu_title: 'Default Menu', what to do with this and how return my menus????

worn jasper
#

this is for development

#

or am I misunderstanding and this is not a DM issue?

#

your sentence kinda hard to understand

shell frost
shell frost
worn jasper
neon pewter
#

hmm, for some reason all my variable is parse as void?
the code itself

            float spriteWidth = sprites.loadWidth() * ratioX;
            float spriteHeight = sprites.loadHeight() * ratioY;
            int id = sprites.loadTexId();

            Vector2f[] texCoord = sprites.loadTexCrd();

            ImGui.pushID(i);

            if (ImGui.imageButton(id, spriteWidth, spriteHeight,
                    texCoord[2].x, texCoord[0].y,
                    texCoord[0].x, texCoord[2].y
            )
            ) {//rest of if statement go here
            }
#

or maybe im interepted it wrong... Just updated the library, probably the function is now void type so the if statement is broken

#

it used to be boolean type to detect when the button is click or not. so I might need to find a new way to check if that button is click

#

Looked into the native code, it seem like this is changed because ImGui already have item check so probably can use that instead

dense galleon
#

if I want to check through code that a player-built structure matches with a template structure I have buit, do I just have to check each block one at a time or is there some other, better way?

dense drift
#

I guess it depends on the size of the building, the check frequency.

dense galleon
#

It's like 5x2x5

#

Nothing massive

#

But generally what's the best approach for small and for big buildings?

icy shadow
#

50 comparisons seems pretty cheap

#

i wouldn't worry about it at this scale

icy shadow
dense galleon
#

How many do you think it would be worth using another approach do you recon

sterile hinge
#

it also depends on whether you have an origin point to check from, or if rotation is allowed, etc

icy shadow
#

but yeah it depends

torn heart
#

I mean you need to do some sort of equality check either way

torpid raft
#

but yeah you'd need to cover a ton of blocks before that becomes worth it

icy shadow
#

but i guess that's easy enough to prevent

torpid raft
#

yeah

neon pewter
#

@dusty frost sorry for the ping but do you know what cause this ? I try generate the wrapper again to try fix it but it no work, so I might want to remove the classpath, since they said it is not needed

dusty frost
#

yeah I mean try removing the classpath stuff

#

But honestly you should be able to generate the wrapper without even running any code in the project

#

so I might recommend just making a new project from scratch, making sure gradle is all setup, and then porting over your existing lwjgl stuff

neon pewter
#

i see, does pushing from the new project to github sstill work normally ?

dusty frost
#

uh I mean if you set the git remote to that and just fully recreate, yeah

#

might just be worth it to make a new git project honestly

neon pewter
#

it a bit complicated since I also have other contributor so I might go to that if makeing new local project not work

neon pewter
hollow surge
#

does anyone know why the placeholderapi dependency errors out?

#

i have never used tweaked the pom.xml before so im kinda new to this stuff

#

it says the dependency me.clip:placeholderapi:2.11.6 not found

#

nvm i forgot to refresh maven haha

west socket
#

Do any opensource alternatives to model engine exist?

#

I want to see examples of how the bbmodel file format is parsed and implemented

proud pebble
#

trying to implement a hologram that will follow the player, pointing towards a location if you follow it

#

i know theres some mathematically way to do it im just confusing myself when trying to figure out how exactly to do that

dusky harness
#

like how does it point?

proud pebble
#

its not a physically arrow or anything

dusky harness
#

oh that appears like x blocks away from the player?

proud pebble
#

player is at 60, 60, destination is 0,0. hologram is like 4 or 5 blocks away from the player that if you walked towards the hologram itll eventually end you up at the destination

#

but the hologram moves based on where you are

#

so guiding you towards the destination

dusky harness
#

oh you'd also have to find the angle

dusky harness
#

there's probably a much simple way to do this with bukkit vectors

proud pebble
#

found a way to compute an angle thats in the direction of the destination, now just gotta use that to generate a location like 4 blocks away from the player

proud pebble
#

yeah completely out of my depth no idea how to get this shit to work

#

the angle isnt even one that makes sense, its just tiny

#

testloc is 50.5, 76 50.5

#

like from googling ive got the info that i need an angle thats between 180 and -180 and then do some rotation matrix shit to rotate a point that like 4 blocks away from the player around the player by the angle that the atan2 thing is supposed to generate and then itll give me a location that is between the player and the destination location

dusky harness
#

no matrix stuff

#

hold on

proud pebble
dusky harness
#

at least more complex than my current level of knowledge

#

🥲

proud pebble
#

like ive been sat here for like 3 hours trying to come up with some sort of solution that i can break down and turn into code

#

like a method for it

dusky harness
#

tbh should ask chatgpt

#

or if you wait a bit I might be able to make some psuedocode-ish

proud pebble
#

hmm, both circles would always collide in the same point if both circle sizes were A in radius

dusky harness
#

maybe?

proud pebble
#

ahh i reversed it

dusky harness
#

oh wait and add player loc
there we go

proud pebble
#

atan2 seems to range between 0 and 3, both negatives of the same aswell which is weird

dusky harness
#

(pi = 3.1415....)

proud pebble
dusky harness
#

idk

#

confus

torn heart
#

you can just get the difference vector and normalize it to those blocks

torn heart
#

there is absolutely no need for trig

#

why yall overcomplicating it 😭

torn heart
#

you're just trying to get a point 4-5 blocks away from player in the same direction as a destination right?

#

there is no need for rotations here

dusky harness
#

yeah I knew it was gonna be simple :/

#

welp

torn heart
#

the way luna started looking up rotation matrices is quite funny

#

please read more math 🙏, and how it's actually applied

#

and stuff with vectors is really quite simple if you avoid matrices

torn heart
#

oh and btw id recommed not using bukkt vectors

#

joml vectors are superior in every way

stuck hearth
#

Should've used display entities

#

Oh it's less a hologram than I thought

neon pewter
left panther
#

Hello

proud pebble
#

i spent way too long trying to come up with a way to get it to work

#

also i read that the distance method doesnt work at long distances

torn heart
#

30 seconds of programming

torn heart
# torn heart what

do you understand how the distance method works 😭??? unless you're making a Minecraft map bigger than billions of blocks you'll be fine

#

it's literally just Pythagorean theorem

torn heart
#

sorry for the ping

#

and even then you shouldn't be using trig @proud pebble 😭

dusky harness
dusky harness
sharp hemlock
#

extendedclip clip repo down?

true peak
#

for me too

#

Unable to download anything

rocky raft
#

Repo down...

robust crow
prisma briar
#

Damn. I was going insane, so this explained it.

trail mulch
#

same

dense drift
west basalt
dense drift
#

Would be nice 🙂 and don't ping staff members for help, just wait

chilly timber
#

Hi! I need some help with a plugin I'm making.
I've made a bleeding system where there is a chance of start bleeding if you get hurt, and you'll need to heal with a bandage (custom peace of paper), very simple

#

The problem is that I can't make it work well the healing part, sometimes it doesn't heal when you "bleed" even if it says it does

#

Video in

stuck hearth
#

code?

chilly timber
#

Yes, on my way

#

Im making the video, and will post my repo

#

huh cant upload video?

pulsar ferry
#

?imgur

neat pierBOT
#
FAQ Answer:

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.

pulsar ferry
#

Same for videos

#

You can upload the video to imgur or something like streamable

chilly timber
#

Fine

chilly timber
#

Video

proud pebble
# torn heart how

it took me so long cus i didnt know what steps to take to get it done

dusky harness
#

ex in the map it should be Map<UUID, BukkitTask>

#

also when the player takes damage, it seems like the code doesn't check if the player is already bleeding

#

so you should either check or cancel the previous task, since right now, it just replaces the previous task in the map without cancelling it

proud pebble
#

like my thinking was get an angle off the player's coords and the target location and then transform the players location 3-4 blocks in that direction

#

just getting the distance doesnt give an angle

#

the angle isnt based on the player's looking direction either

#

also its been a while since i played with vectors and programming as a whole really as ive not touched any of my projects in months so im a bit rusty and trying to come up with how to approach something i know very little about isnt gunna be a fast process

chilly timber
#

Yes i believed that was the issue

#

But didn't know how to manage it

dusky harness
#

inside the map

#

or multimap etc

chilly timber
#

Well my main idea is not to accumulate

dusky harness
#

oh

chilly timber
#

But thats what is happening right now

#

Hence im opening tasks and tasks and cant instanciate them

#

I see then

#

Will try to modify it

#

Thanks!

elder topaz
#

or use what Map#put returns; it returns the previous value of given key or null if none

#

so
var oldTask = map.put(player, task);
if(oldTask != null) {
oldTask.cancel();
}

chilly timber
#

Well everything implemented

#

what you both have said

#

Now will see if it works

#

Looks like it works now

#

Thanks!

torn heart
torn heart
torn heart
chilly timber
#

So officially

#

I finished my plugin

#

hehe

torn heart
#

nice!

woven turret
reef rivet
#

yes

#

has been for many hours now

sharp hemlock
#

for nearly a day

woven turret
#

i guess that's why ive been trying to compile my plugin for few hours

#

thinking something wrong with my plugin

#

ahh dammit

prisma briar
#

@scenic vapor can i get your resource pack that has 1920x1080 dimensions for item please please? i'm experimenting with display entity and wanted to achieve what you had before, which is the large background shadow.

scenic vapor
#

it really is not affected by resource pack

#

Ive only got 2D items imported that got 16x16 ingame pixels

prisma briar
scenic vapor
#

no I just set scale of the item display

#

and the texture resolution is 512 for example

#

so to reach 1920 you need to use 8 items in total

#

due to resource pack limitations

prisma briar
shell moon
#

Hellow, someone knows how to create this item using NBTAPI?
/give @p nether_star[attribute_modifiers=[{id:"scale",type:"generic.scale",amount:0.2,operation:"add_value"}]] 1
I don't mean using spigot api like setAttributeModifiers and a map with Attribute.GENERIC_SCALE
I mean, make it manually using NBTAPI methods like setString etc

dense drift
#

attribute_modifiers is a compound list I guess

worn jasper
#

mine is just a 1920x1080 png xd

#

Pros and cons of item displays vs text displays I guess

worn jasper
#

might involve more math to properly set coords since item displays the coords are the center in both x and y

#

while in text displays it is the bottom center

#

#showcase message for ex. is one 1920x1080 text display for background and 2 others for the cards

#

So basically, you either go with item displays which are easier to use because of custom model data, but require extra work for the textures themselves, since item textures NEED to be a square. Or you go with text displays which you have to do some extra math and extra work to define each texture's unicode but at least have the freedom with resolutions

#

Both choices work, and are up to preference.

shell moon
frosty prairie
#

Hi guys!
Is anyone of you having issues while running "mvn package" on IntelliJ IDEA?

Basically the repo.extendedclick.com website is down, so i'm getting some errors for that.
I'm basically stuck on this issue and idk how to bypass it, can someone help me?

river solstice
#

consider using search regarding an issue

frosty prairie
#

Thank you! 🙏
And sorry, i just joined here so i didn't know

dusky harness
#

If maven previously downloaded the dependencies then offline mode can temporarily fix this issue

frosty prairie
#

Nope, sadly i had some issues before :/ can i tell you on dm?

scenic vapor
#

you cannot have over 512 pixels in a texture

worn jasper
#

in text displays it can be any

#

in item displays, the item texture NEEDS to be a square

#

so 1920x1920 for ex.

#

(part of the item is unconfirmed, I just know it needs to be a square)

torn heart
#

"Glyphs themselves must not be larger than 512x512"

worn jasper
scenic vapor
#

you cannot go over 512

worn jasper
#

welp, it appears that's wrong

scenic vapor
#

you may use Optifine or Iris

#

that ignores that limit

worn jasper
#

cause I am LITERALLY using above 512

scenic vapor
#

otherwise u can't

worn jasper
#

can test it rq

#

1s

#

vanilla

torn heart
# worn jasper

so are you just displaying this big image as a glyph in a bitmap, mapping it to a character?

scenic vapor
#

I've been working w Custom UIs using glyphs for quite long

#

and there was always the limit

#

o-o

worn jasper
#

1s

#

opening vanilla and starting server

#

gonna test it

scenic vapor
#

do you like have a pixel texture

#

and then render whole image using it?

#

or do you have over 512 pixels big texture in the resource pack

worn jasper
#
  1. option
torn heart
#

huh

scenic vapor
#

that's strange lol

#

that literally shouldn't work

torn heart
#

could you send the resourcepack that's letting u do that then

scenic vapor
#

yea xD

torn heart
#

maybe it got updated recently?

scenic vapor
#

i don't know tbh

#

but

#

i haven't read any changes regarding that

worn jasper
#

hmm think you are right

scenic vapor
#

I've also sesrched it up on the internet

worn jasper
#

vanilla is not showing anything

#

unless texturepack not activated

#

1s

torn heart
#

yeaaa that would make sense

scenic vapor
#

ffs

#

xD

torn heart
#

o

worn jasper
#

resourcepack was not loaded lol

#

let me see

scenic vapor
#

it won't load the pack

#

bcs of the error

#

if am not wrong

#

it fails loading the image

worn jasper
#

it did load

scenic vapor
#

oh

worn jasper
#

the resourcepack

torn heart
#

does it work

worn jasper
#

the image is not showing though

scenic vapor
#

ah ye

#

well

worn jasper
#

got baited

scenic vapor
#

sad news 😦

worn jasper
#

papermc people stupid

#

lol

scenic vapor
#

xD

torn heart
#

😭

worn jasper
#

they told me there was no limit

#

lol

scenic vapor
#

it requires optifine

worn jasper
#

not using optifine

#

but yes, sodium, etc.

scenic vapor
#

well it requires optifine to have higher resolution

worn jasper
#

tbf, most people nowadays do use an optifine, etc.

#

wait what

#

how am I 2x in the game

#

LMAO

#

minestom moment

#

Ah Auth is not on

#

wait a sec, how did that one guy do it...

#

1s

torn heart
#

like they are in their player but have absolutely no control

worn jasper
#

uh wut

torn heart
#

in any capacity. was very interesting

worn jasper
#

weird

#

so literally freeze them

scenic vapor
worn jasper
#

xd

pulsar ferry
worn jasper
#

Oh welp

worn jasper
pulsar ferry
#

You'd be surprised the amount of people that play vanilla

scenic vapor
#

yea

torn heart
#

let's start a statistical debate based on no statistical evidence

worn jasper
#

minecraft is quite literally unplayable without it, from polls servers I worked at did, over 90% was using them

scenic vapor
#

and most of servers do hope that they are using vanilla

#

bcs iris breaks the server shaders

worn jasper
#

not just vanilla

pulsar ferry
#

We had stats but I don't remember so I won't say anything but from people joining island (many many thousands) the percentage of players on optifine was very small

torn heart
pulsar ferry
#

And the amount of work I had to do to support optifine because it doesn't render components correctly

worn jasper
#

yeah ^^

torn heart
#

or just like a general "non vanilla"

pulsar ferry
#

Including fabric it is higher but vanilla is still the most used

torn heart
#

cause optifine itself is just falling out of favor for new versions

pulsar ferry
#

All components

worn jasper
#

how did u add support?

#

aren't components a vanilla thing?

torn heart
#

it would definitely vary a lot with what your audience is

pulsar ferry
#

Font shenanigans

worn jasper
#

although tbf, audience I am targetting is a more casual one

#

sooo....

pulsar ferry
torn heart
pulsar ferry
#

does not apply to other performance mods, optifine only

#

Also lunar client used to completely fuck anything related to text because they also messed up how components are rendered

torn heart
worn jasper
#

Eh either way, it's no biggy if textures 1920x1080 don't render, luckly I have made the system easy enough to use that splitting that screen into several 512x512 is no big deal

torn heart
#

yes lunar and badlion hwk break a lot

worn jasper
#

I am not doing an smp

pulsar ferry
#

We had a lunar dev join island during dev time to work on fixing the component rendering omega_lul

worn jasper
#

in lunar I assume?

pulsar ferry
#

Yeah

scenic vapor
#

omg

#

barry

#

lemme back

#

be

worn jasper
#

larkyy being targeted by barry

#

xd

torn heart
scenic vapor
#

Matt by any chance

#

have you taken a look into optimized world handling?

#

I've tried to actually, because am working on one multi server handling

worn jasper
#

Well using text displays still has that one advantage... resolutions still don't require to be a square

scenic vapor
#

and it has loads of logic with worlds

worn jasper
pulsar ferry
#

I haven't really messed much with world handling, I do think we do stuff with it, but it was another dev

scenic vapor
worn jasper
#

lmao

scenic vapor
#

well I've been thinking Abt copy pasting code from paper

#

and skipping some logic

#

and putting it more into async

#

as much as I can

worn jasper
#

sooooo

#

Might just go and switch to item displays

#

💀

worn jasper
#

a tiny bit better to handle I guess

scenic vapor
#

can you like

#

rotate text displays?

worn jasper
#

in what sense?

scenic vapor
#

around X and Z

torn heart
worn jasper
#

yes

torn heart
#

they're displays

worn jasper
#

item displays can't?

torn heart
#

matrix transformations work on them