#help-development

1 messages Ā· Page 856 of 1

kindred rapids
#

bro do u know how to configure spartan or not

young knoll
#

Since choco pr not merged yet smh

river oracle
#

no, but why would you ever want to do legacy string šŸ¤”

remote swallow
#

i dont, wrong channel here for it too

river oracle
#

oh lol I forget of my obscene NMS use often

young knoll
#

😩

kindred rapids
remote swallow
#

this is for development

river oracle
kindred rapids
#

idc its a help channel make me bud

river oracle
#

this isn't even the place to ask whoever directed you here was wrong no one here will know how to configure your anti-cheat besides its creators and community

#

@young knoll this is why you gotta use Pineapple I can maintain all this NMS for you

#

:P

young knoll
#

If you aren’t developing a plugin please take your question to #help-server
Although for specific plugin help it’s often better to ask the developers directly

young knoll
remote swallow
#

huh whats this

kindred rapids
#

did u see he said i sent a reply on gmail where he told me it stupid LOL

#

honestly sharing half an iq

river oracle
#

then go through the refund process if you don't like the product, he is literally the best person to help you

#

as he knows that product better than anyone else

kindred rapids
#

well he said hes busy and doesnt know how to

river oracle
young knoll
#

Yes but that’s craftbukkits problem not mine :p

#

I’ll happily move away from legacy when I’m able to

quaint mantle
#

Is this OK or do you think I could separate some of the logic differently

public final class DamageListener implements Listener { 
  
     private final PitMap pitMap; 
  
     public DamageListener(PitMap pitMap) { 
         this.pitMap = pitMap; 
     } 
  
     @EventHandler 
     public void onEntityDamage(EntityDamageEvent event) { 
         if (!(event.getEntity() instanceof Player)) { 
             return; 
         } 
         Player victim = (Player) event.getEntity(); 
  
         this.cancelEventAndTakeActionIfIllegal(event, victim); 
         if (event.isCancelled()) { 
             return; 
         } 
     } 
  
     private void cancelEventAndTakeActionIfIllegal(EntityDamageEvent event, Player victim) { 
         if (event.getCause() == EntityDamageEvent.DamageCause.FALL) { 
             event.setCancelled(true); 
             return; 
         } 
         if (event.getCause() == EntityDamageEvent.DamageCause.FIRE_TICK) { 
             event.setCancelled(true); 
             victim.setFireTicks(0); 
             return; 
         } 
         if (event.getCause() == EntityDamageEvent.DamageCause.VOID) { 
             event.setDamage(999999); 
             return; 
         } 
         if ( this.pitMap.getSpawnBounds().collides(victim.getLocation().toVector()) ) { 
             event.setCancelled(true); 
             return; 
         } 
     } 
  
 }
worldly ingot
#

Is that your whole code? Or are you omitting something? Because at that point you might as well just inline everything. No real sense in pulling it out into a method

#

(also, your last if (event.isCancelled()) { return; } doesn't do anything, it can be removed - again, assuming nothing is omitted)

quaint mantle
#

how do I link the gui i added as an Itemsadder to InventoryClickEvent?

#

e.getView().getTitle() returns "IA_CUST_GUI"

young knoll
#

Don’t use title

#

ItemsAdder probably has an api to identify their custom GUIs

quaint mantle
#

idk I'm really thinking now tho

#

about making my custom events

#

and having the rest of the plugin deal with the custom events instead of just putting them in my damage listener

quaint mantle
stiff cape
#
package lol.nightmarexd.practicecore.menu;

import net.md_5.bungee.api.ChatColor;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;

public class StatsMenu implements Listener {
    public StatsMenu(Player player, Player self) {
        Player target = (Player)self;
        String name = target.getName();
        String name1 = target.getName();
        Inventory stats = Bukkit.createInventory(null, 54, ChatColor.translateAlternateColorCodes('&', "&8" + name + "'s sᓛᓀᓛɪsᓛɪᓄs"));

        ItemStack head = new ItemStack(Material.PLAYER_HEAD, 1);
        SkullMeta headmeta = (SkullMeta)head.getItemMeta();
        headmeta.setOwner(name1);
        headmeta.setDisplayName((ChatColor.translateAlternateColorCodes('&', "§x§f§b§0§0§0§0" + name + "'s sᓛᓀᓛs")));
        head.setItemMeta(headmeta);
        stats.setItem(22, head);
#
package lol.nightmarexd.practicecore.listener;

import net.md_5.bungee.api.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;

public class StatsMenuListener implements Listener {
    public StatsMenuListener(Player player, Player self) {
        String name = self.getName();
    }
    @EventHandler
    public void onInvClick(InventoryClickEvent e){
        if (!e.getView().getTitle().equals(ChatColor.translateAlternateColorCodes('&', "&7" + name + "'s sᓛᓀᓛɪsᓛɪᓄs"))){

        }
    }

}
#

how to fix

young knoll
#

Fix what

stiff cape
#

the name in the listner is not woking

#

how

remote swallow
#

you define it in a constructor not in the class

#

how do you expect to be able to access it

young knoll
#

Also one has &8 and one has &7

#

Also you shouldn’t use title to identify inventories

#

Use the actual inventory object or the InventoryView object

river oracle
#

if you do I will patch your code with e.getView().setTitle("trolled") to mess with you

river oracle
#

I wonder how many plugins I could break just by doing this

public void onInventoryOpen(@NotNull final InventoryOpenEvent event) {
  event.getView().setTitle("Hi :3);
}
remote swallow
#

none

manic delta
#

Hello i have a tabcompleter for a command and i want tab completer for a list of numbers, I have this code:

#

The code prints this:

#

But in minecraft the tab completer looks like this:

young knoll
#

Yes

#

The sorting is client side

manic delta
#

So i cant sort from 1 to 10?

young knoll
young knoll
manic delta
#

damn

#

any other option to do this?

#

i can do it with roman numbers but i would like a number tabcompleter

young knoll
#

Don’t go above 9 ig

#

Or only suggest numbers based on the digits the player has already typed

manic delta
#

uhm

#

i think ill use roman numbers

#

anyway is from 1 to 10 only

young knoll
#

How would those sort

#

Brain work harder plz

manic delta
river oracle
remote swallow
#

(its nerdy)

young knoll
#

I
II
III
IV
IX
V
VI
VII
VIII
X

manic delta
#

i have an util for it lol

remote swallow
#

oh josh

young knoll
#

It almost works

remote swallow
#

ive just stolen ur database helper

#

thanks for the free help

young knoll
#

Mmk

river oracle
#

Man didn't even bother to steal mine wtf

remote swallow
#

urs is too big

#

joshs is 1 class

#

with 3 methods

river oracle
#

Chonky but useful

remote swallow
young knoll
#

I thought pineapple was just a component api

remote swallow
#

no

#

thats pineapple-chat

#

pineapple is a lifestyle josh

river oracle
#

Join our corporate take over

young knoll
#

Ur a pineapple

river oracle
#

I dm you our documentation

#

Since it's not finished yet

#

But you can see the glory of pineapple

young knoll
#

Hmm

#

Config api seems familiar

#

šŸ‘€

river oracle
#

Epic stolen it I think

#

Thank gods for gpl3

remote swallow
#

the chat gpt 3 license

remote swallow
#

wrote that myself

river oracle
#

Smh smh

#

Don't lie we all know you're a thief

remote swallow
#

kekw

#

who isnt a code thief

#

other than people contributing to spigot

river oracle
#

Yeah I gotta get around to depreciating that legacy config api

#

Thx for the reminder coll

remote swallow
#

i will fight you if you remove it and dont replace it with something that works as that does but better

young knoll
#

See I avoid this problem by having me be the only person using my library

#

Depreciation? Nah just yeet it

river oracle
#

We're still in non release versions

#

I just made like 20 breaking changes today lol

remote swallow
#

he made me lgtm the pr

#

i still say its lets get this merged

river oracle
#

It's looks good to me

#

🤔

remote swallow
#

@worldly ingot is lgtm lets get this merged or looks good to me

young knoll
#

According to spigot contributors

#

It’s LGTM

remote swallow
#

there both lgtm

young knoll
#

Big brain

kind hatch
#

nah, I'm gonna start using lets get this merged.

young knoll
remote swallow
#

what does it stand for

young knoll
#

It stands for let’s get this M E A T

worldly ingot
#

ą² _ą² 

manic delta
#

@young knoll how does it looks like

river oracle
remote swallow
worldly ingot
#

I'd definitely opt for numbers > roman numerals for a command

young knoll
#

Aye I got it right

#

IX has to ruin everything

worldly ingot
#

?

manic delta
kind hatch
remote swallow
manic delta
#

just testing

worldly ingot
#

I see it as "looks good to me", but I've heard the former as well

manic delta
remote swallow
#

nooooooooooooooooooooooooooooooooooooooooooooooooo

young knoll
#

Yeah I’d say 1 10 2 3 4 etc is better than 1 2 3 4 9 5 etc

remote swallow
#

who else has a valid opinion here

river oracle
remote swallow
#

simple does

remote swallow
manic delta
young knoll
#

Do it in binary

river oracle
#

Trueeee

manic delta
#

wym

river oracle
#

Binary is guaranteed to be sorted

kind hatch
#

Can't you just have 10 show up only if they type 1?

young knoll
#

Actually no binary would still get scuffed

#

F

river oracle
worldly ingot
#

I don't think binary would get fucked

kind hatch
#

Just use the actual names of the numbers. smh

young knoll
#

Wait

worldly ingot
#

As long as you pad it with 0s

remote swallow
#

im great at naming tables

young knoll
#

Ah yeah

manic delta
#

wym by binary lol

river oracle
#

00001

worldly ingot
#

0001
0010
0011
0100
0101
...

#

:p

kind hatch
#

00000000
00000001
00000010

manic delta
#

lol

#

kekew

remote swallow
#

okay so if theres 4 bits in a byte, does that mean we can count to 32,767 on our hands

young knoll
#

What kinda bytes are you using

remote swallow
#

i dont remember how many bits are in a byte

#

shutup

worldly ingot
#

Definitely not 4

young knoll
#

Mans got them discount bytes from Walmart

remote swallow
#

oh its 8

kind hatch
#

Double that infact.

worldly ingot
young knoll
#

Sorry, Tesco

remote swallow
#

so we can count to 255 on our hands

young knoll
#

No

remote swallow
#

its called asda

worldly ingot
#

mans has a nibble

young knoll
#

We have 10 fingers if you count thumbs

remote swallow
#

yess

kind hatch
#

I like bits

remote swallow
#

if we only use 1 byte we can count to 255

#

if we use 1 byte and 2 bits we can get higher

worldly ingot
#

Or from -128 to 127

young knoll
#

Chop off children’s thumbs and teach them to count in binary so they are ready for the ai overlords they will grow up to have

kind hatch
#

We only use signed integers here. :p

worldly ingot
#

If you want to be really quirky, you can count from -255 to 0

young knoll
#

Shh I got that backwards

remote swallow
#

kekw

young knoll
#

I mean technically you can do any 256 number range

#

If you just remember the base offset

kind hatch
#

Let's start using base 4 instead.

remote swallow
#

why do embeds have so much stuff

remote swallow
#

makes life a lot harder if you dont know ur 9s

#

what times tables did ur schools make you learn

young knoll
#

1-10

kind hatch
#

^

young knoll
#

As far as I remember

remote swallow
#

ha

#

my school made us learn to 12

young knoll
#

Obviously im a big boy now and can handle higher

remote swallow
#

primary school only

#

most schools only did 1-10 i think

kind hatch
#

Alright, now to learn 13-24

young knoll
#

Yeah cuz you didn’t go to anything past primary

sterile axle
#

who pang me and why

young knoll
#

Gottem

remote swallow
#

is lgtm lets get this merged or looks good to me

sterile axle
#

on what

#

wtf

#

it's "looks good to me"

remote swallow
#

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

#

fuck y2k was right

sterile axle
#

literally by definition

young knoll
#

Md uses it as looks good to me

kind hatch
#

rekt

young knoll
#

So get rekt again

sterile axle
#

looks good to me is #1 and endorsed by google so gtfo

remote swallow
#

whoever thinks lgtm is legitimate can get the fuck out

young knoll
#

I like that last one

#

The key is to do the merge on a Friday so you don’t have to worry about it until Monday

remote swallow
#

what if you work weekends

kind hatch
#

Just don't work weekends.

young knoll
#

^

worldly ingot
#

If anybody ever uses "LGTM" in place of "legitimate", they can rightfully eat dirt

#

LGTMly

young knoll
#

That just makes me think of LMGTFY

remote swallow
sterile axle
#

@sullen marlin please ban Choco for that

worldly ingot
#

??? what did I do!?

#

I thought it was a funny haha joke :(

young knoll
young knoll
remote swallow
#

this is literall yme

kind hatch
#

Tutorial code is for the weak. Return to binary.

young knoll
#

What if that gives an error

remote swallow
kind hatch
young knoll
#

My brain did that long ago

kind hatch
#

Where are the spigot.yml settings found in the source code?

kind hatch
#

Fuck Ngl, no clue how patch files work. Nor how to edit them properly.

quaint mantle
#

If I get like a runtime exception in the onEnable method

remote swallow
#

for cb its like you edit the java file and it makes the patches

quaint mantle
#

and my plugin can't run anymore

remote swallow
#

i think spigot works the same

quaint mantle
#

Do I try to give a friendly error msg

young knoll
#

Nah for spigot editing the patches is wack

quaint mantle
#

or just print stackttacd

young knoll
#

Ask choco, he knows how

quaint mantle
#

and disable

kind hatch
#

Friendly error message would be nice alongside disabling the plugin.

quaint mantle
#

alr what if it's like an uncaught runtime that I'm just paranoid might happen

#

but I don't know what to catch (all theoretical)

#

should I catch Exception?

#

And give a friendly error msg

kind hatch
#

@worldly ingot How does editing the spigot patch files work?
I want to verify functionality of the spigot config options, but idk how to work with it.

kind hatch
sullen marlin
#

But I'm not sure what you're trying to do, sounds like you can just edit the source normally

kind hatch
sullen marlin
#

It's in spigot and the issue there is that datapacks load before the server now

#

That ticket is a duplicate you can probably find the core issue by searching spigot.yml and data pack

#

Workaround: reload

sullen marlin
kind hatch
#

I didn't even know that feature existed in bukkit. lol
I thought that was a thing that forks added. :p

kind hatch
#

Another question. When it comes to Player#getBedSpawnLocation(), would it be better to

  1. Update the docs stating that it can actually return the location of Respawn Anchors as well?
  2. Deprecate #getBedSpawnLocation() and introduce #getRespawnLocation() since respawn anchors aren't beds?
tender shard
#

i'd deprecate it with reason "misleading name, see <here> instead", then add getRespawnLocation and in these docs explain that it could be a bed or anchor location

wet breach
#

There is two kinds fyi. Command line and config file

#

The ones for command line use joptsimple

kind hatch
#

The spigot.yml options.

hardy cairn
#

can someone help me, i wanna do it so that miner group only can drop items from certain ores. how do i do it using luck perms

#

i dont really know that plugin well

wet breach
hardy cairn
#

anyone?

rotund ravine
#

Just use the bukkit permissions api

#

Player#hasPermission

hardy cairn
#

so i make a permission node then like assing check for it in block break event?

rotund ravine
#

BlockDropItemEvent for drops

hardy cairn
#

oh

#

wait that makes sens

tribal zephyr
#

Is there something I can use to send commands to console instead of
Bukkit.dispatchCommand?

sullen marlin
#

?

tribal zephyr
wet breach
#

why do you need to send commands to console from a plugin?

tribal zephyr
wet breach
#

keyall?

tribal zephyr
wet breach
#

then just invoke that command directly

tribal zephyr
#

o

quaint mantle
#

Hey i have a issue when i try to install BuildTools im trying to use it for my plugin for world border packets So when i run java -jar BuildTools.jar --rev 1.16.5 in the correct folder It dosent do anything no errors pretty much nothing as output

#

I made sure i have java 8

sullen marlin
#

?log

#

?paste

undone axleBOT
sullen marlin
#

Post the output

quaint mantle
#

like nothing

#

how do I link the gui i added as an Itemsadder to InventoryClickEvent?
e.getView().getTitle() returns "IA_CUST_GUI"
i looked up itemsadder api docs but couldnt find another event
https://lonedev6.github.io/API-ItemsAdder/

umbral ridge
#

send a screenshot of the log

echo quarry
#

Unless he fucked up installing Java somehow..

umbral ridge
#

you cant fuck up that lol

echo quarry
#

You would be shocked at what people can fuck up.

quaint mantle
echo quarry
quaint mantle
#

nope

#

i used the jar before too

#

worked fine no issues

echo quarry
#

When did you last use it?

quaint mantle
#

uh like a month ago

#

for 1.20.1

#

and i also reinstalled the buildtools to make sure its all good

echo quarry
#

So literally nothing at all pops up when you run the command in console?

sullen marlin
#

Screenshot your console then

quaint mantle
#

ok

#

1s

quaint mantle
echo quarry
quaint mantle
#

oh ok

#

1s

echo quarry
#

If you DM me the screenshot, I can post it for you.

quaint mantle
#

ok

quaint mantle
#

lol that username though

echo quarry
#

Eh, I just do not care at all.

echo quarry
quaint mantle
#

alright

#

nothing

echo quarry
#

Do java -version

quaint mantle
#

nothing

#

i checked my java config

#

it says 1_8_0

echo quarry
#

Your issue is not with Buildtools, it is with however you setup Java on your computer.

quaint mantle
#

uhm thats weird

#

because i used the buildtools in this pc before

#

do i reinstall the runtime enivorment?

echo quarry
#

If java -version did nothing, then Java itself is not setup properly on your compuiter. I would reinstall your JDK, JRE, and check your system enviorment variables.

quaint mantle
#

ill do that and share the results

quaint mantle
echo quarry
sullen marlin
#

They banned

echo quarry
#

Oh, what for?

sullen marlin
#

Look at the name

smoky anchor
#

They they just change it ?

echo quarry
#

Eh, I was just ignoring the name. Honestly, almost everyone online is a little bit weird. The best stratagy is to care about literally nothing at all.

quaint mantle
echo quarry
#

He has had that name since at least the first message I replied to.

quaint mantle
#

LOL his onlyfans link though

echo quarry
#

LMAO

wet breach
#

like its not a word to refer to people, rather the actual color

echo quarry
wet breach
#

wasn't my point

#

but if you don't care I see no reason to further chat I suppose

echo quarry
#

I wouldn't ban someone over it, but it isn't my server and isn't my call. Honestly, I didn't see a massive issue with it. The only reason I have ever banned anyone from a discord server is when they posted stuff that was illegal and could get the server banned.

valid burrow
#

as this is a verified server, im almost certain they have to follow the general Discord rules

#

which includes not being racist

wet breach
valid burrow
#

it does. His account will 100% get banned

echo quarry
#

I do not think that discord's rules would disallow his username.

valid burrow
#

if reported

echo quarry
#

It wasn't neccicarly a racist username.

valid burrow
#

yes it was?

#

how was that not racist

wet breach
wet breach
valid burrow
#

we all know he didnt mean the color black in spanish.

echo quarry
#

As frostalf said, the word literally means "black" in spanish. He could himself just be a black man who is also a killer šŸ¤·ā€ā™‚ļø

valid burrow
#

We all know he was refering to black people

wet breach
echo quarry
#

Probably.

#

I know how he most likely meant it, however, that does not gurentee that is how he meant it.

wet breach
#

unless someone goes and asks them

#

no one knows what exactly is meant and can only assume

valid burrow
#

thats still on him then for not thinking his name through. If i run for president as a 70yr old man and say ā€ži just love little childrenā€œ its still my fault if id be called a pedo

wet breach
valid burrow
#

no? But his name is english not spanish

#

if you use a single spanish word in an english name, while being aware that the word has a different meaning in the english language

#

thats on you.

#

fully.

echo quarry
#

It was 1/3 Spanish 2/3 English.

wet breach
valid burrow
#

yes. They obviously speak enligsh

#

also

#

i even told them

#

they didnt bother

echo quarry
#

And who cares, even if his name meant exactly what you think it meant, he is just some random guy online.

wet breach
#

anyways, people who want to think its offensive generally are the ones that keep perpetuating the problem XD

echo quarry
#

I like to put chicken nuggets in my macoroni and cheese.

wet breach
#

its your food, eat it how you like it

valid burrow
#

1st This discord is verified as i said
2nd As a person with huge publicity Md could not only ruin the reputation of spigot but also himself by tolerating such behaviour

wet breach
#

the rules don't ban words =/

valid burrow
#

if you think this is not a bannable offense you did not read them

echo quarry
#

Eh, Md_5 could probably do whatever he wants and be just fine. At the end of the day, Spigot is not something that is easily replaceable.

wet breach
echo quarry
wet breach
#

trust me, dude isn't going to lose their account and this server isn't going to get shutdown over it XD

#

now if they started spouting some nonsense in regards to it sure

grim hound
#

bruh aren't there any good APIs for creating a dummy server on proxies?

wet breach
#

that is, people attacking others etc

grim hound
wet breach
#

why would there be api's for something that isn't necessary?

#

there is literally no market for it

grim hound
#

let's say on Velocity

#

would it be better for me to create a server engine and tell the user to start it with .bat

#

or create a virtual server with an api with no documentation

wet breach
#

what you are wanting is a waste of resources to do

#

its a waste because its makes no sense to create an entire server to validate something

wet breach
#

or maybe I am confusing you with someone else?

#

and its coincendental you also want this dummy server thing

grim hound
wet breach
#

its super easy to dynamically connect servers to the bungee

#

because bungee doesn't need to know about the server ahead of time

#

and the server doesn't need to know about bungee

#

the only thing bungee cares about, is when it attempts to send someone to a server, the server picks up

#

and the server doesn't really care about the connection to begin with

grim hound
summer scroll
lost matrix
#

One moment, ill show you an example

lost matrix
# summer scroll I'm trying to modify armor stand metadata using ProtocolLib, but I receive an er...
    public void dressArmorStand(int entityId) {
        // Create the packet first
        ProtocolManager protocolManager = NextGens.getProtocolManager();
        // Entity Metadata Packet
        PacketType type = PacketType.Play.Server.ENTITY_METADATA;
        PacketContainer packet = protocolManager.createPacket(type);
        // Create serializers
        WrappedDataWatcher.Serializer byteSerializer = WrappedDataWatcher.Registry.get(Byte.class);
        // Create list of data values to change
        List<WrappedDataValue> dataValues = new ArrayList<>();
        // Create a data value and add it to your values list
        Byte armorStandTypeFlags = 0x01 | 0x08 | 0x10;
        int asFlagIndex = 15;
        dataValues.add(new WrappedDataValue(asFlagIndex, byteSerializer, armorStandTypeFlags));
        // Write the data values
        packet.getDataValueCollectionModifier().write(0, dataValues);
        // Set the entity id
        packet.getIntegers().write(0, entityId);
        // Broadcast the packet
        protocolManager.broadcastServerPacket(packet);
    }
quaint mantle
#

For this u can use a static private Class right

#

To hold the instance

ivory sleet
#

Yea

lost matrix
quaint mantle
#

and it's thread safe

ivory sleet
#

I assume he meant nested class to hold the singleton instance

echo basalt
#

Or just ?di

#

?di

undone axleBOT
lost matrix
quaint mantle
#

thread safety and lazy initialization

lost matrix
dry hazel
#

you can use a local class for its lazy initialization properties

ivory sleet
lost matrix
#

The design of creating a nested class, just to hold an instance of a singleton. Never seen that.

dry hazel
#
public class Whatever {
  public static Whatever getInstance() {
    class Lazy { Whatever INSTANCE = new Whatever(); }
    return Lazy.INSTANCE;
  }
}
ivory sleet
#

You know when your singleton is concurrently accessed and it may end up creating more than one instance of it, to fix that we usually double lock the retrieval method, a better way is to just have a nested class or local class, as classloading ensures its only loaded once pretty much

quaint mantle
#

Yeah

#

if you lock and check null twice, intellij also gives you that suggestion to use a inner static class

ivory sleet
#

And yes Max, that’s fine

lost matrix
#

I dont like this. What is the benefit over just

public class Whatever {
  
  private static Whatever instance;
  
  public static synchronized Whatever getInstance() {
    return instance == null ? instance = new Whatever() : instance;
  }
}
ivory sleet
#

I think the synchronized way of doing it was considered as a way of not having to allocate a whole nother class, cheaper in other ways, but since we got just too much memory nowadays

quaint mantle
#

Bill Pugh Singleton Implementation: Prior to Java5, memory model had a lot of issues and above methods caused failure in certain scenarios in multithreaded environment. So, Bill Pugh suggested a concept of inner static classes to use for singleton.

ivory sleet
#

yeah smile, i think the common approach was
if instance null
lock
if instance null
set instance
yield instance

minor junco
#

you only lock when needed

ivory sleet
#

The nested variant is afaik the best approach

minor junco
#

Yes

quaint mantle
#

why

lost matrix
#

I see the problem with synchronized locking on every retrieval when only needed for instantiation.
But using the classloader to ensure single access is so unclean to me. There must be a better way.

ivory sleet
#

because you don’t have to check if the instance is null every time u access it

#

using an additional class ofc implies more memory consumption in regards to allocating a whole nother class

lost matrix
#

Thats whatever

ivory sleet
#

but we got lots of memory these days

#

Yea

lost matrix
#

Im more concerned about the code readability.
This def requires a comment to explain its purpose.

minor junco
#

No idea about the convo but If you design for Java 5 when your target environment is > Java 5 something went wrong

ivory sleet
quaint mantle
#

It didnt

ivory sleet
#

i mean singleton in general is something I often comment on

quaint mantle
#

It supports lazy initialize & thread safety

ivory sleet
#

since there usually needs to be a reason why u choose such a design pattern ^^

lost matrix
#

Because its convenient af šŸ˜›

#

In my smaller projects, every manager is a singleton because its just convenient to use.
Dont need to have an intricate design otherwise.

lost matrix
#

You mean dependency injection. Yes, valid, but enforces a lot of thinking about design.

ivory sleet
#

It becomes a bit more tricky when you have layered abstraction, like certain layers are made to be consumed by the entire system and other layers are just internal abstraction

#

No

#

Fuck lombok

#

:)

tender shard
#

i finally got my ssh honeypot working on ipv4 and ipv6

lost matrix
#

Im in the other camp. I dont like wasting time with getters and setters.

ivory sleet
#

So u have public fields then?

ivory sleet
#

lmao

#

smile is 100%, trust

lost matrix
#

Get away with your infix functions and all that nonsense

ivory sleet
#

ā€œinfluxā€ 😭

lost matrix
#

Has been a while šŸ™‚

#

influxDB just creeped into my brain

quaint mantle
#

Is this an ok way to do stuff for my custom gamemode

class DamageListener:
void onDamageEvent:
check victim is not at spawn
other checks etc
call a new GamemodeDamageEvent

Then have all the "special" effects and abilities listen to this custom event

ivory sleet
lost matrix
quaint mantle
#

the thing is tho I don't wanna put everything in my DamageListener

lost matrix
#

Then pass the important parameters to another place

quaint mantle
#

Ok

lost matrix
#

My listeners always delegate functionality. I really dislike having code in listeners as they are merely an API link

quaint mantle
glad prawn
lost matrix
quaint mantle
#

Wdym states

lost matrix
#

Stateful behavior

quaint mantle
#

How would i

#

even name the method

lost matrix
#

Hardest part of programming

#

What does it do?

quaint mantle
#

the private one

lost matrix
#

There are a ton of ways to handle this.
Is there more code coming after those lines?

quaint mantle
#

In the listener?

#

or the method

lost matrix
#

In the listener

quaint mantle
#

Yeah

#

Here's how it will go

#

probably go

#

event:
cancel event and handle illegal scenarios
if event is cancelled: return
damageManager.handle(victim, attacker, etc..)

#

the names are obv not final but it's probably what I'll do

#

But I may just pass in the event into the damage manager idk

#

Oh and I'll have some custom enchants that also like modify the event

lost matrix
#

I mean separation-logic is totally fine to have in your listener.
You can increase the encapsulation of your spawnBounds by passing the event like this

     @EventHandler 
     public void onEntityDamage(EntityDamageEvent event) { 
         if (!(event.getEntity() instanceof Player)) { 
             return; 
         } 
         Player victim = (Player) event.getEntity(); 
         
         boolean validDamage = pitMap.validateVictimDamage(event, victim); // contains the logic of cancelEventAndTakeActionIfIllegal
         
         if (!validDamage) {
             return; 
         }
          
         enchantManager.handle(someStuff...)
         damageManager.handle(victim, attacker, etc..)
         ...
     }
quaint mantle
#

Yeah maybe I'm overthinking the names

glossy venture
#

why dont plugins store per-world info in the world folder

#

like worldguard and decentholograms

lost matrix
#

Clearing data from plugins should be easy. So storing everyting in your plugins folder is preferred. But
there is nothing stopping your from storing data in world folders. Storing data in PDCs indirectly does that as well.

glossy venture
#

true

tender shard
#

i'd also think it'd be annoying if you wanna reset a world, you just delete the world folder. if the config is inside there, it'll be gone

glossy venture
#

isnt that what u want

#

a new world new config

#

thats what id expect at least

tender shard
#

depends. for example you might want to reset your farmworld once a month but keep the configs for that world for whatever plugin

glossy venture
#

u could delete regions and entities folders

#

only

tender shard
#

sure one could do that. just wanted to mention a possible downside of storing it in the world folder, which is "you can't just delete the folder to reset the world anymore"

glossy venture
#

yeah true

summer scroll
# lost matrix ```java public void dressArmorStand(int entityId) { // Create the pa...

I missed your message, thank you for the help, it works!
I have another issue, I'm trying to destroy an entity but it throws error saying that the field 0 is not exist.

    public void destroyEntity(int entityId) {
        ProtocolManager protocolManager = NextGens.getProtocolManager();
        PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_DESTROY);
        // Set the id of the entity
        packet.getIntegerArrays().write(0, new int[]{ entityId }); // <-- Error is in this line apparently
        // Broadcast the packet
        protocolManager.broadcastServerPacket(packet);
    }
lost matrix
#

This packet now has an IntList instead of an array

summer scroll
#

Where is the IntList.class from? I see multiple imports.

lost matrix
# summer scroll Where is the `IntList.class` from? I see multiple imports.

Its from FastUtils. But ProtocolLib allows you to pass any List and convert it to an IntList internally:

  public void destroyEntity(int entityId) {
    ProtocolManager protocolManager = NextGens.getProtocolManager();
    PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_DESTROY);
    // Set the id of the entity
    packet.getIntLists().write(0, List.of(entityId));
    // Broadcast the packet
    protocolManager.broadcastServerPacket(packet);
  }
summer scroll
#

Ah right, thank you.

#

I usually don't use ProtocolLib, just nms and other messy stuff. I figured using this will help me maintaining for future versions.

tribal valve
#
        ArmorStand stand = block.getWorld().spawn(block.getLocation(), ArmorStand.class);
        stand.setBasePlate(false);
        stand.setCanMove(false);
        stand.setCanPickupItems(false);
        stand.setMarker(true);
        stand.setInvisible(false);
        stand.setCustomNameVisible(true);
        stand.setCustomName(ChatColor.GREEN + "" + health + "/" + maxHealth);
        stand.teleport(block.getLocation());
        this.healthArmorStand = stand;
``` how to fix it so it teleports on top of the block
tall dragon
#

you add 0.5, 1, 0.5

#

to the spawn location

tribal valve
#

okay i'll try

hushed spindle
#

is there any way to respawn the ender dragon as if it was its first time

tribal valve
tall dragon
#

..

#

location.add

hushed spindle
#

good christ

#

thats a learn java moment right there

tribal valve
tribal valve
hushed spindle
#

oh wanna be rude now

tribal valve
#

ur rude

lost matrix
tribal valve
hushed spindle
lost matrix
hushed spindle
#

having to use nms is no issue, i just need to know how

lost matrix
#

Have you tried simply calling DragonBattle#initiateRespawn()

hushed spindle
#

i mean that works but it spawns the dragon as if a player had respawned it

#

so it gives less exp and no egg

#

i wanna make it so that if a player who hasnt entered the end before yet it spawns a new dragon

#

as to prevent fear of missing out

#

i could just hardcode the dragon dropping that much exp and an egg though i guess

lost matrix
#

Im thinking which metadata value results in the dragon spawning an egg and additional experience.

tall dragon
#

or previouslyKilled ;d

#

who knows

lost matrix
#

Yeah. This would need testing and then locating this in the NMS world.
After that you need to expose it in the API and make a PR.

orchid gazelle
#

If I have some time that may become my first PR

eternal night
#

CLA time kekwhyper

orchid gazelle
#

:)

#

Is there any guide on how the structure of spigot works and how to contribute to it?

quiet ice
#

?contributing

#

Ah well, was worth a try

#

There is a command for it though

orchid gazelle
#

?pr

quiet ice
orchid gazelle
#

Alright thanks, I'll look into it later

echo basalt
#

?cla

undone axleBOT
lost matrix
#

net.minecraft.world.level.dimension.end.EndDragonFight
So its simply a matter of exposing a setter in CraftDragonBattle

orchid gazelle
#

Sure

#

Ok

wet breach
hushed spindle
#

very useful

#

thank you

quaint mantle
#

Hi guys, I made this state variable to cancel the event when true. But it doesn't change (always false)

plucky skiff
#

why is this not working


        ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
        protocolManager.addPacketListener(new PacketAdapter(this, PacketType.Play.Server.ENTITY_EQUIPMENT) {
            @Override
            public void onPacketSending(PacketEvent event) {
                try {
                    PacketContainer packet = event.getPacket();
                    StructureModifier<ItemStack> items = packet.getItemModifier();

                    ItemStack stack = items.read(0);

                    packet = new PacketContainer(PacketType.Play.Server.ENTITY_EQUIPMENT);
                    items = packet.getItemModifier();

                    items.write(0, new ItemStack(Material.DIAMOND_SWORD));

                    event.setPacket(packet);

                } catch (FieldAccessException e) {
                    e.printStackTrace();
                }
            }
        });

        plugin = this;

    }``` I want it to change the player main hand item to a diamond sword every time the entity equipment packet gets sent, but instead, it gives me this error: ```java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because "protocolManager" is null``` it might just be me being dumb, but I can't really find good material on packets and protocol online
lost matrix
quaint mantle
lost matrix
plucky skiff
#

alr, will try now

lost matrix
lost matrix
quaint mantle
smoky anchor
#

Also, probably not a good idea to create new object every time you want a random double
Since Java idk what, you can use Math.random

quaint mantle
#

But I know 100% that works because it drops the item down

#

look

#

full code

lost matrix
minor junco
#

what's the issue?

lost matrix
#

He is using two different instances. He just doesnt know yet

quaint mantle
#

ohh yeah when registering the event

smoky anchor
quaint mantle
#

So i make it static?

lost matrix
#

?di

undone axleBOT
lost matrix
# quaint mantle So i make it static?

I would not reference listeners to each other.

  • Create a new class
  • Store your relevant data in this class
  • Create one instance of this class when the plugin enables
  • Pass this one instance to all your listeners, commands, etc.
    This way you have a centralized point for your data that can be passed around.
lost matrix
inner mulch
#

Is it faster to have 1 database with all tables or many dbs with their own tables?

ashen quest
#

It's fast enough

#

Multiple might even be slower

inner mulch
# ashen quest Why many, it is a hassle to handle

lets say i have many different tables for the economy data, i create a economy db and put all the tables there, when i have one big all the tables would be there unsorted, or is it possible to create packages in sql?

#

im not so experienced but from what i have seen you cannot really create packages

ivory sleet
#

It will be needed

inner mulch
ivory sleet
#

Nah I mean like relational tables in general

river oracle
#

Is there a way to make a gradle plugin apply to only some subprojects. I want to use the gradle checkstyle plugin, but I don't want to apply it to every module, only a specific few. Copying and pasting the configuration seems naive

ivory sleet
#

Thats possible

#

you can in ur main one in the plugins block add the gradle plugin but also add apply false

#

then in respective project, add apply plugin: "name"

#

iirc

#

Dont remember groovy syntax

#

W kotlin dsl its
apply(plugin = "name") iirc

river oracle
#

where in the subproject do I apply the plugin?

#

its not in the plugins block

ivory sleet
#

just about anywhere, I mean pretty much at the top i think

glossy venture
#

?mappings

undone axleBOT
ivory sleet
#

cuz u want it applied before using it ofc

river oracle
ashen quest
river oracle
#

?paste

undone axleBOT
river oracle
#

it executes fine when I put the configuration and plugin id in the specific project

ivory sleet
#

You should add it in the top as well

#

like

#

id 'checkstyle' version 'ver' apply false

river oracle
#

you can't do that with checkstyle

#

> Plugin 'checkstyle' is a core Gradle plugin, which is already on the classpath. Requesting it with the 'apply false' option is a no-op.

#

unless you're suggesting I put its entire definition in the subprojects block

ivory sleet
#

oh its a core one

#

Im troll

#

well than just applying that should work fine

river oracle
#

I get errors when doing that though šŸ¤”

ivory sleet
#

Or am I missing something ?

#

What errors?

river oracle
#

one sec

#

Unable to create Root Module: config {/run/media/miles/minimize/Coding/PineappleDevelopmentGroup/Libraries/Pineapple/config/checkstyle/checkstyle.xml}, classpath {null}.

#

the checkstyle file doesn't actually have any errors either it works fine if I move it all into a single module

ivory sleet
#

Hmm

river oracle
#

okay I ran it and grabbed the stacktrace, but I'm confused

#

lemme double check the checkstyle docs

tender shard
#

uuugh IJ always causes trouble for me when using checkstyle.xml, it never properly worked

river oracle
#

okay yeah

#

like how is this possible

Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Token "LITERAL_SWITCH" was not found in Acceptable tokens list in check com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck
#

it legit is

#

it also works when in a single module

#

how did moving it break my checkstyle.xml its nonsensicle

glossy venture
ivory sleet
#

yeah im kinda clueless

glossy venture
#

the stupid aabb ray intersection works

ivory sleet
#

maybe subprojects override some sort of base file path that checkstyle is using

river oracle
#

and why all of a sudden now that specific file decides it's configuration is wrong

#

@tender shard any ideas you are the master of beating gradle jank

ivory sleet
#

lol

#

What an earned title

river oracle
#

he went from raging at gradle to being able to use it

#

and thinking its decent

worldly ingot
#

It's always been good. It's just too good is the problem lol

river oracle
worldly ingot
#

Way too flexible. Easy to shoot yourself in the foot and not know how to fix it

river oracle
#

that moment you realize you're build script is now more complicated then your project

tender shard
worldly ingot
#

I do >:(

tender shard
#

well then chill out!

river oracle
tender shard
#

for javadoc stuff?

#

wdym?

river oracle
#

like javadoc rules

tender shard
#

but javadoc itself complains if you're doing sth wrong?

river oracle
#

not really javadoc doesn't care if you forget to doccument a class

#

or forget a parameter tag etc

worldly ingot
#

I think it does actually show a warning

#

Not a failure, but it will yell at you

river oracle
#

not on IJ afaik

worldly ingot
#

No no I just mean the general javadoc tool (Maven uses it as well with javadoc:javadoc)

river oracle
#

is their a way I could force a failure then>

#

Ig I'd have to look that up I suppose

worldly ingot
#

You could specify an invalid tag in a Javadoc comment if you'd like

#

e.g. @thisdoesntexist

#

If you're compiling docs via IJ it might not fail though

river oracle
#

yeah, but then I'd need to script writing that into all forgotten java docs and that's just a mess

worldly ingot
#

oic you want to be sure everything has a comment

river oracle
#

I mean I'm not disastified with checkstyle

#

it's pretty nice as it gives me errors for that stuff

#

I just am having issues applying the plugin to specific sub projects

misty garden
#

Salut

river oracle
#

I can just ask epic later I suppose

misty garden
#

y'a-t-il des franƧais ?

river oracle
#

he might beable to figure it out

river oracle
misty garden
river oracle
#

huh traduct is an actual word

#

I learned something new ig

inner mulch
#

i cannot decide whether i should create my systems in one big plugin or split them apart. Any advice or experience on this topic?

inner mulch
#

im creating a server, i make pretty much everything on my own except a few apis to help out, im not sure whether i should have this one big project or split it apart for readability

#

when having everything together i can create my own big api for servers and dont need to work with so many dependencies accross the plugins

ivory sleet
#

One big project is fine

#

I can already tell its not gonna affect you a lot by splitting it up

#

so just stick to one big project

hazy parrot
#

I would personally split, for example one plugin for essentials, one for pvp events etc

inner mulch
#

i currently have everything split up

#

and im thinking about putting it together

river oracle
shadow night
#

hmm, how would I store something like a little id number that I don't want to be accessible by the user and be independent of the world?

inner mulch
#

one plugin to manage chat for example, one for economy that's how i do it currently

ivory sleet
#

I doubt you’re with many people, I doubt you need independent redeployment

river oracle
river oracle
#

its easier to maintain even if you're by yourself imho

ivory sleet
#

you can separate it in compile time just fine

#

if you can’t handle it urself, its also doable to modularize

river oracle
inner mulch
ivory sleet
#

Well I forgot to mention VCS wise its easier to have separate repos, but that’s ā€œhandleableā€ in a single project, tho I doubt u use vcs that much anyway

river oracle
#

Data API's etc

#

not the actual implementation

#

implementation stays to each individual plugin

inner mulch
#

oh

ivory sleet
#

And either way when you code multiple plugins you will still code them against each others apis

#

so you’d get a binary incompatibility either or

river oracle
ivory sleet
#

If you scope out to a new server you’d have to completely recompile anyway at some point to tweak it

river oracle
#

ig in my server work experience I've never worked alone only ever in teams

inner mulch
ivory sleet
#

Apart from some generic library like bk commons

#

Yes I can agree w it if u’re on different platforms

#

But that presupposed you already develop platform agnostic a head of time

#

Just look at illusions code for instance

#

How much pre planning he does

ivory sleet
#

Because VCS is gonna be much more crucial

#

And independent redeployment as well

glossy venture
#

tf what block other than air has a null AABB

ivory sleet
#

but at the scope of which yoursalvation is doing stuff, having multiple jars isnt helpful

river oracle
# ivory sleet Can you actually give a concrete example of this

I mean I can give an example from where I worked. We had a generic library core that provided everything you could ever want. e.g. every API you would ever need etc. You essentially can use that plugin accross any server as its just a library so you know it will be useful and used 100%. When it comes to plugins within that library we separated them out. We had a minigame plugin for the minigames servers which utilized the core library, but also had its own implementation. It'd be a disadvantage if we put all 3 or 4 minigames inside this library plugin we had it'd be a huge disadvantage especially when propogating across bungee and spinning up new servers.

ivory sleet
#

But there you already recognized that ahead of time its likely you gonna have to distribute production onto multiple servers across the network

misty garden
#

Hi, there,
how can I get my items to place 100 blocks of different heights?

tender shard
echo basalt
#

well there are a few approaches

echo basalt
inner mulch
echo basalt
#

That comes with a lot more development time though

river oracle
echo basalt
#

You can also make a bungee core and a spigot core

river oracle
#

checkstyle can guarentee this to and extent

echo basalt
#

But that results in duplicate code

inner mulch
lost matrix
glossy venture
#

why is raycasting so annoyign

river oracle
#

I wouldn't got that far yourself xD

echo basalt
river oracle
#

as long as you stay on the bukkit platform

#

if you plan to use minestom you might want to look into platform agnostic API

echo basalt
#

:)

river oracle
#

otherwise just do what Conclure said Ig

echo basalt
#

I plan in a very distant future

#

but hey it helps me learn new shit

ivory sleet
#

I’ve alreayd told u yoursalvatipn

echo basalt
#

like uh

ivory sleet
#

Multiple jars is not gonna be helpful

echo basalt
#

itemstacks

ivory sleet
#

You can listen to the others if you feel like going for the best practice in general

echo basalt
#

and because I'm using namespaced keys I can also support fabric in a very distant future think3d

ivory sleet
#

But I’m just saying it to you, so u dont waste time

echo basalt
#

But does your project require that many ppl and platforms

echo basalt
#

fabric by 2030

#

hopefully the project's out of alpha by then

river oracle
#

lol

#

maybe

echo basalt
#

working on minigame autoscaling

#

did some progress today

#

maybe next month I can actually try it with a real setup

#

planning on makin a lil minigame network and reselling assets or sumn

river oracle
#

one thing I noticed is your minigame core was structured pretty similar to the one I made 2 years ago

eternal valve
#

I want to make a plugin I want it to listen to a plugin that I specify, so if that plugin stops, I want to tell it to restart the server

river oracle
#

nice to know I thought similarly to a pro

#

pro illussion

echo basalt
#

I copied minikloon's code

#

no originality

#

I'm not a pro

tender shard
echo basalt
#

I'm a programmer swagHD

eternal valve
tender shard
#
tasks.withType<Javadoc> {
    val options = options as StandardJavadocDocletOptions
    options.addStringOption("Xdoclint:all")
}

tasks.withType<JavaCompile> {
    options.compilerArgs.add("-Xdoclint:all")
}

@river oracle this should enable all doclints and then complain about missing comments

echo basalt
#

alex you have a new boyfriend opportunity

tender shard
#

nah thx

#

im good

echo basalt
#

that's that folks

eternal valve
river oracle
echo basalt
#

onDisable

river oracle
#

and if said plugin disabled System.exit()

inner mulch
# ivory sleet But I’m just saying it to you, so u dont waste time

yeah i think one big plugin is the way as this gamemode is like one game and not just many different things glued together. But regarding this, i have a few data objects, do you think it is smarter and faster to keep them apart (coindata, leveldata) or should i create a customplayer object that can be wrapped around the spigot player and then return all the data once created, but therefore would be reasonably bigger and probably slower as i might sometimes only change the coindata and not the leveldata, but with the approach it would be forced together?

echo basalt
#

jokes on you

river oracle
#

but that logic is flawed already since its hard to tell if the srever is already restarting or not

river oracle
#

also you can't guarentee you load before or after the plugin you wanna watch

#

or conversely disable

echo basalt
ivory sleet
#

At least facade it to a dto such that the lifetime of the data can be centralized

inner mulch
echo basalt
#

There are multiple custom player objects with their own data features

ivory sleet
echo basalt
#

The "core"'s data object has a player id : island id association

#

There's an island id storage that maps island id : island data

eternal valve
echo basalt
#

Sub modules can handle their own stuff (economy module can map profile id : economy data)

#

That way I can selectively enable the modules I want without having to make new tables

#

Each storage can also handle its own logic (for more complex queries that require sorting and aggregation, for example)

#

It also allows me to store economy data in a separate database cluster if needed

ivory sleet
#

But yoursalvation if you want some sort of dynamic data adaptation just define a visitor to populate and manage the data for each player data transfer

echo basalt
#

Or just inherit credentials

#

Only reason why I went with that system is because I'd like to make modules in the future, and I'd like something I can copypaste across projects as part of my utils

#

I'd suggest coming up with something yourself through trial and error

inner mulch
echo basalt
#

Well

#

In the past I've done a player data object that was just a Map<String, Object> wrapper

#

That became a mess to serialize and manage

#

It'd also toss everything in 1 collection

glossy venture
#

love my raycasting solution

inner mulch
echo basalt
#

It's just not a good approach

inner mulch
#

when i only want coindata i would also get all the other shit that i might not need

echo basalt
#

You'd load all the player data just to get 1 value

inner mulch
#

i mean the data is already in memory

#

im not loading it in

echo basalt
#

For example I wouldn't want to load a whole island every time I wanted to get the player's last known username

#

It's just too much to load in memory

#

It becomes a point of failure

#

if someone has corrupted data you compromise the entire system :)

#

Like do you think hypixel loads your bedwars win streak when you're logging into a skyblock server?

#

It's part of your player data

inner mulch
#

okay, the reason why i thought it would be cool to have this, is so that i would have my own api like spigot's player for example.
You can get the player's name, uuid, health, everything related to minecraft. I thought it would've been cool to have my own kind of player object that returns the defualt player and coins, levels or whatevery im storing in my core game experience.

echo basalt
#

Well

#

You can still have little data objects for that

inner mulch
#

yeah i know, i thought just thought i would looked cleaner than

EconomyData economyData = DataManager.getEconomyData(uuid);
LevelData levelData = DataManager.getLevelData(uuid);

echo basalt
#

Well

#

Yeah that's still valid

inner mulch
echo basalt
#

Well

#

What if

#

EconomyData and LevelData were interfaces

#

And you just made your CustomPlayer object implement all of them

#

and proxy the data

#

(I'm personally not a fan of this and am not advocating for it)

inner mulch
#

what does proxying data mean?

echo basalt
#

basically just route the method to the getter of your other class

inner mulch
#

so this one player method just basically
EconomyData economyData = DataManager.getEconomyData(uuid);
LevelData levelData = DataManager.getLevelData(uuid);
does this in secret?

echo basalt
#

yuh

#

Still not a fan because you're putting all your eggs in one basket

#

but eh

glossy venture
#

id personally put it all in one object for player data as you will probably save and load it all on join and quit anyways

#

u can just project the data u need if youre doing operations while theyre offline

echo basalt
#

It scales up to a certain point

#

But if you have A LOT of data and you only need some of it selectively

#

loading it all isn't a great option

#

Whatever you'll learn with time

#

different approaches fit for different problems

glossy venture
#

stats and economy data will probably be in use most of the time

#

like scoreboard

#

display

#

n shit

echo basalt
#

Then there's the different question

#

Are you going to reuse this system?

#

For instance I reuse my system across projects and hook with it on external modules

#

You lose flexibility otherwise

glossy venture
#

what i use

inner mulch
#

regarding data, when having a sql database, i would really like to only have one database, but putting all the tables into one seems kind of not readable, can you create packages in sql?

river oracle
#

a database isn't meant to be readable

#

its meant to store data

#

that's why its stored in bytes and not ascii text

proud badge
#

Why is the stacktrace so short? I can't figure out the issue

glossy venture
#

most databases have command line or gui interfaces to edit them which arguably makes them more readable but what y2k is saying is def true

echo basalt
#

stacktrace gets short if it's already been pasted a bunch

#

just open the log file and scroll down until you see it

glossy venture
echo basalt
#

damn you're learning them plug skills with me

#

pls star my skyblock core guys it doesn't even load islands yet guys but pls minestom

glossy venture
#

lmoa

echo basalt
#

34 stars rn

echo basalt
#

I mean it's some damn good code now

#

not perfect but no one is

glossy venture
#

pascal case module names immediate unstar

echo basalt
#

fuck off

tender shard
#

i knew a guy whose name is Pascal

glossy venture
#

wait holy shit im stupid im writing my own raycast using nms but the nms world has a ray cast method

glossy venture
#

lmao

grim hound
#

what does an object need to have in order for it to work like a packet in Channel#writeAndFlush?

astral scroll
#

Someone has a ItemStack serializer for gson?

#

can't find one

#

and writing one for me is very difficult :(

tender shard
astral scroll
#

thanks

shadow night
#

wasn't there some directory you could put updated plugin jars so bukkit automatically updates them on next restart

eternal valve
#

I want to make a plugin I want it to listen to a plugin that I specify, so if that plugin stops, I want to tell it to restart the server Well, if I make it asynchronous, that is, if I request it to control every 1 second, will it consume too many resources? will it also have an impact on other servers, such as processor usage, ram usage, etc.?

hallow lion
#

Are there plans on adding actual api for custom anvil inventories?

#

mainly it is impossible to get text from a virtual anvil without the use of nms or packets

grim hound
#

and can link you my github

hallow lion
shadow night
#

Can I disable those "original-*" jars from building or something

warm mica
grim hound
warm mica
#

No idea what he means with "virtual" but it's the same thing?

grim hound
shadow night
tender shard
shadow night
warm mica
warm mica
#

Doing it myself

tender shard
grim hound
shadow night
warm mica
#

I literally just looked up in my code that works across 1.8 and 1.20

undone axleBOT
grim hound
shadow night
grim hound
#

those do not change any actual item display names that you could read

shadow night
eternal valve
#
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.server.PluginDisableEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class AnaEklenti extends JavaPlugin implements Listener {
    @Override
    public void onEnable() {
        // Olayları dinleyecek olan bu sınıfı kaydet
        getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onPluginDisable(PluginDisableEvent event) {
        // Devre dışı bırakılan eklentinin adını al
        String disabledPluginName = event.getPlugin().getName();

        // Eğer devre dışı bırakılan eklenti istediğimiz eklenti ise sunucuyu yeniden başlat
        if (disabledPluginName.equals("TakipEdilenEklenti")) {
            restartServer();
        }
    }

    private void restartServer() {
        // Sunucuyu yeniden başlatma komutunu buraya ekleyin
        // Ɩrneğin:
        Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "restart");
    }
}

#

Do you think this will work?

warm mica
#

My inventory isn't backed by a block, I just place the items in the inventory and read the display name when clicked on

glad prawn
grim hound
#

no actual block or any existing entity

#

I don't wanna get too much into definitions and shit

#

but a virtual inventory is more when you have the items be virtual as well

eternal valve
#

But if there is something wrong, I want to correct it. 🄹

warm mica
grim hound
warm mica
#

Do you mean items that have been sent via packets?