#help-development

1 messages · Page 2075 of 1

granite owl
#

i serialize it on shutdown

#

and deserialize it on load

#

everytime a player logs online i check if the list contains him

#

if not make new entry

#

so even if i have 100k users which i highly doubt, id barely use 8.5mb ram

#
@SuppressWarnings("unchecked")
    public static void loadPlayerUUIDList()
    {
        File knownPlayerFile = new File(MetaDir + SelfName + "/PlayerList.bin");
        
        if (knownPlayerFile.exists())
        {
            main.playerUUIDList = (HashMap<String, UUID>)Utils.DeserializePtr(knownPlayerFile.getPath());
        }
    }
    
    public static void savePlayerUUIDList()
    {
        Utils.SerializePtr(main.playerUUIDList, new File(MetaDir + SelfName + "/PlayerList.bin").getPath());
    }
    
    public static void updatePlayerUUIDList(Player p)
    {
        if (!main.playerUUIDList.containsKey(p.getName()))
        {
            main.playerUUIDList.put(p.getName(), p.getUniqueId());
        }
    }
#

and then the list is accessed via reflection from other plugins

#

using the plugins instance

#

thats what i came up with to bypass mysql

#

xD

tardy flame
#

wow

#
    public static @NotNull UUID getUUIDFromName(String name) {
        return Bukkit.getOfflinePlayer(name).getUniqueId();
    }
grim ice
#

request to mojang

#

a blocking request

tardy flame
#

do I look like I care?

grim ice
#

you should

tardy flame
#

i don't

hybrid spoke
#

sus

grim ice
#

give me an ideea

#

i wanna make some type of app that crashes ur pc

#

but that doesnt sound fun

hybrid spoke
#

a config option to let specific mob types have x2 damage in 35 lines of code

grim ice
#

i can just main(null);

hybrid spoke
#

that was health

grim ice
#

i saw the repo

worldly ingot
# tardy flame i don't

Man. I look forward to the day that you run this code while the auth servers are down and your server crashes as a result lol

grim ice
#

i mean my way is laggy but i dont really notice another way

river oracle
#

My favorite code is thread.sleep

grim ice
#

my favourite method is
public static void main(String[] args) {
main(args);
}

#

in a JFrame app

river oracle
#

Recursion

grim ice
#

yes

river oracle
#

Smart cookie using efficient recursive algorithm

torn shuttle
#

auth is for cowards

#

do you really think people would do that, go on the internet and tell lies?

worldly ingot
torn shuttle
#

thanks man I trimmed my beard just yesterday actually

#

it's been a long-ass time since I posted a selfie on here

#

do I need to bring that back?

worldly ingot
#

No

torn shuttle
#

I'm getting mixed messages

grim ice
#

Yea

worldly ingot
#

GOod

grim ice
#

2vs1

#

i dont but i wanna torture yall

torn shuttle
#

man it really is inevitable that popularity breeds controversy

river oracle
#

Yez

torn shuttle
#

Heyo it's a good day to be me

halcyon mica
#

So question

#

I am registering a custom entity type for one of my plugins

grim ice
#

(jk)

halcyon mica
#

But in 1.18.2, I cannot access the registry anymore because it is "frozen" now

#

How do I circumvent that

river oracle
torn shuttle
hybrid spoke
torn shuttle
#

the one and only, accept no replacements

grim ice
#

i mean ur pfp suits u

torn shuttle
#

it's literally me on the pfp

grim ice
#

OH LOL

torn shuttle
#

well back when I had glasses

river oracle
#

It's almost like it's him

torn shuttle
#

I got lasik a couple of months back

river oracle
#

My pfp is me too guys trust me

torn shuttle
#

uh november, it's been more than a couple

hybrid spoke
#

he looks like his pfp, not the pfp looks like him.

hexed hatch
torn shuttle
#

ye

halcyon mica
#

Anyone?

hexed hatch
#

Was it expensive?

torn shuttle
#

if you don't mind people slicing your eye open it's lit af

torn shuttle
#

it cost me 3k which is actually pretty expensive for these surgeries, you can get it done in the us for about 1.1k per eye

grim ice
#

and idk if i can trust them

#

what if someone terrorist bombs the hospital during my surgery

#

i cant trust my luck

#

u can go blind if they mess up that kinda uh

#

gambling

torn shuttle
#

but yeah all in all pretty cheap

river oracle
#

I like gambling with my health

torn shuttle
#

honestly I would've spent way more in glasses

#

over the next 20-30 years

grim ice
#

my eyes are the last thing i want to gamble with

#

and ON 2 EYES

#

THATS WAY TOO BIG OF A GAMBLE

river oracle
#

Just have it done 1 eye at a time

grim ice
#

yea

torn shuttle
#

that what I had, 1 at a time

grim ice
#

that doesnt change anything

torn shuttle
#

2 days apart

river oracle
#

Yes it does

grim ice
#

1 at a time is worse than 2 at once

river oracle
#

Well if they mess up the first one you can still see out of one eye

grim ice
#

the chances of stuff going fine twice in a row is less than stuff going fine once

torn shuttle
#

lol no that's not how that works

grim ice
#

shh

river oracle
#

Don't tell that too a statistics professor

torn shuttle
#

also interestingly enough lasik is statistically speaking the safest operation you can have as it would seem

#

turns out people are extreeeemly picky about this one very specific surgery so it has to be super duper safe

halcyon mica
#

I guess I'll ask somewhere else then

grim ice
#

i wouldnt want to gamble my frickin vision bro

river oracle
#

I wonder why people are picky about there eyes

grim ice
#

same

river oracle
#

Who cares about legs and shit bruh

grim ice
#

river oracle
#

As long as my wheelchair is comfy

torn shuttle
#

I saw a freaking menace at the gym yesterday

#

dude managed to max out the leg press

river oracle
#

What the

halcyon mica
#

Ah yes, development

river oracle
#

Mad?

torn shuttle
#

he was developing his legs

#

so was I

river oracle
#

Lol

halcyon mica
#

You might want to go into general

river oracle
#

I'm developing my social skills

grim ice
# river oracle Who cares about legs and shit bruh

Subscribe || http://gwr.co/YT-Sub
Favourites || http://gwr.co/YT-Favs

Read more: https://www.guinnessworldrecords.com/news/2021/9/no-excuses-zion-clark-achieves-record-for-fastest-20m-on-hands-676320

Zion Clark is a wrestler and athlete who dreams of becoming a multi-time Olympic champion.

He was born without legs as a result of a rare geneti...

▶ Play video
#

this guy is awesome though

river oracle
#

What the hell this baller

grim ice
#

i cant believe how hard his training was

torn shuttle
#

oh wow that's like me optimizing my fundamentally bad code

#

to run faster on its hands

#

see brought it back to development, this is a development chat

halcyon mica
#

Hillarious

#

Just go into general instead of spamming the development support channel with unrelated stuff

river oracle
#

Someone's mad

grim ice
#

No clue too

worldly ingot
#

#general though lol

halcyon mica
#

There has to be some way to bypass it

#

Surely someone's figured it out yet, no?

#

The fact that the entity type registry has been frozen by the time a plugins initializer is called

#

Even when marked as startup

#

I know, but I want to know if anyone's done it yet

#

Is there a early entrypoint for a plugin to load?

river oracle
#

You could probably look at the source

hasty prawn
#

load: STARTUP is earlier than the default in your plugin.yml

#

Idk if that's early enough though

halcyon mica
#

I am trying to figure out when the registry is frozen

quaint mantle
#

ey, documentation shows a World#strikeLightningEffect(Location, boolean) for making it silent, but the method does not seem to exist

hasty prawn
#

Do world.spigot().strikeLightningEffect

quaint mantle
#

gotcha

#

works

#

👌

hasty prawn
kindred valley
#

how can i control if a config has the specified String.

hasty prawn
#

You want to check if a config has a specified String? What do you mean by control

halcyon mica
proper pawn
#

https://api.mojang.com/users/profiles/minecraft/:username
This api returns a UUID but when I do:

Player player = Bukkit.getPlayer(UUID.fromString(UUID));

It doesn't work. but when I put mu UUID in it its with "-" in it but the API returns a UUID without dashes. I don't know if this is what is causing the error (it probably is) but I can't find any other API that does return a API with "-". Do you guys know any? or know another solution to my problem?

#

no i just put UUID there to share it. I've tested it with just strings and everything

kindred valley
#

want to control if a configs specified section has the specified String

hasty prawn
kindred valley
#

on isimler, want to check if it contains alek @quaint mantle

hasty prawn
#

Use getKeys() and check if any of the keys are equalsIgnoresCase("alek")

halcyon mica
#

OK so

kindred valley
hasty prawn
#

if it gets the nested ones too, probably don't want that, so do false.

halcyon mica
#

According to fabric mappings, registries are frozen before even the server properties are loaded

hasty prawn
#

I assume you're talking about the NMS registries in the Registry class?

halcyon mica
#

Yes

#

Meaning a earlier entrypoint is not a option

hasty prawn
#

I feel like I've added to those before but I could be wrong

halcyon mica
#

It used to be easy

#

But with 1.18.2, all vanilla registries are made immutable after initial startup

hasty prawn
#

oh lulw

halcyon mica
#

So the question now is, how does one bypass this

#

Being unable to register entity types is kinda a big deal

hasty prawn
#

Can you just set the freeze variable back to false?

#

Although freeze does other things to maybe not

halcyon mica
#

No, when freezing a registry it creates a immutable copy of its contents

cursive loom
#

Hey do you know how I can do a freeze wither ?

chrome beacon
#

Why are you trying to register stuff

chrome beacon
halcyon mica
#

A custom entity type is required for several nms based unique entities

cursive loom
#

No I want he can attack, I just want he can't moove, I have try to put Slowness but that dindn't work

halcyon mica
#

Otherwise the server has a stroke upon loading the world

chrome beacon
#

Save and load the entities yourself

halcyon mica
#

I cannot

#

This is a comission designed to replace vanilla entities AI by overwriting them

waxen plinth
#

Could fuck around with reflection

chrome beacon
#

^

halcyon mica
#

Reflection is the easy part

#

idk why everyone is so scared of it

hasty prawn
#

Well it's hard if you don't know anything about Java

halcyon mica
#

A proper iterative approach allows you to fully abstract reflection access to any class

#

Without relying on hardcoded names

#

But regardless, that's not important

rough drift
#

Anyways....

#

what did you need?

chrome beacon
#

Register their own entities

rough drift
#

Well

#

unless they use the same id as vanilla

#

that aint gonna work chief

hasty prawn
#

why does mojang make everything so hard pepeMeltdown

cursive loom
#

Hey do you know how I can do a freeze wither ? I want he can attack, I just want he can't moove, I have try to put Slowness but that dindn't work

halcyon mica
#

Registering custom entities is patheticially easy on the server

halcyon mica
#

As long as you let the client see it as a existing entity type

rough drift
#

you can figure it out

halcyon mica
#

Which is soley used for the model

cursive loom
#

What is PDC ?

rough drift
quaint mantle
rough drift
#

opinion: mojang should allow the client to just get entities from the server

#

there

#

you added so much customizability

halcyon mica
#

Absolutely not

quaint mantle
#

gets all entities on the server and leaks their location. 2b2t be like

quaint mantle
#

AAAAA

#

-_-

rough drift
#

entity models

#

and names

#

and stuff

#

not the actual entities

quaint mantle
#

oh like that

rough drift
#

yes

quaint mantle
#

yes for sure

rough drift
#

BE has that actually

quaint mantle
#

custom models from the server would be so good

#

without resource packs obviously

late socket
#

org.bukkit.plugin.InvalidPluginException: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;CLjava/lang/Object;)

I keep on getting this error even tho i shade the jar so all dependencys should be found can anyone help?

chrome beacon
#

How are you shading

crisp steeple
#

request every entity on the server every tick and crash the server

late socket
#

shade plugin

chrome beacon
#

?paste Show pom

undone axleBOT
hasty prawn
waxen plinth
#

You probably need to set the movement speed attribute

rough drift
#

nope

#

iirc wither does not get affected by attributes

#

so just marking it and then checking move events would work better

rough drift
#

This is one way to allow rotation but no movement

#

works smooth as butter on the client

waxen plinth
#

Isn't EntityMoveEvent only a thing in paper

rough drift
#

oh

#

wops

hasty prawn
#

Yeah so put false

kindred valley
#

this shit is not working

hasty prawn
#

?paste your code

undone axleBOT
kindred valley
# hasty prawn ?paste your code
public class SignSystem {
    public static void signIt(Player p, String pName, String pSurName, int id) {
            Main.getInstance().getConfig().createSection(p.getName() + ".isims: " + pName + ".soyisim: " + pSurName + ".kimlikNo: " + id);
            Main.getInstance().saveConfig();
            ItemStack is = new ItemStack(Material.PAPER);
            ItemMeta meta = is.getItemMeta();
            meta.setDisplayName(ChatColor.AQUA + "KIMLIK");
            ArrayList<String> lore = new ArrayList<>();
            lore.add(ChatColor.DARK_BLUE + " ISIM: " + ChatColor.WHITE + pName);
            lore.add(ChatColor.DARK_BLUE + " ISIM: " + ChatColor.WHITE + pSurName);
            lore.add(ChatColor.DARK_BLUE + " KIMLIK NO: " + ChatColor.WHITE + id);
            meta.setLore(lore);
            meta.addEnchant(Enchantment.OXYGEN, 2, false);
            is.setItemMeta(meta);
            p.getInventory().addItem(is);
    }
}```
hasty prawn
#

wheres the check

kindred valley
#

i want to check if section ".kimlikNo" has specified int i have

hasty prawn
#

Well use what I gave you before

#

getKeys(false).contains(<some string here>)

halcyon mica
#

Sorry, I am back

#

Got some food

kindred valley
#

wait

crisp steeple
#

.getInt

kindred valley
#

no no this is surely not working

#

or you got me wrong

crisp steeple
#

how are you using it

ornate mantle
#

why does my project randomly go "package does not exist" when it clearly does

halcyon mica
#

God, on one hand remapping stuff to mojang makes things a lot easier to work with NMS wise

#

On the other hand, it turns reflection into a pain

desert musk
#

lol

kindred valley
ornate mantle
#

i added my api to another plugin via the project structure and libraries thing

#

package does not exist

#

it just refuses to compile

#

do i have to add it via maven

#

cuz i did this before and it clearly worked

ornate mantle
kindred valley
tardy delta
#

because paths cant start with .

#

they are usually something like root.some-value

#

or just some-value

crisp steeple
kindred valley
crisp steeple
kindred valley
#

yes idvariable

crisp steeple
#

so <player name>.isms.<pname>.soyism.<psurname>.kimlikNo

desert musk
#

lmao

#

fr

tardy delta
#

i just take a look at the forum and i find a solution for something

kindred valley
crisp steeple
#

what?

kindred valley
#

how can i get method parameter

crisp steeple
#

then yeah just make it the constructor

viral crag
#

"why are you not working?" error messages is not really a feature most want ...

granite owl
#

i didnt find an implementation for the hashmap class but like

#

is there a way to get the key based on its value xD

crisp steeple
#

yes

granite owl
#

without iteration

crisp steeple
#

everything uses iteration lol

granite owl
#

the hashmap should use hashed strings

#

instead of iterating

crisp steeple
#

yeah

kindred valley
# crisp steeple yes

if(Main.getInstance().getConfig().getInt(SignSystem.getP() + ".isims." + SignSystem.getpName() + ".soyisim." + SignSystem.getpSurName() + ".kimlikNo" + SignSystem.getId() = strings[0])) 😦

granite owl
#

same like the switch casts strings to sha-hashes

viral crag
#

how would you know which key the result belonged to if you dont know the key?

crisp steeple
#

multiple keys can have the same value

granite owl
#

it returns if theres a value but not to which key it belongs to

tardy delta
#

that doesnt return the key

kindred valley
kindred valley
#

then how can i take it on a command

crisp steeple
#

why do you need them to be static

#

just set them in the constructor

granite owl
#

also a rather technical question, ```java
HashMap<String, UUID> playerUUIDList = (HashMap<String, UUID>) f.get(Bukkit.getPluginManager().getPlugin("SystemControl"));

#

thats relevant because the map will be big

#

and id prefer to read from the instance in the plugin

tardy delta
#

what is f

granite owl
#

instead of creating a new one

kindred valley
granite owl
tardy delta
#

lol what does it points to

granite owl
#
public static UUID getPlayerUUID(String player)
    {
        try
        {
            Field f = Bukkit.getPluginManager().getPlugin("SystemControl").getClass().getDeclaredField("playerUUIDList");
            f.setAccessible(true);
            @SuppressWarnings("unchecked")
            HashMap<String, UUID> playerUUIDList = (HashMap<String, UUID>) f.get(Bukkit.getPluginManager().getPlugin("SystemControl"));
            f.setAccessible(false);
            
            if (playerUUIDList.containsKey(player))
            {
                return playerUUIDList.get(player);
            }
        }
        catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e)
        {
            e.printStackTrace();
        }
        
        return null;
    }
#

it points to public static HashMap<String, UUID> playerUUIDList = new HashMap<String, UUID>();

tardy delta
#

ah a map

#

it returns a map lol

granite owl
#

yea but like

#

does it return a copy of the map and all its contents

#

so do i have the memory usage twice

tardy delta
#

im not the one you should ask refelection stuff at

granite owl
#

or does it return a pointer to the instance

crisp steeple
granite owl
#

the difference can be gigabyte in size so thats relevant

tardy delta
#

you're basically asking what casting does?

granite owl
#

theoretically

kindred valley
granite owl
#

practially it wont be that big

tardy delta
#

a map with the size of a gig?

granite owl
#

its my way to avoid using sql

#

it stores the uuid and username of every player to ever been online

#

which is 70byte per user

tardy delta
#

i think databases are more optimized for that

granite owl
#

and then its accessed via reflection so not every plugin stores its own copy

#

of the list

#

hence i want my plugins to read from the instance in the "master" plugin

granite owl
#

but i tend to avoid using databases

#

esp for the cause of switching providers

crisp steeple
#

i thought you were making the method in the class

viral crag
crisp steeple
#

making static fields means there can only be one (static) value

#

and it’s not object based

ornate mantle
#

omg bruh why can i not use my plugin api

#

it just says "package not found"

#

the editor doesnt raise any errors

#

like "package doesnt exist"

#

instead when writing the code, the stuff comes up normally

#

and everything shits itself once i compile it

viral crag
#

did you include youtr api in your config?

zealous osprey
#

Good day people, I have a (hopefully) quick question:
I'm trying to get the IBlockData from this sign to use in sending a packet, but I get a class cast exception.
Now I'm wondering what to do :/

ornate mantle
#

yes i did

#

this is how im using it

viral crag
#

no in your pom if you are using maven

ornate mantle
#

imnot

viral crag
#

then that would be why it does not compile

ornate mantle
#

no

#

noo

#

im adding it

#

i added it via this thingy

viral crag
#

i dont think that will help maven

ornate mantle
#

omg

#

so

viral crag
#

add it the same way you added the spigotmc api

ornate mantle
#

is there a way to tell maven that this is a dependency

ornate mantle
#

pain

quaint mantle
ornate mantle
#

true

quaint mantle
#

anyone else use morphia?

viral crag
# ornate mantle as a maven dependency
    <repositories>
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.17.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
ornate mantle
#

yeah i know what that is

#

and how to do it

#

i just didnt want to do it

muted idol
#

hey quick question. whats the best API for creating inventory menus?

ornate mantle
#

plus i thought importing it as a jar would work the same way

river oracle
#

There aren't many good menus apis tbh

#

Which is surprising

muted idol
ornate mantle
#

its easy to use

quaint mantle
#

:P

halcyon mica
#

Well this sucks

#

So I may have found a way to bypass the freezing of a registry

#

But for that I need to hijack the cache and add a entry into the map

#

The issue is, to do that I need to have a instance of the EntityType already

#

But the constructor of an entity type calls the createIntrusiveReference, which is the very reason that errors out

quaint mantle
sterile token
halcyon mica
#

...

#

Because you can't cancel a method call inside the constructor of a class you don't have write access to?

sterile token
halcyon mica
#

Reflection doesn't help there

quaint mantle
sterile token
granite owl
#

i dont understand 1 thing

halcyon mica
#

There is, I just have to find a different approach

granite owl
#

why use maven if i still have to have local copies of the repos on my machine by using the buildtools

#

xD

#

isnt it supposed to like eh idk

#

load stuff automatically?

sterile token
#

Terminator

#

Maven looks for dependencies on global repos. If the depend its on a custom repo you have to told maven

#

If not it wont find your depend. Its a bit of logic

ornate mantle
#

anyone know what this means

undone axleBOT
ornate mantle
#

sorry for making the mistake of uploading a single line error

#

anyone know what this means

sterile token
#

Its saying you casting to a wrong class

river oracle
#

Cast error not sure what or where without more context though

ornate mantle
#

its casted properly

sterile token
#

Send full code

river oracle
#

Obviously not or there would be no error

quaint mantle
#

Someone shaded the class into another plugin so there's two of the same folders which I think can cause conflict @ornate mantle

sterile token
quaint mantle
sterile token
#

Yeah that too

ornate mantle
#

class xyz.minefalls.coinapi.Main cannot be cast to class xyz.minefalls.coinapi.Main

#

what

ivory sleet
#

your class is loaded multiple times

ornate mantle
#

idk man i only loaded it once

#

i added the api to the server as a plugin

ivory sleet
#

well in spite of what you're saying there's evidence to the contrary

ornate mantle
#

and then used that plugin in maven

#

theres also evidence to my claim wtf

ivory sleet
#

oh

#

nah

#

well you probably by mistake shade that api library

ornate mantle
#

wait lemme just

#

whats shading

ivory sleet
#

when you include classes of (external) dependencies into your own jar during compilation

rough drift
#

ProtocolLib sounds

ornate mantle
#

and i made another plugin which uses that plugin via maven

ivory sleet
#

myes

ornate mantle
#

locally

ivory sleet
#

and chances are that you shade the plugin that depends on your plugin with few methods

ornate mantle
ivory sleet
#

well

ornate mantle
#

i used this method

ivory sleet
#

send your pom

ornate mantle
#

dms?

#

or that

#

link thing

ivory sleet
#

that'll reveal your culprit

#

not dms

ornate mantle
#

?paste

undone axleBOT
ivory sleet
#

here, so everyone can see and give plausible insight

kindred valley
#

@crisp steeple buddy i made it constructor now what should i do

ivory sleet
#

<scope>provided</scope>

#

add that to the latter dependency as well

kindred valley
ivory sleet
#

and try recompile and deploy your jar again

ivory sleet
ornate mantle
#

it works wtf

kindred valley
ivory sleet
#

alr

kindred valley
ivory sleet
#

well that looks like some improper parsing

tardy delta
#

you cant have strings as subnodes

#

or how you would call it

ornate mantle
#

conclure

ivory sleet
#

mye

ornate mantle
#

what does the scope thing do and why did it fix it

ivory sleet
#

well you have to understand that there are two types of dependencies

#

compile time respectively runtime

tardy delta
kindred valley
tardy delta
#

and what does limpeex mean?

ivory sleet
#

compile time dependencies are those that you need when writing code, you know, such that your ide can recognize classes and functions from said dependency

tardy delta
#

ah wait thats your name

#

save the players uuid instead of the name

kindred valley
ivory sleet
#

runtime dependencies are those that you need when the jvm instance actually runs

#

now thing is, that api library of yours gets loaded during runtime by spigot

tardy delta
#

if a player changes his name, his stats will be resetted because his name cannot be found in the file

ivory sleet
#

and essentially, what you had there took the api classes from the api library and put those inside your jar file as well

ivory sleet
#

as it thought that the dependency was both runtime and compile time

ornate mantle
#

ah

#

smh

ivory sleet
#

so what happens is that the class x.y.z.Api was loaded in your jar as well as from the other api library

#

mye

#

provided btw means compile time only

ornate mantle
#

oh

#

so thats what you meant by

#

shaded twice

ivory sleet
#

yeah

kindred valley
#

@tardy delta how can i access that subnodes

ivory sleet
#

if you do not provide any scope, the scope type compile will be set

cyan compass
#

Custom Snowball Entity data?

ivory sleet
#

which declares said dependency as both compile time and runtime

kind hatch
tardy delta
#

i would do

playerdata:
  uuid1:
    name: 'some name'
    surname: 'some surname'
    id: 2```
#

@kindred valley

kindred valley
cosmic arrow
#

how do i check when a boat is placed

kindred valley
kindred valley
kind hatch
kindred valley
#

i need a method like this

kindred valley
#

want to control if that subnode has the int i want

kind hatch
#

I think you misunderstand how that method works.

The #get method returns the value from the path you give it. So if you want to get a number from the config, you’d use #getInteger() and use it for what you need.

kindred valley
naive bolt
#

how do i set the default config of a bungee plugin like you do with a spigot plugin

kind hatch
kindred valley
# kind hatch Use the proper method to return what you want. So if you want to get a number, ...
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
        SignSystem signSystem = new SignSystem();
        Player p = (Player) commandSender;
        if(p.hasPermission("polis")) {
            for(int i: Main.getInstance().getConfig().getIntegerList("isims.soyisim.kimlikNo")) {
                if(i == Integer.parseInt(strings[0])) {
                    p.sendMessage(ChatColor.AQUA + " BOYLE BIR KISI BULUNUO...");
                }else {
                    p.sendMessage(ChatColor.RED + " BOYLE BIR KISI BULUNMUO...");
                }
            }
        }
        return true;
    }```
kindred valley
kind hatch
#

Is the config structure consistent?

#

Because if it is, you can loop through your sections using #getConfigurationSection(“path.to.your.section”).getKeys(false)

kindred valley
#

i made it like this but it always shows null

#

wait

quaint mantle
#

== doesnt work on strings

kindred valley
#

still cant get the result i want

quaint mantle
#

no == is for references

halcyon mica
#

Alright, so lets think criticially

#

I cannot register my own entity type anymore

quaint mantle
#

use .equals on objects

halcyon mica
#

Yet I have a custom entity that needs to be loaded by the game on world start

kindred valley
halcyon mica
#

So what would be the smartest approach of this

#

I can't rely on the vanilla loading mechanism anymore because I have no way to indicate wether or not the entity is my custom one or not

#

And as such cannot parse it as one

#

Unless there is a event for that

ivory sleet
#

?scheduler

#

?scheduling

undone axleBOT
quaint mantle
#

woah

#

prove it

river oracle
#

Send me all the code

quaint mantle
#

what da dawg doing

proper pawn
#

I want a config file so I can save the data to link a discord account with a minecraft account

players:
  minecraftids:
    bf32bb0f-0345-4de8-9ae4-f7a759677746:
      discordid: "468512709248548865"
      nickname: "example_name"
      verified: true
  discordids:
    468512709248548865:
      minecraftid: "bf32bb0f-0345-4de8-9ae4-f7a759677746"
      nickname: "example_name"
      verified: true

I thought of this but there must be a better way to do it. If you have the discord id, you can get the minecraft id along with more info And If you have the minecraft id, you can get the discord id along with more info.
or is this really just the best way?

tardy delta
#

ye that too but hes asking for yml

proper pawn
#

alrighty then

tardy delta
#

if its small it doesnt matter that much

ivory sleet
#

I mean it can be fine to use yml

#

like ifs a mock implementation for instance

#

of course you're rather limited with it

tardy delta
#

databases are slow

#

mysql ones are

#

embedded ones better

ivory sleet
#

mysql sucks

quaint mantle
#

then use sqlite

tardy delta
#

lol

ivory sleet
#

but like postgresql

tardy delta
#

im using h2

#

youre a mongo

#

🤡

proper pawn
tardy delta
#

wha

#

llol

ivory sleet
#

hehe

#

thing is fourteen, postgresql is extremely horizontally scalable

tardy delta
#

he cant mute me

ivory sleet
#

which h2 isnt the slightest

tardy delta
#

ah i dont know postgresql

ivory sleet
#

and whilst mongo can be it isn't when it comes to advanced queries on relational data

tardy delta
#

i just saw that its a better alternative for mysql

ivory sleet
#

yes

#

mysql as mysql is obsolete

#

at least one should use mariadb

kindred valley
#

someone pls help me

ivory sleet
#

and ideally postgre

tardy delta
#

with

ivory sleet
#

provide some context ^

kindred valley
# tardy delta with

I have a config directory and I want to get the values ​​of a subnode in this directory

tardy delta
#

did you change the format now so it can be parsed?

#

because you were having invalid yml

tardy delta
#

which cannot be parsed without errors

kindred valley
tardy delta
#

so how does it look rn

#

the file

#

time to go to bed lol

#

night

kindred valley
crisp steeple
#

also that path is completely redundant

#

i would recommend learning more about how yaml works

kindred valley
crisp steeple
#

please look into yaml more

#

the way you are making it is completely incorrect

#

a configuration section is a section that holds values

#

set actually sets the values of attributes

kindred valley
#

im handicapped on yml

crisp steeple
#

what?

kindred valley
#

I get confused when strings are involved to code

crisp steeple
#

i would work on that then since strings come up a lot in coding

kindred valley
#

alright i will take a little bit help from my friends. Do you have any resources i can watch?

#

or is it legal to say idk

crisp steeple
kindred valley
quaint mantle
kindred valley
arctic moth
#

That doesn't have isNewChunk() tho

steel swan
#

hey i kinda need help on smth :

arctic moth
#

Then say it

steel swan
#

so i need help : i m trying to make it so like when u do a certain command, it creates a world and the middle is a dark forest here is my code :

if(command.getName().equalsIgnoreCase("roofed")) {
                Player player = (Player) sender;
                System.out.println("1");
                WorldCreator worldcreator = new WorldCreator("" + player.getUniqueId());
                worldcreator.type(WorldType.NORMAL);
                worldcreator.generateStructures(true);

                worldcreator.createWorld();

                int bx = 0;
                int bz = 0;

                World world = Bukkit.getWorld("" + player.getUniqueId());

                for(int xx = bx; xx < bx+16; xx++) {
                    for(int zz = bz; zz < bz+16; zz++) {
                        for(int yy = 0; yy < 128; yy++) {

                            world.getBlockAt(xx,yy,zz).setBiome(Biome.ROOFED_FOREST);

                        }
                    }
                }
                p2.teleport(new Location(Bukkit.getWorld("" + player.getUniqueId()),0, 0, 0));




                for(Player p3 : Bukkit.getOnlinePlayers()){
                    p3.teleport(new Location(Bukkit.getWorld("" + player.getUniqueId()), getRandomNumber(-200, 200), 200, getRandomNumber(-200, 200)));
                }
                System.out.println("2");


                System.out.println("3");
                WorldBorder worldborder = Bukkit.getWorld("" + player.getUniqueId()).getWorldBorder();
                worldborder.setCenter(0, 0);
                worldborder.setSize(500);



            }
#

the problem here is the folowing
when it changes the biome, the world is already created
the problem is : it just changes ths biome, but does not generate anything

crisp steeple
#

?

arctic moth
#

So why would that

crisp steeple
#

why would it not work

arctic moth
#

Idk the entities aren't generated in ChunkLoadEvent

#

So getting the world in the event is gonna return it at that time

#

Before they spaen

crisp steeple
#

if you listen for worldloadevent then get all the entities in the world it should work

#

at least in my experience

arctic moth
#

But I need to know if the chunk is new

#

Otherwise it'll do it every time

crisp steeple
#

you could add a persistent data container to the end crystal

arctic moth
#

Wdym

crisp steeple
#

i think that’s how it works in later versions

#

you’re sure entityspawnevent wouldn’t work as well?

arctic moth
#

But that still would generate the structure for player-built end crystals

#

Ig I'ma just get it using the bedrock

crisp steeple
#

i wouldn’t do that

arctic moth
#

But idk how to filter out the middle bedrock

#

And it's only supposed to generate the first time the end is loaded

crisp steeple
#

i haven’t really used persistent data containers since i usually work in earlier versions, but i’m pretty sure you could just add something like <“playerSpawed”: true> to the crystal

arctic moth
crisp steeple
#

possibly

#

there’s a way to see the reason entities were spawned pretty sure

#

you could check that

steel swan
crisp steeple
steel swan
#

ik look at my code i used it but i cant find how to do that

crisp steeple
#

BiomeProvider?

chrome beacon
#

^^

steel swan
crisp steeple
#

create a biomeprovider

#

then set it with .biomeprovider(<provider>)

steel swan
#

like worldcreator.biomeprovider() ?

crisp steeple
#

yeah

steel swan
#

doesnt exist

crisp steeple
steel swan
#

i said for 1.8.8

#

thats 1.18.2

crisp steeple
#

not sure how you would do it then

steel swan
#

thats why i asked lmao

quiet ice
#

One further reason to say away from out-of-date stuff

crisp steeple
#

yea

#

not much documentation on stuff from old versions

steel swan
#

long story

crisp steeple
#

you’re sure?

steel swan
#

yup

#

100%

quiet ice
#

I also deved with 1.8/1.12 when I started, but it isn't pleasant to use and now I wouldn't go back

crisp steeple
#

yeah same lol

steel swan
#

no but rn i dont have a choice i told ya

ivory sleet
#

quite sad as you'll be missing out on so much niceties

steel swan
#

ik but i know its possible

#

cuz ive seen plugins do it

#

in 1.8

halcyon mica
#

Are there events fired before a world is loaded, to intercept entity load calls?

steel swan
#

ok wait

#

i have an idea... would it technicly be possible to generate worlds and check the coordonates of 0 0 0 to see the biome and delete it if its not correct?

quiet ice
#

huh

#

what exactly are you trying to do?

chrome beacon
#

Create a world with a biome

arctic moth
#

is placing entities like endcrystal part of BlockPlaceEvent?

steel swan
#

ye

chrome beacon
arctic moth
#

what is it

quiet ice
#

Like the entire world being a single biome or just being centered around a biome?

steel swan
quiet ice
#

If it is the entire world you might be able to force the amplified world generator but idk how to do that

steel swan
#

hmmmm

#

maybe i could generate the world and check where there is this biome and put the 0 0 there?

crisp steeple
#

try just scrolling through the methods of WorldGenerator for a while and see if there’s anything that relates to biomes

#

if not then it might just not be implemented on 1.8

#

could require nms

steel swan
#

imma be honnest i saw a few things but dont rly understand how they work

crisp steeple
#

wdym

arctic moth
#

is there something with my fill command?

fossil lily
#

Why does .getTPS() return an arraylist?

#

When I average it out it gets to be above 20

#

i figured it out

grim ice
fossil lily
grim ice
#

u can just get(0)

fossil lily
#

oh okay

grim ice
#

yes

midnight shore
#

Hi! How can i convert a 2 digit number to match it from -1 to 1?

exotic jetty
grim ice
#

World world = plugin.getServer().getWorld(worldName);

plugin isnt null, server isnt null, worldName isnt null

#

but world is null

#

and the world exists

#

why is it null

delicate lynx
#

the world isn't loaded then

midnight shore
# exotic jetty you can do x>0 and X<0

uh maybe i said it wrongly.
I want to have the corrispondent decimal value from -1 to 1 equivalent to what a two digit number would be.
For example: I have 20 and i want to get the equivalent value from -1 to 1.

exotic jetty
#

idk how to do that sorry

crisp steeple
#

try seeing if bukkit.getworlds has it

viral crag
#

you trying to do 2 compliment will0mane?

midnight shore
#

?

#

lets have it clear. I'm making a Speed Stat and this is from 0 to 100. To set the actual player speed i need a float from -1 to 1. How can i convert the stat value to the equivalent speed value?

viral crag
#

using division

arctic moth
#

how do i get the location of the dragon's head?

midnight shore
viral crag
#

(xb-xa)/xa

#

would give you your relative change percentage

grim ice
#

IM LITERALLY DOING

#

getworld("world")

#

HOLY SHIT

midnight shore
grim ice
#

IS SPIGOT DRUNK OR SMTH

viral crag
#

final value and initial value

grim ice
#

getWorlds() only returns diamondworld

#

and not world

viral crag
#

minecraft:overworld

midnight shore
#

like if i have Stat value: 10 what would speed value be?

viral crag
grim ice
#

wait does the world have to be loaded

viral crag
midnight shore
viral crag
#

yes

grim ice
#

how do i load a world

viral crag
grim ice
#

?

crisp steeple
#

are you using multicraft

grim ice
#

no idk whats that

crisp steeple
#

world plugin

grim ice
#

im using multiverse

crisp steeple
#

let me try to check how i fixed it

viral crag
crisp steeple
#

just got the names mixed up

#

well yeah then that is part of the problem

viral crag
crisp steeple
#

you have to import the world with multiverse

#

in order for it to be registered

midnight shore
#

(100-?)/?

grim ice
#

broo

#

even though

#

i made a world

#

without multiverse

crisp steeple
#

yeah

grim ice
#

spigot only loads one world

crisp steeple
#

you still have to import it with multiverse

#

idk why it works like that but it just does

grim ice
#

what do i do then

crisp steeple
#

/mv import <name> NORMAL

grim ice
#

/mv import worldName?

#

ic

tender shard
#

getWOrlds() only returns LOADED worlds

grim ice
#

spigot really disappoints me sometimes

viral crag
viral crag
#

it load 3 dimensions by default

tender shard
ember estuary
#

how can you check if the world, which a player is in when he joins, actually still exists?
player().getLocation(). ?

#

isWorldLoaded() ?

#

is that what u need?

viral crag
#

...

#

you cant join a world if it doesnt exist

quaint mantle
#

who else agrees that packets are pog

ember estuary
#

It throws this error in console, when a player joins who last was in a world that has been deleted
Could not call method 'public static org.bukkit.Location org.bukkit.Location.deserialize(java.util.Map)' of class org.bukkit.Location for deserialization
java.lang.IllegalArgumentException: unknown world

viral crag
#

OnPlayerJoin and then TP them or respawn them

ember estuary
#

but tp them under what condition?

#

if ( ? ) tp player to spawn

tender shard
naive bolt
naive bolt
#

can i do something like that

quaint mantle
#

PacketPlayOutMapChunk

#

1.8

#

pog

tender shard
#

eeew

quaint mantle
#

D:

tender shard
#

I am disgusted

grim ice
quaint mantle
#

:(

tender shard
#

I go back to my furry dc

quaint mantle
#

:O

grim ice
#

or can i just make console send that cmd

tender shard
#

you can just do Bukkit.createWorld("foldername");

grim ice
#

load a world

viral crag
#

he wants to load muliple worlds

tender shard
#

I know

#

createWorld

grim ice
#

oh cool

tender shard
#

creates a new world

#

or loads an existing one

dire salmon
#

help
im using this

Block block = event.getClickedBlock().get();//the block the player right clicked
            if (block.getState() instanceof Sign sign) {
                sign.setGlowingText(true);
            }

to make the sign glow
but im getting this
https://paste.md-5.net/eviqutegor.http

tender shard
#

oh wait

dire salmon
#

wait, wrong code

tender shard
#

makes no sense

#

send the real code pls 😛

quaint mantle
#

should work just fine unless you imported the wrong sign, if there another one

#

?jd

grim ice
dire salmon
#
Block block = event.getClickedBlock().get();//the block the player right clicked
            if (block.getState() instanceof Sign) {
                Sign sign = (Sign) block;
                sign.setGlowingText(true);
            }
quaint mantle
#

instanceof casting

quaint mantle
#

wait

#

no

tender shard
dire salmon
#

import org.bukkit.block.Sign;

tender shard
#

the code looks totally fine to me

quaint mantle
#

did you like update the jar in the plugins folder

#

the code seems fine

dire salmon
#

wait

tender shard
#

yeah the error message and the code don't really match up

dire salmon
#

forgot to restart server before test :p

tender shard
#

.... 😛

#

THANKS FOR WASTING OUR TIME

#

jk

#

it happens to everyone all the time

quaint mantle
#

nah ive done that plenty of times

dire salmon
quaint mantle
#

what the fuck

tender shard
#

best coding I've ever seen

#

I definitely would not recommend ?learnjava to the dev who did that

dire salmon
#

i got no errors but also didnt glow the text

quaint mantle
#

call #update

#

on the state

dire salmon
#

block.getState().update()?

#

if (block.getState().update() instanceof Sign sign) {

quaint mantle
#

no

ember estuary
# tender shard show the full error

i figured it out, thank you! thanks to you i searched the whole error-log (which was pretty long) and at line 40 or so it named one of my classes, where the error was actually originating from. lol.

dire salmon
#

ah, sign.update()

quaint mantle
#
BlockState state = event.getClickedBlock().getState();
if (state instanceof Sign sign) {
    sign.setGlowingText(true);
    sign.update();
}
dire salmon
#

ah

#

cant i do block.getState() instead of first line?

#

nvm

quaint mantle
#

if block is a variable, i mean yeah

dire salmon
#

well

#
Block block = event.getClickedBlock().get();//the block the player right clicked
            if (block.getState() instanceof Sign) {
                Sign sign = (Sign) block;
                sign.setGlowingText(true);
                sign.update();
            }
quaint mantle
#

whats .get

dire salmon
#

idk, api thing

#

i will see

tender shard
#

huh?

#

what event even is that?

viral crag
#

hes using paper

tall dragon
#

might be an optional

tender shard
#

but what event is it?

quaint mantle
#

why would it return an optional and not just be nullable

tender shard
#

exactly

dire salmon
#

nah ill try what you said to

tall dragon
#

idk. some people think its "cleaner"

quaint mantle
dire salmon
#

yep, its optional. cant resolve method getState in Optional

tall dragon
grim ice
#

Optional looks better imo

tall dragon
#

Optional is just a fancy null check

grim ice
#

Yes

tall dragon
#

pretty useless imo

dire salmon
#
Block block = event.getClickedBlock().get();
            BlockState state = block.getState();
            if (state instanceof Sign sign) {
                sign.setGlowingText(true);
                sign.update();
            }
grim ice
#

makes it fancier

grim ice
#

dont get() without isPresent

dire salmon
#

im using isPresent

grim ice
#

good

#

intellij prob screamed at u

#

if u didnt do it

tall dragon
#

u could also use ifPresent ig

dire salmon
#
public void setNeonLight(PlayerRightClickEvent event) {
        if (event.getClickedBlock().isPresent()) {
            Block block = event.getClickedBlock().get();
            BlockState state = block.getState();
            if (state instanceof Sign sign) {
                sign.setGlowingText(true);
                sign.update();
            }
        }
    }
grim ice
arctic moth
#

how do you make a projectile immune to a certain entity

tall dragon
arctic moth
#

trying to spawn end fireballs but they keep exploding on the dragon

dire salmon
#

PlayerRightClickEvent is slimefun api thing, i cant explain, if you want to know go read its docs

tall dragon
#

u should indent ur code 500 times no i agree.

arctic moth
#

wait could i just cast the dragon to ProjectileSource?

grim ice
#

one plus one is 2

#

2 plus 2 is 4

#

it stacks

tall dragon
#

why would u have 2

dire salmon
#

i did that

arctic moth
#

and use launchProjectile

tall dragon
dire salmon
tall dragon
#

invert ur if statements and just return instead

grim ice
#

ah yes

#

an empty page

dire salmon
dire salmon
grim ice
#

nnow its completely empty

tall dragon
dire salmon
#

xD

grim ice
#

stairs

quaint mantle
dire salmon
#

arctic moth
#

this shoots the projectile into literal space, what would be the vector for the player?
((ProjectileSource) entity).launchProjectile(DragonFireball.class, closest.getLocation().toVector());

grim ice
#

u couldve just looped it

noble lantern
#

fuck

grim ice
#

why did u spam it

noble lantern
#

whos code

#

nah nah were fixing that shit

arctic moth
noble lantern
#

whos code is that

dire salmon
#

me

arctic moth
noble lantern
#

listen were not here to judge my grammar

dire salmon
#

no need to fix anymore

noble lantern
#

okay good

arctic moth
#

lmao emoji just yeeted

noble lantern
#

troll hehe Hyper

arctic moth
#

why does my :troll: not work

noble lantern
#

need booster role

arctic moth
#

bruh it just converts back

#

thats dumb

tall dragon
grim ice
noble lantern
arctic moth
#

spigot = p2w

noble lantern
#

is there so many runnables

#

chaining into each other

grim ice
#

its kinda funny

noble lantern
#

this actually angers me

dire salmon
#

lol

#

well, i didnt fix it, still the same thing
but works

noble lantern
#

Im sure you can do without all those runnables

dire salmon
#

here what it makes

noble lantern
#

loops?

dire salmon
#

i tried

tender shard
#

WAIT WHAT THE

grim ice
#

owo

noble lantern
#

LOOPS

grim ice
#

thats so pretty

noble lantern
#

EXIST

dire salmon
tender shard
#

Burchard you're the dude I chatted with about the AE API lol?!

tender shard
#

haha

noble lantern
#

AdvancedEnchantments API

tender shard
#

api

dire salmon
#

you guys are lightnings to type