#help-development

1 messages Β· Page 249 of 1

hazy parrot
#

Gson is using
.parse(json, YourClass.class)kind of type safety

tender shard
#

yeah, and in simple-json you just cast it yourself

#

basically the same thing

#

damn is that new again

quaint mantle
#

@tender shard After checking: For some ungodly reason, it sees it as either being blank or nil inside the event handlers ONLY

#

i tried doing this

#
private Map<UUID, HashMap<String, Object>> invList;

if(invList == null || invList.isEmpty()){
            invList = new HashMap<>();
        }
#

and now it reads it as null so its not my code thats weird its the eventhandlers

tender shard
#

that code wouldn't even compile?

#

you cannot have an if statement outside of a code block (method, constructor, static init block, etc)

quaint mantle
#
public void openInventory(Player p){
    if(invList == null || invList.isEmpty()){
        invList = new HashMap<>();
    }
    createInventory(p);
    p.openInventory((Inventory) invList.get(p.getUniqueId()).get("Inv"));
}
tender shard
#

I doN't understand why you always create a new HashMap

quaint mantle
#

heres the actual code

quaint mantle
#
public class LotteryGui implements Listener {
    private Map<UUID, HashMap<String, Object>> invList = new HashMap<>();
#

isnt this creating it once in the class

tender shard
#

invList can NEVER be null unless you set it to null somewhere

#

it looks like you always only read from the map, but never properly add to it

quaint mantle
#

OH MY GOD

#

I FIGURED IT OUT.

#

BECAUSE I WAS ALWAYS GENERATING A NEW CLASS, I JUST NEEDED TO MAKE IT STATIC.

tender shard
#

uuuughm

#

X doubt

remote swallow
#

no

quaint mantle
#

I kept getting told using static was bad so I didnt want to use it

remote swallow
#

static bad dont use it

tender shard
#

static is not bad

remote swallow
#

in most cases it is

tender shard
#

but many people abuse it

#

and that's bad

quaint mantle
#

i used to abuse static and now i dont

#

this is the first time using static in my code

quaint mantle
#

huh

tender shard
#

usually you have exactly one instance per listener, they are basically singletons

#

(not always, but in 99% of cases)

quaint mantle
#

but every time that event ran

#

it would create a new instnace of the gui

tender shard
#

hm well did you already fix it now? if not, all I can suggest is to upload your FULL PLUGIN SOURCE CODE on github or sth, then send it here

quaint mantle
#

yes

tender shard
#

ok good

#

but you always have to remember: No one can be older than 150 years!

#

TL;DR
You can declare everything as static that either describes stuff about the class itself, or that will never be changed in any object instances.

#

but making something static because "otherwise it won't work" sounds like you did sth wrong, as Epic said :/

#

story of my life

#

"should X do Y?"
"yes, unless it doesn't"

#

lol

glossy venture
#

yo im trying to have players always join in one world at the spawn, regardless of where they logged out. it works when you logged in before, but it doesnt work for people the first time they join. they just spawn in the default/main server level. no errors, nothing, this is how im doing it

@EventHandler
void onJoin(PlayerJoinEvent event) {
  // ...

  // schedule teleport
  Bukkit.getScheduler().runTaskLater(plugin, () -> {
      // teleport to world spawn
      e.getPlayer().teleport(connectWorld.getSpawnLocation());
  }, 1);

  // ...
}
tender shard
glossy venture
#

multiverse

#

which i actually dont think i need

tender shard
#

nothing else?

glossy venture
#

so ill uninstall that i think

#

nah

tender shard
#

try to uninstall it, see if that changes anything

#

probably multiverse does sth similar

#

btw I don't think you need to delay it by one tick

glossy venture
#

was an attempt at fixing it

#

i had it immediately at first

#

i also saw MV code which does it a tick later

#

so yeah idk

tender shard
#

try to do it without delay, and uninstall multiverse. if that still doesn't work, then I have absolutely no clue lol

#

if it works after uninstalling multiverse, then I guess yo uhave to delay it a bit longer, since multiverse probably tries to do the same

glossy venture
#

oh boy ill have to get another mc instance

tender shard
#

but then you need sth to sync inventories across servers

#

or do you mean another client / account?

#

if so, you could just remove your playerdata from the world folder

#

or I could quickly join to test it

glossy venture
#

sure

#

ill delete all player data ig

#

wait

tender shard
#

kk

glossy venture
#

wait

#

nvm

tender shard
#

1.19.2?

glossy venture
#

i sent you in dms right

#

few days ago

#

yes

#

but the server shat itself

tender shard
#

send again pls

glossy venture
#

i gotta restart it lol

#

ok

tender shard
#

I get like 20 DMs every day, it's very annoying haha

fierce whale
remote swallow
#

reload maven

fierce whale
#

what is meaning of reload maven?

remote swallow
#

do you see an M with a circle in the top right

fierce whale
#

Ahha I did well

#

But console send me "can't find project"

remote swallow
#

?paste your pom

undone axleBOT
fierce whale
remote swallow
#

?forks

#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

fierce whale
#

okay I got it thx

#

It still doesn't work 😒

kindred valley
#

Drink

quaint mantle
#

    @EventHandler
    public void onDamage(EntityDamageEvent e) {
        if (e.getCause() == EntityDamageEvent.DamageCause.FALL) {
            Bukkit.getConsoleSender().sendMessage("fall damage");
            e.setCancelled(true);
        } else if (e.getCause() == EntityDamageEvent.DamageCause.VOID) {
            Bukkit.getConsoleSender().sendMessage("void damage");
            e.setCancelled(true);
        }        
    }
#

So when I get fall damage it sends 1 time "fall damage"

#

But if I get void damage it completly spamms "void damage" instead of sending it once per second or something

kind hatch
#

That’s cause void damage is constant damage. Fall damage is a one time thing.

quaint mantle
#

As it is when I spring normally in the void

#

I only get 1 time every ~ second damage

#

But not constantly

kind hatch
#

Not exactly sure what you mean, but you could cancel the event every so often to prevent the damage.

quaint mantle
#

Or something

eternal oxide
#

you take damage every tick, you mean you only want a message every 1 second

#

set a field for teh last time you sent a message

#

if the timeMS is not +1000 it's not been a second

kind hatch
#

AFAIK, no, you cannot slow down the rate of events as they are fired by the server, but you can cancel the event.

However, there’s workarounds.

quaint mantle
#

i fond a plugin called "nohitdelay"

#

May I can make it to "hitdelay"

#

xD

#

They use: e.getPlayer().setMaximumNoDamageTicks(Integer.parseInt(this.getConfig().getString("hit-delay")));

kind hatch
#

Pretty sure void damage ignores that value.

quaint mantle
#

oh ok

tepid eagle
#
public class PlayerSleep implements Listener {

    public PlayerSleep() {
    }

    @EventHandler
    public void onLeaveBed(PlayerBedEnterEvent e) throws InterruptedException {
        Player p = e.getPlayer();
        if(p.getWorld().getTime() > 12516) {
            p.getWorld().setTime(0);
            Bukkit.broadcastMessage(p.getName() + " is sleeping");
        } else {
            Bukkit.getConsoleSender().sendMessage("can only sleep at night.");
        }
    }
}

Hello guys im new to MC developement in general how can i schedule p.getWorld().setTime(0) ? since i cannot use thread timer in bukkit

eternal oxide
#

?scheduling

undone axleBOT
kindred valley
tepid eagle
gray merlin
#

Is there a way to spawn in a boat of a certain type straight away? Currently i'm spawning it in with
.spawnEntity(stackEntity.getLocation(), EntityType.BOAT);
and then changing the type with
.setBoatType(this.popBoatType());
but that causes a small flicker.

sonic goblet
gray merlin
#

Unfortunately that workaround would probably psychologically mislead my client into thinking that some of the processes are slow/that the server is lagging, and i'd rather keep the flickering by that point...

#

but I do appreciate the suggestion

echo basalt
gray merlin
unreal willow
#

How do I change my profile picture?

flint coyote
#

I don't wanna be rude but that's not a development question and either belongs in general or verified.
You can change it by clicking on it in your profile

rotund ravine
#

Well more like ur code can do it

tender shard
rotund ravine
tender shard
#

sparkling vodka?!

kindred valley
#

I did not define it as a drink πŸ‘

#

Get it as a verb πŸ‘

tender shard
kindred valley
#

Yes

tender shard
#

joke's on you, I'm always drinking

#

maybe I should see a doctor

#

Β―_(ツ)_/Β―

sonic cosmos
opal juniper
#

u need to shade or relocate it

sonic cosmos
#

pom.xml

tender shard
#

how did you compile your stuff @sonic cosmos

sonic cosmos
#

mvn clean install

#

in terminal

tender shard
#

hm that should work

#

open your .jar, and check if the file is actually there

#

you can open it with winrar / extract it with unzip / whatever

sonic cosmos
#

wait but

#

i have that plugin midule inside a nats-api

tender shard
#

imgur doesnt work for me, no clue why

#

have you checked whether your plugin .jar file actually contains a file at io/nats/client/Options$Builder.class ?

sonic cosmos
#

yes, it has

#

oh

#

okay

#

i know

tender shard
#

what version of nats do you use? what's your java version?

sonic cosmos
#

i changed to

<dependency>
            <groupId>net.jedzius</groupId>
            <artifactId>nats-api</artifactId>
            <version>1.0-SNAPSHOT</version>
            <scope>compile</scope>
        </dependency>
#

and it worked

tender shard
#

and what was it before?

sonic cosmos
#

without scope

tender shard
#

tbh that cannot have changed anything

#

compile is the default scope

#

maybe you used the wrong .jar or sth

sonic cosmos
#

maybe but anyway thanks for help

tender shard
#

np!

wary harness
#

dm it Japan is kicking Croatia ass

#

😭

undone axleBOT
faint tide
#

Do you get an error or doesn't it do anything?

tender shard
#

why does your server crash in the first place

#

ofc it doesnt save anything when it crashes

faint tide
#

and in the file? have you tried changing a value in the file and then stopping the server to see if anything changes at all?

#

different question for myself: Is there any in-depth tutorial on multilanguage setup? I'm trying to use ResourceBundles but whatever I do I can't seem to locate my Locale language file. It's starting to annoy me

tardy delta
#

What

pine pine
#

Hi

#

Need help with spawning command

hasty prawn
#

What's the problem

#

?ask

undone axleBOT
#

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

pine pine
#

Right sorry

#

I am trying to use this command on my Spigot server, doesnt work.

/give A2rath bow{display:{Name:'[{"text":"Test sword","italic":false}]',Lore:['[{"text":"1","italic":false}]','[{"text":"2","italic":false}]','[{"text":"3","italic":false}]']},Enchantments:[{id:flame,lvl:1},{id:power,lvl:10}]} 1

Tried in Singleplayer, works fine. what is the issue?

hasty prawn
#

Essentials is why

#

Do /minecraft:give on the server

pine pine
#

Aha let me try

#

So I just replace base of the command?

hasty prawn
#

Yes

pine pine
#

Ooo thansk!

#

You are my savior

icy beacon
#

what is a good way to get a NMS entity from a normal entity? right now I have this code:

fun getNMSEntity(entity: Entity) : net.minecraft.world.entity.Entity {
  return (entity as CraftEntity).handle
}

which works, because i have the following import:

import org.bukkit.craftbukkit.v1_18_R2.entity.CraftEntity

i'm trying to make it multiversional, so what do I do? the package name for CraftEntity is version-dependent, as seen in the import. do I need reflection to create an object from package name somehow?

#

as a certified nms amateur, i hereby request help of nms experts

opal juniper
#

yeah that is possible, but if not create separate modules for each version with classes that all implement a common interface and then just some quick logic to determine which to load

icy beacon
#

hm, guess I gotta learn multimodules too :D

fervent panther
#

How do I store a boolean in PDC?

old cloud
warm trout
#

How would I simulate a player throwing an item out of their inventory?

#

dropNaturally doesnt exactly work, as it just drops it on the player

old cloud
fervent panther
#

I'm just surprised it isn't an option by default

old cloud
#

because you can use byte

fervent panther
#

ok ig I'll just use byte. Thanks

old cloud
#

Its very easy to do and therefore probably not necessary to implement

tardy delta
old cloud
tardy delta
#

with pleasure

languid jackal
#

does EntityMoveEvent fire when a dropped item moves? if not, is there another event which does?

remote swallow
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

shell trench
#

I want to give a player an effect every second.
I tried using java.util.Timer for that but this gave me this error:

Asynchronous effect add!
remote swallow
#

?scheduler

#

?scheduling

undone axleBOT
remote swallow
#

#runTaskTimer

fervent panther
#

There's an error because that 0 is an int. Is there a way to fix it besides casting it to byte?

tardy delta
#

(byte) 0

fervent panther
#

I'm new to Java so I was just wondering if there was a better way

tardy delta
#

well you cant just do byte b = 0 cuz 0 is an int, something like 0b doesnt exist either so you have to cast it to a byte yourself

remote swallow
#

^^

fervent panther
#

Thanks! I was wondering if there was something like 0b because there is for f and d

tardy delta
#

nah there isnt a byte suffix

#

and the reason pdc doesnt have a datatype for a boolean is cuz the size of a boolean is the same size as a byte ig

quaint mantle
#

I am searching for a plugin that allowed you to add a new specific unity like hearts. But it will be souls for example. And when you lose all your souls there is an action. Do you have an idea of what type of plugins I need ?

midnight shore
#

how do i write on this field using PacketContainer (ProtocolLib)? Like there isn't a getAngles() method

quaint mantle
#

I am searching for a plugin that allowed you to add a new specific unity like hearts. But it will be souls for example. And when you lose all your souls there is an action. Do you have an idea of what type of plugins I need ?

midnight shore
#

like a plugin that adds a new stat?

quaint mantle
#

yes

#

like hearts

#

or food

midnight shore
#

let me see

quaint mantle
#

and i want to add an event like when we have no (example) there is a command that happene

midnight shore
#

this kinda seems a plugin that you should code by yourself because i don't think theres something this specific

quaint mantle
#

i dont know how to code

#

can you give me a youtubeur that help me coding

midnight shore
remote swallow
#

i would say its more custom that that so

#

?services

undone axleBOT
quaint mantle
#

ok and for the event thing

#

like when i get no hearts for example i get killed i would like when i have no example left i get banned

river oracle
#

my god what an awful idea he doesn't even know coding

#

send java tutorials

midnight shore
#

πŸ”₯ Get Certified as Full Stack Developer with Simplilearn's Job Guarantee Program: https://www.simplilearn.com/java-full-stack-developer-certification-training-course?utm_campaign=Java-CFD9EFcNZTQ&utm_medium=DescriptionFirstFold&utm_source=youtube

This video is based on Core Java Tutorial for Beginners. The Core Java Full Course in 10 Hours vide...

β–Ά Play video
#

gluck

quaint mantle
#

thx

#

bruh 10h

midnight shore
#

just 11 hours

#

🀯

quaint mantle
#

just* ?

midnight shore
#

it is relatively a small time considering that i spent surely more on learning this

quaint mantle
#

do you know like a custom plugin that execute command when actions are executed

midnight shore
#

what do you mean *actions?

quaint mantle
#

like when i get no example left so i get banned or kicked

midnight shore
#

you could probably do this using command blocks and scoreboards (the old way)

quaint mantle
#

i have to go can we have a private conversation so we can talk tomorow ?

hazy parrot
#

probably skript, but you would need to learn its syntax too

quaint mantle
midnight shore
#

yes i know

river oracle
#

youtube tutorials for minecraft coding like πŸ’€

midnight shore
#

i removed it, no more problems πŸ˜‚

river oracle
#

I should be the change we want to see in the world

midnight shore
#

pain

river oracle
#

except I use vscode and thats a sin in of itself

quiet ice
midnight shore
#

don't say that again please

river oracle
shell trench
#

How can I chek if an advancement completed by a player in PlayerAdvancementDoneEvent was the "Free the end" advancement?

river oracle
#

maybe to become fluent in a language and be very good with it

quiet ice
#

With decently I mean being able to abide conventions and whatnot

river oracle
#

that seems insane no way

midnight shore
river oracle
#

programming language*

quiet ice
#

And to not commit the target folder or to use a git repo to only store compiled binaries

midnight shore
#

but thats a 1.19 thing iirc

quiet ice
hazy parrot
midnight shore
#

what do you mean

river oracle
shell trench
midnight shore
#

how can i get the angles so that then i do .write(0, and the angle)?

#

there's no container.getYaw()

midnight shore
#

?

#

ohh so they are floatss

midnight shore
#

actually in the Server.ENTITY_TELEPORT the head of the entity doesn't actually get rotated right?

quiet ice
# river oracle facts I only been coding for a year and a half I'd say I'm pretty decent

Syntax isn't the only part of learning a language. Being able to intuitively understand what other programmers of that language are writing is another thing. This means you need to obtain a lot of experience from a variety of sources.

Then there is also the buildchain. It's usually never (especially in modding space) as simple as just slapping gradle or maven on it and calling it a day

midnight shore
river oracle
quiet ice
river oracle
#

oh you have depression?

#

have you considered therapy?

quiet ice
#

Nah, it's simply that gradle and maven are unsuited for my purposes

river oracle
#

couldn't you just make your own plugins

quiet ice
#

Yes, but I've estimated that it would take more effort to maintain them correctly for eternity than to just build it from scratch

river oracle
#

fair

midnight shore
#

anyone knows how is Entity Look packet named on wiki.vg?

quiet ice
#

Plus it uses the janino compiler so I'll be very sure that I won't get the issues that I get with vendor JDKs on linux that I get when using javac

wet breach
#

but if all you are doing is just a custom build system to do what you want, then it really isn't all that difficult except taking the time to make it

#

complexity goes up if you intend to release it for the public and then having it to make it more modular then what you really needed it to be lmao

slow oyster
quiet ice
wet breach
#

I suppose I could review the PR

#

have some time before going to work lmao

twilit roost
#

this won't work ig?

wet breach
#

so, you have it returning an inventory, that is either the source or the attached, but what if there is both?

remote swallow
slow oyster
#

@wet breach It sends two separate events, for each type

remote swallow
wet breach
twilit roost
quiet ice
# quiet ice I've gone a bit overkill on the modularity

e.g. the build configuration of one of my testing projects is

LOAD slbc-janino-0.0.1-SNAPSHOT.jar
LOAD slbc-ide-0.0.1-SNAPSHOT.jar
LOAD slbc-paper-0.0.1-SNAPSHOT.jar
LOAD slbc-maven-shader-0.0.1-SNAPSHOT.jar

MODULE de.geolykt.janino.JaninoModule
MODULE de.geolykt.slbc.ide.IDEModule
MODULE de.geolykt.slbc.PaperModule
MODULE de.geolykt.slbc.MavenShaderModule

DATA SRC_FOLDER src/main/java
DATA JANINO_PACKAGER_RESOURCE_DIR build src/main/resources
DATA J_CLASSPATH build compile_Only de.geolykt:slbc-paper:0.0.1-SNAPSHOT slbc-paper-0.0.1-SNAPSHOT.jar

DATA MAVEN_SHADE build org.ow2.asm:asm:9.4
DATA MAVEN_SHADE build org.ow2.asm:asm-tree:9.4
DATA MAVEN_SHADE build org.ow2.asm:asm-util:9.4
DATA MAVEN_SHADE build org.ow2.asm:asm-commons:9.4
DATA MAVEN_SHADE build org.ow2.asm:asm-analysis:9.4

and

DECLARES build
USES get_mojmap
USES reobfuscate_to_spigot
USES janinoCompiler
USES janinoJar
USES eclipse
USES collect_classpath
USES maven_shade
java_compile REQUIRES collect_classpath
java_compile REQUIRES get_mojmap
eclipse REQUIRES java_compile
jar REQUIRES java_compile
maven_shade REQUIRES jar
reobfuscate_to_spigot REQUIRES maven_shade
slow oyster
wet breach
midnight shore
#

Anyone knows how is the Protocol Lib's EntityLook packet named on wiki.vg?

remote swallow
twilit roost
#

via grep.app I found everyone is only using it like this

vocal cloud
#

You can declare it and fill it on one line 😭

twilit roost
wet breach
#

generally should avoid hard set numbers if it isn't needed

slow oyster
#

Erm, I didn't make any changes to that?

wet breach
#

in the diff

slow oyster
#

Erm, yeah I guess because it's a diff of a diff πŸ˜„

remote swallow
#

are stash prs limited or can i just not remember my spigot login

wet breach
#

I will show you an example

#
-                        ItemStack itemstack1 = addItem(iinventory, iinventory1, iinventory.removeItem(i, 1), enumdirection);
+                        // ItemStack itemstack1 = addItem(iinventory, iinventory1, iinventory.removeItem(i, 1), enumdirection);
#

notice on the left, one is a minus the other is a plus

slow oyster
#

Well it shows up because the line numbers changed

wet breach
#

as I said if that was only the case I should see an equal match for removal

#

so the above what was changed is that it was commented out

slow oyster
#

Yeah I know, lines 159 to 185 are the new changes I made

wet breach
#

Anyways if you didn't change it, that is fine, just odd I don't see an equal removal is all

remote swallow
#

ah

remote swallow
#

?cba

undone axleBOT
#

ntm#3114 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.

#

ebic#5512 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.

wet breach
#

not the command I was thinking of

undone axleBOT
wet breach
#

there is another that links how to apply for stash access

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

wet breach
#

?CLA

remote swallow
#

?cla

undone axleBOT
wet breach
#

there it is

remote swallow
#

its not a fan of caps

wet breach
#

apparently

#

lol

wet breach
#

obviously someone else is going to test it too, but never hurts to provide your own results to ensure it works

undone axleBOT
#

morice#2976 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.

slow oyster
wet breach
#

hopefully someone else will review it and maybe then it will get approved πŸ˜„

#

always love new additions to the API

slow oyster
#

Thanks, yep will save me 100's of lines of code trying to do this using InventoryMoveItemEvent in my plugin too πŸ˜„

wet breach
#

almost makes me want to do my big pr for bungee and spigot

remote swallow
#

what of

slow oyster
#

Will also save me a ton of headaches as Paper optimised all the Hopper code so it behaves completely different on Spigot vs Paper πŸ˜„

wet breach
#

unix sockets

#

starting with java 17, java natively supports unix sockets

remote swallow
#

how would you explain unix sockets to an idiot

wet breach
#

this is good, and the pr I want to do is addition an option to use unix socket with bungee if the mc servers are also on the same host

#

this will improve network and overall make them secure

#

if they are on the same host

#

far less overhead in using unix sockets instead of TCP between bungee and mc servers

wet breach
remote swallow
#

sadly not

wet breach
#

unix sockets makes use of a file descriptor to utilize as a connection

#

so instead of going through the network card or the upper network layers, it is all handled at the OS level

#

this removes overhead in opening a socket and the sorts as well as improves the speed at which the data flows

remote swallow
#

that actually seems really useful

wet breach
#

the only thing people may have a problem with would be specifying the location of the unix socket file for bungee

#

but as long as the wiki gets updated it shouldn't be too much of a problem

#

also, unix sockets are not accessible outside of the host so naturally they are more secure

#

and thus no need to worry about firewall rules or ensuring you are using 127.0.0.1

tardy delta
#

whats a file descriptor lol

wet breach
#
In Unix and Unix-like computer operating systems, a file descriptor is a process-unique identifier for a file or other input/output resource, such as a pipe or network socket.
tardy delta
remote swallow
#

i wonder how many people have thought "that would be useful in the spigotapi" and then didnt pr it

wet breach
#

not sure, but for a long time Java didn't support unix sockets natively

#

it wasn't until Java 17

#

we could have done unix sockets long time ago, but software implementation of unix sockets isn't as performant as a native solution

#

also, unix sockets on windows is handled and created differently then on unix

#

so even more helpful to have that native solution to handle that issue

#

starting with windows 10 Insider Build 17063 unix sockets became natively supported πŸ™‚

#

so windows didn't always support such things either

#

but here is another thing though

#

If allowed, I could pr where there could be 2 unix sockets

#

one for the mc bungee communication and another for plugin communications

#

would be super handy lol

tall dragon
#

ughhhh as soon as i even hover my mouse over the class "Material" my intire ide freezes and forces me to stop the task from the task manager does any1 know why this could be happening?

#

even when i try to comment out code using the material class my ide freezes

#

i dont get it

echo granite
#

Anyone here knows why MythicLib requires java 16 to compile(using maven) while the plugin runs on mc 1.14?

tall dragon
#

intellij

tall dragon
#

like i legit cannot code anymore. this started happening out of nowhere

remote swallow
#

thats weird

tall dragon
#

my pc is plenty powerfull enough

remote swallow
#

you maxing disc or ram out or something

tall dragon
#

cpu is at 100%

echo granite
#

same thing happened to me in my i3 old pc

tall dragon
#

but it never used to happen

echo granite
#

couldn't open the material enum

tall dragon
#

it handled Material class just fine

#

and now it just freezes even when i try to delete code that uses Material

#

so i cant even remove it

remote swallow
#

have you by chance recently updated to 2022.4

tall dragon
#

no

tardy delta
#

so it doesnt have to decompile every time

#

had that issue too

tall dragon
#

dont think that works if ur using from BuildTools

tardy delta
#

uh if it comes from a dependency ur fine

wet breach
# tall dragon my pc is plenty powerfull enough

idk if IntelliJ finally allows it, but see if you can change the resource requirements for intelliJ? or see if you can use additional JVM arguments and use something similar like what you would for mc server

#

netbeans lets me do this, not sure if IntelliJ finally did

#

otherwise the only way to make intelliJ use such things is to modify the global Java options stuff from control panel

#

another thing to try is to close out projects you are no longer doing anything with

tall dragon
#

yea like change how much ram it uses?

wet breach
#

as well as the GC stuff

#

I normally give my IDE 4GB to use

#

since I tend to have a lot of opened projects usually

tardy delta
tall dragon
#

it lets me edit this

tardy delta
#

8 gigs max brr

tall dragon
#

my ide has 8gb available

remote swallow
wet breach
#

add some VM options for the GC stuff

tall dragon
#

it doesnt even use it all

wet breach
#

it is most likely the GC that is killing your IDE

#

give the GC some extra threads to work with

tall dragon
#

no idea how tbh

wet breach
#

let me go find the vm option for it

#

by default GC gets 1 thread to use

kind hatch
wet breach
#

it should have 4 threads if you can allow it

tall dragon
#

@wet breach the weird thing is. its only freezing in one project

#

another project opens material class in under a second

wet breach
#

-XX:ParallelGCThreads=4

remote swallow
kind hatch
remote swallow
#

it made me update to 2022.2.4 a lot so i probably just thought it off that

tall dragon
#

could it be some dependency problem?

wet breach
#

-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled +PerfDisableSharedMem

#

and then add those

#

the last one in that may or may not cause problems

tall dragon
#

then it looks like this

#

that correct?

wet breach
#

not sure if they can be all on one line or it IntelliJ expects it on multiple lines

#

but try it out πŸ™‚

remote swallow
#

i wonder if giving ij more threads would make it run somewhat smoother

wet breach
#

it should for the GC

tall dragon
#

πŸ˜„

wet breach
#

I added another option

orchid gazelle
#

Eh normally it just should give it to the JVM directly, and JVM Standard allows the argument format

remote swallow
#

why are you still on 2022.1 lmao

wet breach
#

might need the unlock experimental option

tall dragon
#

well this is fun

#

now i cannot launch my ide and idk where that jvm file is

wet breach
#

it tells you above

#

in that pic

tall dragon
#

its not there tho

wet breach
#

oh

#

well then time to use some google fu

tall dragon
#

its in bin so i found that

#

but it doesnt look like what i left it at. at all

wet breach
#

IDE_HOME\bin\<product>[bits][.exe].vmoptions

remote swallow
#

if its using that one it cant handle the 750mb of ram

#

doesnt have enough

wet breach
# tall dragon

make a copy of this file, then try modifying this file instead

#

Please note that customΒ .vmoptions file created using 'Edit Custom VM Options' action has the priority over the original file in the bin directory.

tall dragon
#

well where is that one

wet breach
#

try looking in your user directory

wet breach
tall dragon
#

ya i found it

wet breach
#

and it appears the options have to specified one per line

#

instead of all on one line lmao

tall dragon
#

yea put em all one a line

#

and it launches now

wet breach
#

it should perform a bit better now πŸ™‚

remote swallow
#

im just gonna rob them rq and see if i can make ij run smoother

wet breach
#

Anyways try setting in that options as well

#

for xms to be the same

#

if anything you probably could use almost everything from aikar flags

#

could even set the -Server flag as well in the beginning

tall dragon
#

well damn the Material class opened without problems

wet breach
tall dragon
#

though i did comment out all my dependencies

#

so could still be a problem in there

#

somehow

wet breach
#

try it without them commented out

#

worse case is your IDE freezes again lmao

tall dragon
#

well yea its still opening fine right now

#

never mind

#

whenever i interact with this class specifically it freezes

#

though this time it did recover from the freeze

#

so i think those vm options really did help

#

thanks a ton @wet breach been pulling my hairs for 2 days over this

remote swallow
#

update ij as well, might be an outdated version thing

echo granite
tall dragon
remote swallow
#

oh god

tall dragon
unkempt hare
#

Is there a method that will automatically replace hex codes with the proper color (i.e. &#ffffff would turn text white)? I would have thought translateAlternateColorCodes would have done the job but it doesn't

chrome beacon
#

If you want to use legacy colors the format would be &x&f&f&f&f&f&f

unkempt hare
#

Oh god

tardy delta
#

that will be able to replace colors like #fffff

echo basalt
tardy delta
echo basalt
#

I despise the new discord font

remote swallow
#

what new discord font

tardy delta
#

im gettin used to it

echo basalt
#

fucks with my poor eyesight

tardy delta
remote swallow
#

dont have it

echo basalt
tardy delta
#

had a related font on linux

remote swallow
tardy delta
#

tf

echo basalt
remote swallow
#

ratio

tardy delta
#

i should be sleeping in fact

remote swallow
#

who needs sleep

tardy delta
#

but i thought fuck sleep

#

college at 11am smh

#

gotta take a train earlier so im there at 10am, still getting up at 8:30 lol

last sleet
#

Hello, I'm wondering how can I check which slot I,m hovering over?

#

I'm currently in an InventoryClickEvent, and I'm detecting when a player presses a number key (hotbar swap), but I want to know which item it will swap with

quaint mantle
#

How would I go about making a page system for an inventory.

#

Lets say each page has 3*7 slots

remote swallow
#

now something doesnt add up there

#

a row has 9 slots not 7 lol

quaint mantle
#

technically its 5*9 but the slots used will be 3*7

remote swallow
#

ah

quaint mantle
#

anyways: do you have a video i could watch or some sort of help w/ that

#

couldnt find anything on google and my attempts had failed

last sleet
remote swallow
last sleet
#

Oh, nvm, I just learned that hotbar swapping also triggers an inventory click event. I'm guessing I can use e.getSlot() to get it

remote swallow
#

didntknow that

unkempt hare
last sleet
quaint mantle
#

ill give an example of how it should look

robust ferry
summer scroll
#

It depends, do you want maximize the page, or it will go unlimited pages?

quaint mantle
#

unlimited based on the number of items available

#

so if there is only X amount of items then there is X pages available to browse thru said items

unkempt hare
#

Well if you're trying to do it manually then the general idea is to create a 2d array of itemstacks where each page has it's own array with arrays of rows. When a page is changed you go to the element of the page in the first array, and loop through it to get all of the items

quaint mantle
#

mixed paper and the arrows but you get the idea

quaint mantle
#

correct?

summer scroll
#

What I do is I put all of the items in a single list and then paginate them, and have a Map to determine what items that this page have, but If you care about what slots the item is put before, use ItemStack arrays.

quaint mantle
#

ic

unkempt hare
#

Although I would recommend using a library since all of the hard work is already done for you, but that's obviously up to you

quaint mantle
#

Can you confirm a yml file to a hashmap

#

like lets say i want to convert this:

Test:
    A: 1
    B: 2
unkempt hare
#

You can turn a yml file into an entire class if you do it right (and vise versa)

quaint mantle
#

into a hashmap of String: Integer

eternal oxide
#

When a yml file is loaded it's Hashmap backed

quaint mantle
#

oh damn really?

#

so then i assume i can do

eternal oxide
#

yes, .getValues(true) I believe returns a map of a MemorySection

#

or something close to that

quaint mantle
#

okay but

#
inst.getData().get("%s/Crates").getValues(true)
#

I know this doesnt work, but something similar to this

#

%s is what i used for string.format to add the uniqueid

eternal oxide
#

not /

quaint mantle
#

?

eternal oxide
#

a path uses . not / as a divisor

quaint mantle
#

/ has always worked for me

#

for some reason

#

ive used it for months with 0 issue

remote swallow
#

are you setting the divisor to that somewhere

quaint mantle
#

uhh

#

lettme check

#

@remote swallow where would you chance this?

#

in the pom, plugin o

#

*or

remote swallow
#

code

#

something like config.options().pathSeparator('char')

quaint mantle
#

nope

eternal oxide
#

I guess it accepts / too. Never seen that as everyone uses the default .

remote swallow
#

yeah

quaint mantle
#

huh

#

i didnt know . was a default

#

i just assumed / because of windows cmd lol

#
PlayerData inst = PlayerData.getInstance();

HashMap<String, Integer> hash = new HashMap<String, Integer>(){{
    put("CommonCrate", 0);
    put("RareCrate", 0);
    put("LegendaryCrate", 0);
}};
inst.getData().set(String.format("%s/Crates", event.getPlayer().getUniqueId()), hash);
#

So then this should work fine correct?

#

yaml player data

#

i can read it

#

fine

last sleet
#

How can I check if an item can take damage (has durability)

eternal oxide
#

instanceof Damageable (make sure you use the correct import)

last sleet
#

There are multiple ones?

#

Because I tried with instanceof Damageable and it didn't work

eternal oxide
#

two

last sleet
#

I assume this is not the good one

eternal oxide
#

thats for itemstacks

last sleet
#

It's in the meta subcategory though

#

which one is the good one?

eternal oxide
#

depends what "item" you are testing

#

the other is for Entities

last sleet
#

but it tells me sticks and arrows are instanceof Damageables

unkempt hare
#

You're telling me you've never broken a stick before?

last sleet
#

;-;

#

test code + console output

#

it doesn't get any more cursed than this

unkempt hare
#

I believe all item meta is damageable even if it doesn't actually use it

last sleet
#

ah.

#

then what should I use to check if it can take durability

#

A guy made a whole list of damageable manually, but I think there's a more elegant solution lol

unkempt hare
#

I think you have to do something with the Material but I am checking

#

Material has getMaxDurability()

last sleet
#

I'll see what it returns when it can't take damage

hazy parrot
#

in that case, there is Repairable interface

#

so you can check instanceof that

last sleet
rugged leaf
#

how would you increment the scoreboard value of a player? Anything I try to look up about scoreboards just talk about the getting the sidebar to do fancy things

kind hatch
#

Can anyone help me with mysql database design. I have the data I want to store, but I don't think I'm doing a great job organizing it effectively. At least the way I'm currently storing it is to prevent one table from storing a massive amount of columns.

wet breach
#

use foreign keys

#

foreign keys match the primary key of another table, this helps link tables together efficiently that have data that is to be used together

kind hatch
#

Right now I have some tables setup like this. I don't think they have foreign key relations atm, but I just access the table I need anyways. Is this better than storing all of this data in one table? Or should I be taking this approach?

wispy flicker
#

Hey guys
Came back to my plugin after about a week break.
Im new to packet editing and sending . could i get some help with it?
Im struggling a bit because im trying to follow guides and not getting far enough. can someone walk me through making an itemstack for an entity and help me fix a bit of my broken code

worldly ingot
#

Then any reference to a player can just be done via that foreign key instead. Saves you a little bit of data because an int is much smaller than a 36 CHAR

kind hatch
worldly ingot
#

You will almost certainly have to do that

#

And yeah, the UUID type is usually pretty fast, but the tables you showed are using VARCHAR(36)

#

Which, I mean at the very least, make use of a CHAR(36) ;p It's never going to be variable

#

I think the UUID type specifically is also relatively modern

kind hatch
worldly ingot
#

Oh actually, UUID doesn't exist in MySQL. It's MariaDB exclusive

next plume
#

The more I learn about SQL, the more I hate it.

kind hatch
#

At least I think I am

worldly ingot
#

It's a superset of MySQL iirc, created by some maintainers of MySQL

#

Most people are running MariaDB now-a-days anyways

kind hatch
#

Ah, I am not.

#

Fk me

wet breach
kind hatch
next plume
#

Most hosts provide a MySQL database.

wet breach
#

You could grab data from all 3 tables with a single query using a foreign key

#

In this manner it is faster and more efficient and more easily cacheable

wet breach
wet breach
#

They left because they were not being allowed to do the things that were needed for mysql cause you know oracle likes to be that way lol

remote swallow
#

i should check mariadb out

wet breach
#

It is a lot better. And it's compatible with the mysql driver however mariadb driver is recommended

#

Maybe we can convince MD to swap the driver out that spigot provides since it is a pain to load mariadb one if mysql is on the path

#

About the only nuisance in terms of plugins go

spare marsh
#

is there a way to get an inventory instance and check for its title? With reflection or something?... Without events

wet breach
#

Inventory should have a method for getting the title?

#

And you don't need events to grab inventories

spare marsh
#

The inventory object itself doesn't have a method to get the title I think. I have looked for it

kind hatch
# wet breach It would reduce the amount of queries.

I'm still wondering if I would actually need foreign keys or a table join when I'm just accessing each value individually. My impl right now has a method for each piece of data. (Probably not the best, but it is what it is) I think there is maybe one thing that would actually take advantage of multiple pieces of data from a single query, but for the most part, it's kept very simple.

kind hatch
spare marsh
#

Which I can get from InventoryClickEvent... But I want to get it without catching the event

wet breach
#

Because the benefits with using foreign keys is a combination of query caching and less queries which you probably are fine without either of those

kind hatch
# wet breach Because the benefits with using foreign keys is a combination of query caching a...

I mean, query caching sounds great, but would that not happen with a normal query that's sent multiple times? Like, when I call one of my methods, lets say #wantsCommandSounds(). It'll use the query SELECT command_sounds FROM preferences_sounds WHERE uuid=?; I'm being very explicit with what I want because it's the only thing I need. Would this query not be cached? Or am I still not understanding something here?

wet breach
#

Yes and no.

#

So yes it would cache queries but no because you doing two separate table lookups. So mysql has no way of knowing the two tables and queries are related

remote swallow
#

from what ive found online from a quick google, is there no repos for direct maria db or am i just blind

wet breach
kind hatch
wet breach
#

You can select at bottom for which distro

wet breach
#

You have 3 tables all of which have a primary key

kind hatch
#

Right

wet breach
#

You could on two tables replace primary key with foreign key and specify the primary key to use for it the first table

#

You wouldn't need to drastically change anything presently to make use of foreign key either. But your setup as it is now. Is perfect for it

#

You can continue to keep your queries the same. Just when you need data from all 3, it makes it easier to grab it all

kind hatch
#

That's the thing. I don't access more than one column name at a time. So I'm not sure if it would make a major difference.
SELECT command_sounds FROM preferences_sounds WHERE uuid=?
vs
SELECT * FROM preferences WHERE uuid=?

If I understand correctly and I went with your suggestion, would I just need to change the queries to the second one? That way I can grab whatever I want? Or would I just leave them like the first one and some benefits show up in the background?

wet breach
#

You can leave them like the first. Just when you want data from the other tables you could query on foreign key instead

#

Recommend reading on foreign keys. Recommend setting it up and not really need it then to try and set it up later but all your data needs reorganizing to benefit from it.

#

As I said, right now your setup is perfect to setup foreign keys

#

And you have the tables properly organized too

#

Not many people manage to have it like you do lol

remote swallow
#

maria db is still confusing me so ill try and figure it out when ive slept

kind hatch
wet breach
#

It's mysql with improvements

kind hatch
#

I just didn't want everything in one large table.

#

However, I didn't know if that was good practice or not

wet breach
#

So what you are doing is good and should be a habit you do

#

For mysql dbs that is or relational dbs

#

Other db types benefit from the opposite lol

river oracle
#

see I'm glad to know that. I always was scared of large SQL database because i thought the tables would get unbearably big glad to know its encouraged to split them up

#

i just imagine a super big excell sheet with random information that has nothing in common besides the key

wet breach
#

Well if it's just one db and table then there is no relational in that. It's not called a relational db if it wasn't designed to have multiple tables lol

river oracle
#

what does relational data even entail

wet breach
#

Means data from one spot relates to another

river oracle
#

isn't that just basic key -> value structure though

#

key relates to value

#

I feel stupid lol thats def not it

wet breach
#

So the design above that shadow has is a perfect example. All 3 tables relate to each other. But the data is far enough apart they can be in their own tables

kind hatch
wet breach
#

Easiest way to setup a db is to make them pie graphs that overlap

kind hatch
#

You mean the ones that you can click a section and you get another subdivided section?

wet breach
#

The ones I am talking about is 2 or 3 circles and they overlap in the middle

kind hatch
#

A Venn diagram?

wet breach
#

If you use that and start plugging data you want stored into it. You can see which data relates to what and setup a db accordingly

wet breach
river oracle
#

lets say you store data under a player UUID wouldn't all data relate back to that player UUID in some form or another so you could justify putting it in one table since all of that data relates to certain things about the player?

#

i feel like that'd be shitty design just pointing something stpuid my brain thought of

wet breach
#

Well you could store data for entities in which case those uuids don't point to a player

#

Or maybe you are storing block info

#

Which points to no uuid

wet breach
river oracle
#

so it'd be logical to have a table like
Player (primary key), join_sound, home_position, last_death_location, money

wet breach
#

Yes but let's take for example home position

river oracle
#

idk I rather have a table

table 1
UUID (primary key), join_sound, leave_sound
table 2
UUID (primary key), home_location, last_death_location
table 3
UUID (primary key), money
wet breach
#

Home position could be multiple points and therefore could have its own table but linked by the uuid to better store more points instead of putting them all in a single column

river oracle
#

this may be completely illogical, but it seems much more neat and clear than the jumbled mess of a massive table

wet breach
#

It is easier grabbing data by row then it is parsing a single column as well as mysql can more efficiently store such data

#

But your setup above would be logical

#

Because now you can grab player money without having to grab all the other data. But you can still grab the other data if need be

river oracle
#

I don't know much about sql statements

#

but wait could you do something like

kind hatch
#

Wait, so in my setup, would it just be as simple changing the primary keys to foreign keys that point back to the preferences table? I wouldn't actually have to remove that column?

river oracle
#

GET * FROM table1,table2 WHERE playeruuid = ?

wet breach
#

Have to remember data will be returned for a query. The more data in a table and row the more data returned and you might not need it all. Also more data for mysql to parse.

kind hatch
wet breach
river oracle
#

ahhh okay thats dope

wet breach
kind hatch
#

So the benefits are really just more on the backend?

wet breach
#

Yes and frontend too. But you already took care of that from the start

kind hatch
#

Oh, so I would still need to join the tables if I wanted to "merge" the data into one resultset.

wet breach
#

Yes.

river oracle
#

look at me learning SQL for the first time πŸ₯³ now I should actually use it outside of school lol

wet breach
#

Lol

river oracle
#

I don't ever have good plugin ideas I feel like making though I just start something and than abandon it

wet breach
#

Which as I said most people don't do

#

Thus harder to see or realize the benefits of this one other thing lol

river oracle
#

good job shadow good DB design πŸ‘πŸ½ can't relate

kind hatch
#

:3

wet breach
#

I think once you get the hang of foreign keys and joins the next thing to learn would probably be when to use myisam over innodb

kind hatch
# wet breach I think part of the reason you have a hard time seeing the benefit is because yo...

Idk, when I was in college they were teaching us Microsoft SQL and I wanted to end myself. What they had us make just confused the hell out of me. So when I started researching normal mysql, things started making a little more sense. However, I think it's mainly because I don't understand how it all fits together.

Organizing data together is complicated since you can categorize it multiple ways. Then based off those categorizations, you have different setups to get the maximum benefit out of it. I'm trying to find that out as well as understand how the backend works.

wet breach
#

Yeah Ms SQL is weird

#

Never really bothered with it myself so don't feel bad about that lmao

#

And you are right data can be organized in different ways and essentially that is what makes or breaks a db design

#

Because in the beginning it could have been good until you started adding more and now that original design is no longer good

#

But this is normal and your db design should change as needed and not attempt to make it all work as that is where it will start to go all wrong lol

kind hatch
#

Right, and I figured at one point that may happen, but I'm kind of reaching my creative limit with this plugin anyways, so it's unlikely that I will have much to change in the future.

remote swallow
#

what would be the better way to store data that is a uuid, location and a material and just an int, would it be better to make a table to each uuid been as there stands an infinite amount of locations that can be stored for that, or do i just store it in 1 table with uuid as the primary key

#

on sqllite or maria db

river oracle
#

whether you use sqlite or maria db depends more on scale I guess

wet breach
#

SQLite does alright with small to medium datasets as it is just plain binary file storage. After a certain limit SQLite starts to suffer

remote swallow
river oracle
wet breach
remote swallow
#

int is just money value

#

actually that should be a double

wet breach
#

So you should have player data in one table and block data in another and you either use uuid to identify them both or use some other unique identifier.

remote swallow
#

mkay

#

which is better for storing uuids, byte array or a char(36)

wet breach
#

However not all data needs to relate either.

wet breach
remote swallow
#

im just planning atm so idk which i would do, ive got bytearray code already so ill probably end up using that

kind hatch
river oracle
kind hatch
#

IntelliJ

remote swallow
#

ultimate?

kind hatch
#

Yes

#

Student edition baby

wet breach
#

The bytes will be stored as a string in mysql unless you are using blob and don't recommend using blob unless you really need to

river oracle
remote swallow
#

what ill probably end up doing is just making it work with sqllite then figure out how to support mysql into that

wet breach
#

SQLite and mysql both use SQL there is some minor differences in the SQL queries and types. Major difference comes in connection and performance

kind hatch
wet breach
#

SQLite is nice for small things also SQLite can't be used to share data as only a single process can have a lock on a SQLite db file

remote swallow
#

what ill end up doing for now is

playerdata
--UUID (byteArray)
--int (to relate to other table)
blockdata
--int
--location with however many collums it needs, i dont remember
--material
--double money value

wet breach
#

Unless you make some kind of api of course to share that data but then might as well use mysql as it will do such things more optimally lol

kind hatch
kind hatch
wet breach
#

Why does hugs data have a uuid?

river oracle
#

thats hours of work I'm not prepared to do

kind hatch
wet breach
#

Just fyi. Mysql allows creating a function to pull that data automatically

kind hatch
river oracle
#

I use VSCode

#

and custom hotkeys I bound myself

kind hatch
#

Oh right

#

lmao

#

I forgor

wet breach
#

So you can create a function then create a script ran daily to fill db in

remote swallow
river oracle
#

my hotkeys are based off of eclipse hotkeys, but thats a minescule amount of the work

#

I can use my entire IDE without the mouse most of the time now

kind hatch
#

@river oracle Also

#

Visual Studio is on that list. πŸ˜›

river oracle
#

I use like a clongomerate of VSCode defaults Eclipse defaults and my custom binds

kind hatch
remote swallow
river oracle
wet breach
remote swallow
wet breach
# kind hatch Can SQLite also do this?

With mysql you can make a function and then a script that runs daily or hourly to invoke the function which then populates that table and that table could best be memory only

kind hatch
river oracle
#

what? whats a database? I just store all my data in a piece of bedrock hovering above spawn with alex's Block PDC lib

wet breach
#

Lol

remote swallow
#

i store all my data in yaml files

river oracle
#

hopefully no one breaks the piece of bedrock that would be chatastrophic

remote swallow
#

if its item stacks i keep 3 copies of it and b64

remote swallow
#

every block gets atleast 10 copies of it

wet breach
kind hatch
wet breach
#

But there is some nifty commands mysql comes with built in. Like you can do math with mysql and other things

#

So like I said with your hugs data, if it's all data combines just make a function to call some mysql commands and then have it insert into that table. Table benefits from being memory only because you don't actually need to save that data to disk as it already is

#

Data gets rebuilt anyways if table is lost every so often

#

Just make sure you include in your function the presence of the table and if not there recreate it

kind hatch
#

Hmm, I wonder how that would affect my current implementation. That would take some load off of the server startup. I guess I could leave some of the interface specific methods blank then.

wet breach
#

All you would need is a timer to invoke the function

#

And then pull the data into application lol

kind hatch
#

Oh, not that. I'm talking about my database interface class.

wet breach
#

Oh

kind hatch
#

The way I have it now is to increment the number every time a hug is given. So in the case of mysql, I could just leave it blank.

wet breach
#

You can make dynamic functions too where you plug the info in that it needs

#

So like if the queries are always the same but only difference is like uuid you can turn that entire query into a function call instead

kind hatch
#

Wait what?

#

Why is there so much that can be done with mysql? :3

wet breach
#

You can even do comparisons in a query or function too

last sleet
#

I'm trying to hide the enchantments on an item (to replace them with my custom lore), but it won't work even with HIDE_ENCHANTS flag

wet breach
#

Which is handy for some math related things lol

last sleet
#

any ideas why?

kind hatch
wet breach
#

Yeah when I first learned about mysql doing functions I was like man why am I messing with all these queries then lmao

#

Since most of the time my queries are relatively the same. Also you can setup functions from a query too

#

So they don't have to be setup before hand

kind hatch
#

I thought this was going to be easy. Smh

wet breach
undone axleBOT
last sleet
#

I accidentally closed MC and now it's stuck on downloading update?

#

anyways

kind hatch
#

You need to add an item flag to the item meta.
ItemMeta#addItemFlags(ItemFlag flag)
The flag you want is ItemFlag.HIDE_ENCHANTS.

last sleet
#

this just takes enchantments and puts them in blue on the item. It works (in minecraft) but the enchantments are nto hidden

#

rest of the code

#

(in which I do actually add the flag)

remote swallow
#

are you setting the meta, then setting the meta again

last sleet
#

made a quick command to give me flags and lore, and it seems the book does have hide enchants

wet breach
#

Are you sure it's being added and not like overwritten?

remote swallow
#

because that code looks like you are setting the hide_enchants flag then are setting the lore on a different item meta

last sleet
last sleet
#

Actually, I think I just figured it out: perhaps HIDE_ENCHANTS does not work on EnchantmentStorageMeta (for books)

#

I'll go check if there's a flag for that

wet breach
#

Add some debug code to output the metadata

#

Or that could be it

remote swallow
#

from what i remember enchantment books have lore for the enchant

kind hatch
#

Actually, I think they use the Potion Effects attribute for some reason.

last sleet
kind hatch
#

Try using the ItemFlag.HIDE_POTION_EFFECTS flag on the item as well.

remote swallow
wet breach
kind hatch
#

lmao

last sleet
#

weird stuff...

remote swallow
#

mojank

kind hatch
last sleet
#

mojunk 😒

wet breach
#

Actually makes sense

kind hatch
#

Potion effects on books?

wet breach
#

Yep

kind hatch
#

How?

wet breach
#

Because enchant books and potions share similar nbt data and structure unlike the tool items

#

Have to remember some of these features are after thoughts lol

kind hatch
#

Fair, but they could have separated them for better consistency.
HIDE_TOOL_ATTRIBUTES vs HIDE_ITEM_ATTRIBUTES

wet breach
#

True

kind hatch
#

Then the catch all HIDE_ATTRIBUTES would handle both and keep legacy support somewhat in tact.

wet breach
#

But internally the code for book enchants in regards to fetching nbt data is probably the same for potions hence not changing the nbt flag name to something that makes sense. But yeah they could have done better but lately seems they haven't been able to

kind hatch
#

Wdym as of lately?

#

They've been doing decent QOL in the snapshots.

wet breach
#

Well they were forced to add that reporting feature. I am sure that wasn't mojangs idea. And if Mojang could have they probably would have made certain things better but probably didn't have time

kind hatch
#

Yea, I agree. They did fix some stuff revolving around it in the snapshots. Lemme see if I can find what specifically because it sounded decent enough to maybe not be overly skeptical about using 1.19.3 regularly.

#

Oh right. They only changed things revolving around the chat trust status indicator in the first snapshot. Then they fixed some exploit that the community was using in a future snapshot.

wet breach
#

Still doesn't resolve the moderation portion

kind hatch
#

True

wet breach
#

So all of this is not really relevant as long as forced moderation exists or attempted anyways as the community is going to make those features not relevant

#

Like cool I guess the client is notified but not sure who is actually going to care

kind hatch
#

That's why I'm going to stick with modded launchers from now on. Gotta have that NoChatReports mod installed at all times.

wet breach
#

Well for servers you don't control. But like not necessary if servers disable chat reporting anyways lol

#

I think Mojang would have better reception of the feature of it had an opt out setting

kind hatch
wet breach
#

Or maybe if there was a banner servers could sport by having that feature enabled like valve servers and their anticheat

kind hatch
#

Is it not something you can get from the query port?

wet breach
#

If you had the anticheat disabled for valve servers you couldn't be considered official

#

So Mojang could have done something similar for mc servers if they chose to have that feature enabled

#

But they would need some added other benefits for it too. Like for example maybe server owners could be allowed closer contact with support in cases where chat involved their server

#

Like I mean as long as the moderators for a server took care of it already and show proof to Mojang not like Mojang needs to do anything further. I would say this system works best for servers that choose to do nothing

#

While I understand server owners not liking Mojang stepping in, at the same time server owners should be following the rules they agreed to as well

#

But as long as they are, Mojang shouldn't need to step in so I could see a system where closer contact with support being the middle ground here

kind hatch
#

There are so many things they could have done during that whole debacle, but they caused another rift in the community. Fortunately, the community always comes up with a solution and at least we got an option to disable part of it for servers. However, it is extremely annoying that we have to download a mod so that we don't get banned for no justifiable reason.

wet breach
#

Well again it's something Microsoft probably forced on them and probably did it at less then ideal times giving Mojang no time to really do much

#

However they could though fix the system to be better especially for server owners

#

I also understand Microsoft's side too. Maybe I should email them in a better way to fix this

kind hatch
#

I'm of the same belief, but deadlines can always be pushed back. Thankfully their first implementation was so bad that it made it easy for the community to find ways around it.

wet breach
#

Because I think what Microsoft is trying to do is enforce servers being more kid friendly just don't understand there is a better way

#

Like they could make a service like said to be so called verified for server owners to participate in. And if they meet all the guidelines, they can sport a banner for being kid friendly or whatever else

#

In this manner it makes it easier for parents to decide for their kids what servers they can be allowed on

#

Also would make it easier to incorporate a system to only show such servers if an account is designated for kid friendly too

#

And I wouldn't mind paying into such service either

#

So that's an added revenue source for Mojang and Microsoft as well

#

See unlike everyone else, I can see the business aspect of such things and unfortunately not everything can be free lol

#

Plenty of servers have been allowed to freely make money all the while some ignoring the rules

#

This is just Microsoft pushing back just doing so in less then favorable ways. The system I proposed above would probably not have received as much backlash all the while accomplishing what they are wanting

round finch
#

Age restrictied servers?

#

Or kid friendly servers for kids

wet breach
#

Like not being a scam server for example lol

round finch
#

Ban scam owners

wet breach
#

Easier said then done with current system. System I propose above would automatically do that

#

Without having to really put much effort

round finch
#

Yeah verification servers would be great
Approved for safety

kind hatch
#

They wouldn't shell out the money for a system like that.

wet breach
#

That extra revenue stream would pay to have staff visit verified servers or check out servers that applied for verification

round finch
#

Easier to feck everyone else over

wet breach
#

In this manner everyone wins because it's not forced

#

But all sever owners would want that verified tag

round finch
#

Plus making kids ask parents to spend more money

#

I bet next is mine coin to java

#

Total greed

wet breach
#

I think I will email Mojang about my idea

round finch
#

Server tags would be great πŸ‘

wet breach
#

Who knows maybe they may change it to that. But won't know unless I try

round finch
#

Not sure if they care about older players

wet breach
#

Never said anything about older players

round finch
#

Just the way they act

#

Everything is now kid and family friendly in chat

wet breach
#

My idea is to fit what Microsoft is most likely trying to accomplish and Mojang for a while.

round finch
#

I want to use mods for private chat

wet breach
#

Their game and Microsoft's service is geared towards kids and parents. Older players can still do what they want just not in places designated kid friendly.