#help-development

1 messages Β· Page 910 of 1

quaint mantle
#

let's say

river oracle
#

Basically he just means a minigame should have phases start game play end etc

wet breach
#

technically states are finite to begin with, I mean even infinity in programming is finite

river oracle
#

This is a fundamental approach to minigames

#

And doesn't require any fancy terminology

quaint mantle
#

Each phase can have a million other phases after, depending on what happens

wet breach
quaint mantle
#

wait here hold up

noble lantern
#

oh so an if statement

river oracle
#

I've always been a simple man myself though

noble lantern
#

nah actually function maps are really nice

river oracle
wet breach
quaint mantle
#

Yeah I dont rly have anything else to say

wet breach
#

Lol

surreal hornet
#

You are not a clean code believer

#

Design Patterns: Elements of Reusable Object-Oriented Software and Clean Code, are bible for developers, so yeah finite state machine is a good idea and if your mini game is super complicated you can also go with behavioral pattern

echo basalt
#

yes

wet breach
#

I think it is a bit misleading to say finite state machine

echo basalt
#

I need to rewrite my minigame guide I've changed so much since last time

wet breach
#

because this implies there is infinite, when this isn't the reality

surreal hornet
#

bro stop thats its name lol

echo basalt
#

but yeah you want the uh

#

phase thing

flat olive
undone axleBOT
flat olive
#

I am using it

#

but I dont understand whats wrong in my code

rough ibex
#

Check your type signature.

#

you are using registerNewObjective(String, String, String)

#

you should be using registerNewObjective(String, Criteria, String)

flat olive
#

ah I see

#

🀣

#

thank you

#

I didn't understand how to set that type, never used it before but I see now

rough ibex
#

Criteria is an interface

flat olive
#

Oh I see

rough ibex
rare rover
#

what's the best way of keeping track of fake players on tab?

#

59 should be at 0, 0

#

it goes different places everytime

rough ibex
#

are you using an API

#

or is this in-house

rare rover
#

in-house

#

im keeping track by doing this:

#

although its wonky and is different mostly every time

rough ibex
#

your wacky constructor aside

#

show setSlot

#

and also try to reduce it to a small number - reproduce it more concisely

rare rover
#

and getSlot from column is just grabbing from the map above ^^

rare rover
rough ibex
rare rover
#

ah lol

rough ibex
#

return this? funny business

rare rover
#

could use init {} ig

#

but

#

smhhh

rough ibex
#

yes that is the correct way

rare rover
#

anyways! Yeah idk why its wonky everytime

rough ibex
#

keep in mind HashMap is not ordered

rare rover
#

O

#

that might be why

rough ibex
#

let me 2x check

rare rover
#

although i print them

#

and they are in order

remote swallow
#

hash map is unorder and linked hash map is

rough ibex
#

yeah " This class makes no guarantees as to the order of the map; in particular, it does not guarantee that the order will remain constant over time. "

remote swallow
#

iirc

rare rover
#

printed from the initialize

rough ibex
#

that may be it

rare rover
#

hmm

#

let me try linked hash map

rough ibex
#

I'm only working off of limited info

#

but thats my first thought.

rare rover
#

i can just post my classes if you'd like

rough ibex
#

I'm actually about to sleep

rare rover
#

yeah linked hash map didn't work either 😭

rough ibex
#

but do as you need

rare rover
#

same column and slot but in a different spot

#

does this everytime

#

let me just post on github

#

ig

#

there ya go

tepid acorn
#

Hello, how exactly does the bungeecord proxyproto listener work?

#

Im sending headers at the start of the connection and ive verified with other libraries it gets recognized as a valid proxyproto connection but when i try proxying a bungee it doesnt accept the connection

#

Nvm

#

im dumb

plucky rock
#

can somone give me a semi challenging beginner project for plugin dev

#

idk what to do

native ruin
rough ibex
#

Markdown processor

#

for chat

plucky rock
#

cool ty

undone summit
#

ikr

inner mulch
#

Yes

dire marsh
#

kotlin is alright if you're not using bukkit and you aren't making a library/api

#

its obsession with preventing nulls makes it very ugly for bukkit dev imo

inner mulch
#

Whats so bad about null? 1 null check and its fine or why does kotlin do this?

rough drift
#

I'm trying to do proper API design and one thing I'm doing is separating the API from the implementation using maven modules, now the implementation depends on the API, but how do I make plugins actually call my implementation? i.e. if I have a class GreetingGetter with a method getGreeting how do I redirect getGreeting to GreetingGetterImplementation

mortal hare
#

wow what a nice vanilla mc terrain

lost matrix
rough drift
#

A Gateway?

lost matrix
#
GrassGetter someImpl = FloraLib.getGrassGetter();

Where FloraLib is your gateway. You can simply register implementations in it.
Its the same for PLib. ProtocolManager is an interface and ProtocolLib.getProtocolManager() returns you an impl of ProtocolManager

mortal hare
#

eh i go vault's path

#

and use bukkit's services api

lost matrix
#

This is probably cleaner as it prevents some static fkery

mortal hare
#

same shit, but integrated into bukkit api

#

unless you want your plugin cross platform

rough drift
#

imagine you have

flora-lib-api
flora-lib-impl

modules, how does -api return an implementation?

mortal hare
#

you include implementation in the gradle project for the platform to shade?

lost matrix
#

Someone has to register implementations in FloraLib when the server starts

rough drift
#

AH

#

So just like Bukkit.setServer?

lost matrix
#

Something like that

rough drift
#

Thank you :D It's my first time actually designing something proper lol

lost matrix
rough drift
#

oop thanks!

mortal hare
#

@lost matrix this conversation actually confused a bit, we know the plugins are loaded by separate class loaders, thus no class implementation details cannot be shared

#

how does public api implementation would get exposed to external plugin

#

if its loaded by separate class loader?

lost matrix
#

They all end up on the same classpath. Every implementation is exposed to every plugin on runtime.

mortal hare
#

but doesnt that defeat the whole purpose of a separate class loader for a plugin?

#

i guess separate classloaders are used for not to blow up the server when one plugin's classes fails to load

lost matrix
#

The PluginClassLoader are all parented by the applications class loader

slender elbow
#

while they are separate classloaders, they do perform lookups between each other

twin venture
#

Hi , should i use mongodb for a plugin like this :
2 tables :

  • user : uuid , faction_id , kills , deaths , points
  • faction : faction_id , total_kills, total_wins, total_points
lost matrix
#

Literally could use OrientDB

twin venture
#

alright but what will be better

#

in your opinion?

#

easy to use

lost matrix
#

Whatever you feel confident with

twin venture
#

and less bugs?

#

i used to work with mysql but i think its kind of old , i think iam gonna use mongodb

lost matrix
#

I personally use MongoDB a lot. But only because it suits my design philosophy.
Its not a bad idea to learn new stuff.

inner mulch
#

?paste

undone axleBOT
twin venture
#

alright thanks sir , iam gonna learn it and use it

#

iam working on new plugin , and i want it to be perfect as possible .

twin venture
#

ofc but for now i will stick with mongodb

mortal hare
slender elbow
#

they are not isolated

#

while i don't know for sure, my guess is that the reason they are separate is so if a plugin fails to load, its CL can be closed and whatever is inside it won't affect the rest

glacial narwhal
#

How can i use UTF-8 on my plugin ? i tried this:

tasks.withType(JavaCompile).configureEach {
    options.encoding = 'UTF-8'

    if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
        options.release.set(targetJavaVersion)
    }
}``` and ```gradle
  tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
  }
```but both did not work
rare rover
#

Did you reload gradle, that works for me

glacial narwhal
#

Just reloaded, does not work

rough drift
lost matrix
# glacial narwhal

Try typing something in chat and see if the console picks it up correctly

rough drift
#

^

glacial narwhal
lost matrix
#

Well its your console then

glacial narwhal
#

I'm gonna try something

#

Yeah it works thanks a lot to everyone that helped me!

umbral ridge
#

what is this

#

everything worked fine a month or two ago

#

now when i got back to this project

lost matrix
umbral ridge
#

hm

fallow gyro
#

For the inventory click event here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryClickEvent.html

I'd like to know, when this event is called, if the player clicked an item within the inventory without previously having anything on their cursor, does the getCurrentItem() method return the item in the slot they clicked before the item was taken out of the inventory, or after?

In other words, would this method return null if the player took out an item from the inventory? Thanks

worldly ingot
#

getCurrentItem() gets the item in the slot, yes

#

getCursor() would be null in this case

lost matrix
#

ah

worldly ingot
#

Events are called before actions actually occur, so the actual click hasn't happened yet, but it's about to

fallow gyro
#

Right okay

#

Interesting

#

Thanks a lot then!

worldly ingot
fallow gyro
fallow gyro
worldly ingot
#

Yes

young knoll
#

yes

fallow gyro
#

Lol thanks both!

worldly ingot
#

That inventory is nullable too if they click outside the inventory, so keep that in mind

fallow gyro
#

Oh and thanks again @young knoll for implementing that sign side feature!

fallow gyro
rare rover
#

Got a question for y'all, what would be a good way to store tab slots? My system seems to be way off and inconsistent, each time its in a different spot:

#

technically that should be the top left

lost matrix
rare rover
#

interesting.. So how would i keep track of these?

#

can't think of another way

#

cuz they are seperate classes, each column

lost matrix
#

Fill them all up and map each one to an index

#

I did something similar where i can simply select by row and column after filling all slots

trim lake
#

Hi, I how can get name of yml file? This ios not working for some reason. Why im getting empty string?

System.out.println("Loading pets...");
        File folder = new File(PetsPlugin.getInstance().getName()).getDataFolder() + "/pets");
        File[] listOfFiles = folder.listFiles();
        List<String> pets = new ArrayList<>();
        for (File listedFile : listOfFiles)  {
            if (!listedFile.getName().endsWith("yml")) continue;
            YamlConfiguration yamlFile = new YamlConfiguration();
            yamlFile.load(listedFile);
            System.out.println("listedFile " + listedFile);
            System.out.println("yamlFile " + yamlFile);
            System.out.println("yamlFile " + yamlFile.getName());
rare rover
#

just grab all of them and use a TreeMap? Or what

young knoll
lost matrix
rare rover
#

ohhhhhh

#

legit all of them are named "" πŸ’€

#

i'll figure it out, lots of help though, thank you

young knoll
#

So you could just make the name a number I assume?

rare rover
#

ye, that's what i was thinking

#

🀞

trim lake
# young knoll listedFile.getName in this case

why is there optiopn from yamlFile.getName() than lol. Im just sending to another class only yamlFile to get only string like suckAcoolName.yml and thats not possible fuck.. I will need to work with full path what will listedFile.getName returun. Thanks

young knoll
#

It gets the name of the current section

#

But the root section has no name

trim lake
#

oh, now I get it. I think it will get name of the file... I need in another class only yml file, but first I need to validate if file is yml file, so I will probably validate that and then start working with that. Just send name and yamlFile to next class. Thats will be probably best solution.

#

There is probably no way of getting that file name from YamlConfiguration right?

young knoll
#

no

trim lake
#

nwm than. Thanks a lot. Now it makes sens to me

rare rover
#

hmmm, am i doing something wrong or?

#

wonky numbers but it ain't ordering them?

#

that is displaying its name atm ^

#

OH

#

i'm so dumb

#

nvm

#

πŸ’€

hybrid spoke
#

its ordered πŸ€”

rare rover
#

πŸ’€

#

lmfao

#

is there a way to make the columns fixed, cuz sometimes its 16, sometimes its 20, like bruh

#

its throwing me off

rare rover
#

well wtf

#

it was this earlier:

#

now its this

rare rover
sullen wharf
#

What was EnchantmentWrapper deprecated for?

young knoll
#

Deprecated.
only for backwards compatibility, EnchantmentWrapper is no longer used.

river oracle
sullen wharf
#

So, what's the correct usage now?

river oracle
sullen wharf
#

Yes

river oracle
#

Extending api has never been permitted

#

:P

sullen wharf
#

This code is not mine, don't ask those questions

#

I just need to get it fixed

#

lmfao

young knoll
#

Use pdc

#

Or idk registry hacking

river oracle
#

But to each their own

young knoll
#

Maybe

#

But that's not api

river oracle
river oracle
young knoll
#

smh

lost matrix
#

I would probably also use the pdc. However hacking the registry might come with benefits like automatic support for discovered enchantments.
Drawback: The client wont be able to display the enchantments anyways because it has no translations for that.

sullen wharf
#

Well, fuck me

#

Thanks for the help anyways, going to have a good time making this work again

young knoll
#

Even if it does have translations sadly it won't work afaik

rare rover
#

minecraft tab's are so scuffed why do they change column sizes on me 😭

young knoll
#

Since the client doesn't understand the custom id

onyx fjord
#

how do your register an enchant in 1.20.4?

young knoll
#

Registry hacking

onyx fjord
#

the old method seems to be gone

quaint mantle
#

Hi , anyone can tell me how to fill this ? player.getInventory().setItem(1, );

lost matrix
quaint mantle
lost matrix
# quaint mantle fill after 1

Create a new ItemStack with a Material of your choice:

ItemStack item = new ItemStack(Material.STICK);

And then pass it as the second method parameter.

quaint mantle
#

can i use this ?

lost matrix
#

Sure. But i would recommend you to allocate a new variable instead of inlining it.
Makes it more clear and helps you expand on the code later on.

mortal hare
#

i've never realized how bad brigadier looks until now:

tribal zephyr
#

my eyes

mortal hare
#

ngl mojang's code sometimes looks like yandere dev's

rotund pond
#

Hello guys
I'm looking for a little help about NMS, am I at the right place ?
I saw some topics on spigotmc.org about NMS so I was wondering if I can talk about it here

#

If I'm at the right place, I'm trying to understand what is the method "a" from EntityLiving. I have a problem about this spamming an error in a plugin I don't own, and I'm trying to understand so I can talk with the plugin dev with good informations

eternal oxide
#

?mappings

undone axleBOT
next plume
lost matrix
#

You should use those mappings instead

next plume
rotund pond
#

Exactly :/

#

I'm not trying to modify the plugin, I decompilated the plugin and trying to understand what's the problem so I can give a good feedback to the author

#

I'm wondering if it's legal to decompilate a plugin without modifying it tho πŸ€”

#

Why do I can't find my entity using your mapper ? πŸ€”
I'm looking for "EntityLiving" and there is a "LivingEntity" πŸ€”

chrome beacon
#

Yeah

#

EntityLiving isn't named that in mojmaps

#

LivingEntity would be the mapped name

next plume
#

Spigot calls it EntityLiving
Mojang calls it LivingEntity

rotund pond
#

Oooooh

next plume
#

But it's the same thing

chrome beacon
#

you can modify it for personal use too I believe

next plume
river oracle
next plume
#

You could post the exception message you're getting

rotund pond
#

Tbh I already know what's the problem, I'm just trying to find how
When handling a EntityDamageByEntityEvent, MythicMobs lets Bukkit call the CraftEventFactory#callEvent method recursively (and infinitely)

next plume
#

Is your server version up to date? There were recent changes to those events.

rotund pond
#

(I didn't paste the whole stacktrace, it's litteraly calling himself so...)

next plume
#

Also make sure the plugin is up to date.

rotund pond
#

Ah, thank you for the information, wasn't aware of this

river oracle
#

bless Doc

#

finally I don't have to registry back my own DamageType API πŸ₯²

next plume
#

Start by asking if the plugin version can be used with your server version.

mortal hare
#

ah yes

#

vs code lsp language server

#

using 90% of my 8 core cpu

#

glad i took my headset off

#

my pc sounded like its taking off

river oracle
inner mulch
#

?paste

undone axleBOT
inner mulch
#

what am i doing wrong?

river oracle
#

you don't have a default constructor

#

importantly why are you needing ByteBuddy

inner mulch
#

i dont know redis needs it

#

i didnt do anything regarding bytebuddy

river oracle
#

a default constructor hsa no arguments

inner mulch
#

hows that supposed to work

#

if i need a uuid

river oracle
#

UUID can't be final in this case

#

likely whatever Pojo mapper you are using

#

creates an empty class instance and fills the fields

lost matrix
inner mulch
#

whys that?

river oracle
#

my assumption is the object is being recieved from redis thus the error the POJO mapper can't use his constructor

lost matrix
river oracle
#

ohhh

lost matrix
#

Which was generated using an annotation processor

river oracle
#

they're using ASM

#

interesting

inner mulch
#

if they cant have a constructor, what can they have πŸ˜”

lost matrix
#

They can have a constructor and they dont even need a default no-args constructor.
The problem is that you tried to serialize the object by sending it to some remote collection.
Live objects are auto synchronized between applications, there is no need to put them in a remote collection.

inner mulch
#

i dont put them anywhere

#

this is the only thing and i have one other method that tries to read the data as debug

#

from the objectservice

lost matrix
#

Give me a min

#

First step: Dont use a raw RedisConnection. Use some RedissonClient implementation.

inner mulch
lost matrix
#

Thats a weird name and it shadows redissons internal class. Alright let me check what else it could be.

torn shuttle
#

and here I was trying to avoid turning on the heater but it's just too dang cold, I hate the winter

#

I need to be toasty to do my very important programming work

river oracle
torn shuttle
#

it's 13c rn

#

it's been 21c+ for the last few weeks, it was great

#

and it's not going to warm up, this sucks

river oracle
#

we're having a warm week at its 6c

torn shuttle
#

I am wearing a sleeveless t-shirt right now and I'm going to be forced to actually wear a normal t-shirt

#

sad!

quaint mantle
river oracle
torn shuttle
#

I've been in -32c weather in canada

#

for a year

#

that was fun

river oracle
#

That was probably stupidly dangerous

torn shuttle
#

well you wouldn't be able to anyway since the tears would freeze in your eyes

torn shuttle
#

πŸ₯Ά

lost matrix
#

Hm, this could be a more complicated problem involving spigots classloader.
Try a minimal setup in a normal java application.

torn shuttle
#

I think it should always be 27c

#

everywhere all the time

river oracle
#

27c is too hot

lost matrix
#

Something like 24Β° is better for hiking and cycling. 27 is alread a bit hot.

torn shuttle
#

I love working out at 35c weather

river oracle
#

classic american moment

river oracle
torn shuttle
#

you literally sweat puddles, it feels like you're getting the workout of the century every single time

quaint mantle
torn shuttle
#

I've worked out under a 42c sun before

#

that was hot

#

that was real hot

lost matrix
torn shuttle
#

I mean it's always hot anywhere I go but my surroundings were also hot that time

lost matrix
#

Ill try a simple setup for myself as well. Would be interesting to be able to use them.

mighty gazelle
#

How can I send someone a message with a clickable link?

torn shuttle
#

imo working out is fine up to 40c, after 40c if you're doing it under direct sunlight it does get to be a bit much

torn shuttle
#

but under 20c it's also unpleasant

rotund ravine
#

Bruh complaining about working out under 20c

#

Cold resis -200%

torn shuttle
#

my gym doesn't have heating, cooling and only installed air extractors this year

#

if it's 13c outside it's 13c inside

river oracle
quiet ice
#

18 Β°C is the sweet spot. A bit chilly, but not cold, but it is very far from being hot

rotund ravine
#

Working out in 10-20 is great

quaint mantle
#

Hamedan now is -4C but always snowy :/ i can't go school at all

inner mulch
torn shuttle
#

if you're doing weights and it's 10c in the room you're in you will actually get cold while between sets, it sucks

rotund ravine
#

Just wear some proper clothes smh

#

Also u get used to it after a while

echo basalt
#

my gym runs hot water on every tap which I despise because I can't refill my bottle :/

torn shuttle
#

ah yeah my favorite, putting on a ton of clothes to work out

#

how great, how comfy

echo basalt
#

and they charge like 3 bucks for a water bottle

#

big scam

torn shuttle
quiet ice
#

Monopolies be lies

echo basalt
#

pizza is 5 bucks

#

chicken is 4

torn shuttle
#

just squeeze the juices from the chicken into a water bottle and take the bottle with you to the gym for your preferred hydration method

#

I've never refilled at the gym

rotund ravine
#

Should be some eye washers

torn shuttle
#

I actually have two water canteens, one that is 1l and one that is 2l just so I can take the 2l one when it's leg day

echo basalt
#

gl trying to refill your water bottle without getting slammed by 5 naked dudes

echo basalt
#

I won't judge

rotund ravine
#

Get @tender shard to do it

river oracle
torn shuttle
#

he's going to that kind of gym, you know

echo basalt
#

can't wait to take tomorrow off work so I can catch up on work

river oracle
torn shuttle
#

I'm trying real hard to ignore the offset bug visual entities are giving me rn

river oracle
echo basalt
#

nothing nicer than getting 3 new maps 15 mins before the deadline

#

and each one taking an hour to config

torn shuttle
#

I have it mostly figured out but I need to redo some of the scaling math

lost matrix
# inner mulch ok

Ok, it was actually just a problem with the constructor. You need a no-args constructor because the auto synchronized anonymous nested class copies all constructors and needs one with no-args for instantiation.

torn shuttle
#

ngl it really sucks to have both armorstands AND display entities working in tandem

#

but the upside is that it can do bedrock and pre-1.19.4 clients safely

sterile flicker
#
    @EventHandler
    public void onChunkLoad(ChunkLoadEvent event) throws Exception {
        Chunk chunk = event.getChunk();
        for (CraftPlayer npc : manager.getNpcsInChunk(chunk.getX(), chunk.getZ())) {
            for (Player player : Bukkit.getOnlinePlayers()) {
                manager.showTo(player, npc);
            }
        }
    }

    @EventHandler
    public void onChunkUnload(ChunkUnloadEvent event) throws IOException {
        Chunk chunk = event.getChunk();
        for (CraftPlayer npc : manager.getNpcsInChunk(chunk.getX(), chunk.getZ() )) {
            for (Player player : Bukkit.getOnlinePlayers()) {
                manager.hideFrom(player, npc);
            }
        }
    }

    @EventHandler
    public void onPlayerLeave(PlayerQuitEvent event) {
        Npc.ejectNetty(event.getPlayer());
    }
    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) throws Exception {
        Player p = event.getPlayer();
        for (List<CraftPlayer> npc : manager.getAllNpcs().values()) {
            for (CraftPlayer n : npc) {
                for (Player player : Bukkit.getOnlinePlayers()) {
                    System.out.println("show");
                    manager.showTo(player, n);
                }
            }
        }
        Npc.injectNetty(p, manager);
    }``` can someone suggest what should be added here, my NPC plugin does not work stably and in many cases players do not see NPCs
#

I mean, in what cases do I send packets?

inner mulch
torn shuttle
#

I've never looked at the underlying code for this stuff, do clients even use packets with data sent from chunks they are well beyond the view distance from?

lost matrix
lost matrix
#

But there is soo much code missing. I think he is still mixing the idea of virtual and physical entities.

sterile flicker
lost matrix
#

So you are using it for packet listening

torn shuttle
ivory tundra
#

can any one code a plugin for me I dont know what els I am supose to do but ask lol

#

just joined

hazy parrot
#

?services

undone axleBOT
sterile flicker
lost matrix
ivory tundra
#

how do I get somone to code me a plugin???

sterile flicker
lost matrix
ivory tundra
#

what is devs

hazy parrot
#

developers

#

people that write code

lost matrix
ivory tundra
#

oh ok do I got to pay

lost matrix
#

Depends. Sometimes there are devs which code smaller plugins just for fun.

hazy parrot
#

i mean if someone is willing to do it voluntarily no

#

you can just ask

rotund ravine
ivory tundra
#

I am confused could you join the vc rq

sterile flicker
rotund ravine
#

Ask your question

ivory tundra
#

no but I dont know what to do when I am on the site

rotund ravine
#

Read the guides or important pins

sterile flicker
rotund ravine
#

When they come in range

sterile flicker
#

how do I check if the NPC is within range, to use the distance?

lost matrix
#

The proper way (which would also be used in newer version) would be to listen to outgoing chunk packets, and simply send your NPCs afterwards.
Same for unloading.

#

Paper has events for that iirc. Something like PlayerUnloadChunkEvent

sterile flicker
#

that is, to replace the chunkloadevent event with listening for packets that I already have?

#

(injectnetty)

sterile flicker
#

and which packets should I listen to

#

PacketPlayOutMapChunk and PacketPlayOutUnloaddChunk

#

?

rare rover
#

do you need a signature for a skull?

#

or am i doing it wrong

remote swallow
#

Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...

rare rover
#

well, i need the texture values though

#

its for tablist

#

hmm

trail lintel
#

Hey guys, I last worked on my plugin in 1.19. I am trying to update it to 1.20, but am confused why this bit of logic has stopped working. Has something changed with handling PlayerInteractEvent and its relevant Action?

@EventHandler
private void onRightClick(PlayerInteractEvent event) {
    Player player = event.getPlayer();
    Action action = event.getAction();
    if (action != Action.RIGHT_CLICK_AIR || action != Action.RIGHT_CLICK_BLOCK)
    {
        // This seems to always trigger now, even if I am right clicking a block or air
    }
}
eternal oxide
#

that will always be true

trail lintel
#

It seemed to not be true before in the case of intractable blocks like doors and trapdoors

#

That was the reason that strange check was put in, I wonder if maybe its not necessary now

#

gonna try just removing it πŸ˜‰

#

Ahhh interesting, it does indeed work. Let me try this same build in 1.19 and see if I was just hallucinating haha.

livid bluff
#

try and instead of or

mighty gazelle
#

How can I make an AutoBroudcast that sends messages every 2 minutes? Message1 should come after 2 minutes and then message2 again after 2 minutes up to message6.

shadow night
#

Have a runnable that runs every two minutes and interement one in some counter variable, then choose a message depending on the current counter ig, or there are also like 5 other ways to do it from what I remember

minor otter
#

Is it fine to change the name of a open container or should I close it and reopen it with a different name

lost matrix
minor otter
#

oh for real? So are the items persistent between containers or what?

#

does it remove all items?

lost matrix
#

The details depend on what protocol version you are on

ivory breach
#
PlayerListener.java:

@EventHandler
    public void onJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        String arena_id = plugin.getSqlManager().getPlayerGameID(player);
        plugin.getLogger().info(arena_id);
        GameArena arena = plugin.getSqlManager().getArenaFromID(arena_id);
        plugin.getLogger().info(arena.toString());
        arena.addPlayer(player);
        plugin.getSqlManager().addplayertoArenaMap(player, arena);

    }```

```java
SQLManager.java:

public String getPlayerGameID(Player player) {
        ResultSet games = getAllGames();
        String gameid = null;
        try{
            while(games.next()){
                String uuids = games.getString("player_uuids");
                String[] uuidsList = uuids.split("\\.");
                plugin.getLogger().info("uuidsList: " + uuidsList.toString());
                for (String uuid : uuidsList) {
                    String playeruuid = player.getUniqueId().toString();
                    plugin.getLogger().info("uuid: " + uuid);
                    if (uuid.equals(playeruuid)) {
                        gameid = games.getString("game_id");
                        return gameid;
                    }
                }
            }
            return gameid;
        } catch (SQLException e){
            e.printStackTrace();
            return null;
        }
    }```

The issue seems to be that the UUID in the database (which is the correct UUID for me) is not equal to the UUID my game server is returning in the onJoin event. I have tried to figure it out but can't for the life of me, does anyone have a fix?
sterile flicker
#

I tried to switch to paper, but there is no playerchunkloadevent and nms in 1.12.2, and PacketPlayOutMapChunk does not listen correctly

#

do i need another packet to listen load the chunk for the client?

lost matrix
lost matrix
sterile flicker
#

can you please name it specifically

lost matrix
#

Idk. You need to look at the old protocol. Some chunk packet.

rare rover
#

hmm, why wont this work when i add the viewer?

private fun hidePlayersInTablist(player: Player) {
        val uuids: List<UUID> = Bukkit.getOnlinePlayers().map { it.uniqueId }
        val connection = player.getConnection()

        connection.send(ClientboundPlayerInfoRemovePacket(uuids))
    }

    override fun addViewer(player: Player) {
        if (viewers.contains(player)) return
        viewers.add(player)

        val entries = slots.map { it.packetEntry }
        val enumSet: EnumSet<ClientboundPlayerInfoUpdatePacket.Action> =
            EnumSet.of(
                ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER,
                ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED
            )

        val connection = player.getConnection()
        connection.send(ClientboundPlayerInfoUpdatePacket(enumSet, entries))

        updateTablist(listOf(player))

        hidePlayersInTablist(player)
    }```
#

although it works here:

    private fun updateSlots(slots: Collection<Slot>, players: Collection<Player>) {
        val entries = slots.map { it.packetEntry }
        val enumSet = EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_DISPLAY_NAME)

        for (player in players) {
            val connection = player.getConnection()
            connection.send(ClientboundPlayerInfoUpdatePacket(enumSet, entries))
            hidePlayersInTablist(player)
        }
    }```
sterile flicker
rare rover
#

check nms mapper

worthy yarrow
#

I thought nms had documentation?

lost matrix
#

Never had, never will be.

worthy yarrow
#

Ah that's why everyone hates it

lost matrix
#

I mean its mojangs code. We basically have to dig through that and make sense of it.

worthy yarrow
#

Surely there are lots of public nms examples?

rare rover
#

not rlly, if you know where to look ig

#

but

#

and nms wasn't really made to be expanded on so half the stuff you use you gotta recode yourself

worthy yarrow
#

Oh how lovely

rare rover
#

cuz they put wacky stuff in the methods

worthy yarrow
#

Hmmm maybe I should actually try to work with nms... never touched it in my 4 years haha

sterile flicker
#

net.minecraft.network.play.server.SPacketChunkData
net.minecraft.server.v1_12_R1.PacketPlayOutMapChunk
?

lost matrix
rare rover
sterile flicker
lost matrix
sterile flicker
#

But that's probably not what I need.

rare rover
#

ahh, true true

#

could do that

worthy yarrow
#

Anyone got some advice for getting out of a coding slump?

#

I've lost the motivation and I don't know how to get it back D:

ivory breach
sterile flicker
#
public static void injectNetty(final Player player, NPCManager manager) {
        try {
            Channel channel = (Channel) channelField
                    .get(((CraftPlayer) player).getHandle().playerConnection.networkManager);
            if (channel != null) {
                channel.pipeline().addAfter("decoder", "npc_interact", new MessageToMessageDecoder<Packet>() {
                    
                        out.add(packet);
                    }
                });
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }``` I figured out what the problem is, how do I change the code so that it also handles packetplayout packets and not just packetplayin
lost matrix
lost matrix
rare rover
#

would there by chance be a way to check if the player has their tablist open?

slender elbow
#

no

#

you just send the info and the client holds it there for whenever the player presses tab

rare rover
#

damn, alr

umbral ridge
#

how do you detect snow weather at a certain block? also is this rendered by client or is it some sort of invisible block.. idk?

#

or is this done by getting the chunk and weather or biome and so on?

carmine mica
#

that is just set by the biome and weather

#

and elevation probably, for the non snowy mountain biomes

umbral ridge
#

Ok thanks!

gilded lily
#

how i can move this character left?

sterile flicker
#

that Internal Exception: net.minecraft.server.v1_12_R1.CancelledPacketHandleException mean?

rough ibex
sterile flicker
# rough ibex Need more info
public static void injectPlayer(Player player, NPCManager manager) {
        ChannelDuplexHandler channelDuplexHandler = new ChannelDuplexHandler() {
        

            @Override
            public void write(ChannelHandlerContext channelHandlerContext, Object packet, ChannelPromise channelPromise) throws Exception {
               
                if (packet instanceof PacketPlayOutUnloadChunk) {
                    LOGGER.info("unload");
                    PacketPlayOutUnloadChunk unloadChunkPacket = (PacketPlayOutUnloadChunk) packet;
                    Field xField = unloadChunkPacket.getClass().getDeclaredField("a");
                    xField.setAccessible(true);

                    Field zField = unloadChunkPacket.getClass().getDeclaredField("b");
                    zField.setAccessible(true);

                    int chunkX = xField.getInt(unloadChunkPacket);
                    int chunkZ = zField.getInt(unloadChunkPacket);
                    for (CraftPlayer npc : manager.getNpcsInChunk(chunkX, chunkZ)) {
                        for (Player player : Bukkit.getOnlinePlayers()) {
                            manager.hideFrom(player, npc);
                        }
                    }
                }
                super.write(channelHandlerContext, packet, channelPromise);
            }
        };

        ChannelPipeline pipeline = ((CraftPlayer) player).getHandle().playerConnection.networkManager.channel.pipeline();
        pipeline.addBefore("packet_handler", player.getName(), channelDuplexHandler);

    }```
#

I suspect that there is error happens in this part of the code

#

how do I get the coordinates of the chunk that is unloaded?

rough ibex
#

Can you describe what this is supposed to do

#

Since no javadoc

sterile flicker
zealous osprey
twin venture
#

how i can fix this?
[SQLITE_BUSY] The database file is locked (database is locked)

river oracle
twin venture
#

it should create 3

river oracle
#

Sqlite databases only support 1 connection so it's likely some other task owns the file lock

twin venture
#

factions

#

am i doing anything wrong?

river oracle
#

It's highly likely another task has the lock file or the lock file wasn't properly cleaned up

zealous osprey
# twin venture

Why are you loading everything and are not directly trying to get only what you want?

river oracle
quaint mantle
#

Hi

zealous osprey
#

then why have a db?

twin venture
#

it should save the data

river oracle
#

Okay we are just going to ignore my point 😒

twin venture
#

like total_points of that faction

#

and total_wins.

zealous osprey
#

sorry, I made the convo sway, do as you want :D

sterile flicker
twin venture
hazy parrot
#

yeah its weird to query all factions, but get just first one

tepid acorn
#

hi

#

can someone help

#

😭

twin venture
#

this is how its should looks like

river oracle
# river oracle .

If the database is busy from one connection it just executes your queries in a queue like fashion

twin venture
river oracle
#

Okay bruh

#

Nvm ig lol

river oracle
undone axleBOT
#

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

tepid acorn
hazy parrot
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

tepid acorn
#

bruh

#

ok ill verify in a bit

#

basically im getting an out of bounds exception

#

and the packet is sent correctly with the correct lenght prefix

#

but it still shows that for some reason

narrow ledge
#

is there an event for when players change the entity type of a spawner?

river oracle
narrow ledge
#

ah yeah that'll do great, thanks

tepid acorn
#

\x19\x00\x7b\x22\x74\x65\x78\x74\x22\x3a\x22\xc2\xa7\x62\x53\x69\x6d\x70\x6c\x20\x54\x65\x73\x74\x22\x7d

#

HOW IS THIS PACKET NOT VALID

#

😭

vivid skiff
#

why is the spigot update checker returning always the same version eaven if the resource was updated? When accessing the api from the browser the resource version is the correct one

tender shard
#

which URL are you using?

vivid skiff
tender shard
#

that's the outdated one

vivid skiff
#

witch one is the new one?

tender shard
vivid skiff
#

Thanks

tender shard
onyx fjord
#

what is the new method to hack enchants with nms

#

adding to BuiltInRegistries.ENCHANTMENT throws java.lang.IllegalStateException: This registry can't create intrusive holders

sage patio
#

duo to some stuff unfortunately no i can't use that event

#

i'm handling some other damages which its not caused by an entity

#

and i can't split this into 2 events

grave kite
#

Hi, do you know how to set Persistent Data Container values on chunks? When calling "set" and "has" on the next load it does not seem to be saving the values.

dawn flower
#

can you extend the minecraft anvil limit? even if i have to use nms

tall dragon
#

what anvil limit

sage patio
dawn flower
tall dragon
#

prolly not

#

since client limits that

dawn flower
#

i could send fake data to client

onyx fjord
#

client won't be able to send above its limit

#

unless its a modded client

tall dragon
#

^

dawn flower
#

rip

onyx fjord
#

aka even if server accepts longer values, client will refuse to input them

dawn flower
#

is there any other way to get input text in a gui

onyx fjord
#

chat conversation

tall dragon
#

best way to get longer input is just chat i g

onyx fjord
#

bukkit has api for that

dawn flower
icy monolith
#

If i want to make a pvp system, should i save the data like, if the player is in pvp or who he was last hit by in a database or just save it in a simple list.

dawn flower
#

what about a book gui?

tall dragon
#

book guis are client side too iirc

dawn flower
#

dang

dawn flower
tall dragon
#

yea

#

i know

tender shard
#

are you sure you're not checking a different chunk?

#

or did you disable world saving?

dawn flower
#

what about PlayerEditBookEvent is that called when you sign a book

tender shard
dawn flower
#

k thanks

cedar flint
#

Here is my code. There is a bug that when you jump and right when you are about to hit the ground press double space(double jump) then you get put into fly mode. And i cant figure out why/ lmk of you have any questions.

#

I have tried this bug multiple times. And you will be either floating about 0.3 blocks above the ground or 0.17 blocks.

eternal oxide
#

Why are you testing EVERY move event?

#

you are only interested in jumps?

trim lake
#

Is there some simple way how to convert this (4*25) from string to number?

eternal oxide
#

Integer.valueOf(String)

trim lake
#

hmm I used Integer.parseInt(effectStringSplit[1]); and get this. Gonna try that.

ivory sleet
#

valueOf is stricter

#

iirc

#

Actually i might be seeing things

#

return type is the only major difference, woops

trim lake
#

Im doing like this...

        String[] effectStringSplit = effectString.split(":");
        System.out.println("effectStringSplit " + Arrays.toString(effectStringSplit));
        System.out.println("effectStringSplit.length  " + effectStringSplit.length );
        System.out.println("effectStringSplit[1] " + effectStringSplit[1]);
        int mult = Integer.valueOf(effectStringSplit[1]);
        System.out.println("mult: " + mult);

Still error.

eternal oxide
#

ah I didn;t notice the *

#

Not so simple to parse an equation

#

you could use teh Javascript engine, depening on how bloated you want your jar

#

Not to be used if a user supplies input though

trim lake
#

or maybe try to cast it to int? lol I mean.. it should work just if you type

int lala = 25*5

it will work lol

#

user need to imput thinks like this in config... thats my issue

eternal oxide
#

so long as teh server owner inputs it, it will be fine

#

You can;t use the JS engine if the end user inputs the string as it will be parsed as JS

#
ScriptEngineManager mgr = new ScriptEngineManager();
ScriptEngine engine = mgr.getEngineByName("JavaScript");
String foo = "25*5";
System.out.println(engine.eval(foo));```
trim lake
#

input look like this: 'INCREASE_MOB_DAMAGE:(4*25):60' so it will be string

#

Thanks anyway I will figurate something out

cedar flint
eternal oxide
cedar flint
#

I was currently using this: if (e.getTo().getY() > e.getFrom().getY()) {

eternal oxide
#

using the statistic increase your code only runs when the server believes they jumped

cedar flint
#

Ah ok thank you

#

still need to fix the bug xd

eternal oxide
#

what bug? you are the one putting them into fly if they double jump?

cedar flint
#

If they double jump close to the ground

lost matrix
#

Wait, what is a boxbeam. @waxen plinth Redempt why u do this?

tawdry echo
#

if i want to teleport player its good do it async?

lost matrix
tawdry echo
#

just use player#teleport and dont care?

lost matrix
#

Paper has a method to async request the chunk on that location first.
On spigot you just call this method and load the chunk sync if it isnt loaded.

waxen plinth
#

redempt didn't feel like me anymore

#

think I had to get away from every aspect of my old identity after realizing πŸ³οΈβ€βš§οΈ

waxen plinth
#

I only write perfect code

lost matrix
#

Alrighty. My username is from an email i created when i was 10 XD
Not much attachement to it

lost matrix
waxen plinth
#

but you gotta write a lotta shit code to start writing good code

#

most people, by the time they're writing good code, no longer want to be writing spigot code

waxen plinth
#

it's kinda dumb how well I fit all the stereotypes

lost matrix
young knoll
rough ibex
#

need a 2024 update

#

rust

lost matrix
#

Aah, i saw that a few days back. Tell me when you write C++ C# box squirtle

young knoll
#

Presumably the far far right is just raw binary

lost matrix
#

Soldering transistors

waxen plinth
#

and add 1 to each year counter

#

boy I wish I had started my transition 5 years ago and looked like that now

sullen canyon
#

Why is skin displayed differently for different players?

On my own screen I see as it's supposed to be, and from my alt account the skin looks different (the right player in the ss)
Why might this be so?

rough ibex
#

clients cache skins

#

did you change skin

sullen canyon
#

Well I modify player's skins with gameprofile

#

how would I force clients to update cache?

rough ibex
#

reshow the player

remote swallow
torn shuttle
young knoll
#

We need a bot to post it daily clearly

tawdry echo
waxen plinth
#

don't get what the fuss was about

umbral ridge
#

hey how do you get an advancement message? on PlayerAdvancementDoneEvent

waxen plinth
#

it was a bit strange, but whatever

#

ok looking at it one more time

#

this is actually pretty straightforward, I don't get what the fuss was about this code

#

it has a very specific purpose that's not exactly explained well, but that's because it's an internal function

waxen plinth
#

it splits on commas while ignoring nested types

tawdry echo
#

if you mean reload maven, yes i did

rough ibex
#

Full error pls?

river oracle
#

xD

waxen plinth
#

it's technically O(n^2) with n being the max generic depth

#

but who the fuck is using 10-nested generics?

#

it doesn't need to have a good runtime complexity because this is not an input that scales up

river oracle
young knoll
#

I think you mean IUD

waxen plinth
#

it'd most likely have to be over 100 layers deep to make any kind of difference

#

it especially doesn't matter because this is a one-time cost at startup

#

I forget who complained about this code initially but there are definitely far worse examples in redlib if you look

#

much of the code is pretty old and shows it

young knoll
#

Man a lot of acronyms start with I

#

IUD
IED
IRS
IMDB
ICBM
IHOP

waxen plinth
#

actually I'm looking through redlib and can't really find any egregious code

#

I did go back and rewrite most things that got old and bad

#

at this point the only bad part left is redcommands which is shaded

#

this entire file is full of horrible code

opal juniper
#

I’ve seen worse

waxen plinth
#

😌

#

I still have a lot of magic numbers in there, unfortunately

#

but otherwise all-around far better designed and less buggy

#

rewriting something enough times is the only surefire way to get a good design imo

ivory sleet
#

I mean good design at core is hard since different aspects of good design sometimes compromise each other on a fundamental level, which can be hard if you in certain modules favor one aspect, but in other modules happen to favor the other, now you’re also compromising consistency on top of that for the sake of each individual module just to satisfy design at some degree

waxen plinth
#

I think that is kind of too vague to be useful

#

it's true you have to make tradeoffs but there are often designs that are better in every respect

#

I think rewriting something repeatedly is the only surefire way to get a well-designed product because it's impossible to predict every challenge you're going to face

#

you can spend as much time as you want designing the thing, as soon as you start implementing you're going to hit a snag

#

when you rewrite, you're doing so with a much better understanding of the problem space and will most likely come up with a far better solution

#

but then it too eventually outgrows its boots

#

and so on and so forth

river oracle
#

Imo the goal of design is to make it look cool 😎

waxen plinth
#

true

river oracle
#

What's the point of my plugin if I don't have an API no one will use

#

And it's not multi module with a large inheritance structure

#

Like why even code if above isn't the result

next plume
ivory sleet
waxen plinth
#

businesses never prioritize rewriting and refactoring

#

as a result, all enterprise code is garbage

next plume
#

No, the problem is engineers who can't stop fooling with stuff. There are some brilliant people who can never finish a project.
If it works and it meets the requirements, you're done!

ivory sleet
#

you’re done for now at least

rough ibex
#

it'll work until you breathe on it

#

so yes

ivory sleet
#

Until they want u to extend, stretch and modify what is working in every way to suit the new requirements u get in 6 months or whatever time

next plume
#

Then the requirements are faulty. Do better writing requirements. Did you have a requirements review in writing?

young knoll
#

I think you mean the original requirements the client just forgot to tell you

next plume
young knoll
#

Yeah I’m sure the customer relations team will approve of that

ivory sleet
next plume
#

Never give the client extra stuff for free!

young knoll
#

Look I just forgot to mention it has to work with java 5

ivory sleet
#

there is also functional and non functional requirements

young knoll
#

It’s not that big of a deal

next plume
#

(Unless it's a cost-plus job.)

ivory sleet
#

Its not always so easy to make non functional requirements into functional ones

#

Sure you can blame the person who wrote the requirements for phrasing them poorly or so, but its not like that relates to the requirement ever being so static, when they change just so often

next plume
#

If the software engineers aren't doing the requirements review, you're doomed.

#

And they better consider testability.

ivory sleet
#

yep ofc

next plume
#

Anyway, I'm just trying to say if you're continually rewriting stuff, you're doing it wrong. At some point you have to say you're done and to move on.

ivory sleet
#

yeah thats true

#

I concur fully

next plume
#

Don't fall into the trap of making it perfect.

#

You'll get a reputation for not finishing things.

#

Of course it helps if you get things right the first time. πŸ™‚

young knoll
#

I already have that reputation:D

ivory sleet
#

do you?

#

Thought u had like a million plugins, all finished coll

next plume
#

Talk to other people and ask if they think it's working ok.

#

I worked with two very smart people who could never finish things. They just kept tinkering because they thought they could make it better.

ivory sleet
#

did they make it better at least?

next plume
#

Not a big enough improvement to make it worth the additional cost.

umbral ridge
#

how do you properly subtract two doubles

#

I'm making a /balance command, need values to be exact, I don't want to have overflow and other stuff

#

i limited numbers to 2 decimal places (in /pay you can't use more than 2 decimals)

#

is it fine doing

double v1
double v2

double result = v1 - v2

ivory sleet
#

well it caaaan fail

#

in terms of making result + v2 = v1

#

if you really really wanna ensure the integrity of that operation

#

I’d advice going with BigDecimal

umbral ridge
#

yes

rough ibex
#

.1 + .2

umbral ridge
#

how do you use it

rough ibex
#

the bane of floating points

young knoll
#

My project folder has 98 projects

waxen plinth
#

stuff needs to be fucking rewritten sometimes

#

otherwise you end up with pure legacy

#

requirements and priorities always change

#

technical debt tends only to increase

umbral ridge
ivory sleet
#

BigDecimal.valueOf(v1).subtract(BigDecimal.valueOf(v2)) @umbral ridge

umbral ridge
#

nvm xDD

next plume
ivory sleet
waxen plinth
#

I rewrote many of my libs over the span of years

ivory sleet
#

if u wna choose mode

waxen plinth
#

average was like a year or two between rewrites

#

and I was actually using them in between

#

not just sitting around fucking with it forever

umbral ridge
next plume
#

OK, that's not "continually".

umbral ridge
#

only 32 64 and unlimited?

ivory sleet
#

most of them unfinished

waxen plinth
#

it is a continuous process

#

every now and then software just outgrows its original requirements and needs a rewrite

young knoll
waxen plinth
#

you can delay it with good future proofing but it will happen eventually

#

you want it to integrate with newer systems, the client has new demands, there are new features, bugs have to be fixed, security holes patched

#

at some point it makes sense to scrap the whole thing and start over with better tools, because the larger a codebase is, the more difficult it tends to be to work with it

rough ibex
ivory sleet
#

I think what bobcat is getting at is like, sure we need to write and put effort into code thats maintainable and extendable in the long run, but that’s not an incentive to sit all day and refactor your code and make it perfect - perfect

waxen plinth
#

and if you can make meaningful improvements with a rewrite, it will often yield a massive increase in productivity

ivory sleet
#

ultimately the requirements change sooner or later

waxen plinth
#

yes, ofc

#

you have to get it done

next plume
#

I find it better not to put in bugs or security holes in the first place.

ivory sleet
#

And then u need to rewrite

waxen plinth
#

but you get it done with the expectation that it won't last forever

ivory sleet
rough ibex
#

I have ~19

#

but many are private archived because theyre awful

waxen plinth
#

obviously you aim to not write buggy code

#

but everybody makes mistakes

#

in both the logic and the design of the code

ivory sleet
#

@umbral ridge u can instantiate ur own mathcontext

#

iirc

next plume
#

It was a joke, partially.

waxen plinth
#

rn I work at a company that takes refactoring and design seriously and it's already making a big difference

ivory sleet
#

But I have snippets I sometimes need

next plume
waxen plinth
#

I convinced my boss to let me refactor all of our db code by switching out a library for a far more ergonomic and powerful one

ivory sleet
#

So good enough of a reason to keep them there

waxen plinth
#

and our code is now significantly better because of that

young knoll
waxen plinth
#

I'm constantly pitching refactoring tasks that I think would make the code easier to work with

#

I'd say I probably spend 10-20% of my time refactoring, and I think that's a good target

#

sometimes you will need a major spike for it, but in general, you want to just be making small improvements as you go, at least until it reaches a critical point where you need to just rip something out and rewrite it

ivory sleet
young knoll
#

Mayhaps

waxen plinth
#

rewriting the database code took roughly a full week

young knoll
#

I just keep getting new ideas before I finish old ones xD

waxen plinth
#

all I'm saying is companies are almost never realistic about refactoring and re-engineering, they don't budget for it and they don't prioritize for it, but I think it's the only way to make sure the code stays maintainable

ivory sleet
#

whats the current project

young knoll
#

Uhh

next plume
#

Add the refactoring as part of a new project that someone is paying for. Don't pay for it out of overhead.

young knoll
#

Messing with large vehicles made of display entities

waxen plinth
#

nah, I would charge people for refactoring

ivory sleet
waxen plinth
#

like of course you can't expect me to make a perfect design the first time, and so I will want to improve it - if you don't let me, then my work will dramatically slow down as the code becomes tangibly more difficult to work with

ivory sleet
#

esp when the code base grows

waxen plinth
#

refactoring is part of the job of software engineering, and I won't do it for free just because it's not directly a feature

#

right

young knoll
waxen plinth
#

are display entities low overhead?

ivory sleet
waxen plinth
#

I remember people doing that kind of thing with armor stands or falling blocks in the past and it would lag out the server and client alike

ivory sleet
#

pleaaaaaseee coll lol

tranquil prairie
#

Do you have to manually check if a player has the * permission?

ivory sleet
#

I believe so

waxen plinth
#

that's not really a permission node

#

spigot doesn't handle it by default to my knowledge

tranquil prairie
#

πŸ‘

waxen plinth
#

I'm pretty sure it's a special case handled by permission plugins

#

so you should only have to check for your specific permission node

ivory sleet
#

I mean some systems, assume it to be the parent permission of every other permission

waxen plinth
#

and they will use wildcards to determine which permissions apply

ivory sleet
#

but like, wildcard permissions are evil

waxen plinth
#

because it's not just *, you can do things like essentials.*

#

and you don't want to be checking for *, myplugin.*, myplugin.subcommand.*, AND myplugin.subcommand.permission

umbral ridge
#

I usually do
plugin.command.<command-name>
plugin.events.<event-tag>

#

etc

ivory sleet
#

@young knoll don’t think u can hide!

#

yea spexx looks fine

umbral ridge
#

XD

ivory sleet
#

btw u dealing w economy rn?

#

The double stuff for instance

umbral ridge
#

yes

ivory sleet
#

Ah

#

I hate dealing with economical stuff

umbral ridge
#

kinda copied and pasted the whole thing from withdrawPlayer and am now changing stuff

ivory sleet
#

ah

#

well it sucks that vault is using double

umbral ridge
#

yes it does

#

it sucks

ivory sleet
ivory sleet
#

BigDecimal is mediocre at most

umbral ridge
#

I wanna make banks where you can go in and open an account and all sorts of stuff

#

make it hardcore

#

but need a perfect plugin for this

#

so i have to do it myself

#

because i believe noone else is capable

#

XD

young knoll
ivory sleet
#

hmm, well spexx I made an economy plugin that works on multiple servers (like through a proxy), then dealing with stuff like high availability, scalability and data consistency becomes a real pain

#

esp when u need to synchronize on transactions etc

umbral ridge
#

ahh across servers?

ivory sleet
#

yea

umbral ridge
#

that's probably pain yea

#

a lot of db work..

#

and stuff

ivory sleet
#

yea

young knoll
#

Like, spawning 1500 of them at once will hang the client for a bit, but after they are all spawned it runs fine

umbral ridge
#

im making this for one server only, for survival

ivory sleet
#

well, if u dont need to do that, its pretty gucci

#

Nice

#

U’re gucci ganging

umbral ridge
#

yessir

#

im ganging gucci

ivory sleet
#

Coll

#

this is revolutionary

ivory sleet
#

in my eyes

ivory sleet
#

Lmao

umbral ridge
#

move blocks so smoothly

ivory sleet
#

Would it be possible to make large blockbench models w animations with what u’re doing?

umbral ridge
#

aa animations and models

ivory sleet
#

Assuming u got a resource pack ofc

young knoll
#

This is all without a pack

#

But yeah with a pack you can go crazy

ivory sleet
#

Coll the chef

umbral ridge
#

go crazy go mad go crazyyy

ivory sleet
#

he be cooking

worthy yarrow
umbral ridge
#

coll the animator

ivory sleet
#

coll the coll

umbral ridge
#

coll the resource pack

young knoll
#

I wanted to make them solid with shulkers

#

But it’s just too janky sadly

ivory sleet
#

Ahh

#

Well for instance