#help-archived

1 messages Ā· Page 116 of 1

rich olive
#

that's all the info

jolly ember
#

Hey guys, does anybody know how to change player's block collision to one block height?
@jolly ember Is there any way?

fleet crane
#

you can try posting a ticket but it might get closed if the issue is not obvious from the stack trace and there are no reproduction steps

undone narwhal
#

There is a plugin that make you crawl

#

So I suppose this is possible

frigid ember
#

md_5 will u play mc dungeons

formal wharf
#

So, the Spigot APIs are now the BuildTools?

frigid ember
#

ye

undone narwhal
#

Use Maven to use the SpigotAPI @formal wharf

frigid ember
#

the only legal way to get spigot is with bt

#

or maven

#

or like that

formal wharf
#

I dont like Maven, I cant get BT from that for some reason

undone narwhal
#

Repo stuff is amazing Jat, you should try it

frigid ember
#

use gradl

formal wharf
#

I haven't learned the whole Repo stuff so I just import an APi

#

Easier for me right now

frigid ember
#

maximum a day normally for me

tiny dagger
#

rip, i added someone manually because i thought paypal api had a fart however now this happened šŸ˜‚

frigid ember
#

lol

#

is there any plugins that can fix item sorters on paper 1.15.2.

#

also, god i regret choosing this name

jolly ember
undone narwhal
#

Have find source code on how to do it

jolly ember
#

at least i know now to how to put player to tunnel

timid valley
#

@frigid ember this isn't paper support go to our discord.

frigid ember
#

isn't paper a branch of spigot?

timid valley
#

We are separate projects

frigid ember
#

oke x

#

why say we

hoary parcel
#

Because he is a part of the core team working on said project?

frigid ember
#

ok?

limber summit
#

hey guys, should I close my sql connection once I've finished to execute my queries

#

and reopen it when I need it

chrome lark
#

use a pool

#

things like hikari can make it easy to manage some stuff, can easily set the min connections to something low if you're not expecting to use it much, but, it can also handle scaling up the pool if needed

limber summit
#

ok thanks

shrewd fog
#

Heya guys, im looking for a Modpack Maker šŸ™‚

jaunty night
shrewd fog
#

thank yuo

#

im mean im looking for someone to make me a modpack

jaunty night
#

We don't provide support for that here as this is mainly for plugin focused issues.

shrewd fog
#

ohhh okay thank yuo

cursive lily
undone narwhal
#

Seems you hadn't import the jar

cursive lily
#

@undone narwhal i did import the jar

#

tho

#

i imported the latest 1.15.2 jar file

floral isle
#

@cursive lily you are using eclipse?

cursive lily
#

yer

floral isle
#

i recommend you intellij idea is 1000 times better than eclipse

cursive lily
#

ok

floral isle
#

for the minecraft developement you must download the plugin

cursive lily
#

ok

undone narwhal
#

Start by watching tuts online "create spigot plugin intellij" to familiarize with the ide

cursive lily
#

ok i was watchng one

floral isle
#

you can use maven or gradle

undone narwhal
#

You can, it's an option the plugin

cursive lily
#

ok

#

ill get it anyway

undone narwhal
#

@floral isle Material etc is Xseries in your lib right?

frigid ember
#

is it possible for me to kick someone, sending the player thru Plugin Message to check someone on bungee then send back?

floral isle
#

yes and sounds chat and more

#

@undone narwhal

cursive lily
#

Thanks for the help

undone narwhal
#

Okay

#

@frigid ember You can do it, but doing this every tick is going to be really heavy

cursive lily
#

So how do i install the plugins

#

for intellij

undone narwhal
#

File

#

Settings > Plugins

#

And then Marketplace

cursive lily
#

ok

floral isle
#

@cursive lily it is better or not intellij idea of ​​eclipse

tidal mica
#

Can a normal player see what plugin message i'm sending?

hoary parcel
#

Well, depend s

#

Do you send the plugin message to the player?

silk bane
#

they'll see it if you send it to them šŸ˜‚

hoary parcel
#

Or do you use bungees channel?

cursive lily
#

@floral isle ill tell you later sorry thanks tho

pure pasture
#

Hi guys I'm not that experienced with files and wanted to ask if there's a good way of creating a new file whenever a command is executed and also read stuff from this file?

naive goblet
#

Are you using the spigot api?

frigid ember
#

hi

pure pasture
#

Yes

naive goblet
#

Then perhaps take usage of the FileConfiguration system

frigid ember
#

use a config

pure pasture
#

Or maybe another would be can you give items "values" and read them later?

#

Like a damage value or something

naive goblet
#

You can load a YamlConfiguration with YamlConfiguration.load(file);

pure pasture
#

Yeah but how do you make it so it can read every file?

#

Do you do that with a for loop?

naive goblet
#

Wym

#

Yes probably

pure pasture
#

like for(all filesindirectory : idk) {

#

like this?

naive goblet
#

yeah

pure pasture
#

K thanks!

#

And how would you create the file?

#

public TeleportUtils(main main) {
file = new File(main.getDataFolder(), "locations.yml");
if(!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}

#

Would that work?+

#

but replace "locations.yml" with name

naive goblet
#

Uhm

#

You never check if the file exist itself and only create it based on its parent

pure pasture
#

}
if(!file.exists()) {
try {
file.createNewFile();
}catch(Exception ex) {
ex.printStackTrace();
}

    }
#

So you would need this to right

naive goblet
#

Yeah

pure pasture
#

K thanks

naive goblet
#

Well I’dnt check if the parent file exists or not. Just call mkdirs on it if current file doesn’t exist

pure pasture
#

public TeleportUtils(main main) {
file = new File(main.getDataFolder(), "locations.yml");
if(!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
if(!file.exists()) {
try {
file.createNewFile();
}catch(Exception ex) {
ex.printStackTrace();
}

    }
#

These two combined should work

naive goblet
#
if (!file.exists) {
  file.getParentFile().mkdirs();
  try {
    file.createNewFile();
  } catch (Exception ignored){}
}```
pure pasture
#

Ohhh ok thanks!

naive goblet
#

You might not want to ignore the exception

pure pasture
#

But will it try to create the parentfile everytime it detects that has not been created yet?

#

it has not been created yet*

naive goblet
#

Every time it loads the current file it will try creating parent dir

pure pasture
#

But will it then overwrite it?

#

Or will it do nothing if the parent file exists?

naive goblet
#

Overwrite what?

pure pasture
#

The parent gile

#

file

naive goblet
#

I don’t believe so

pure pasture
#

I will try

#

And to add values I would just do cfg.set("damage",0) as an example

#

if cfg was the yamlconfiguration right?

naive goblet
#

YamlConfiguration.load(file).set(ā€œdamageā€, 0);

#

Btw

pure pasture
#

Yeah that's what I thought

naive goblet
#

Do this instead

#
FileConfiguration config = YamlConfiguration.load(file);
config.set(ā€œdamageā€, 0);
config.save();
pure pasture
#

Ok

#

Cause' it's cleaner?

naive goblet
#

No but a reference is always handy if you’re going to use the config over several times

pure pasture
#

Yeah that's true

naive goblet
#

And saving is necessary after you’ve written in the config with code

pure pasture
#

Yeah

frigid ember
#

Why do newer versions of spigot overwrite old(1.8 worlds) and make them incompatible to reverse back to 1.8 worlds and use on a 1.8 server.

pure pasture
#

Do they?

fleet crane
#

because the save data format changes

#

minecraft has never been backwards compatible

#

slots start at 0

#

ie 0-53 not 1-54

pure pasture
#

yeah

rich olive
#

md5, I was about to find out what was wrong and it's easily reproducible. if the server.properties has no gamemode set, like so:

gamemode=

world creation results in a NullPointerException

naive goblet
#

No fallback value???

rich olive
#

I think that's user error, but I also think it should be handled. maybe a warning on startup would suffice?

pure pasture
#

@naive goblet I love you

#

It works

naive goblet
undone narwhal
#

return true in your command executor

#

not false

naive goblet
#

^

#

DKL long story short just return true and handle all the exceptions yourself

dusty owl
#

hey there, I have a question, what kind of license is associated with the Craftbukkit mappings?

cursive lily
#

Hello im currently getting an issue where when i put the plugin in the plugins folder that it doesn't show up? Please help! Thanks in advance

undone narwhal
#

Any errors N

cursive lily
#

no

#

console looks good

undone narwhal
#

@dusty owl GPL I think ?

naive mountain
#

Hello, I keep having issues with my worldborder. I was wondering if anyone knows how to properly configure worldborder for overworld and nether. Do you have to keep in mind the 1/8 rule? Or do I set worldborder in Nether and Overworld as the same radius?

naive goblet
#

Lukeos main class doesn’t need to be final

dusty owl
#

no
@cursive lily do you have compiled the yml?

cursive lily
pure pasture
#

Did you create a plugin.yml

naive goblet
#

That’s not an error nor a warn

cursive lily
#

yer the plugin.yml is good

undone narwhal
#

Is there a line saying that your plugin is enabled

pure pasture
#

Can you send you plugin.yml?

cursive lily
#

nope

pure pasture
#

K

#

Does it have secret Information xD

undone narwhal
#

^^

cursive lily
undone narwhal
#

The answer was for me Trixone lol

cursive lily
#

plugin.yml

naive goblet
#

Is the your plugin a jar file in the plugins dir ?

pure pasture
#

oh

cursive lily
#

the plugin is a jar and is in the plugins folder

naive goblet
#

What if you open it?

pure pasture
#

In what package is your plugin.yml?

cursive lily
#

open the jar

naive goblet
#

Yh

cursive lily
#

does nothing

dusty owl
#

@dusty owl GPL I think ?
@undone narwhal I think so, but is not specified with any kind of file....

naive goblet
#

Open w/ winrar or winzip

cursive lily
#

do you mean right click and do edit

#

??

naive goblet
#

So you can have a loon what files exist in that jar

undone narwhal
#

@dusty owl CraftBukkit git has a GPL license file

cursive lily
#

ok let me try

#

when i exstract with win rar it creates a folder with some stuff in it

naive goblet
#

What stuff

cursive lily
#

extract**

undone narwhal
#

Is there the plugin.yml file?

cursive lily
#

like pom.yml and

undone narwhal
#

yml or xml?

cursive lily
#

no pom.xml

naive goblet
#

Are you building your jar the right way?

cursive lily
#

and pom.properties

#

wym

naive goblet
#

You’re using maven?

cursive lily
#

im following a tutorial

#

yer

naive goblet
#

Uh well how do you export your project into a jar?

dusty owl
cursive lily
#

using run maven build

bronze marten
#

^^ If you want that nice little menu with all maven commands, navigate to View > Tool Windows > Maven

cursive lily
#

yer thats the menu

undone narwhal
#

@dusty owl Yep but it is related to so it keeps the same license

#

While there is no another license

dusty owl
#

nice, I think so, but I wanted to be sure

frigid ember
#

I thought mc couldn't be sublicensed @undone narwhal

dusty owl
#

well, is not a sublicense of mc (Spigot uses patches to avoid using mc code)

pure pasture
#

One question again xD

#

How can you use numeric id's instead of the Spigot Materials?

#

Nevermind I think I found it

frigid ember
#

well, is not a sublicense of mc (Spigot uses patches to avoid using mc code)
@dusty owl they cant patch whole of mc

dusty owl
#

sure, they patch what they need, but the file server.jar is downloaded when you start the server the first time, so they are not really ridistributing the mc code itself (btw I read the cose once, in the past so Idk if it works in this precise way lol)

tiny horizon
#

So I'm kinda new to plugins, but how would I go about making a plugin support multiple versions in one jar

frigid ember
#

Not importing or using NMS

sturdy oar
#

multiple minecraft versions, or multiple environments support?

frigid ember
#

the net.minecraft.server import

#

Just stick with the bukkit api, most of the bukkit api stays the same across all versions.

sturdy oar
#

that's not enough

#

there are more factors

frigid ember
#

It is

sturdy oar
#

for backwards support

frigid ember
#

use 1.8 spigot api

#

and it works on all

sturdy oar
#

nope

frigid ember
#

oh yes

#

i use it

sturdy oar
#

🤦

pure pasture
#

For backwards support it probably wouldn't work

#

But who uses a version under 1.8??

frigid ember
#

Just use 1.8 spigot API.

sturdy oar
#

Be a sane person and use 1.15.2 ...

#

that's what everybody does

frigid ember
#

not everyone

tiny horizon
#

Yeah i mean like 1.7, 1.8, 1.9 all in one jar rather then making people have to download a specific jar

frigid ember
#

but I do use 1.15.2 time to time

pure pasture
#

I dont

frigid ember
#

respect idisappointment's choices

#

or whoever

#

They wanna support whatever, let them.

#

idisappointment, if you need more support dm me as one is not allowed to give support for legacy versions

sturdy oar
#

well glhf i ain't helping

pure pasture
#

You can write it in the lowest version that should be supported and then it should work with all versions upwards from the oldest one

frigid ember
#

1.8 supports all

naive goblet
#

There is no guarantee of support when using legacy versions

frigid ember
#

dm me @tiny horizon

tiny horizon
#

will do

naive goblet
#

But I mean many devs still go with it so it exists unofficial support

pure pasture
#

That's why I said it " should" work

sturdy oar
#

1.12.2 and lower has so many issues

pure pasture
#

name a few

frigid ember
#

Name them

sturdy oar
#

GSON is not embedded

#

SQLite drivers are below 3.21.0.2

#

And so many other

frigid ember
#

We're talking about issues right?

#

name them

#

@frigid ember today im ur side

#

LES GOO

#

LOl

#

name them

pure pasture
#

@sturdy oar These aren't really issues more like inconviniences

undone narwhal
#

There are some issues, not really important

pure pasture
#

Name them

frigid ember
#

Except sticky packets

undone narwhal
#

But we all should use new versions

sturdy oar
#

^

undone narwhal
#

But we shouldn't restart this no end conversation

#

Nah?

sturdy oar
#

imma leave, i don't have time to waste with people who keep glorifying 1.8

pure pasture
#

We don't glorify it

naive goblet
#

I don’t see any issues except for that 1.8 might be a little old

sturdy oar
#

"a little"

#

2014

pure pasture
#

nah

#

The combat is trash in newer versions

naive goblet
#

You can change it with code lol

pure pasture
#

Now I'm glorifying it

undone narwhal
#

Maintaining 1.8 plugins literally means: keeping all devs wasting time supporting older versions that are not that differents

#

Pvp can be found almost like 1.8 with a simple code line in 1.15.2

frigid ember
#

Windows 10 is a little old anyway
Glorifying ok

Because no one provides valid points which is why its a no end issue.

If you want support for most versions make it compatiable; e.g. nms for somethings

1.15 still doesnt have hitboxes, blocking etc.

#

Shields blocking all damage lmao

undone narwhal
#

Windows 10 is the latest update

#

1.8 is 6 years old

pure pasture
#

It's still old

#

Windows 10 is probably older

undone narwhal
#

There is nothing new

pure pasture
#

But idk

sturdy oar
#

if 1.8 is so great why only 14% of the servers using it šŸ¤·ā€ā™‚ļø

pure pasture
#

It's younger

undone narwhal
#

There is no Windows 11 or 12 or 13 or 14 or 15

frigid ember
#

Not every plugin or spigot has bstats

sturdy oar
#

you dumb

#

that's not plugin

#

it's server stats

pure pasture
#

And how do oyu get these?

naive goblet
#

@sturdy oar comparing server amount is kinda misleading

sturdy oar
#

I'd say comparing between 160'000 different servers is enough

frigid ember
#

I can open 10,000 1.8 servers on 80 machines does that mean it has players?

pure pasture
#

True

undone narwhal
#

FatalPacket?

#

Do you love developping all versions plugin?

frigid ember
#

i love

undone narwhal
#

Aren't you bored of legacy stuff, nms cross versions?

pure pasture
#

you should compare player counts

frigid ember
#

i even made a packet api for it

#

It takes like 20 seconds to add support through nms

#

exaguration

#

Ichatbasecomponent no longer has a byte as a constructor in 1.12+

undone narwhal
#

I don't have that time for people staying 1.8 because it has more FPS or a blocking sword functionality

frigid ember
#

Again your choice as it is theres

#

i still use 1.15.2

#

just some 1.8 pvpers are ignorant

#

and just do it because they are influenced by others its "bad"

#

That is the sad part.

undone narwhal
#

This is my choice yes, but if other devs like you still use 1.8 then you're destroying the potential targets of my plugins you know?

frigid ember
#

Im sorry what potential?

#

Bees šŸ˜‚

naive goblet
#

Ngl bees is lit af

frigid ember
#

?

#

what do you mean

#

you will still get an audience

#

as your plugins are optimized for 1.15.2

#

We make universal plugins optimized for all

pure pasture
#

Honey blocks are really nice though

naive goblet
#

Yup

frigid ember
#

Yours will be better to use for just 1.15.2 servers

#

Ours for other non 1.15.2

undone narwhal
#

You're really everything but not smart...

frigid ember
#

???

undone narwhal
#

Let's move to general guys

frigid ember
#

bruh

#

Wooh there we go

pure pasture
#

And the Nether Update has some nice stuff aswell

frigid ember
#

that was kinda rude

pure pasture
#

How can you make an armor stand follow an entity (not the player)

frigid ember
#

smoothly?

#

use interpolation

pure pasture
#

Just so an entity can have a custom name that you can always see

#

Not only when you look at it

tidal mica
#

Or do you use bungees channel?
@hoary parcel if i use bungees channel, can they view my plugin message?

hoary parcel
#

Nah, those shouldn't ever reach the client

sturdy oar
#

I have this question:
I'm caching data from a database (either MariaDB or SQLite) and
I'm saving data inside a Set , it's a set of PlayerData which is an object that contains 5 fields (UUID, username, and 3 integers). This set would be able to be accessed concurrently, to achieve this i used CopyOnWriteArraySet

#

However I'm worried that with databases with lot of rows this could kill the performance

#

should I worry or not?

frigid ember
#

5 isnt that much

#

its alright

sturdy oar
#

yeah but let's say someone has 10'000 rows

#

CopyOnWriteArraySet would copy those objects each time

#

it's accessed

#

I could technically solve this by using Futures and making requests perform their work on other threads

#

But it just seems like an improper fix and just throwing the "load issues" somewhere else

hoary parcel
#

I mean, could syncronise access to the set

sturdy oar
#

I think i should try generating a database with random values and see how it performs

hard crane
#

hey anyone have an idea how i could prevent players from using items with lore in the 2x2 crafting? ive already tried using inventory drag which for some reason didnt trigger every time, and inventory click which doesnt give off the result slot

frigid ember
#

why lambda

hoary parcel
#

Why not, lol

#

That's like saying, why set

south shoal
#

I need help with a plugin that I am making a plugin that show your rank / prefix from luckperms in the scoreboard on the right and in the TAB

mellow wave
#

You're not giving us any information about what part you need help with

south shoal
#

So I made a plugin that is show a scoreboard on the right

#

on the %PlayerRank% needs to be the prefix /rank of a player

#

Dutch by the way what you are seeing there

mellow wave
#

Did you code the scoreboard plugin? If so just hook to PlaceholderAPI

south shoal
#

a own made plugin

mellow wave
#

Ok then hook to PlaceholderAPI and use it's placeholders or create your own

south shoal
#

so Placeholder API in the plugins as a libarary and in the server him self?

mellow wave
#

Wdym?

south shoal
#

nvrm

#

so you mean use Placeholder API

#

or I need to create my own place holder

mellow wave
#

It's up to you but I recommend adding PlaceholderAPI support

south shoal
#

We have a lot of custom plugins on ower server sutch as that coins

undone narwhal
#

@sturdy oar I'm interested into your parallel data using with database. If it doesn't bother you, can you please keep me up to date with all you try etc?

remote socket
mild hound
#

Anyone can help me? im was trying to start a server with Hamachi, but a Appeared " FAILED TO BIND PORT " I've tried everything and I couldn't solve it.

#

If you know how to help me, send me a message in private.

sturdy oar
#

@sturdy oar I'm interested into your parallel data using with database. If it doesn't bother you, can you please keep me up to date with all you try etc?
@undone narwhal wdym

cerulean musk
sturdy oar
#

what have you tried so far

cerulean musk
sturdy oar
#

Is this your plugin, or someone else's?

cerulean musk
#

no its cubecraft egg wars shop

sturdy oar
#

contact them then?

#

like im not getting what you trying to achieve

#

if you're developing a plugin just listen to the click event

#

and equip the armor to whoever clicked

cerulean musk
#

i try to use this plugin but its not work for me

mellow wave
#

There is no reason to use that

sturdy oar
#

yes

#

it's also kinda stupid

cerulean musk
#

what do you suggest

#

?

mellow wave
#

Do as ExtraLimo and FendiTony77 said

sturdy oar
#

also you might want to check the player's current inventory

#

you don't want to just yeet their currently equipped armour

#
If the slot is not free move the armor to the inventory
If the inventory is full, drop the armor (or send a message that tells to free the inventory)```
#

simple as that

mellow wave
#

If you want to rip it compleatly you also need to equip it if the armor is better

cerulean musk
#

i just want auto armor wear when i buy. so need coding with "eclipse" ?

sturdy oar
#

Either find a plugin that does that

#

or made your own

#

I'd also suggest you don't use Eclipse

#

rather IntelliJ IDEA

frigid ember
#

@hoary parcel what is npe

sturdy oar
#

NullPointerException

#

and don't ping him

hoary parcel
#

^

sturdy oar
cerulean musk
#

so i cant make this plugin :/ bcs i dont know coding

hoary parcel
#

.8ball is Google hard to use?

sturdy oar
#

this is not paper

hoary parcel
#

But we have cafebabe here, no?

sturdy oar
#

fail

#

?8ball is google hard to use

worldly heathBOT
#

Yes

hoary parcel
#

Oh it's not cafebabe with dum prefix

#

Smh

sturdy oar
#

?8ball is DuckDuckGo better than Google

worldly heathBOT
#

Yes

hoary parcel
#

?8ball are you not retarded?

worldly heathBOT
#

No

sturdy oar
#

perfection

hard crane
#

sorry for reposting but i kinda didnt get a response the first time
does anyone have an idea how i could prevent players from using items with lore in the 2x2 crafting? ive already tried using inventory drag which for some reason didnt trigger every time, and inventory click which doesnt give off the result slot

hoary parcel
#

Statistics šŸ¤” šŸ˜‚

sturdy oar
#

you could technically check the ItemMeta?

hard crane
#

ive also now tried looping through the recipe matrix and setting the result to air if it detects an item with lore

#

but that didnt work for some reason

#

wym tony

mellow wave
#
  1. Listen to the PrepareItemCraftEvent
  2. Check items in the recipe
  3. Cancel event if items contains lore
hard crane
#

like i said i already tried

#

also you cant cancel prepare item craft

#

thats why i tried setting the result to air

mellow wave
#

Ow I didn't see that

weary harness
#

what handles the /help command?

#

the text doesnt fit on screen so it finishes off with ...

#

and i want to fix that

sturdy oar
#

that's EssentialsX

#

i think

weary harness
#

i dont have that plugin

sturdy oar
#

oh

#

then it's bukkit who adds the /help

weary harness
#

i cant seem to edit anything, i dont even know where /help gets its information about those commands

sturdy oar
#

plugin.yml

#

of every plugin

weary harness
#

you mean config?

sturdy oar
#

no

#

plugin.yml

#

it's an embedded resource used by the server to manage plugins and provide info about them

#

every plugin has one, since it's required by the server

weary harness
#

i see

#

in my console it doesnt cut them short

#

any idea how to fix this?

remote socket
#

If I #set() in a custom yml, do i have to #save() afterwards?

tiny dagger
#

depends

#

do you want to save it?

frigid ember
#

when I open it just works but when I add it in my file manager it doesnt

undone narwhal
#

Did you load your css?

frigid ember
#

yes

#

you mean put the files in the css folder?

hollow thorn
#

how do i make an event run every tick

frigid ember
#

create a bukkit runnable schedule a repeating tick task

round rover
#

Hey,
I have a created a plugin and its in a Teamchat , but on my localtest Server is all ok, on my main Server it won't go, can anyone help ?

mellow wave
#

Are they running the same version of spigot? Are there any errors?

hollow thorn
#

how do i make a projectile source

round rover
#

no errors and the Same version

hollow thorn
#

.runTaskTimer is this a repeat task

frigid ember
#

yes

#

use that

#

store the bukkittask i recommend

#

so you can cancel it later

#

Did you load your css?
@undone narwhal ?

#

What do you exactly mean with this :p

hollow thorn
#
                                                  Location loc = turret.getLocation();
                                                  turret.teleport(loc.setDirection(ent.getLocation().subtract(loc).toVector()));
                                                  Location loc2 = turret.getLocation();
                                                  Fireball ee = loc2.getWorld().spawn(loc2, Fireball.class);
                                                  ee.teleport(loc2);
                                                  
                                                  ee.setShooter(turret);
                                                  Vector y = turret.getVelocity();
                                                  int x = 40;
    
    ee.setVelocity(y.multiply(x/20));
                                              }``` whats wrong with the setsshooter
mellow wave
#

We don't know what the turret is

hollow thorn
#

an entity

#

all entities got int the world

#

in

#

and then narrowed down using if

#

Entity cannot be converted to ProjectileSource

frigid ember
hollow thorn
#

Entity cannot be converted to ProjectileSource

paper pumice
#

What is the best way to check to see if a player has permission to right click a block without using any APIs?

remote socket
#
  public static Set<String> getLocations() {
        if (dbFile.getKeys(false) != null) {
            return dbFile.getKeys(false);
        } else {
            return Collections.emptySet();
        }
    }

second line has NPE, how can i prevent that

paper pumice
#

@remote socket dbFile is null

remote socket
#

But it's not...

paper pumice
#

Are you checking? Do a sysout if dbFile == null

frigid ember
#

First check section than get keys

remote socket
#
    private static FileConfiguration dbFile;
  
    public static void setup() {
        file = new File(Bukkit.getServer().getPluginManager().getPlugin("IChest").getDataFolder(), "database.yml");

        //check exists
        if (!file.exists()) {
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        dbFile = YamlConfiguration.loadConfiguration(file);
    }
paper pumice
#

Where is setup being ran?

#

On your onEnable?

remote socket
#

onEnable

#

yeah

paper pumice
#

How are you accessing that method

#

Is it the same class?

remote socket
#

Different class

paper pumice
#

Yeah that could be why, I had the same issue the other day

#

How are you accessing that class?

remote socket
#
ChestsDatabase.setup();
ChestsDatabase.get().options().copyDefaults(true);
ChestsDatabase.save();
paper pumice
#

Don't make it static, no need

#

Remove all of the static modifiers

#

Put this in your class that has the setup() method:

    static SetupData inst = new SetupData();

    public static SetupData getInstance() {
        return inst;
    }```
#

But change "SetupData" to your class

#

Then on your main class, put this:

        SetupData data = SetupData.getInstance();```
hollow thorn
#

if(im.hasEnchant(Enchantment.BINDING_CURSE)) why isnt this working

paper pumice
#

then onEnable, put this:

        data.setup();```
remote socket
#

Now I have this error everywhere

#

Wait nvm

#

I need to change it

frigid ember
#

Why do some client bound packets contain an entity id where it is unnecessary, for example the Client-bound Entity Velocity packet.
When sending it you already specify who you are sending to, as the entity id must be specified in the packet constructor, does this mean I can send velocity to one player only and the rest won't see it?

hollow thorn
#

if 2 seperate events on 2 differnet plugins have the same name will that cause errors

undone narwhal
#

Yes retrooper

frigid ember
#

ok

#

I don't know why anyone would want this, it would just mess up stuff.

mellow wave
#

No euanPC

hollow thorn
#
org.bukkit.plugin.InvalidPluginException: Abnormal plugin type
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:80) ~[spigot.jar:git-Spigot-e7dc2f5-a8ec1d6]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot.jar:git-Spigot-e7dc2f5-a8ec1d6]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[spigot.jar:git-Spigot-e7dc2f5-a8ec1d6]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) [spigot.jar:git-Spigot-e7dc2f5-a8ec1d6]
    at org.bukkit.craftbukkit.v1_15_R1.CraftServer.loadPlugins(CraftServer.java:353) [spigot.jar:git-Spigot-e7dc2f5-a8ec1d6]
    at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:210) [spigot.jar:git-Spigot-e7dc2f5-a8ec1d6]
    at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:784) [spigot.jar:git-Spigot-e7dc2f5-a8ec1d6]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]
Caused by: java.lang.InstantiationException: com.javaminecraft.Elytra
    at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_241]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[spigot.jar:git-Spigot-e7dc2f5-a8ec1d6]
    ... 7 more
Caused by: java.lang.NoSuchMethodException: com.javaminecraft.Elytra.<init>()
    at java.lang.Class.getConstructor0(Unknown Source) ~[?:1.8.0_241]
    at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_241]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[spigot.jar:git-Spigot-e7dc2f5-a8ec1d6]
    ... 7 more```
undone narwhal
#

Can you send the main class?

frigid ember
#

I realllyyyy need some help with vectors

hollow thorn
#

?paste

worldly heathBOT
undone narwhal
#

?ask

worldly heathBOT
#

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.

frigid ember
#

If anyone wants to take at my question more in depth:

#

Its fairly advanced, and I need someone who has a fairly deep understanding of Minecraft's implementation of vectors

hollow thorn
#

@undone narwhal

frigid ember
#

?ask

worldly heathBOT
#

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.

frigid ember
#

lol

#

i find it funny when people dont type out and use commands

undone narwhal
#

@hollow thorn Do not create a constructor. Instead override the onEnable() method!

hollow thorn
#

it is overriden

#

@undone narwhal

undone narwhal
#

Remove your constructor and move the stuff inside to the onEnable

hollow thorn
#

wut?

undone narwhal
#

Your public Elytra(Plugin plugin)

#

Your remove it

#

And the two lines inside you move it to the onEnable

sturdy oar
#

does CompletableFuture#thenAccept block the thread if the supplier is async?

undone narwhal
#

Nop

sturdy oar
#

mh cool

#

so there's no need to use thenAcceptAsync

undone narwhal
#

Oh wait

#

Now I'm not sure

frigid ember
#

ask google

#

LOL

undone narwhal
#

Maybe it won't block but it will work synchronized

frigid ember
#

@sturdy oar u can duckduckgo it

sturdy oar
#

I've read google but i think it depends from the context

undone narwhal
#

@frigid ember nice help...

sturdy oar
#

was reading this rn

undone narwhal
#

@sturdy oar Reading something on CompletableFuture whithout mentioning the Spigot stuff only main thread is not the reality ^^

frigid ember
#

he also told me to look at google

#

lmao

#

it was a joke calm

#

down

sturdy oar
#

you had asked what an NPE was .-.

paper pumice
#

@remote socket is your problem solved?

undone narwhal
#

I'm pretty sure it won't block the thread and work synchronized then you can use Bukkit methods but not sure 99%

#

You should try a thread.wait(5000) to check

sturdy oar
#

ill just try and see if it doesn't crash

paper pumice
#

What is the best way to check to see if a player has permission to right click a block without using any APIs?

sturdy oar
#

"permission to click a block"

#

wut

paper pumice
#

Interact with a block

#

Right click it

undone narwhal
#

Player#hasPermission("nameyourpermissionhere")

remote socket
#

@remote socket is your problem solved?
@paper pumice Yes, thank you very much šŸ™‚

paper pumice
#

Np
and I mean like not a String permission, I mean like has physical access

sturdy oar
#

i don't know if that is what you were looking for

paper pumice
#

I mean like, if they can build/break basically

#

Like for example, if they're in their own territory or whatever

sturdy oar
#

if they are in survival, they can always break?

paper pumice
#

But if they are in a territory that isnt' theirs

undone narwhal
#

Ah

paper pumice
#

Towny, factions, etc

sturdy oar
#

if you have any stuff like worldGuard or GriefPrevention limiting that, you'd need to hook into their API

undone narwhal
#

You have to check Factions, wg or other API

paper pumice
#

Is there a way to do it without API?

sturdy oar
#

no

undone narwhal
#

Nop

paper pumice
#

Ok np

#

thank you

#

Just another quick question, do you guys know, if I use FactionsUUID API to check if they can break/build, do you think that will work for other Factions plugins such as SavageFactions, MassiveCore etc?

sturdy oar
#

well each plugin has its own API

#

(supposing they even have one)

undone narwhal
#

If FactionsUUID and SavageFaction are forks of Factions then you should use Factions API

paper pumice
#

Ah ok

undone narwhal
#

I know that Factions has an API

ashen stirrup
#

Can you do lambda like this?

toBeRemoved.forEach(ItemStack -> quests.remove(ItemStack));
sturdy oar
#

isn't SavageFaction standalone?

undone narwhal
#

(or something like API)

#

I don't know this plugin

sturdy oar
#

@ashen stirrup Use method reference

undone narwhal
#

forEach(Quest::remove)

sturdy oar
#

yeah it's much shorter, i end up using method reference pretty often

ashen stirrup
#

Oh okay, would it work though?

sturdy oar
#

i don't know?

#

depends if your code works lmao

ashen stirrup
#

I'll test lmao

sturdy oar
#

also

#

couldn't you do

#
quests.removeAll(toBeRemoved);
#

supposing it's a collection

frigid ember
#

does anyone know how to add acceleration to a vector?

undone narwhal
#

Oh yeag

sturdy oar
#

there's no such thing named "acceleration" in a vector

frigid ember
#

I don't want the vector starting out at max speed. I want the vector to have 0 speed and then gradually work its way up in speed

#

I understand that

undone narwhal
#

@ashen stirrup Even use quests.removeIf() if you don't want to create another list

frigid ember
#

Which is why I'm trying to figure out how to apply acceleration to entity movement in minecraft

#

@sturdy oar

sturdy oar
#

you could gradually resize it

ashen stirrup
#

It'll throw a concurrent modification error?

sturdy oar
#

you get that if you try to add stuff into a list while you're iterating it

undone narwhal
#

@frigid ember Minecraft uses Velocity, I think you just have to input a vector then it will calculate trajectory with all other forces (gravity etc)

sacred roost
#

Can someone who knows luckperms help me?

undone narwhal
#

@ashen stirrup not with a removeIf !

sacred roost
#

I'm in voice

ashen stirrup
#

What's the issue?

frigid ember
#

@undone narwhal yes I understand that, but again, Minecraft applies speed based on the vector

#

I want to instead have a parabolic effect

#

where once it peaks at a certain speed, it decelerates

sacred roost
#

@ashen stirrup My defult can see /brush as well as a couple other commands

undone narwhal
#

If you want a graduating speed then you'll need to iterate an increasing velocity

ashen stirrup
#

Set the permission to false?

undone narwhal
#

As Fendi said

sacred roost
#

I dont want them to see it... its coming up as an auto selection for pressing "tab" to auto insert

sturdy oar
#

fuc

undone narwhal
#

@sturdy oar did the Not async method block the thread?

sturdy oar
#

am still writing

#

the consumer should apply on the main thread as soon as the CompletableFuture has been finished from what I've understood

undone narwhal
#

For sure

sturdy oar
#

I mean i could even run that async, it's just sending messages to a player

#

and messages can be sent async

undone narwhal
#

Yep!

sturdy oar
#

since they're just packets

gleaming helm
#

You really don't need to run that async at all

sturdy oar
#

???

gleaming helm
#

Or use the parallel stream

#

It's totally redundant

sturdy oar
#

wut

gleaming helm
#

I'm assuming getUsername() is just returning a variable

#

Like a getter

#

In which case that code's runtime can be measured in microseconds

sturdy oar
#

I'm searching for all PlayerData objects in a set that match a given UUID

#

if the database is huge, that could take some time

gleaming helm
#

Ohhhh man

#

Read up on time complexity - then use a hashmap

undone narwhal
#

After the "i don't want to leave 1.8 because it is more performant", the "this is useless to fetch all the data async" 😭

sturdy oar
#

why would i use an hashmap lol

#

the UUID is stored in the Playerdata

undone narwhal
#

@gleaming helm You want to put all the players data in Ram?

gleaming helm
#

It's useless when that code can be easily modified to run in constant time in microseconds

#

Is that fetching data from files?

#

playerData is already in memory

sturdy oar
#

No, it's fetching data from a CopyOnWriteArraySet,

gleaming helm
#

when that method is called

#

Use a ConcurrentHashMap instead

sturdy oar
#

but i don't need an hashmap

gleaming helm
#

And set the key as the thing you want to look up by

sturdy oar
#

i'd have to rewrite the entire code

gleaming helm
#

You do if you want your code to be remotely efficient

sturdy oar
#

to have the UUIDs as keys

gleaming helm
#

Yeah why wouldn't you do that from the beginning

#

Sounds pretty idiotic to me

#

Has nobody here heard of time complexity before?

undone narwhal
#

Sounds strange to force someone to modify his entire structure without knowing even its functionality

gleaming helm
#

And if you really care about your code running really fast, for the love of god don't use a fucking stream

undone narwhal
#

Omg here we go again

sturdy oar
#

what's wrong with stream lol

#

Stream are perfectly fine unless you're calling them 1000 times every second

gleaming helm
#

😐

sturdy oar
#

Aikar himself told me to use parallelStream

#

so I trust him

gleaming helm
#

So your search time is O(n) when it could easily be O(1)

#

re

#

tar

#

ded

sturdy oar
#

O(1) isn't always guaranteed in an hashmap

gleaming helm
#

😐 yes it is

sturdy oar
#

it could be up to O(N) in the worst scenario

gleaming helm
#

Nope

#

Hashmap is O(1) lookups

#

LOL

green oasis
#

driver does not support get/set network timeout for connections. (feature not supported)

My Friends cant Join my Server and i got this warn

gleaming helm
#

If you want to know how a hashmap does lookups,

#

It hashes the key

#

And looks up the value at that bucket

#

O(1) time

frigid ember
#

How do I create a IChatBaseComponent with a string in NMS?

sturdy oar
#

more keys could have same hash

gleaming helm
#

Doesn't matter if you have 2 buckets or 2 billion buckets

frigid ember
#

spigot 1.15.2 api?

gleaming helm
#

Yeah if they have more than 1 hash then you're using a dumb hashcode

#

UUIDs have a perfectly good hashcode implementation

#

So if your keys are UUIDs then you're going to be totally fine

green oasis
#

driver does not support get/set network timeout for connections. (feature not supported)

My Friends cant Join my Server and i got this warn

sturdy oar
#

I guess i'll try modifying my code

#

it would not take that much

undone narwhal
#

@frigid ember does not exists in 1.15 I guess

sturdy oar
#

I honestly had HashMap<UUID, PlayerData> before

gleaming helm
#

It's TextComponent

#

It's confusing because it's in the bungeecord package

steady cedar
#

why would it be in the bungeecord package

sturdy oar
#

So you're saying i wouldn't need to make searches through the hashMap concurrent?

steady cedar
#

that's dumb

frigid ember
#

it does

#

It does exist in 1.15 bruhh

#

check ur nms man

steady cedar
#

Hello ReTrooper

#

Code

frigid ember
#

for some reason IChatBaseComponent.a("") is null

gleaming helm
#

You don't fucking need NMS anymore to send a chat component

#

lmfao

sturdy oar
#

yeah

#

what does NMS have to do with those

steady cedar
#

NMS Net Minecraft Server.

frigid ember
#

I asked how to create a IChatBaseComponent

#

with a string

steady cedar
frigid ember
#

you guys say you provide support for 1.15

#

so stop complaining

sturdy oar
#

sure

steady cedar
#

Nobody Owes you Support bro.

gleaming helm
#
            mainComponent.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, url));
            mainComponent.setColor(ChatColor.GREEN);
            player.spigot().sendMessage(mainComponent);```
sturdy oar
#

why would you create a component with NMS

undone narwhal
#

You need it in a packet?

sturdy oar
#

if there's an API

frigid ember
#

im not going to abandon my api and use protocollib now

gleaming helm
#

Now everybody here needs to shut the fuck up and stop giving answers if they don't know the answers.

steady cedar
#

What is Your API?

frigid ember
#

it is kinda annoying when u guys ask why or say u don't need it

keen compass
#

hashmaps are not guaranteed to be O(1) @gleaming helm Most of the time is indeed the case, however if you actually look at the implementation especially starting in Java8, after a certain threshold it becomes TreeMaps which is O(log n)

gleaming helm
#

You. Don't. Need. NMS. To. Send. Chat. Components.

sturdy oar
#

^

steady cedar
#

@keen compass it's log n worst case lol

gleaming helm
#

logn worst case

#

retard

steady cedar
#

holy shit chill

frigid ember
#

I need a chat component

gleaming helm
#

O(1) average case

sturdy oar
#

yeah frostalf , i think I should change anyway

gleaming helm
#

Better than an O(n) search

sturdy oar
#

using a set is just making things worse for me i think

gleaming helm
#

And far good enough to call it "instant"

keen compass
#

O(1) isn't average case, it is when a certain limit is hit because after there is so much data you can't remain in constant time for lookups

frigid ember
#

see now u just don't support and say " you don't need it"

gleaming helm
#

No

#

I say

#

"There's a better way"

#

Because... not using NMS is a better way.

sturdy oar
#

perfectly handles chat components

gleaming helm
#

It

frigid ember
#

i wont add some random large massive chat api in ma api bro

gleaming helm
#

is

#

in

#

the

#

spigot

keen compass
#

Anyways, most of the time Hashmap is good enough. Very rarely do you actually need something better unless you really are just handling that much data

gleaming helm
#

api now

frigid ember
#

thanks for effort tho

steady cedar
#

@keen compass when you say that the time complexity diverts from O(1) average case, how much data are we talking about?

sturdy oar
#

@keen compass thank you, I'll change to ConcurrentHashMap asap

#

I don't think someone would ever have a table with more than 100'000 rows for my plugin

frigid ember
#

@gleaming helm you can't say I don't need it

#

I need it

#

How do I convert a string to a ichatbasecomponent

#

the static function named "a" returns null

#

I also checked it is nullable

keen compass
#

@steady cedar its hard to say exactly at what number, there is a threshold starting with Java8 that the HashMap becomes a TreeMap. so if I had to guess it be somewhere in the millions.

gleaming helm
#

Why would you want to use an iChatBaseComponent when you can just use TextComponent which is included in the fucking API for you

frigid ember
#

it is in NMS

sturdy oar
#

and figure it out

gleaming helm
#

Why would you use NMS when you can use the standard API

#

to do the exact same thing

frigid ember
#

@gleaming helm stop cussing

#

I am sending nms packets

sturdy oar
#

don't the packet contain JSON?

#

for the components

frigid ember
#

it takes in an IChatBaseComponent

steady cedar
#

What are you sending NMS packets for?

frigid ember
#

you said u cant code to me

#

so its ok

#

if you don't know rather u not say guys

sturdy oar
#

Retrooper we don't provide NMS support here

undone narwhal
#

Retrooper answer the Idriz question please

keen compass
#

I am curious as to why you need NMS chat stuff

frigid ember
#

where

sturdy oar
#

this is Spigot support, not Mojang obfuscated code support discord

frigid ember
#

I blocked him

#

lol

#

so i dont see

keen compass
#

only thing I can think of is if you wanted to manipulate the packet before the server gets it or after the server sends it

undone narwhal
#

Man

steady cedar
#

It's futile trying to talk to him lol

#

It's like talking to a brick wall

gleaming helm
#

He's a skid

#

Who doesn't know what he's doing

#

And comes here asking for support for plugins that he's skidded and is passing off as his own

#

That's what he does

undone narwhal
#

ANSWER THIS QUESTION THEN WE CAN HELP: Why do you need a iChat component? What will be the usage

gleaming helm
#

?xy

undone narwhal
#

Precisely please

sturdy oar
#

seems like an XY problem

frigid ember
#

i want to send an nms packet i said

undone narwhal
#

Man

worldly heathBOT
frigid ember
#

a clientbound chat packet

undone narwhal
#

Are you kidding me

#

Ok

steady cedar
#

Fine, I'll bite

#

Use ChatSerializer

frigid ember
#

the method named "a" returns null

#

and it also is annotated with the Nulalble

#

so I wanna know how

steady cedar
#

Are you sure the string you're providing is not null

#

lol

frigid ember
#

yes

undone narwhal
#

Decomplie spigot is your best option

mossy creek
#

how do i debug plugins in eclipse

steady cedar
#

Wait you said you'd blocked me

#

🤔

gleaming helm
#

LOL

keen compass
#

You can read messages from those blocked

frigid ember
#

i open all ur msgs

undone narwhal
#

I don't know ErikDa, intellij team

keen compass
#

just have to press the + icon

gleaming helm
#

Who's going to tell him to fuck off

frigid ember
#

or u guys will shout ANSWER X'S QUESTION

#

ffs

steady cedar
#

Yeah, I know, just kinda funny how he used it as an excuse to avoid answering my question

#

and now he suddenly listens to what I have to say 🤔

keen compass
#

@frigid ember is there a specific reason you need to use packets to send chat messages to the client?

frigid ember
#

yes

#

if u want to know dms pls

gleaming helm
#

Dude if you can't properly explain why you want to send a chat packet, I'm going to tell you to just use the spigot API to accomplish the exact same task

undone narwhal
#

Please answer here

frigid ember
#

these guys will say "He's a skidder"

keen compass
#

Well, without knowing your reason I can't really help is all

frigid ember
#

all that crap

gleaming helm
#

Man all your code is skidded from open source repos, you have no right to any closed source code

sturdy oar
gleaming helm
#

Just like that

steady cedar
#

Map is fine

sturdy oar
#

ty

undone narwhal
#

Like that

keen compass
#

@sturdy oar is it an API?

sturdy oar
#

api what

#

no

keen compass
#

then use ConcurrentHashMap

gleaming helm
#

What

steady cedar
#

??

gleaming helm
#

??

tiny dagger
#

declare it as map tho

frigid ember
#

Concurrent means it wil be modified by diff threads

keen compass
#

if it was an API you default to lowest base and let others determine what they want

sturdy oar
#

i'll check what cool methods it provides, and see if it's worth it

gleaming helm
#

Are you retarded @keen compass

steady cedar
#

dude

#

stop being toxic

sturdy oar
#

no i think he's right

steady cedar
#

deadass

sturdy oar
#

I'm only passing it through my own code

#

so there's no need to be general

frigid ember
#

i have so many blocke dit says so many blocked messages

keen compass
#

Just use HashMap or ConcurrentHashMap if its not an API @sturdy oar

sturdy oar
#

ok i'll do

#

ty

steady cedar
#

@keen compass why?

gleaming helm
#

^

keen compass
#

because if you back it by a Map, it will be slower

steady cedar
#

What

gleaming helm
#

What

#

I think you're confused about how the JVM processes inheritance

sturdy oar
#

well it has a lot of other methods that I would be missing if i generalize with Map

steady cedar
#

Like what?

#

Which method are you using that isn't provided by Map?

gleaming helm
#

You don't need to use them ^

frigid ember
#

why is kevin so toxic

steady cedar
#

And why are you so annoying lol

#

just answer why you need NMS

tiny dagger
#

consurrenthashmap is just for threads, i doubt it has anything new imo šŸ¤”

frigid ember
#

to send a packet

sturdy oar
#

these are all cool

steady cedar
#

What?

sturdy oar
#

and are not present in hashMap

steady cedar
#

Why would you use any of those?

#

Do you need any of those?

sturdy oar
#

some , yes

#

i could benefit

#

from them

undone narwhal
#

Is casting an object heavy?

steady cedar
#

Then use a ConcurrentMap??

gleaming helm
#

Not at all @undone narwhal

undone narwhal
#

Cool, then put a Map

gleaming helm
#

You can measure the time in microseconds

tiny dagger
#

casting wrong is a bit heavier i think

undone narwhal
#

And cast only if you need these methods

gleaming helm
#

So just don't cast wrong?

tiny dagger
#

exactly

steady cedar
#

instanceof does a wonderful job

#

of making sure you don't cast wrong

#

ĀÆ_(惄)_/ĀÆ

tiny dagger
#

but then what if they try catch cast exception

#

šŸ˜‚

gleaming helm
#

That's stupid

#

Don't do that

steady cedar
#

I get you tried to make an attempt at humor

#

but

undone narwhal
#

Supposing you know what is what lol

steady cedar
#

it wasn't that funny

tiny dagger
#

i haven't said i did

gleaming helm
#

Some people actually do that

#

Some people (here) really are that dumb

sturdy oar
#

well some are just kids u know

#

so that's the only way the can act

keen compass
#

@sturdy oar the reason I say go with HashMap or ConcurrentHashMap if its not an API, is because only you are using therefore you don't need to worry about breaking the contract with the API if you later want to change it. With Map, you can turn that object into other maps without breaking the contract with the API and thus having to change your implementation to make it work.

sturdy oar
#

Yeah I figured that out

gleaming helm
#

What.

sturdy oar
#

have already done that

#

I don't plan to provide an API

gleaming helm
#

That must be one of the dumbest things I've ever read

sturdy oar
#

Frostalf

#

so the same goes with EnumMap

#

im using EnumMap as well

gleaming helm
#

With a map you can put(), you can get() you can contains(), you can clear(), you can do a bunch of things

steady cedar
#

This is hurting my brain a little bit

#

I'm not going to lie

gleaming helm
#

But you don't really ever need to use the lower level methods

#

The map handles it for you

steady cedar
#

Is there any method you'd lose with using a Map instead of a HashMap that you do need @sturdy oar?

#

I'll put my money on no.

sturdy oar
#

I've seen some on ConcurrentMap that I could use

#

so definetively using ConcurrentMap at least

steady cedar
#

Okay, use a ConcurrentMap then

#

It's actually

#

this has a name hold on

#

yeah it's part of the SOLID principles

#
Liskov Substitution Principle
sturdy oar
#

But i mean ,i don't think there's an issue with using ConcurrentHashMap

tiny dagger
#

well

#

if you ever plan on changing that

sturdy oar
#

i don't

tiny dagger
#

your api would become obsolete

steady cedar
#

How are you so sure?

sturdy oar
#

i don't plan to provide an API, or ever change that

steady cedar
#

Okay, somebody will have to maintain your legacy software at one point and wants to change it

#

😐

tiny dagger
#

better rewrite it lol

sturdy oar
#

and even if i were to provide an API, i could just return a copy of that as a map

tiny dagger
#

just like i did for iconomy

keen compass
#

Just let the person make their program. Can't always worry about the future if it isn't certain. As the person explained they don't plan on making an API for it, therefore changes to the code even if its later on, isn't going to be harmful lol. And if someone else ends up maintaining it, then its that future persons problem XD

steady cedar
#

Yeah but this is what fucks over most people who have to maintain your legacy software

#

lol

#

Don't be a dick to them

#

also it's more about good practice, I guess

gleaming helm
#

^

sturdy oar
#

Nobody would be maintaining my resource except than me anyway

keen compass
#

As long as it is well documented it really isn't an issue

sturdy oar
#

since I use lombok and many don't like it

steady cedar
#

And you don't know that

gleaming helm
#

If you think screwing future maintainers of your software is funny, you've clearly never worked on corporate software

steady cedar
#

You can put 20 javadocs above that ConcurrentHashMap

keen compass
#

Except this isn't corporate software, more of a private project from the sounds of it

steady cedar
#

doesn't change the fact that if someone wants to change it they're gonna have to do extra work

gleaming helm
#

And that makes your opinion about legacy software about 20x less valid

steady cedar
#

Also also the people who use your software will have to make assumptions

sturdy oar
#

Except this isn't corporate software, more of a private project from the sounds of it
@keen compass Yes this code have been made only by me, i have no team working with me

gleaming helm
#

Doesn't mean you won't in the future

steady cedar
#

"Why did they specifically declare the type as a ConcurrentHashMap? Is there some small thing in there that could fuck with my rewrite?"

#

@sturdy oar Is this going to be a public resource?