#help-development

1 messages ยท Page 781 of 1

glad prawn
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

south mason
#

Hello everyone again. It's me again with my stupid idea to shove a spring website into a plugin on Spigot. I read a little bit about how to put a site in a jar and even compiled a plugin, but when I launch the site itself, I get an error over and over again: Application run failed java.lang.IllegalArgumentException: No auto configuration classes found in META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports. If you are using a custom packaging, make sure that file is correct. Can anyone tell me how to fix it?
I apologize in advance for my stupidity

storm crystal
#

You guys apologize for stupidity?

vital vortex
#

help please i cant send messages on โ help-server it says "failed upload"

young knoll
#

You can't send images/videos/attachments unless you verify

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

vital vortex
storm crystal
storm crystal
rustic grail
#

hey does anybody know the kotlin/jvm/internal/Intrinsics bug? Never heard of it and now it stops my kotlin paper(bukkit) plugin from working...

rotund ravine
#

?noertor

#

?noerror

rotund ravine
young knoll
#

?stacktrace

undone axleBOT
rotund ravine
#

?stacktrace

undone axleBOT
rotund ravine
#

@young knoll nub

rustic grail
#

do you want the build or the code?

rotund ravine
#

The error

rustic grail
#
java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
    at one.cawatech.smashv2.SmashV2$Companion.setInstance(SmashV2.kt) ~[SmashV2-1.0-SNAPSHOT.jar:?]
    at one.cawatech.smashv2.SmashV2.onEnable(SmashV2.kt:11) ~[SmashV2-1.0-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.1.jar:git-Paper-100]
    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.1.jar:git-Paper-100]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:639) ~[paper-1.20.1.jar:git-Paper-100]
    at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:550) ~[paper-1.20.1.jar:git-Paper-100]
    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.20.1.jar:git-Paper-100]
    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:435) ~[paper-1.20.1.jar:git-Paper-100]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.1.jar:git-Paper-100]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1101) ~[paper-1.20.1.jar:git-Paper-100]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-100]
    at java.lang.Thread.run(Thread.java:840) ~[?:?]
#
    at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:183) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:150) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
    ... 14 more
dry hazel
#

you need to shade kotlin's stdlib or use the library loader

rustic grail
#

already have that on jdk8

rotund ravine
#

What zlataovce said

dry hazel
rustic grail
#

dependencies {
compileOnly "io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
}

#

clearly yes

dry hazel
#

shadow plugin applied?

#

used the right jar (-all classifier)?

rustic grail
#

not yet am trying that now

valid burrow
#

ignore this

#

?nms

slender elbow
#

not ignoring

valid burrow
slender elbow
#

acknowledged, in fact

dry hazel
#

not like there's a bot command channel

valid burrow
#

if you care so much about channels stop complaining and keep this one dedicated to coding

slender elbow
#

but in the fights channel pls

dry hazel
#

true

rustic grail
rotund ravine
#

Lies

valid burrow
dry hazel
#

paste the stacktrace now

hushed spindle
#

is there any specific packet for a player jumping

rotund ravine
hushed spindle
#

cringe

slender elbow
#

the joys of client authored movement

rustic grail
#

ty

#

worked perfectly

rotund ravine
#

๐Ÿ‘Œ๐Ÿป

quiet ice
#

Rather stupid question, but how the hell do I disable IJ doing wildstar imports that really should not be used

#

Like I understand it sometimes, but for java.awt.*? Are you drunk? This is the exact opposite of eclipse's behavior (it used to completely ignore AWT for a while)

slender elbow
#

settings, code style, java, very far right tab

river oracle
slender elbow
#

you can also add exceptions to the suggestions list

#

don't remember where that is

#

fortunately there is a search bar

river oracle
quiet ice
#

Why is the default threshold at what seems to be a single class? Whatever, I do not question it

river oracle
#

IJ has some stupid ass defaults

#

sometimes I wonder what genius thought of them

#

and how they still have a job

slender elbow
#

I mean, maybe they don't :^)

river oracle
#

fair

quiet ice
#

Okay, apparently AWT and swing are treated exceptionally and ALWAYS wildcard imported, regardless of thresholds or whether wildcard imports are on. Whatever, found and nuked the relevant settings - thanks!

quiet ice
#

Yeah, makes IJ default to java.awt.List each time in any swing applications

#

Under eclipse that class is completely invisible and hidden from autocompletion (including it's members), so I am getting a bit of a culture shock here lol

vital vortex
river oracle
#

when I first swithced to IJ i had to spend 3 hours configuring so it seemed usable

river oracle
#

so ofcourse it will error confused how your compiler even let you compile that into a jar

river oracle
#

you're not coding are you

vital vortex
river oracle
#

lmfao

vital vortex
#

only for java

river oracle
#

ChatGPT can't code never do that

vital vortex
#

other langages i code

vital vortex
#

mine gpt ๐Ÿ™‚

river oracle
#

my lord

vital vortex
#

my brain

quiet ice
#

I think that is not an error produced by eclipse

vital vortex
quiet ice
#

You are using the wrong bukkit version

vital vortex
river oracle
quiet ice
#

Either at compile-time or at runtime, depending on how you see it

river oracle
#

I don't remember Inventory ever having #getName

quiet ice
#

Probably I guess

vital vortex
#

i think its because if i do /stats i can "grab" the items in the gui

quiet ice
#

Yep, it exists in 1.8, but not on newer versions

#

I highly recommend using the same versions of bukkit for runtime and compile-time

river oracle
#

10/10 API choice classic 1.8 moment

quiet ice
#

Saves a lot of trouble

quiet ice
river oracle
#

Inventory's don't have names

#

its a quirk of the API

#

granted idk what the code looked like back in the day

#

but now adays its true

quiet ice
#

Yeah, but from a logical perspective it made sense

#

These days viewing is highly decoupled though so I guess there is that

river oracle
#

I was still a child back in 1.8 days didn't code :P

quiet ice
#

Also god, someone really gotta upload 1.8 bukkit javadocs compiled with J11+

river oracle
#

lol

quiet ice
#

Java 8 javadocs makes me puke

river oracle
#

update to modern versions

#

enjoy modern looks

quiet ice
#

I already have - but sometimes you just wanna look up this stuff

glacial coral
#

What are some libraries that you guys feel like makes your plugins much better? (not looking for anything specific just wanna see what people say)

tender shard
river oracle
#

Facts Jeff makes great libs

quiet ice
sullen marlin
#

?1.8

undone axleBOT
sullen marlin
#

8 year olds legit gonna be playing 1.8 now

tender shard
#

Yeah 1.8 sucks but i agree that its useful to have modern javadocs for it

quiet ice
#

Don't worry, I don't actually use anything but 1.19.3

tender shard
quiet ice
#

I wonder why the search function was simply ... Absent

#

Like how did they navigate back in the days?

tender shard
#

The oss super pom disabled that feature

#

No clue why

quiet ice
#

Oh so this was a feature?

sullen marlin
#

Did it even exist in java 8?

tender shard
#

I had to manually declare the javadoc plugin to enable it even on java 20

sullen marlin
#

Thought it was a java 9 thing

quiet ice
#

Yeah the official J8 javadocs have no search bar

sullen marlin
quiet ice
#

Which is why I don't like the fact that google recommends the J8 jacadocs

tender shard
#

this + using java 20 to compile was needed to get the search working

upper hazel
#

Have you ever had a moment when you needed to modify the vanilla chunk generator?

tender shard
quiet ice
#

I believe there was some kind of bug in the search bar a few years ago

upper hazel
#

I tried to find the default generator but I had a lot of problems when trying to get the source code for spigot, so I would like to know if you have it?

tender shard
#

it would probably have been enough to simply set the javadoc-plugin version to 3.5.0 or whatever is newest

quiet ice
#

Well the bug is more due to javadoc having problems with the undefined modules

tender shard
#

(and compile/target to 8)

#

idk, tbh I never used java modules

quiet ice
#

But that bug probably did not persist for long, regardless I still have the workaround in most my projects

quiet ice
tender shard
#
Index: pom.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/pom.xml b/pom.xml
--- a/pom.xml    (revision 01d1820664a5f881665b84b28871dadd132deaef)
+++ b/pom.xml    (date 1699387824165)
@@ -19,8 +19,8 @@
     <description>A plugin API for Minecraft servers.</description>
 
     <properties>
-        <maven.compiler.source>1.6</maven.compiler.source>
-        <maven.compiler.target>1.6</maven.compiler.target>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
 
@@ -98,8 +98,19 @@
         </dependency>
     </dependencies>
 
+
     <build>
         <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <version>3.5.0</version>
+                <configuration>
+                    <links>
+                        <link>https://docs.oracle.com/javase/8/docs/api/</link>
+                    </links>
+            </configuration>
+        </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>

this is enough to get the javadocs working properly

#

did 1.8 really use java 6? o0

#

or is it just bukkit using java 6 for 1.8?

zenith gate
#

Do entities have a UUID like players ?

tall dragon
#

pretty sure they have a EntityID

zenith gate
#

That works.

tender shard
#

Entity#getUniqueId

upper hazel
#

how i can get spigot code no usage Buildtools?

tender shard
#

what

#

spigot doesn't even really have any big amounts of code, it's just a bunch of patch files on top of craftbukkit

upper hazel
#

how can I get the source code of the spigot server without using buildTools I have problems uploading with the certificate

#

oh soryy i mean

#

craftSpigot

tender shard
#

there is no craftspigot

#

also wdym with "uploading with the certificate"

#

just download buildtools and run it and then you have all the compileable code

upper hazel
#

During the download process an error appears related to the certificate.

#

he can't find it

#

or some kind of problem

#

?paste

undone axleBOT
upper hazel
#

Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

kind hatch
#

Can you paste the whole log?

upper hazel
#

error log or?

kind hatch
#

BuildTools.log.txt

#

Whole thing

upper hazel
#

?paste

undone axleBOT
upper hazel
tender shard
upper hazel
#

yes

tender shard
#

are you using a weird proxy / anti virus software that does HTTPS MITM?

#

like norton shit

upper hazel
#

i use kaspersky

tender shard
#

try disabling that completely

#

kaspersky probably opens more vulneribilities than it fixes anyway

kind hatch
#

It can be built. Not an issue with mojang's servers.

tender shard
#

100% kaspersky issue

#

they are known to do weird shit and dirty hacks related to HTTPS and stuff

#

e.g. postbox-inc.com mentions this

Kaspersky will scan encrypted connections, including IMAP/SMTP over SSL between Postbox and your mail servers. Kaspersky will intercept your mail connections, inject itself between Postbox and your mail server, and use its own certificates to protect the "last mile" of your connectivity. This will cause Postbox to complain about invalid certificates.

upper hazel
#

i have so many option for protection disable all?

tender shard
#

and java doesn't trust the stupid kaspersky certificate

kind hatch
#

@tender shard Do you think the disable https flag would work for this case?

tender shard
#

hm yeah that might fix it

kind hatch
#

Ye

tender shard
#

the proper solution is to get rid of kaspersky though

kind hatch
#

Wouldn't have to disable antivirus that way.

kind hatch
tender shard
#
kind hatch
#

@upper hazel Try running: java -jar BuildTools.jar --rev 1.16.5 --disable-certificate-check if you don't want to disable Kaspersky

tender shard
#

or just disable "Encrypted connections scanning" completely in kaspersky

#

fixed screenshot of a screenshot

somber scarab
#

yo why the hell does Entity.PRIMED_TNT not have a setFuseTime()?

tender shard
somber scarab
#

I saw that

#

but it's not there in my IDE

young knoll
#

What api version

somber scarab
#

it aint here

#

1.20

tender shard
kind hatch
#

^

somber scarab
#

whow

#

that was deep..

tender shard
#

EntityType is just an ordinary enum, not related to any individual entity

upper hazel
kind hatch
#

Spawn the entity as an instance of TNTPrimed and set the fuse ticks on that object instead.

somber scarab
tender shard
young knoll
#

Same way you spawn any entity

somber scarab
#

I got world.spawnEntity()

young knoll
#

World.spawn(location, TNTPrimed.class, consumer)

tender shard
# somber scarab okay.. so how can I spawn a TNTPrimed then?

https://blog.jeff-media.com/use-consumers-when-spawning-custom-entities/ like this but using TNTPrimed.class instead of Pig.class, then set the fuse ticks in the consumer

When you want to spawn a custom entity, e.g. with a custom name or certain items equipped, you must use the method World#spawn(Location, Class, Consumer) unless you give a shit about compatibility with other plugins. Iโ€™ll explain why. The shitty way Usually, you can easily spawn entities like this: That is fine, as...

kind hatch
#

Use that instead.

tender shard
#
location.getWorld().spawn(location, TNTPrimed.class, (tnt) -> {
    tnt.setFuseTicks(0);
});
#

no clue

slender elbow
#

generics prob

kind hatch
#

Make a PR for it. :p

tender shard
#

it's because spawnEntity takes an EntityType

#

so you couldn't know which class it is

undone axleBOT
tender shard
#

spawn(...) takes a class hence you can have a consumer with the correct entity class

#

what's incorrect?

somber scarab
#

okay looks all good on compile errors

#

ill see if it works

#

now onto spawning creepers

tender shard
#

you can get it at runtime but not at compile time

#

by providing the class however, you have the correct type at compile time

upper hazel
#

@tender shard give pls 1.16.5 spigot sourse in zip))

kind hatch
#

lmao

tender shard
#

ok

#

this is 100% the 1.16.5 source code, it's definitely not my shitty adventure game written in lua

storm crystal
upper hazel
#

๐Ÿคจ

storm crystal
#

last time I heard kaspersky I was at like 3rd grade

upper hazel
#

bruh....

storm crystal
#

during IT lessons this shit would eat half of our barely working PC's manpower

tender shard
#

just disable kaspersky, it opens more security issues than it fixes anyway

#

then run buildtools

storm crystal
#

using ur common sense and adblocker is more than enough tbh

tender shard
#

just don't download arbitrary .exe files from weird pr0n sites, then you're fine

kind hatch
#

It may also help to run it in a directory without spaces.
Current Path: C:\spigot sources 1.16.5\.

C:\BuildTools

upper hazel
#

well he is the best in the world at the moment

#

I saw a whole study somewhere

tender shard
#

depends on the genre but sure

slender elbow
#

all the genres at once

kind hatch
#

NOT THE JAR!!!!

tender shard
#

probably not even google has enough disk space to download em all

tender shard
storm crystal
#

how about we make comically large disk space

#

and download all of pr0n here

upper hazel
#

so ah someome has sourse)

#

spigot server?

tender shard
#

yes, you. after you ran buildtools after disabling kaspersky

kind hatch
#

There's a reason spigot doesn't have a direct download.

storm crystal
#

also I got a question just to make sure that I got it right

upper hazel
#

why didn't they just put this on github?

kind hatch
#

It used to be

tender shard
#

?dmca

undone axleBOT
storm crystal
#

lambda is a nameless function that you call -> { //somecode } when you want the code into the parameter once and not anywhere else?

upper hazel
upper hazel
#

anyway

tender shard
#

yes

#

but you can easily reuse it

slender elbow
#

even if it was on GitHub you'd still need to run buildtools lol cuz patches

tender shard
#
// valid lambda
Consumer<Entity> printOutEntityConsumer  = entity-> { System.out.println(entity.getName()) };
kind hatch
storm crystal
#

wait u used consumer I havent learned it yet

#

one thing at time

#

unless its needed to get idea of lambda then ill switch to it

tender shard
# storm crystal unless its needed to get idea of lambda then ill switch to it

Lambdas and Method references can be used to make your code way shorter, and (sometimes) more readable by getting rid of anonymous classes. What are Anonymous Classes? Anonymous classes are like local classes without a name. Imagine you have the following code: We hereby declare and instantiate a class implementing java.lang.Runnable that just p...

#

you first have to know what an anonymous class is

upper hazel
#

oh, that means the politics are guilty...

tender shard
#

lol that website doesn't even have any ads

kind hatch
#

It does have an annoying cookie banner that doesn't work in Vivaldi.

tender shard
#

blame the GDPR on that

#

I hate cookie banners too

slender elbow
#

just move out of europe

#

best solution

upper hazel
tender shard
#

no

kind hatch
#

That's not how that works.

tender shard
#

I mean

#

I already sent it to you

slender elbow
#

my brother just uninstall Kaspersky, it's literal spyware

upper hazel
#

this game...

#

what this

slender elbow
#

the game

#

you just lost

kind hatch
#

That's even more sus

tender shard
#

just send him some random .exe file

kind hatch
#

1 sec

tender shard
#

dw he's protected by kaspersky lol

kind hatch
#

There you go.

upper hazel
#

yeaaa not hard.. so read this decomplie code...

tender shard
kind hatch
#

Was messing with git stuff.

upper hazel
kind hatch
#

It didn't launch?

#

Ohh, I bet it's an older one.

tender shard
#

yeah it shows the splash screen for 50ms then exits

upper hazel
tender shard
#

java

slender elbow
#

literally any

#

even windows defender is better

tender shard
upper hazel
#

windows)?

tall dragon
#

Windows defender

grand flint
#

whats hash and how do i use it someone under a tutorial video said to use hash instead of array

kind hatch
#

That might work better. idk tbh. Don't have enough testing for it.

upper hazel
#

bro why exe

tender shard
upper hazel
#

cool

tender shard
#

it's not like it could do any more harm than a .jar could

upper hazel
#

but i no need it

slender elbow
kind hatch
#

I don't know how to decipher this.

kind hatch
tender shard
upper hazel
#

I trust jar more than exe

tender shard
#

jars are usually made out of glass while cans are made out of aluminium

kind hatch
#

Sheesh

upper hazel
#

oh

kind hatch
upper hazel
#

my translate

#

not work good

kind hatch
#

It's the exact same, just not wrapped in an exe.

upper hazel
#

wth

tender shard
kind hatch
#

Almost as if I have the source.

upper hazel
#

does that mean all applications are jar in exe? ๐Ÿคจ

kind hatch
#

Idk though.

kind hatch
#

Still can't trust it though

tender shard
#

unless you don't have java installed in the first place

kind hatch
#

Why do you think there's more warnings placed on .jar downloads than other formats? It's cause they are unsigned executables capable of running arbitrary code.

slender elbow
tender shard
#

a .jar and an .exe are like cocaine you bought from a weird stranger at the train station. it could be anything inside

upper hazel
#

oh

grand flint
#

which of these databases would be more suitable for a large server,

username
- skywars
-- kills
-- deaths
- bedwars
-- kills
-- bed breaks
- smp
-- farms

or

skywars
-username
-- kills
-username
-- kills
bedwars
-username
--bed breaks
-username
--bed breaks
upper hazel
#

who know asembler

#

lets create minecraft in asembler

#

fast powerful replacement

kind hatch
grand flint
#

wdym moved

kind hatch
#

Asuming you wanted to split the data away from that one file.

grand flint
#

hmm okk

glossy venture
#

its probably the 2nd even if its in yml files

#

but thats not really scalable for a large server

grand flint
#

why would any sane person store it in a yml file

glossy venture
#

i mean yml isnt scalable

glossy venture
#

idk

#

beginners do that sometimes

grand flint
#

thats horrible

kind hatch
#

Yaml backup is better than nothing.

grand flint
#

imagine having to scroll thru a 1000 lines

glossy venture
kind hatch
#

Ye

grand flint
#

mongo takes backups ๐Ÿ˜Ž

glossy venture
#

also id store it as like bson or smth

#

yeah

#

like mongo

#

less space used

#

yml syntax is prob inefficient asf

#

for data

tender shard
#

just use json syntax and call it a yaml file lol

#

snakeyaml can minimize yaml files so they aren't any bigger than a normal json file would be

glossy venture
#

still inefficient

#

binary is gonna be smaller

#

so bson

ivory sleet
#

yeah space wise bson is just superior

glossy venture
#

also load and save times prob

#

because it doesnt have to parse shit

#

its just not user friendly

#

unless u have some editing program or smth

ivory sleet
#

yeah

#

i mean parsing has to happen at some point tho

#

but ye

glossy venture
#

well parsing bytes is more efficient than parsing utf tokens which there are like 2x as much of, especially when parsing numbers and shit

ivory sleet
#

yup

glossy venture
#

but yeah bson isnt magical instant object load

lost matrix
tender shard
#

yes

#

hewwo

wet breach
river oracle
#

@worldly ingot
how do you use the PR flags on BT I keep getting random errors from CB that shouldn't happen given I use the correct bukkit PR https://paste.md-5.net/davonipuka.coffeescript. The source code itself compiles and works fine too I've been using java -jar BuildTools.jar --pr BUKKIT:926 CRAFTBUKKIT:1282 I double checked these are the proper PR #, prs for CraftBukkit and Bukkit too

worldly ingot
#

ngl, never used them

river oracle
#

I thought you might know ๐Ÿ˜ญ

#

My dissapointment is immeasurable

worldly ingot
#

๐Ÿ˜…

storm crystal
#

do I add PDC tags to armor stands just like to entity?

chrome beacon
#

Yes

#

it's an entity

river oracle
#

Choco entity confirmed

storm crystal
#

how can I loop through every entity type in world?

river oracle
worldly ingot
#

From there, regular foreach loop and calling getEntityType() on them

storm crystal
#

in ArrayList?

#

or in what data type

worldly ingot
#

It might be a Collection

#

But yeah same idea

storm crystal
#

alright ill be able to work from now on

worldly ingot
#

Ah no it is a List

storm crystal
#

even better

worldly ingot
#

Honestly not totally sure why lol. It could definitely have been a generic Collection

storm crystal
#

I just wanna to make ability that spawns armor stands with PDC and then runs scheduler that would get rid of them after X time elapsed

chrome beacon
#

You don't need to loop all entities for that

#

that's quite inefficient

worldly ingot
#

Yeah, keep track of the entities you spawned in your own List so you can remove them later

harsh carbon
#

What is the Minecraft client verification plugin when entering the server for the first time?

worldly ingot
#

You're probably thinking of AuthMe, though I'd seriously advise against an offline mode server

harsh carbon
worldly ingot
#

not sure I understand the question

storm crystal
#

is it uh, a proper way of doing that?

#

or is there something to make it less redundant?

worldly ingot
#

You could have getters in your plugin class instead so you only have to pass the plugin instance

#
private final EntityPDC entityPDC = new EntityPDC();

// etc.

public EntityPDC getEntityPDC() {
   return entityPDC;
}

// In your other class
private final Rpg plugin;

public DamageListener(Rpg plugin) {
    this.plugin = plugin;
}

@EventHandler
public void myListener(MyEvent event) {  // Anywhere you want to use it
    this.plugin.getEntityPDC().doWhatever();
}```
storm crystal
worldly ingot
#

Correct

#

If they're utility classes though, maybe consider if instances are even necessary. What do one of these types look like?

storm crystal
#

EntityPDC class and DamageManager class

worldly ingot
#

Oh yeah for sure that EntityPDC class can absolutely just be a simple utility class with static methods

#

There's no state associated with it. If there are no fields or anything like that, instances aren't going to benefit you in any way

storm crystal
#

and using static methods is just importing methods like UtilityClass.myMethod?

worldly ingot
#

Correct

#

The proper way to make that a utility class would be to make the class final, make the constructor private, and make your methods static

#
public final class EntityPDC { // Don't allow it to be extendable, it doesn't need to be

    private EntityPDC() { } // Don't allow it to be constructed, it doesn't need to be

    public static void setPDC(String keyname, String value, LivingEntity entity) { // Mark as static
        // ...
    }

    public static String setPDC(String keyname, LivingEntity entity) { // Mark as static
        // ...
    }

}```
#

At least for that specific class it makes sense because those are very clearly utility methods and probably can't take advantage of state or member variables in any way

#

For some classes maybe it makes sense to use objects to design things but in this case specifically it doesn't make all too much sense

storm crystal
#

oh yeah

#

what is this warning?

river oracle
#

I've come across an interesting quirk while working on my Inventory PR. If you create an InventoryView like below

final Player p1;
final Player p2;

final InventoryView view = MenuType.GENERIC_3X3.create(p1, "placeholder title :3");

then you first open it with p2

p2.openInventory(view);

it syncs p2s inventory with p1s inventory (this could either duplicate or destroy items depending on the situation.

Not sure exactly why, but its quite strange. I could add a precondition to the method openInventory(InventoryView) but that wouldn't really be ideal I'd assume it works like that in legacy otherwise their would have been a precondition prior.

The only other thing I can think of is instead of exposing MenuType#create to bukkit rather expose openInventory(MenuType, Consumer<InventoryView>) Unsure though looking for suggestions

worldly ingot
storm crystal
#

alright

young knoll
#

You should see how many it lists when you build craftbukkit :p

worldly ingot
#

Yeah it's like 700 files or something

river oracle
storm crystal
#

why it doesnt read it as armorstand?

remote swallow
#

because you have the variable type as Entity

#

you cast it to an armor stand but the variable is still entity

#

you need ArmorStand armorStand = ...

storm crystal
#

ah okay

#

can I make armorstand have any item in hand or on its head?

young knoll
#

Yes

storm crystal
#

wait if setItemInHand is deprecated

#

then how do I set it

eternal oxide
#

read the javadoc on the deprecation

storm crystal
#

okay got it thanks

#

how can I pass Player to runnable?

glad prawn
#

impl Runnable pass your Player via constructor

#

many ways but depends on you ๐Ÿคทโ€โ™‚๏ธ

storm crystal
#

idk how to get player there

#

hes like

#

in a method

hazy parrot
#

show your code and what u tried

clever crescent
#

sorry if this is a basic asf question, but im stuck at the point where i want to read the data from a YML file and beable to find the specific subsection of the player: and each sub section is a player.getUniqueID().toString() with the players twitch username stored inside of that subsection.

the goal being to loop through the subsections or what ever i have to do, find the player who its running on, then compare the twitch name associated with a separate list of names to find that name on said list

here is my PlayerHandler class, and my ViewerCheck class

public class PlayerHandler implements Listener 
{
    public PlayerHandler(Cumbronco plugin) {
        Bukkit.getPluginManager().registerEvents(this, plugin);
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) 
    {
        Player player = event.getPlayer();

        new ViewerCheck().getPlayerData(player);
    }
}
public class ViewerCheck {
    public void getPlayerData(Player p) 
    {
        
    //the idea here is to open the file, and then some how read through everything til i find the player whos unique id
    //is currently being requested in the YML then when it finds the match in the YML it then compares the data in
    //the subsection to another location that will store a list of twitch names
        
        if(p.getUniqueId().toString() == /* yml file location of player*/) 
        {

        }
          //i also forgot if its .equals() for strings in java :P


    }


}

also not trying to take away from dusktalers question so please answer their question before mine if they post their code ^-^

hazy parrot
#

cant you just do config.get("player." + p.getUniqueId().toString())

clever crescent
#

not sure i just started learning how to make plugins yesterday lmao

#

if so that is infinitely easier haha

hazy parrot
#

if you have yaml file structured like

player:
  someUUID:
        # SOME INFO
  someOtherUUID:
        #SOME MORE INFO
#

you can get someUUID by doing "player.someUUID"

clever crescent
#

current formatting

players:
  testplayer1: testplayer69
  testplayer2: testplayer001
  96acd1f6-c7ec-4bf7-ae5e-0883357d8002: imach
hazy parrot
#

yeah, you can get imach by doing config.getString("player." + thatUUID)

clever crescent
#

so instead of thatUUID i could do player.getUniqueID() right?

#

hell yeah that huge tysm ^-^

#

ohh yeah i didnt add that cause the getString threw me off haha

hazy parrot
#

if you concat string to Object, toString is called implicitly

quaint mantle
#

What is the HandlerList in bukkit events

hazy parrot
#

List of handlers for that event

worldly ingot
#

Any time you register a Listener, each instanceof @EventHandler is an instance held by the HandlerList

#

Think of it like a List<RegisteredListener>

#

Only... a few more methods

storm crystal
#

and it actually works now

#

I know I could make it more scalable

#

But rn I want to practice and set sort of template for it

#

How can I make armor stand with turned off gravity move?

#

What if, im not going to automatically recognize the most optimal way and I will rewrite a code sooner or later

clever crescent
#

so when I try doing it this way, it seems to only output failed to find user and im not exactly sure why that would be the case

public class ViewerCheck 
{
    public void getPlayerData(Player p)
    {
        File file = new File("C:\\Users\\imach\\Desktop\\minecraft server\\PlayerStreamData.yml");
        FileConfiguration data = YamlConfiguration.loadConfiguration(file);

        if(Objects.equals(data.getString("player." + p.getUniqueId()), "imach")) 
        {

            Bukkit.getLogger().info(data.getString("player." + p.getUniqueId()));

        } 
        else 
        {
            Bukkit.getLogger().info("failed to find user");
        }

    }


}
players:
  testplayer1: testplayer69
  testplayer2: testplayer001
  96acd1f6-c7ec-4bf7-ae5e-0883357d8002: imach
eternal oxide
#

player/players

storm crystal
#

I read it and didnt find anything that could help me

#

Setvelocity doesnt work

#

Cuz gravity is false

clever crescent
storm crystal
#

I tried setting gravity to true, adding velocity and turning it off but didnt work either

kind hatch
#

Did you apply it a tick later?

quaint mantle
#

and I'm a lil confused as to what that means

worldly ingot
#

How else would Bukkit know about event listeners?

#

They have to be stored somewhere

quaint mantle
#

I'm so confused ๐Ÿ’€

#

is there like an actual explanation online

worldly ingot
#

I mean as far as you're concerned, it just works. You don't need to know how it works, but it works and it's the reason your event listeners are being called

#

PluginManager#callEvent() will get the handler list, run through its registered listeners, and call all of them

quaint mantle
#

so

#

oh

#

wait so whenever I register a listener

#

It goes to the handlerlist

worldly ingot
#

Yes

storm crystal
#

๐Ÿ’€

#

Thats the answer

polar pagoda
#

Quick question:
Is there a certain way to transfer data/ event from one plugin to another?

kind hatch
#

The Messaging Channel should work.

young knoll
#

Just expose an api

#

No need for messaging between 2 plugins on the same server

polar pagoda
#

yeah turns out I cant read bungee's api for shit

#

๐Ÿ™ƒ

polar pagoda
#

u guys wont undersatand how complete my life is rn

untold mauve
#

Any way to change server.properties without having to reload the server? i have a plugin that automatically uploads a resource pack to dropbox when the sevrer starts.

wet breach
#

Alternative if you dont want to restart

#

Downside is you would need to loop through all players online and send it to them

echo basalt
#

oh hi frosty

wraith apex
#

Using the PlayerPortalEvent, why is it that the return of getTo() is a location that's no where near where the player actually appears when entering a portal in the nether and arriving in the overworld?

weak meteor
#

how can i send the a fake totem pop animation?

#

is it posible?

quaint mantle
#

Yes

weak meteor
#

how?

#

is it a Effect?

untold mauve
#

anyone know how it would be possible to zip a resource pack folder into a zip file that is compatible with minecraft? i have tried like everything and it either corrupts the zip file, does it in some weird way that isnt compatible with mc and no textures load, or just does not work at all. anyone know what to do?

#

closest ive gotten is this from a stack overflow post. minecraft recognizes it but no textures load and only works once i unzip it.

#
private static void zipFolder(Path sourceFolderPath, Path zipPath) throws Exception {
   ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipPath.toFile()));
   Files.walkFileTree(sourceFolderPath, new SimpleFileVisitor<Path>() {
       public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
           zos.putNextEntry(new ZipEntry(sourceFolderPath.relativize(file).toString()));
           Files.copy(file, zos);
           zos.closeEntry();
           return FileVisitResult.CONTINUE;
        }
    });
    zos.close();
 }```
#

i wouldnt think it would be this hard to zip up a file

clever crescent
#

ive always just done it with an assets folder and a pack.mcmeta file highlight the two files and send it to a zip

#

nothing special

echo basalt
#

You need to toss the folder's contents at the root

#

not the folder itself

untold mauve
untold mauve
untold mauve
#

they only load once i unzip it

clever crescent
#

anyone know why i would be getting this when i build after importing another library?
and possibly how i should fix it

credentialmanager-0.2.2.jar, events4j-api-0.12.1.jar, events4j-core-0.12.1.jar, events4j-handler-simple-0.12.1.jar define 1 overlapping resource: 
  - dependencies.txt
maven-shade-plugin has detected that some class files are
present in two or more JARs. When this happens, only one
single version of the class is copied to the uber jar.
Usually this is not harmful and you can skip these warnings,
otherwise try to manually exclude artifacts based on
mvn dependency:tree -Ddetail=true and the above output.
See http://maven.apache.org/plugins/maven-shade-plugin/
valid burrow
#

just found this randomly when would this ever trigger

#

in PlayerInteractEvent

clever crescent
echo basalt
#

This is not one of PlayerInteractEvent's Action

#

it refers to an action that can occur when you click on a chat component

valid burrow
#

alright

split light
#

what is a good way to get extra players to help with development?
I'm recreating telestrations in minecraft and I'm running up against a wall because I only have one account but need at least two others to adequately test my current program

echo basalt
#

game pass

split light
#

because I can't easily simulate a "Player" object even though that's how I refer to players throughout my program

echo basalt
#

or just localhost with cracked accounts (bad)

#

or use bots

split light
echo basalt
#

minecraft's free on game pass

#

you can use it for a secondary acc

#

At some point in your development career you'll want a second or third account

split light
#

yeah I might have to buy two more but that just sucks D:

#

like are there not other ways to somehow like offline boot Minecraft with a random account name?

echo basalt
#

well

#

it's a weird argument for cracked accounts

split light
#

are you allowed to give me a pointer to a dec cracked account launcher?

echo basalt
#

no because I don't crack the game ๐Ÿ—ฟ

split light
#

fair :(

round finch
echo basalt
#

just ofund this at work

#

dude that was working on this was fired and all his projects were passed to me

#

what the actual fuck

river oracle
echo basalt
#

fun fact

#

GriefPrevention does some fucked shit

#

Fun fact #2

#

this shit uses libraries that do some fucked shit

#

liskov substitution principal when

#

it's gonna be one long ass night

rough harness
#

any one would know why my texture is doing this

echo basalt
#

lol we rewriting this crap

rough harness
round finch
molten hearth
#

this might be a me thing but why does that readConfig method have nothing to do with reading a config

upper hazel
#

hmm i was not can load spigot sources for 1.16.5 but for 1.20.1 this worked

#

wtf

onyx fjord
bronze crystal
#

does Bukkit.getCraftingRecipe() get also custom recipies from which were created by other plugins?

upper hazel
#

How you think this passble create plugin no usage api? )

upper hazel
#

How this do? Need use reflection or NMS

tender shard
#

and why does it catch and throw Exception

#

and in general, what the heck is it

tender shard
#

wdym exactly

upper hazel
#

Code

#

Server code

tender shard
rough drift
#

I mean I use reflection but that's just weird

tender shard
#

no generics, and what is "config" even used for

#

and what the heck is the point of calling all private no-args void methods of that object

rough drift
#

ยฏ_(ใƒ„)_/ยฏ

tender shard
#

imagine your config thing relying on the idea that your methods must be private

#

otherwise "readYaml" method won't work which does little else anyway

#

I mean wtf is that even

rough drift
#

Though generics can sometimes cause pain in my experience, like expected T extends B, got T extends B

tender shard
#

or is that maybe a joke about paper like the comment suggests

rough drift
#

Maybe?

#

Even then

#

it's production code

#

leave the jokes for somewhere else

ivory sleet
rough drift
#

I forgot what it was because I just ran type erasure at compile time (<?>)

#

wait I think I still have it

#

Like I had a function <T extends SomeType> something(Class<T> clazz) and it couldn't take in a class class SomeClass extends SomeType

#

(Expected T got SomeClass)

ivory sleet
#

Yeah, and then you need to remember to develop against covariance and contravariance whichever one is which, idk what u call it; think it was site declaration variance

#

Oh yeah cuz that class would be a Class<? extends SomeClass> and the expected type erases to just Class<SomeType>

#

? extends T may work, idk

rough drift
#

meh I got it fixed actually

#

By doing the exact same thing

ivory sleet
#

Interesting

#

I suppose being a programmer implies those types of solutions

rough drift
#

I feel like the compiler is constantly disagreeing and every time there is one of these bs errors it just got mad for a bit

#

lmao

rough drift
#

I mean I do be giving it a hard time

#

11.2k lines over almost 200 files should be shrinked down

ivory sleet
#

Not sure about shrinking it down, it sounds reasonable vooodoooo

rough drift
#

For what it does it feels way too big

#

but then again it is pretty much a very specialized "plugin API"

ivory sleet
#

What does it do? Voooodooooo

rough drift
#

Under NDA but it is basically a plugin loader/manager (not plugins like Spigot plugins, each is very small depending on at most 1 or 2 classes)

ivory sleet
#

Ah I see

#

Na 11k lines, you good :3

tender shard
#

remember the vooooodoooooo lady from monkey island?

ivory sleet
#

Yeah that voooooodooooooooo!?

rough drift
tender shard
#

who the hell doesn't know monkey island

rough drift
#

I may know it but I probs forgor

tender shard
#

duuude you should play monkey island 1 - 3

#

4 too but the graphics suck

#

it's like the most popular point and click adventure games ever

rough drift
#

Oh that may explain it

#

I don't like point-and-click games

tender shard
#

ofc you don't like them if you haven't played proper ones

rough drift
#

If I was given the option I'd rather choose some puzzle stuff

tender shard
#

well they are puzzles

rough drift
#

I mean literal puzzles

tender shard
#

brb downoading monkey island 1-4

rough drift
#

I'll do some procrastination and play some stickfight online

#

Yesterday I played ~400 matches with my friends lol

halcyon hemlock
wet breach
echo basalt
#

yo frosty

#

not saying it's the case

#

but I might need a benjamin this week

#

ppl going on holiday and not paying :/

#

need to buy some formal clothes for the conference

tender shard
#

check on popular escort sites, I'm sure there must be a benjamin somewhere

wet breach
echo basalt
#

well

#

dude is generally reliable

#

we've been working together for like

#

over a year

#

some weeks he's just busy

#

just happens that timing is fucked

rough drift
wet breach
#

There is never a case of being too busy to take care of your employees

echo basalt
#

homie runs 3 businesses, this is just a passion project

#

weekends are for the kids

rough drift
#

my employer pays me on time always, except some days where he can't be at his computer he'll pay me one day late

echo basalt
#

yeah in my case my dude doesn't work weekends

#

this weekend he was travelling with the kids

#

so he's probably somewhere remote without internet

#

I'm not stressing, I'll get paid eventually

tender shard
#

send him an angry invoice

echo basalt
#

p much

tender shard
#

"I'm not angry, I'm just disappointed you haven't paid yet"

#

mom style

wet breach
#

Shouldnt have to do that if they are employing you

tender shard
rough drift
echo basalt
#

Well shit happens

rough drift
#

though for the last like 6 months he was on time every time from memory

echo basalt
#

Dude's always paid on time every week, lately not so much because he opened a new business

rough drift
#

wtf is bro doing

#

he's playin N-D chess

upper hazel
#

who knows where CraftChunk is located in the source code, I'm trying to find it but there are a million of these directories

rotund ravine
#

?stash

undone axleBOT
upper hazel
#

oh thenks

upper hazel
#

who knows whether the class(es) in craftbukkit are responsible for vanilla chunk generation or not?

#

some say it can't be found

rotund ravine
#

Why would they be

shadow night
#

Why would cb have classes for vanilla chunk gen

#

Cb is an implementation of bukkit, if bukkit doesn't have something, cb doesn't have it too, most likely, I guess. Please correct me if this information is wrong.

upper hazel
#

add "new ore" for exemple

chrome beacon
shadow night
#

Bukkit consists of interfaces that craftbukkit implememts, if bukkit doesn't have something, craftbukkit is most likely not gonna have it either. Makes sense, right?

upper hazel
#

a need modify, not create new

#

but yea if this so i try find BLockPopulator in craftBukkit

chrome beacon
#

??

#

Why

#

CraftBukkit doesn't add any new ores

smoky anchor
#

Whatever you're trying to do, you can probably do with a datapack

chrome beacon
#

There's no need for you to be digging around in craft bukkit

upper hazel
#

not create NEW

chrome beacon
#

so?

#

Use the BlockPopulator

upper hazel
#

just add ore in VANILLA generator

chrome beacon
#

yeah

#

Use the BlockPopulator

upper hazel
#

if i use BLockPopulator this change all chunk or not?

chrome beacon
#

new chunks

upper hazel
#

yes this will be new chunks

#

but

#

I just need to change it a little and not create a new one

chrome beacon
#

You want to add a new ore

#

not modify an existing one?

upper hazel
#

blocks

smoky anchor
upper hazel
#

yes

chrome beacon
#

You said just a few messages ago that you only wanted new chunks

smoky anchor
#

nothing like BlockPopulater, whatever it may be, will help you
You gotta do that manually

upper hazel
#

so this is why i want read vanilla

#

generation

smoky anchor
#

MC has no way (that I know of) to retroactively generate something in already generated chunks

chrome beacon
#

Then look at NMS

upper hazel
#

and use it

chrome beacon
#

Yeah ChunkLoadEvent ig

#

and set your blocks

smoky anchor
#

Probably mark that chunk with PDC after you're done with that.

chrome beacon
#

^^

upper hazel
chrome beacon
#

Should be fine

#

Chunk generation is heavy

smoky anchor
#

Where is... Illusions(?) workload thingie ?
Could use that if you worry too much

chrome beacon
#

Nothing you can do about that

upper hazel
#

i need check biom how you think this will be in event?

#

for loop in all blocks not option

chrome beacon
#

You'd calculate where your blocks would be

#

and only place them if it's the correct biome

smoky anchor
#

Vanilla tries to generate ores in this sequence (I think)
Randomly select x, y, z
Check if location is suitable, if yes, place blocks
If not, re-try x times.

Do that loop however many ore nodes you want in your chunk.

upper hazel
#

that is, is it normal to sort through a 16x16x16 chunk?

chrome beacon
#

?

smoky anchor
#

wdym by oversample

upper hazel
#

translate error

smoky anchor
#

depends on what you're doing, if you're generating ores tho, def. not.
Do not iterate through so many blocks for no reason.

upper hazel
#

in the settings there is a minimum number of blocks that should appear, so you still have to sort through

chrome beacon
#

sort?

upper hazel
#

I mean that at least 1 block should appear in a chunk if the chunk has the desired biome and the radnomizer wonโ€™t help much here

#

Unfortunately, you canโ€™t get all the blocks of the required biome...

smoky anchor
#

In that case, if Spigot gives access to the raw biome data (biomes are stored in cubes of 2x2 so 8x8x8 per sub-chunk)
iterate over that instead. Not sure if you can iterate over every second block since the biomes have noise.

upper hazel
#

and even if there is no requirement to find at least 1 required block in a chunk, the chance of its appearance may be small

smoky anchor
#

or is it 4x4?

chrome beacon
#

Not sure

heavy perch
#

Who here has knowledge in ACF?

chrome beacon
#

?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!

smoky anchor
#

beat me to it :D

smoky anchor
heavy perch
#

Geniune question,
I have such code:

    @Default
    @CommandCompletion("@players")
    @Description("Toggles vanishing")
    public void vanish(CommandSender commandSender, @Optional Player target) {
        if (target == null) {
            if (commandSender instanceof Player player)
                target = player;
            else {
                getCommandHelp().showHelp();
                return;
            }
        }
    }

I have to understand, Aikar mentions in this wiki about @Optional exceptional with player arguments, does that mean the current code is not possible?

chrome beacon
#

Your current code won't work very well

shadow night
#

What is brigadier

chrome beacon
#

It doesn't do anything if target is missing

chrome beacon
smoky anchor
#

Has Github repo

shadow night
#

Can anybody give me a link then

#

Or is a google search enough

smoky anchor
#

yes

heavy perch
shadow night
#

Hmm

chrome beacon
chrome beacon
#

What do you mean

heavy perch
#

It'll not go through with it?

chrome beacon
#

If target is missing

#

then it's null and won't do anything

heavy perch
#

Great

#

that exactly what I want

heavy perch
chrome beacon
#

target will be null

heavy perch
#

Ok so its fine then

#

So the code block itself will be executed

chrome beacon
#

yes

heavy perch
#

oh okay that's fine

smoky anchor
# upper hazel i not ignore underground

scan top 16x16 for your biome
if you find it, try to place block in that column but check for biome again in case you get underground biome (just remembered, lush caves exist)

Unless you want to place your block in underground biome, than this method will not work

upper hazel
chrome beacon
#

no

heavy perch
#

I am pretty sure it does exactly what I thought it does.

upper hazel
#

what the "instaneof Player player"

chrome beacon
#

It checks the type of command sender

#

to see if it's a player

heavy perch
upper hazel
#

why here player object

heavy perch
#

to make target = player

#

and not null at all

chrome beacon
heavy perch
#

How come

chrome beacon
#

if I do /vanish Ofir

#

I'll toggle my own vanish

#

not yours

upper hazel
#

this not do error ? i mean this shold look like: if (commandSender instanceof Player)

chrome beacon
#

assuming your vanish code will be under that*

heavy perch
#

Ahh I see what you did there

#

yes

#

Didn't think about that

shadow night
heavy perch
#

So there should be an extra check if such player is even online

chrome beacon
#

The player will always be online

chrome beacon
#

It won't give a player object when the player is offline

shadow night
#

OfflinePlayer be like

chrome beacon
shadow night
#

Java is so ancient ._.

heavy perch
chrome beacon
#

True but it does exist in 14 if you enable it ๐Ÿ™‚

upper hazel
chrome beacon
#

You're going to need to rework your command logic a bit

#

also this

heavy perch
#

ik that yeah

#

oh

#

soz

#

Alr so I need to rework the code, but its not entirely dead code in that turns out that way

#

All I need to do is to precheck if the @optional player is even online

#

if not throw the player out of the vanish equation and send back error message player is not online

upper hazel
#

wdym I'm not talking about checking the class, but about why the class object is there

#

oh

heavy perch
#

@chrome beacon dude I just got my mind exploded jesus
I rather change the Player argument to a String argument and that's it ;-;

shadow night
#

Olivo is a genius

heavy perch
#

ik

upper hazel
#

that lately I've been seeing a lot of strange principles in code

heavy perch
#

dude probably runs logic in his mind and run tests in his brain

#

I am 7 years into coding and my brain melts from my own code sometimes

shadow night
#

I see solutions to coding problems in my dreams, it's really cool waking up and being able to do something in 5 minutes you were trying to do the whole day before

#

I'm not sure if you can call that healthy, but it works

heavy perch
#

I take a toilet walk and then suddenly god brings me the logic I need to my code

wet breach
shadow night
wet breach
#

Ever think about your programs just like one day breaking your system because you coded some weird flawed logic

shadow night
#

I sometimes implement a temporary solution and base all code on it making me change like 90% of all my code

upper hazel
#

Wait, can I use BlockPopulator to overlay my block generator on an existing one? For example, a chunk with biomes loaded with vanilla BlockPopulator. Then I overlay my BlockPopulator on the existing BlockPopulator. I do not know how to explain it

young knoll
#

Yes you can add custom block populators to the vanilla generator

upper hazel
#

but i know what i can add in BlockPopulatorList my class

young knoll
#

What

young knoll
#

What about it

upper hazel
#

can I get all the blocks of the generated chunk at this moment so that I don't have to check everything through for loop?

young knoll
#

How would you get all the blocks in a chunk without a loop

upper hazel
#

I'm just trying to add customBlocks to a vanilla chunk.

slender elbow
#

simd

#

runs

upper hazel
#

I want to add customBlocks and from all the information I've gotten this in

  1. modify the vanilla chunk and load custom blocks at the SAME TIME the chunk is created
  2. modify the blocks AFTER the chunk is created
    3)a lighter strategy of option 1. Somehow overlay your generation on the existing one
#

demm this hard..

#
  1. this hard cuse i think i need read vanilla generation code and somehow use it in my custom generation
#

2)this it's easier but I think the server will lag

#
  1. so here i dont know how do this but I read about this somewhere
young knoll
#

You can easily overlay your generation onto vanilla

#

Depending on what you want to generate it's easy

upper hazel
#

paste custom block

young knoll
#

Yes but where

#

how

#

Is it an ore

#

A tree

upper hazel
#

"new ore"

young knoll
#

Okay so it's an ore

#

Ore gen logic is pretty simple, it's just a blob of blocks

upper hazel
#

yes

#

but

#

i shold find biom

#

in chunk

#

or do this in generate process

halcyon hemlock
#

hi everyone

upper hazel
#

or find after

young knoll
#

You can easily check biomes inside your populator

upper hazel
#

i need check biome in vanile populator

#

and paste block if need biome exists

#

just modify vanille chunk

tame sky
#

Is there anything related to withers that makes them invicible to mobs ?
I've spawned mobs with setTarget on the wither, they go straight for it, attack it but the wither isnt taking damages for an unknow reason. I've no plugins other than mine, and I can hit the wither, but not the mobs.

young knoll
#

Yes you can do that in a block populator

upper hazel
#

not create new, or create but with vanille logic

orchid gazelle
upper hazel
young knoll
#

yes

upper hazel
#

and i not need create new biome or blocks?

#

For example, I presented the task as follows: to get the necessary biomes of a chunk and then get cooridans for all blocks of the biome and use the randomizer.

young knoll
#

Just pick a random location within your parameters

#

Check if the biome matches

#

And then do whatever

upper hazel
#

The chance may be small and there must still be a guarantee that at least 1 custom block must be in the desired biome

#

so this x loop

tame sky
upper hazel
#

this can be create lag i gess

hushed spindle
#

does anyone happen to know if within LootContext.builder() killer or lootedEntity need to be specified if, for example, the player is fishing or something

#

would the killer or lootedEntity be the player or would both parameters be null

hushed spindle
#

or another question, im gonna have a mechanic which involves having to scan the player's inventory for a valid consumable in it which requires me looking at the item's meta. Frequently looping through the entire players inventory, getting the meta for each item, seems rather excessive. would it be more optimized if i did something like this where i skip any item that's basically just a plain item (which is most items)

for (ItemStack i : inventory){
    ItemStack plainCopy = new ItemStack(i.getType());
    if (i.isSimilar(plainCopy)) continue;
    // check meta
}

or would that be even worse lol

young knoll
#

ItemStack.hasItemMeta

hushed spindle
#

the alternative would be to have a configurable list of materials acting as a filter, like if i know the custom consumable is only x type it'll only scan items of that type

#

oh thats a thing

#

darn

tame sky
#

How should I increase my mob view distance ?

#

it's stuck at 48 blocks right now

#

server.properties is at 16

#

my client is at 22

#

i've set entity-tracking-range to 256 each one

#

i dont understand why isnt it changing anything

rough harness
river oracle
#

what's it doing

rotund ravine
#

looking like a texture ๐Ÿ‘Œ๐Ÿป

river oracle
#

factz, I'm confused how they even got a textured block

#

what kind of black magic system are they using

rough harness
echo basalt
river oracle
#

you set the wrong texture on the block

echo basalt
#

that's synchronized

rough harness
river oracle
#

if this is not something you're developing but rather another plugin made by someone else

#

you're best off to contact them

#

unfortunately they don't have a discord so the most you can do is a github issue

#

wait nvm they do

hushed spindle
#

is there any way to simulate a player catching a fish? right now im trying to call a PlayerFishEvent but im not allowed to spawn in a fishing hook to put into the event params

echo basalt
#

just grab a rod and fish

#

give yourself lure 255 or something

worldly ingot
#

Are you just wanting a random loot drop that you'd normally get from fishing?

#

Because you could do this:

LootContext context = new LootContext.Builder(location).build();
Collection<ItemStack> loot = LootTables.FISHING.getLootTable().populateLoot(ThreadLocalRandom.current(), context);
// In theory, "loot" would just have one entry, but it's a Collection so you can just iterate it
hushed spindle
#

i implemented a custom fishing loot table and want to also implement a mechanic that allows players to fish several items at once. for the multiple fishing items i would like this to fire the appropriate event so the loot table can properly replace them

worldly ingot
#

Well I think ideally the other parts of your plugin should have methods that you can invoke yourself rather than relying on the Bukkit event API to do it for you

#
@EventHandler
private void myListener(PlayerFishEvent event) {
    this.doSomeFishingLogic(event.getPlayer(), event.getItem() /*, ... etc.*/);
}

public void doSomeFishingLogic(Player player, ItemStack item */, ... etc.*/) {
    // Do your logic here that you want to be able to "simulate"
}```
#

Then wherever you want to simulate multiple times you can invoke your doSomeFishingLogic() method with the appropriate arguments but not have to include the fishing bobber

hushed spindle
#

i would have preferred to use the event method because it would then allow other plugins to possibly interact with that and put custom drops of their own

#

but so be it

undone axleBOT
rotund ravine
#

It is enogh

worldly ingot
#

I meant getCaught() to get the caught entity, but my point is made

twin venture
#

hi , what would be the best way to handle data transfer bettwen servers?

#

so for example
send some arena data to the lobby such as :
game arena info , if the game is restarting , playing , full and other status ..

#

ik about redis but i just want to make sure there isn't a better way?

worldly ingot
#

Yeah Redis is fine for quick in-memory stuff that doesn't really need to be persistent

#

If it's statistics or something like that, some more persistent storage would be better. Though the things you listed seem rather simple