#help-development

1 messages · Page 2060 of 1

tender shard
#

well "lazy" is a bad word, they are not "lazy" but they only do stuff if it's actually needed

#

I'd more call it "efficient" 😄

granite owl
#

@tall dragon so just like this i guess? ```java
public static Player getPlayer(String player)
{
Player p = Bukkit.getPlayer(player);

        if (p == null)
        {
            for (OfflinePlayer pOff : Bukkit.getOfflinePlayers())
            {
                if (pOff.getName().equals(player))
                {
                    p = pOff.getPlayer();
                }
            }
        }
        
        return ((p != null) ? p : null);
    }
onyx wasp
#

?

desert musk
#

how do you iterate through different values to find a specific subvalue in a yaml file?

tall dragon
sharp flare
#

is there any way of retrieving all the keys inside a pdc instance on 1.15

hardy swan
#

no

sharp flare
#

sad aight

#

that alone broke my heart

desert musk
hardy swan
#

you can

sharp flare
#

oh how

hardy swan
#

oh fk nvm I mixed up my versions

#

my bad

sharp flare
#

rip thanks anyways, gonna have to drop support for 1.15

hardy swan
#

why do you need that getKeys o.O

sharp flare
#

I loop the keys to retrieve every pdc data and do something else

#

something like this

summer scroll
#

How can I spawn an NPC without showing the NPC on the tablist?

noble lantern
#

Does anyone know when GRASS was changed to GRASS_BLOCK in the material enum? Was it 1.13?

sharp flare
noble lantern
#

It has some history but not the direct Enum value change

sharp flare
#

you gotta do version checks then

noble lantern
#

yeah but oracles down cant get java 12 jre atm :/

sharp flare
#

put it in a static block and check bukkit versions on when it was changed

#

then use #matchMaterial

#

or just use ternary for it

#

if #matchMaterial returns null use the other one

#

which doesn't require version checks

noble lantern
#

And version checks are quite required for the plugin im working on

sharp flare
#

can do a static final for it? using ternary?

noble lantern
#

not exactly, version check would just be simpler as theres multiple parts of code intercepting with GRASS and GRASS_BLOCK

sharp flare
#

private static final itemStack grass = #matchMaterial("GRASS) != null ? #matchMaterial("GRASS" : #matchMaterial("GRASS_BLOCK";

noble lantern
#

and GRASS and GRASS_BLOCK need version check as in <im trying to figure this out now> GRASS_BLOCK doesnt exist

sharp flare
#

I mean you can't use both since it changes on mc versions

noble lantern
sharp flare
#

oh wait

#

GRASS returns the actual grass? like the plant?

noble lantern
#

just the plant yeah

#

for say, 1.18 it does that

sharp flare
#

oh disregard what I said

noble lantern
#

1.8.8 its the block

desert musk
#
    public static String getNest(String name) {
        //how do i do this?
        for (String Nests : CustomConfig.get().getKeys(false)) {
            if (CustomConfig.get().getConfigurationSection(Nests+".name").equals(name)) {
                return Nests;
            }
        }
        return null;
    }```

i'm trying to iterate through "nests" in a yaml file to find a specific "nest" that has a given "name"
#

this is how i do that?

noble lantern
#

i need to know the version where GRASS stopped being a block

desert musk
#

hi burchard

noble lantern
#

oracles down so i cant check 1.13.2.... and i beileve thats the version it did it on

noble lantern
desert musk
#

can you help me w/ this yaml shit

#

i promise i'll eventually redo the whole project 🥺

#

it's a shitshow but i gotta start the server in a month

noble lantern
#

cant atm im on the clock to finish this before new release is sent out

desert musk
#

aight

keen birch
keen birch
noble lantern
#

Google java naming conventions

noble lantern
desert musk
noble lantern
#

And another thing pricedown

desert musk
noble lantern
#

CustomConfig.get() isnt a FIleConfiguration iirc you need to getConfigurationSection first

desert musk
#

hmmm

noble lantern
#

if your at school just wait until your home

desert musk
sharp flare
desert musk
#

i'll sort it out

wary harness
#

any one here who understands dependencies

#

with maven

noble lantern
tender shard
noble lantern
#

mfw oracle still down

tender shard
#

oracle cloud sucks eggs anyway

noble lantern
#

no like

#

the java download page

#

is down

desert musk
tender shard
#

oh

noble lantern
#

you need to get the COnfigurationSection your gonna look through, if you dont ur gonna loop through your entire config and wonder why its not working

wary harness
#

So I got one module called hooks in side I have all NMS modules for every version now I want to add them to my core module
by only adding hook as dependancy there

#

but children of hook are not registered I need to add each one

#

to Core pom file

tender shard
#

paste all your pom.xml files

wary harness
#

sub modules of HOOK

tender shard
#

normally you want hook to be submodule too and not just a dependency anyway but that shouldn'T matter

#

?paste all your pom.xml files pls

undone axleBOT
merry python
#

Does anyone know how to use plugin-annotations? It's not generating a plugin.yml file for me

#

Kotlin & Gradle

wary harness
#

so to be clear I want to add hook as dependancy to core.pom

#

and have access to all sub modules inside hook module

#

is that possible

#

or I need to do every module how I did

tender shard
#

you don't even have hooks as dependency in cores, or am I blind?

wary harness
#

in core.pom

#

probably not

tender shard
#

just declaring something a module won't automagically add is as dependency to your other modules

modern vigil
#

Just a thing about organizing my classes

tender shard
#

I don't know if it helps you in any way, but here's how I do it:

https://github.com/JEFF-Media-GbR/JeffLib

parent-pom declares all modules

dist creates the final .jar
core has all the generic stuff
then there's one module per NMS version

all stuff metnioned above is a dependency of dist (except the parent ofc)

modern vigil
#

Should I make packages that actually describe what the classes are for or should I use generic names like dataclasses, serializers, managers ?

modern vigil
#

Is there a "good" one

#

Or is it just preference

tender shard
modern vigil
#

If I make the package with e.g my CommandManager or BaseCommand it would conflict with the actual package that has the commands in it

tender shard
#

np

wary harness
#

because my pom file started being big and it is anoying adding all those modules all over again

#

when I need them

tender shard
#

yeah normally all your modules should be independent from each other

#

except maybe a wrapper module for your NMS stuff

#

but yes, you'll need to declare every module you want to include in some kind of "distribution" pom

#

e.g.

parent pom (artifact: MyLib)
- dist pom (artifact: MyLib-dist)
- core pom (artifact: MyLib-core)
- 1.18 nms pom (artifact: MyLib-1-18-nms)
- 1.17 nms pom ( artifact: MyLib-1.17-nms)```

parent pom has all those declared as module (except the parent pom itself, of course)

all poms have parent-pom as parent (except for parent pom itself, of course)

dist pom has all those things (except parent-pom and itself of course) as dependency
quaint mantle
#

Anyone have any resources on how to code a plugin with kotlin?

tender shard
quaint mantle
#

aight

fallen agate
#

I want to build a plugin with Maven using 1.8.8, is it still possible?

fallen agate
#
    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>
#

I'm getting Dependency 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT' not found

tender shard
#

?paste the full pom.xml

undone axleBOT
merry python
#

Does anyone know how to use spigotmc plugin-annotations? It's not generating a plugin.yml file for me
using Kotlin & Gradle

fallen agate
tender shard
merry python
tender shard
tender shard
fallen agate
#

Oh great it works 😄
thank you

merry python
#

gradle, build>jar

tender shard
tender shard
#

?paste

undone axleBOT
merry python
tender shard
#

why did you add this?

#

try to remove that

#

including the { } braces

merry python
#

I didn't have that before, I copied that from someone else using them haha

#

still missing

tender shard
merry python
minor garnet
#

how can i visualize the difference between one vector and another, for know how much a vector needs to reach?

tender shard
fallen agate
grim ice
#

free domains are cool

fallen agate
#

debatable

tender shard
tender shard
grim ice
#

there are

fallen agate
#

.tk is... bad

grim ice
#

.tk and .ml

tender shard
#

maybe for first year

grim ice
#

.gq

tender shard
#

oh yeah ok

#

I though you meant normal domains

grim ice
#

kekw

tender shard
#

like .com, .me, etc

tender shard
grim ice
#

i always used me.name for my packages

fallen agate
#

"In 2006, McAfee conducted a survey in which they claim out of the 95 percent most trafficked web sites, .tk domains were twice as likely as the global average to be used for "unwanted behaviours", including scams such as phishing and spam." wikipedia

desert musk
#

how much does a .com domain cost

grim ice
#

its a redirect

#

to my github website

fallen agate
tender shard
#

per year

desert musk
#

oh per year

fallen agate
#

namecheap is cheap

tender shard
desert musk
#

aight

grim ice
#

thats pretty cheao

hasty prawn
#

They're generally super cheap yeah

minor garnet
fallen agate
tender shard
grim ice
#

i wanna make a domain that just redirects u to a rickroll

fallen agate
tender shard
#

"first year" yeah and after that?

#

get a proper domain provider who doesn't raise the prices after one year

fallen agate
#

£6 or 10/year after I think

#

still dirt cheap

tender shard
#

yes that's good

vocal cloud
#

It's not bad after that. The website that sells .CA did a deal on it and it's still cheaper than most

hasty prawn
#

"$0.98 first year"

and then $650/yr after that

fallen agate
#

lol

#

I got a really nice domain for quite cheap

tender shard
#

about 10€/10$/8gbp per year is okay for .com

merry python
tender shard
fallen agate
#

I got fizz.red for like £8/year

merry python
#

I was using kotlin so I needed to use the kotlin annotation processor 'kapt' instead

tender shard
#

yeah that makes sense, I haven't thought about that

#

as said, my gradle knowledge is very limited 😄

tender shard
#

everything coming from @serene coralred is automatically considered as spam by most spam filters

fallen agate
shy saffron
#

why doesnt Bukkit.getOfflinePlayer() work for me?

tender shard
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

shy saffron
#

ok fine

tender shard
grim ice
#

awesome

hasty prawn
#

You just want to reverse the Vector direction?

minor garnet
#

let me show in game -_-

hasty prawn
#

Multiply by -1

minor garnet
#

not that

tender shard
hasty prawn
#

Then yeah show in game lol

minor garnet
#

let me explain my game ideia

tender shard
grim ice
#

ik

#

how do i remove its embed btw

tender shard
#

put the link <like this>

hasty prawn
#

Surround it in <>

vocal cloud
#

I mean you build your own site and set the embed to something else

#

Thus tricking people

grim ice
#

idk html or css or js

#

Lmao

viral crag
#

how much of a difference in the vector backwards? that's not an aspect of vectors, they are single direction. you could get the difference between two vectors from their locations

shy saffron
#

So I have this code and im using Bukkit.getOfflinePlayer() to get the offline player from the first argument of my command and its returning null for some reason. Heres my code, and there arent any errors:

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (args.length < 2 | args.length > 3) return false;
        Player target = Bukkit.getOfflinePlayer(args[0]).getPlayer();
        if (target == null) return false;
        return true;
    }
grim ice
#

i wanna learn html and css but idk

#

i suck

worldly ingot
tender shard
viral crag
tender shard
#

getPlayer() returns an Online Player if they are online

worldly ingot
#

Oh that was an answer

tender shard
#

if they are offline, it returns null

vocal cloud
tender shard
shy saffron
#

um

viral crag
tender shard
shy saffron
#

well how should i get the display name of an offline player, for example then?

quaint mantle
#

Kotlin Plugin Error

tender shard
vocal cloud
#

You store it in a database

tender shard
#

all you could do is to save the displayname of online players while they are online

shy saffron
#

damn

tender shard
shy saffron
#

i see

minor garnet
#

i moved -0.5 from pitch

minor garnet
quaint mantle
tender shard
#

idk but somehow I still don't understand what you're talking about lol

minor garnet
#

man cmmon

minor garnet
tender shard
#

you want to recreate some kind of recoil / spread like in counter strike

#

right?

minor garnet
#

i moved -0.5 from yaw, how i get -0.5 from this value

desert musk
#

yeah

minor garnet
#

dude again english is not my main

tender shard
#

no problem, I am not mad or sth lol

#

I just try to understand what your problem is

minor garnet
#

i have -12.0, then i moved my camera to a random direction, in this case i now i have -12.5 from yaw, i just need get how much the yaw is diference from the -12.0 value understand?

hasty prawn
#

Are you just trying to get any difference in yaw/pitch after they start shooting and then apply that to where the shots come out of?

desert musk
#

but i dont know how to solve your problem

desert musk
#

i assume he’s making a no recoil hack

limpid bronze
#

my project can't compiled at all, there is no error just "NameProject: failed"

minor garnet
desert musk
hasty prawn
#

Ohhh, PlayerMoveEvent then? You know when they start shooting, so if they're shooting you store their initial location and then constantly add the change in yaw/pitch to that location, should in theory work okay I think.

desert musk
#

i see

desert musk
#

you sure?

hasty prawn
#

what

desert musk
#

why not

minor garnet
#

each time the player right clicks, i will see how much vector the player moves his camera

#

look

desert musk
#

then you solves your own problem?

hasty prawn
#

^?

minor garnet
#

no

tender shard
minor garnet
#

i just need a vector math

desert musk
#

oh

#

i assume you subtract present vector from initial vector

minor garnet
#

man is it so hard to explain? xd

hasty prawn
#

The way you're doing this is weird that's why.

tender shard
#

tbh if you explain it and 5 people don't understand it, it's probably your way of explaining that's shitty 😛

#

no offense, I probably couldnt explain it properly either

desert musk
#

🤷

minor garnet
#

this is returning me a vector right?, basically I'm going to add this to the player's direction vector, if you see a certain amount for each if, that would be the player portrait number, basically I don't want to type these values ​​inside the plugin , I would then do this in the game and then it would already set these numbers for me

#

i hope now your guys understand

fast path
#

Uh

#

You can use getLocation.getDirection and multiply -(bonus)

#

and set vector to that

manic furnace
#

I am trying to set the skin overlay of an npc, but I always get this error:

        at net.minecraft.network.syncher.EntityDataSerializers$3.copy(EntityDataSerializers.java:57) ~[?:?]
        at net.minecraft.network.syncher.SynchedEntityData$DataItem.copy(SynchedEntityData.java:344) ~[?:?]
        at net.minecraft.network.syncher.SynchedEntityData.getAll(SynchedEntityData.java:211) ~[?:?]
        at net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket.<init>(ClientboundSetEntityDataPacket.java:19) ~[?:?]
        at at.theduggy.project.npc.NPC.<init>(NPC.java:77) ~[Deutsch_DieWolke-1.0-SNAPSHOT.jar:?]
        at at.theduggy.project.TestParticleCommand.onCommand(TestParticleCommand.java:28) ~[Deutsch_DieWolke-1.0-SNAPSHOT.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        ... 21 more

Code:

DataWatcher watcher = npc.ai();
watcher.b(new DataWatcherObject<>(15, DataWatcherRegistry.a), (byte)127);
PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(npc.ae(), watcher, true);
((CraftPlayer)player).getHandle().b.a(packet);
viral crag
#

class java.lang.Byte cannot be cast to class java.lang.Float

vocal cloud
#

Paper roffMET

manic furnace
viral crag
desert tinsel
#

?learnjava

undone axleBOT
desert tinsel
#

it s for me =))), ok?

spring minnow
#

how do i check if a player deposits an item somewhere?

viral crag
#

is it a chest or something? - somewhere is pretty vague

spring minnow
#

yeah

#

a chest

#

but also like enderchest/shulker or even like furnace

viral crag
#

then you can watch for an inventory event and who is involved

spring minnow
#

in every place beside inventory

spring minnow
viral crag
#

well a chest is an inventory type

spring minnow
#

yeah but

#

doesn't the event get triggered like even if a player just clicks in his inventory?

#

in that case wouldn't work

viral crag
#

yeah you will have to filter and get the correct matches

spring minnow
#

ok, i'll try

viral crag
#

the others you mentionad are all there as well

spring minnow
#

thx

#

how can i check if the inventory is open from a certain player?

viral crag
#

from the event

spring minnow
#

doesn't contain a inventory.getWhoOPen

#

oh wait, nvm contains a .getViewers

viral crag
#

...

#

i would stick with who caused the event

#

though i guess you could check to see if there are multiple viewers

spring minnow
#

or i missed it?

#

InventoryEvent class

minor fox
#

Is there a quick way of disabling the warning in console from events taking too long?

viral crag
spring minnow
minor fox
ember estuary
#

for the CS students in here,
does "two's complement of x" have a different meaning than "x in two's complement" ?
Cuz most sites seem to invert the number x if the former is asked, but just take the binary value of x if the latter is asked. is that right?

viral crag
#

the result is different

ember estuary
#

alright, ty

viral crag
#

Two's Complement Decimal Number
0101 5

#

that copy-paste is the reverse order of what you asked

#

"two's complement of x" would usually be something like: two's complement of 0101 - or if they are testing signs it might be a signed value

viral crag
spring minnow
#

nope

#

this was the first event i though would've work

dreamy chasm
spring minnow
#

but then i realized its called only when an item moves from an hopper to a chest

sacred mountain
opal juniper
viral crag
#

hmm should be called when a player moved an item into a chest as well

spring minnow
#

imma try again

opal juniper
#

it has a getPlayer() which returns a HumanEntity

spring minnow
#

perfect way to deubg

spring minnow
#

and not like when an item is moved

viral crag
#

they are targeting a specific item put into a specific inventory - i am guessing its a quest or achievement type thing

opal juniper
spring minnow
spring minnow
#

yes

#

its for a private user, he's going to pay me $.$

sacred mountain
#

isnt there already a datapack

#

for that

spring minnow
#

shhh

#

he doesn't have to know that

sacred mountain
sacred mountain
#

but ok

spring minnow
#

not

#

he asked me to do that, not to search if there already was something to do it

sacred mountain
#

eh

#

ok

spring minnow
#

i'm doing what he asked.

spring minnow
#

btw ItemMOveEvent doesn't work

spring minnow
#

you should "play" with vectors

sacred mountain
limber owl
#

hey, could someone help me with writing stuff into config?

spring minnow
#

projectile is still an entity, and every entity has a velocity

#

you can manage that with vectors

sacred mountain
#

did you even read the code

#

before telling me that

spring minnow
#

projectile.setVelocity(Vector);

sacred mountain
#

bruh

spring minnow
sacred mountain
spring minnow
#

but i actually don't know how to do that well neither xD

spring minnow
placid fog
#

guys im a noob at this and if i want to program a plugin lets say if i right click a diamond and sends me a message how do i do it?

sacred mountain
#

??? i linked code that literally has

viral crag
sacred mountain
#

velocity editing

sacred mountain
#

the multipliers work ive null checked them

viral crag
#

is it running the result?

ancient plank
#

have you tried turning it on and off again

sacred mountain
#

like restarting the server?

opal juniper
limber owl
spring minnow
spring minnow
#

he's right

sacred mountain
sacred mountain
opal juniper
#

ok, so it doesnt change speed?

sacred mountain
#

yeah

viral crag
sacred mountain
#

its running the code

ancient plank
#

sout go brrr

sacred mountain
opal juniper
sacred mountain
#

ofc now actually what is wrong with my code

delicate cargo
#

how do i make a wireframe cube the most efficient way possible?

opal juniper
sacred mountain
#

wont that just freeze it

viral crag
opal juniper
modern vigil
#

Does AttributeModifier.Operation.MULTIPLY_SCALAR_1 just add 1 to the multiplier ?

#

e.g

#

the value passed in is 1

dreamy chasm
modern vigil
#

does it multiply the target attribute by 2?

sacred mountain
#

case SNOWBALL:
e.getEntity().setVelocity(e.getEntity().getVelocity().multiply(new Vector(0, 0, 0)));

limber owl
#

guys please, I need help writing into config file from code

delicate cargo
#

i believe it times it by a scalar of 1

ancient plank
#

write some unit tests

opal juniper
delicate cargo
#

MULTIPLY_SCALAR_10 would times it by 10

modern vigil
sacred mountain
#

ok

modern vigil
#

That says otherwise tho

viral crag
#

no need to re-get your entity

delicate cargo
#

oh so it does

sacred mountain
#

it works

#

the snowball falls

#

why isnt mine working then

delicate cargo
#

anyway what is the most efficient way of making a wireframe cube?

opal juniper
sacred mountain
opal juniper
#

ok cool

#

so are your config values 1 by any chance?

sacred mountain
#

nah

#

5

#

and i reloaded

opal juniper
#

meh, try setting them really big

sacred mountain
#

already done

ancient plank
#

reboated

sacred mountain
#

they're like 20 for some

#

wtf its working

#

???????

limber owl
sacred mountain
#

huh?????

opal juniper
#

im a god

sacred mountain
#

i literally changed one thing, then built it, then press ctrl z then built again

#

what the hell

opal juniper
#

were you reloading with /reload

sacred mountain
#

so confused rn

sacred mountain
opal juniper
#

bet you didnt reload properly

#

but glad it works

delicate cargo
#

so how do i do a wireframe particle effect

sacred mountain
delicate cargo
#

and also how do i make a plugin reload cmd

sacred mountain
delicate cargo
#

wwhat?

sacred mountain
#

also plugin reload commands are mainly just for reloading files

#

so the variables actually update

delicate cargo
#

ok

#

anyway how do i make wireframe particle effects efficiently?

limber owl
sacred mountain
#

sad

#

cant have lightspeed objects

limber owl
#

you're setting them to negative speed?

sacred mountain
#

just a really big number

limber owl
#

long is for long numbers

ancient plank
#

big is for big number

sacred mountain
#

smo

#

l

dense geyser
#

scriptus pom error

limber owl
#

well, this is for help with development and you're not asking anything, and I'm still asking how can I save somethingto config file

sacred mountain
#

write to yaml

#

search bukkit fileconfiguration

delicate cargo
#

what is the most efficient method for making a wireframe particle cube

limber owl
#

my problem is that it doesn't work, I have my suctom sonfig file in a class and use this method to save into it

    public static void set(String path, Object object) {
        config.set(path, object);
    }
#

but it just doesn't work

sacred mountain
#

config.save() ?

ivory sleet
#

Well of course you need to invoke the save function

#

The config object itself is just a hashmap in memory, nothing more

limber owl
# sacred mountain config.save() ?
    public static void save() {
        //plugin.saveResource("levels.yml", true);
        try {
            config.save("levels.yml");
        } catch (IOException e){
            Bukkit.getLogger().log(Level.SEVERE, e.getMessage());
            if(WaterRun.get().getConfig().getBoolean("debug"))
                e.printStackTrace();
        }
    }
``` doesn't work, its called after trying to write into file
ancient plank
#

patience young padawan

limber owl
#

well?

delicate cargo
#

ive been waiting for so long and no answer whatsoever

ancient plank
#

that's a damn shame

sacred mountain
limber owl
delicate cargo
#

meanwhile i have not

#

thats the difference

limber owl
sacred mountain
#

why does intellij do this

#

idk what theyre called

#

tags

limber owl
#

?

ancient plank
#

I like the tags that tell me what they're supposed to be

sacred mountain
#

yeah

#

but some are missing

#

and i dont know why

#

maybe because it isnt the right type? but still accepted

#

dk

limber owl
#

i don't know

#

and i still can't save into my config

delicate cargo
#

so what is the most efficient way of making a wireframe cube particle effect?

ancient plank
#

are you incapable of waiting for longer than 20 minutes

delicate cargo
#

yes

ancient plank
#

don't spam the same question every 4 minutes :)

delicate cargo
#

ill just look at others' code

sacred mountain
#

ok

ancient plank
sacred mountain
#

wow

ancient plank
#

idk man

tender shard
#

wow this is channel is toxic today

sacred mountain
#

never knew about that

sacred mountain
#

noway

tender shard
#

if you didn't get an answer yet, it's because noone knows the answer or noone had time to answer yet. There's no need to to ask why noone answered yet. people will answer to you once they got an answer for you

ivory sleet
#

Mye also you’re absolutely not fucking entitled to help

tender shard
#

oh wow, did my message get pinned? 😮

ancient plank
#

its good message

late sonnet
#

I feel i read this before xd

sacred mountain
#

hey does anyone know why my velocities arent updating when i do my plugin reload command?
all my other files are updated in the same way and they all work fine

#

when i edit a file and reload i mean

limber owl
sacred mountain
#

but, the /reload or restarting works

ivory sleet
#

martinecko that’s because you can’t pass a mere string to the save method

tender shard
sacred mountain
limber owl
sacred mountain
#

i use the same system for my other things and they work fine, e.g. message changing

ivory sleet
#

Because "epic.yml" is a string

limber owl
#

this?

sacred mountain
#

you have to get the fileconfiguration first right

limber owl
#
configFile = new File(plugin.getDataFolder(), "levels.yml");
ivory sleet
#

Yes you need to pass configFile to the save method

#

Basically

#

Also iirc you have to manually check for whether the file exists or not

sacred mountain
#

sad

#

cross

ivory sleet
#

File is not a subclass of FileConfiguration

sacred mountain
#

oh

#

i dont use fileconfiguration ¯_(ツ)_/¯

ivory sleet
#

ok but what does that have to do with anything?😅

sacred mountain
#

thought you agreed with his code up there

#

so i just copy pasted it

limber owl
#

I have that, the thing is why would then there be a save function with string that doesn't work?

ivory sleet
#

Because it doesn’t work

#

That’s the entire point

kind hatch
#

There is no save function that takes a string as a parameter. Only one that takes a file.

ivory sleet
limber owl
kind hatch
#

1 dex

#

Sec*

limber owl
#

in FileConfiguration.java

ivory sleet
#

Yes but that’s not what you want

kind hatch
#

Oh shit, he’s right. There is a method that takes a string, but it’s not what you think.

ivory sleet
#

Because it points towards the wrong file due to not specifying the directory

limber owl
kind hatch
#

I wish the javadocs were a bit clearer about some of those methods. I’m assuming that you need to specify the full file path if you use #save(String).

ivory sleet
#

I also to some extent didn’t know about that method’s existence

kind hatch
#

It’s not directly stated, but both of them share the same description so it wouldn’t be that much of a stretch to assume it.

ivory sleet
#

Mye

urban bramble
#

How does one get a list of ConfigurationSections in spigot's config API?
eg.

- test: 1
  test2: 2
- test: 3
  test4: 4

I'd want to serialize that into a list of test and test2
ConfigurationSection#getList doesn't allow for a custom object

crisp steeple
#

getKeys()?

tardy delta
#

getValues()?

crisp steeple
#

if you need the key as well as subkeys though

urban bramble
#

in a list

#

my experience with getKeys was for an object

#

and getting it's keys

limber owl
#

this is a map not a list

crisp steeple
#

yeah i think you’re looking for a map not a list

urban bramble
#

That's a list though

#

I'd really prefer to use a list if possible

crisp steeple
#

what do you mean

urban bramble
#

That is a yaml list of objects

#

and I would like to recieve a Java list of objects

#

from it

crisp steeple
#

so just numbers?

urban bramble
#

well no, numbers and strings, but that shoulden't matter?

#

It's a list of objects

#

the values inside the object shouldn't matter much

limber owl
#

you ask for a string with number, thats a map, no a list

urban bramble
#

no it's not?

#

That's a list

#

I promise you

crisp steeple
#

is test a serialized object?

#

i’m assuming so

urban bramble
#

No, test is a value in an object

limber owl
#

String:Integer is in fact a map

urban bramble
#

What are you talking about?
That is a Yaml list of objects

limber owl
#

the string has a value of int

urban bramble
#

So? It's a list of them

#

that's what the - is for

limber owl
#

start of a map

urban bramble
#

even if I want it as a map (I don't, but that's for later)

limber owl
#

if you want to convert it into a list

#

you can do in code

urban bramble
#

it will be a list of them

#

a List of maps

limber owl
#

or you know, just a regular hashmap

urban bramble
#

I'm really confused why you want this to be a map, since it's just a list of objects

#

I don't want a map

limber owl
#

i understand you dont want a map

urban bramble
#

And the thing I showed you was technically a List of maps

#

or a list of objects

viral crag
#

wonders why you would argue with an unverified member

urban bramble
#

depending on how you parsed it

#

fair

limber owl
crisp steeple
#

i’m pretty sure in your case you just need to use getValues

#

and then loop through all of them and add it to a list

limber owl
#

I was just trying to explain that what he was looking at wasn't a list but a map

urban bramble
#

but the thing is, it is a list

#

so I'm unclear as to why you're trying to convince me otherwise lmao

crisp steeple
#

it could be a map but that’s not what it’s being used for in this case

limber owl
ivory sleet
#

In case someone didn’t already mention

urban bramble
#

It's not a map ;p

#

it has strings and ints

#

I just used only ints there

#

as a rudimentary example

#

my fault

#

I think I'll try getValues()

ivory sleet
#

well getMapList returns a List<Map<?,?>>

#

Which is exactly what you got there

urban bramble
#

ah, okay

#

so I guess just a bunch of instanceOf checks

limber owl
ivory sleet
#

🥲

urban bramble
#

🥲

#

thanks

ivory sleet
urban bramble
#

oh smh no external emojis

ivory sleet
#

ye sadge

solar sable
#

guys is there a problem with this? it wont do the sounds

public void onClick2(PlayerInteractEvent e) {
        if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
            if (e.getHand() != EquipmentSlot.HAND) return;

            if (e.getClickedBlock() != null && e.getClickedBlock().getType() == Material.OAK_DOOR) {
                Player p = e.getPlayer();
                p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_BELL, 2F, 1F);
            }
ivory sleet
#

did u turn on sounds btw?

solar sable
#

I did

limber owl
#

does it get past ```java
if (e.getHand() != EquipmentSlot.HAND) return;

#

?

solar sable
#

hm?

limber owl
#

try debugging it

#

add something that will write into console if it get past that if statement

solar sable
#

i mean otherwise it should be working right?

#

like there's nothing wrong with it

viral crag
#

you have two hands, and both hold items

worldly ingot
#

There doesn't seem to be anything inherently wrong with that code, though you could use Tag.WOODEN_DOORS.isTagged(e.getClickedBlock().getType()) to account for all doors

#

Just make sure it's registered and has the @EventHandler annotation

solar sable
sage merlin
#

will this return a true if there are a duplicate of elements in this queue?

tardy delta
#

new HashSet<>(queue).size() wha

sage merlin
sage dragon
#

Does anyone know about how I'd generate a normal world with a specific schematic generating every x blocks apart? 😅

tardy delta
#

to achieve what?

#

by killing the cpu

sage merlin
tardy delta
#

ah thats why

solar sable
#

where do i put it?

sage merlin
#

and putting the queue between the brackets of the hashset will be equal to it and were getting the size of that mesh and subtracting it by the queue size - 2 to see if there are duplicates

tardy delta
#

why not just return new HashSet<>(queue).size() < queue.size()?

golden turret
#

why cant i access these variables here?

sage merlin
ivory sleet
#

since it cant at compile time ensure both predicates are gonna be false (beyond the return)

tardy delta
#

dunno why -2

maiden briar
#

Quick question: What is the NMS version of 1.18.2? (CraftPlayer package)

sage merlin
#

im gonna try that

tardy delta
#

😶‍🌫️

dense geyser
maiden briar
dense geyser
#

idk tho

#

OH

#

ignore me

golden turret
#

how can i get the default attributes values?

ivory sleet
#

@golden turret

#

anyways

#

doing sth like

#

if (!(o instanceof String str && o2 instanceof String str2))
return;

#

would fix it

golden turret
#

ok but how can i get the default attribute values?

ivory sleet
#

the base value?

golden turret
#

something like DefaultAttributesBestClass.get(Attribute.AN_ATTRIBUTE)

#

because this is not working as expected

#

the base value is being changed

sage merlin
tardy delta
#

?

sage merlin
#

i thought you were dumb at first now your not

rough drift
#

how can i get enchantments from enchantment book

ivory sleet
#

perhaps getDefaultValue?

rough drift
rough drift
# rough drift how can i get enchantments from enchantment book

For anyone interested:

Rather than the normal:
ItemStack#getEnchantments()

You have to do the following:

EnchantmentStorageMeta meta = (EnchantmentStorageMeta) itemStack.getItemMeta();
Map<Enchantment, Integer> enchantments = meta.getStoredEnchantments();
upper heart
#

Hey. does anyone know how to get player location using Bungee??

viral crag
#

cut it and look for the splat ?

#

you would have to send a command from the bungee to ask the server

upper heart
sharp bough
#

the image is the recomendation

#

kinda confusing sorry

viral crag
#

timer will always be greater than zero i'd expect

sharp bough
#

why?

viral crag
#

its a repeating task

sharp bough
#

Variable 'taskID' is accessed from within inner class, needs to be final or effectively final

sharp bough
viral crag
#

yeah, that only ends your loop

#

that does not mean that it wont run the next sceduled repeate

sharp bough
#

isint the task the loop?

#

so if i cancel it then theres no more loop?

viral crag
#

i think you need to ask yourself why you are using a repeating task

sharp bough
#

because i want to spawn something X amount of times, in this case 5

#

with a small delay in between

viral crag
#

i wouldnt use a repeating task for that

sharp bough
#

wdym

#

what else could i use

viral crag
#

delayed task or scheduled task

sharp bough
#

i dont get it, why would i use a delayed task to repeat something when theres a repetitive task

viral crag
#

for one you are running it on the main thread, if your just generating particles, there isnt a need

#

it is easier to have a timer run out than it is to stop the timer correctly

viral crag
#

5 is a pretty small number of runs to handle

sharp bough
#

after 1,2,3, etc seconds?

viral crag
#

if you think it needs to be on the main thread, then it is at least only blocking while it is running your code if it has an issue

sharp bough
#

so something like this

for (int i = 1; i <= 5; i++){
            Bukkit.getScheduler().scheduleSyncDelayedTask(FactoryIdeaV1.getInstance(), new Runnable() {
                @Override
                public void run() {
                    System.out.println("spawning");
                }
            }, i*20L);
        }
```?
round finch
#

Question why cancelling the thread? Curious

sharp bough
#

i need it to spawn 5 times

viral crag
sharp bough
#

yea dont worry abt that

#

it works now thanks

round finch
#

Ahh CPU processing saving

crisp steeple
#

you could just use a bukkit runnable instead of that entire process

ivory sleet
#

I mean the scheduler works equivalently good

sage dragon
wide coyote
#

so you can stop the task inside of the brackets

ivory sleet
#

I mean they could just pass a consumer instead

#

With a lambda expression that is

wide coyote
#

ah yeah

#

i forgot that BukkitRunnable is deprecated

#

use the consumer one

ivory sleet
#

Well it’s deprecated if you try to pass it through the scheduler

sharp bough
#

i mean is changing it better for the cpu?

crisp steeple
wide coyote
#

yeah we are able to extend it to our object

ivory sleet
#

But that’s because you can basically use its instance methods to schedule it pepehappy

wide coyote
#

"you we" lol

ivory sleet
#

Ig it could be longer, but it’s ideally gonna be shorter

sharp bough
ivory sleet
#

Lucas I’m confused

sage dragon
ivory sleet
sharp bough
ivory sleet
#

You could basically:

Bukkit.getScheduler().runTaskTimer(plugin, ()->{
//TODO
},0L,5L);

sharp bough
#

isint that the same thing?

#

this are 5 delaed tasks

ivory sleet
#

Yes but in a much more reasonable way

sharp bough
#

thats a repetitive task that gets cancelled?

ivory sleet
#

Well you could just cancel it?

#

?scheduling did u read this?

undone axleBOT
sharp bough
#

yea

ancient plank
#

#cancel() gg done

solar sable
#

can someone help me with a little java problem?

#

how to delay a task

round finch
#

?ask

undone axleBOT
#

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

round finch
#

Just put question

solar sable
#

oh

tardy delta
#

?SCHEDULING

#

ah caps

#

?scheduling

undone axleBOT
solar sable
#

thats with spigot

ancient plank
#

indeed

tardy delta
#

what task

solar sable
tardy delta
#

executor

glossy venture
#

why the fuck is it telling me this???

#

its clearly declared

#

java fucking stupid

tardy delta
#

?google

undone axleBOT
tardy delta
#

lol

solar sable
#

ik but google isnt working for me sadly

chrome beacon
#

ok

#

?bing

undone axleBOT
solar sable
#

i can only use discord rn ;-;

tall dragon
#

who the heck uses bing.

solar sable
#

i cant even open youtube

tardy delta
#

bing sucks

round finch
#

Rip ur internet situation

solar sable
#

now idk where to ask

round finch
#

Google is quite a good tool for searching for answers

solar sable
round finch
#

Can you use your browser?

solar sable
#

dw i have some other programming dc servers

solar sable
round finch
#

F

solar sable
#

yup big big F

#

mega F

round finch
#

No one can send you any links then

solar sable
#

yeah sadly

tardy delta
#

why cant you use your browser or yt?

round finch
#

No internet?

#

Wait amxy is using discord

tardy delta
#

well discord works with internet too my man

solar sable
round finch
#

Use discord browser gege

sharp bough
#

you coudl ask a friend to screenshare you google :D

solar sable
#

i dont have dc friends

sharp bough
#

you could go to macdonals

#

most of them have free wifi

solar sable
#

closed

sharp bough
#

starbucks?

#

burgerking?

solar sable
#

none here

sharp bough
#

public library?

solar sable
#

nope

round finch
#

If anyone could give him code

#

Me rn on phone so I cannot confirm anything

sharp bough
#

you could make a bot to make an http request to the link you want and read the contents from that, i would recommend using python for this

#

if thats not possible setup a private ftp server with a friend, and use that

#

dont worry we will find a way for you to google!

round finch
#

Discord has a browser

solar sable
#

but tbh idek how to use this thing XD

#
class MyClass {

    static void sayHello(String name) {
        System.out.println("Hello " + name);
    }

    public static void main(String[] args) {
        sayHello("Ray");
    }

}
sharp bough
#

what thing? internet?

round finch
#

It chromium

ivory sleet
solar sable
#

I literally just copied it from a tutorial and changed it

sharp bough
#

wait how did you get the tutorial without internet?

solar sable
#

i mean i know a bit on how it works but it cant even be delayed right?

sharp bough
#

are you lying to us rn?

round finch
#

Thread

tardy delta
solar sable
#

it was from nov 28 2021 and its a screenshot

#

from my phone

sharp bough
#

can you prove it?

solar sable
sharp bough
#

open a cmd, write ipconfig and then do ping www.google.com, then share what the console says

tardy delta
#

😆

solar sable
#

do i have to ;-;

tardy delta
#

yes

sharp bough
#

would you?

tall dragon
#

if you want everyone to know ur ip. thats a good way

viral crag
#

moot

solar sable
tardy delta
#

if i would save all the ip's being sent here i would have a lot now

solar sable
#

just believe that i have bad wifi

sharp bough
#

hahahahaha aight gtg

#

almost got him tho

solar sable
#

all i ask is can it be delayed? because its literally print in the system so idk

solar sable
#

nvm that

tardy delta
#

this could help

solar sable
#

thanks

#

sadly idk how to really use java so this is gonna be a trial and error moment xD

tardy delta
#

you can look up the documentation in the file

viral crag
#

the googler is still broken

round finch
#

Java documentation

#

Yes

#

In the files

tardy delta
#

just decompile it

#

i mean ctrl right click on ij

round finch
#

Hmm 🤔

solar sable
#

idk how to do this

round finch
#

What exactly about it?

#

Curious

tardy delta
#

rust is brilliant lol

solar sable
#
class MyClass {

    ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
    
    static void sayHello(String name) {
        System.out.println("Hello " + name);
    }

    public static void main(String[] args) {
        sayHello("Ray");
    }

}
``` pls help
rustic hamlet
#

what do you need help with

tardy delta
#

public is something

rustic hamlet
#

im so confused

tardy delta
#

private is something too

#

final is something too

solar sable
#

i dont get this delay thing brush sent me ;(

tardy delta
#

did you look at the method signature?

solar sable
#

wait

viral crag
#

you need to hide the key to the Executors bathroom

solar sable
#

give me a minute i might be getting somewhere

tardy delta
#

im wondering how you learnt java too

#

probably in the same bathroom

solar sable
viral crag
tardy delta
#

which one?

solar sable
#

i got to lesson 29 then i forgot

#

i mean not forgot i mean i deleted it cause i lost motivation ;-;

tardy delta
#

then why you're here?

solar sable
#

took me 5 months to have motivation again

viral crag
#

was lesson 29 how to pre-increment ?

solar sable
#

plus it make me feel smarter even tho im not :smugs:

#

anyways what is TimeUnit?

round finch
#

I would recommend getting browser internet Access to learn

naive bolt
#

is their an way to check if a player joined with a new name compared to last time without using a db?

#

is their a simple function or anything

tardy delta
#

Lesson 29 kek

solar sable
naive bolt
#

why use ip

#

or uuid

tardy delta
#

bruh if you stopped there

#

wait lets see what follows

solar sable
viral crag
naive bolt
#

i want to on playerjoin see if their name is diffrent from last join

tardy delta
#

you stopped before getters and setters

grim ice
#

btw

tardy delta
solar sable
grim ice
#

can i ask something about website development?

solar sable
#

but still i kinda forgot

tardy delta
#

lol

viral crag
round finch
#

I still haven't learned field getters and etc

#

Yet

chrome beacon
tardy delta
#

sololearn

grim ice
grim ice
viral crag
tardy delta
#

dont you have it?

grim ice
solar sable
#

later someday im gonna be here again but asking how to make an effect apply to a person when it eats food like enchanted chicken or something

grim ice
#

im tryna show all pictures in a directory

#

in a website

tardy delta
grim ice
#

but im struggling