#help-development

1 messages · Page 48 of 1

quaint mantle
#

thats kinda why i switched to plugins

#

plus it will help me get a job on minehut servers

#

lmao

drowsy helm
#

to put it this way- you cant make a multi million dollar server with datapacks

quaint mantle
#

thats impossible

#

i only make plugins for the fun of it

dusk flicker
#

you def can

quaint mantle
#

like to mess around with vanillas core mechanics

#

yeah

drowsy helm
#

purely with datapacks?

quaint mantle
#

yeah well

dusk flicker
#

oh I def read what u sent wrong

quaint mantle
#

plugins are much easier

dusk flicker
drowsy helm
#

lmao

dusk flicker
#

im tired lol

quaint mantle
#

yeah im using paper

#

and its still not logging

dusk flicker
#

Can you send the code in a paste please?

quaint mantle
#

oh forgot to make a new project

dusk flicker
#

lamo

#

?paste

undone axleBOT
quaint mantle
#

sure

drowsy helm
#

sorry im a bit late to the party whawt are you trying to log?

dusk flicker
#

I do want to clarify, following this once you are actually running the PaperAPI, you will want to reach out to them regarding support

quaint mantle
#

its suppose to be kotlin

dusk flicker
#

you've registered the listener, correct?

quaint mantle
#

yeah

#

im using paper now

#

yeah

dusk flicker
#

do me a favor

#

put a sysout and see if that sends

drowsy helm
#

System.out.println ftw

quaint mantle
#

k

#

its actually println()

#

for kotlin

#

😎

dusk flicker
#

oh well

#

kotlin = worse java

drowsy helm
#

static import util class 😎

quaint mantle
#

shut up

#

im finding you

dusk flicker
#

a threat 😮

#

banned

drowsy helm
#

roblox java

quaint mantle
#

oh no

dusk flicker
#

calling discord helpers

#

ban !

quaint mantle
#

no no!!!

#

it was a joke lmao

dusk flicker
#

I'm joking lol

quaint mantle
#

im restarting the server

#

hold on

#

and i promise next time ill go to paper support

#

nope

#

still not

dusk flicker
#

check the listener is registed

#

thats my best guess

quaint mantle
#

it is registered

dusk flicker
#

can you send your main class's code?

quaint mantle
#

sure

dusk flicker
#

Weird

quaint mantle
#
package me.yuzoff.testingplugin

import org.bukkit.Bukkit
import org.bukkit.plugin.java.JavaPlugin

class Main : JavaPlugin() {
    override fun onEnable() {
        // Plugin startup logic
        println("My first plugin has started!")
        Bukkit.getPluginManager().registerEvents(events(), this)
    }

    override fun onDisable() {
        // Plugin shutdown logic
        println("My first plugin has stopped :(")
    }
}
dusk flicker
#

how are you testing it?

quaint mantle
#

i restarted

#

server

#

wait should I test an exp bottle event now

dusk flicker
#

yes, but its in an event

quaint mantle
#

cause i switched to paper

dusk flicker
#

you need to trigger the event to get the sysout

quaint mantle
#

HEY

#

THIS IS WEIRD

#

I REMOVED AN EVENTLISTNER LAST TIME AND ITS STIL LHERE

#

am I not installing correctly?

dusk flicker
#

I'll let someone that actually knows about Kotlin figure this out

#

I got nearly no idea what im looking at lol

quaint mantle
#

ill translate

#

the code

#

what do you need me to translate

#

💀

dusk flicker
#

do you mean Listener or EventListener?

quaint mantle
#

eventlistener

#

arent those the same thing

#

i implemented listener

dusk flicker
#

whats this EventListener you are refering to

quaint mantle
#

yeah i havent actually learned kotlin

#

but it only took 1 day to get use to it

#

im not even lying

#

i think i already mastered it

bitter bone
#

How would I cancel a runnable after a mobs health I tried to doing cancel(); but that doesn't seem to stop it it still sends the msg in chat

quaint mantle
#

man why does someone have to take my place during my help

#

ngl that kinda gets me annoyed in every single help channel for help for anything

dusk flicker
#

smh stupid discord

#

you are only one of the 22k people in this Discord, dont expect to be the only one asking for support at one time

#

this is actually very slow right now lol

#

I've seen like 5 people getting help in here at the same time

quaint mantle
#

damn

dusk flicker
#

it is very chaotic in like mid-day US hours

quaint mantle
#

oh sorry for saying that then

#

yeah

#

i think if ixed it but idk

#

nevermind

dusk flicker
#

ima go pass out

#

gn

quaint mantle
#

same

#

i cant even figure this iut

tulip nimbus
#

Use InventoryClickEvent, check for AnvilInventory and Result slot, check if the name of the item in the result slot is the same as the item in the original slot and cancel the event if not

#

Does that make sense?

winter scarab
#

what would be best the way of going about detecting a left click on an invincible entity?
the entitydamagebyentity event does not fire because it is invincible.
playerinteractentity event only detects right clicks
playerinteractevent only detects the location

#

is there no easier way than getting the player vector and looking for entities within that direction?

#

actually i may just set the turtles health to an insane amount and cancel any damage events

#

so that i can register using entitydamage

#

does the entitydamage event umbrella all the other events

#

for example will EntityDamageEvent trigger when EntityDamageByEntityEvent does?

#

or when EntityDamageByBlockEvent does?

drowsy helm
#

cancelling EntityDamageEvent will cancel EntityDamageByEntityEvent

winter scarab
#

so if i cancel entitydamageevent all together, nothing can be damaged in anyway?

drowsy helm
#

not sure which order they go in though

#

yeah

winter scarab
#

now i wonder if things like /kill would override that

drowsy helm
#

kill doesnt call EntityDamageEvent

winter scarab
#

got it

#

but if an entity died from /kill that would trigger the entitydeathevent hopefully?

tender shard
#

yes

tender shard
drowsy helm
#

ah that explains it

tender shard
#

the listener for EntityDamageEvent only gets triggered by EntityDamageByEntityEvent because of erm... inheritance or whats it called

tender shard
#

?askgoodquestions

#

?askgoodquestion

undone axleBOT
echo basalt
desert frigate
#

how can i remove a armor stand in a world by their uuid? ive tried js world.getEntitiesByClass(ArmorStand.class).forEach(e -> { if(e.getUniqueId() == holoUUID) e.remove(); }); but it didnt work

wise mesa
#

is it possible to get the namespaced key of a material

#

like Material#getId but with a namespaced key

wise mesa
#

like for example with Material.STICK I would want to get minecraft:stick

tender shard
#

but use equals()

wise mesa
#

oh how i miss c#

tender shard
#

or simply get the entity directly by it's UUID

#
Bukkit.getEntity(uuid).remove();

@desert frigate

tranquil viper
#

Hi! I want to run the command /hat as a player when they right click an item, but I was wondering how I can do this without giving them perms to /hat

tender shard
#

you can't

desert frigate
#

i thought it needed the world

tranquil viper
#

Well I've learned in coding there isn't such thing as "can't"

tender shard
desert frigate
#

such a life saver

tender shard
#

however that's just a dirty workaround instead of an actual solution

wise mesa
#

you could find what function /hat calls and perhaps call it yourself

tender shard
#

the actual question is, why do you have a /hat command that you don't wanna assign permissions for in the first place

tender shard
wise mesa
#

mhm

wise mesa
desert frigate
#

is is possible to put multiple lines on a armor stand custom name?

tender shard
#

Material#getKey()

tender shard
desert frigate
#

crying

tender shard
#

but using armor stands for holograms isn't exactly the best idea

desert frigate
#

rn

#

what-

#

isnt that the only way

tender shard
#

the best way (currently) are area effect clouds

#

well it depends a bit

desert frigate
#

never heard

tender shard
#

if you have lots of holograms, use area effect clouds

#

if you only have a few holograms, armor stands are fine

wise mesa
#

i skipped right past that one in the javadoc

#

i outta go to bed

tender shard
#

armor stands are visible up to 64 blocks to the client, while area effect clouds are visible only for 48 blocks. however armor stands cause waaaaay more client lag when you use a ton of those

desert frigate
wise mesa
#

that is not how you spell the thing i was trying to write

wise mesa
#

they can't wear anything

tender shard
wise mesa
#

but if you're using armor stands like markers or something like that then they work perfectly

tender shard
#

only downside is that they are only visible for up to 48 blocks

wise mesa
#

was gonna add that part

#

how far away are item frames visible

tender shard
#

erm

#

no idea lol

#

let's try it out

wise mesa
#

lemme google lol

tender shard
#

oh damn I fucking hate this

wise mesa
#

yaaaayyyyyyy

#

you'll get there

tender shard
#

CraftItemStack always takes like 2 minutes to decompile and I always forget to close that class before shutting down IJ >.<

wise mesa
#

rip

desert frigate
tender shard
desert frigate
#

i tried

#

on maven

tender shard
#

what version are you on?

desert frigate
#

1.18

desert frigate
#

i already looked at that

#

buildertools doesnt work

tender shard
#

well what's the problem exactly?

#

because buildtools should work lol

desert frigate
#

uhm, literally nothing cause it doesnt say anything when i run the command in terminal

#

or more the less it does nothing

tender shard
#

well it should print at least SOMETHING

#

can you show a screenshot pls

#

because you NEED to run buildtools to get spigot remapped

#

there is no other way

desert frigate
tender shard
#

perfect :3

#

wait, you aren't the person who had this problem in general with java, like 2 days ago, right?

desert frigate
#

i am

tender shard
#

ooh

#

yikes

desert frigate
#

yeah i sent that ss

tender shard
#

didnt you say you reinstalled java and that fixed it?

desert frigate
#

oh wait no that wasnt me then

tender shard
#

oh okay

#

then just send your screenshot of "trying to run buildtools" pls

desert frigate
#

bruh i cant run git

#

gimme a sec

pliant tundra
#

i have this code that returns a list of connected blocks that are the same type (e.g. a vein of diamonds)

#
import io.github.narutopig.bors.Main
import io.github.narutopig.bors.enchanting.CustomEnchants
import io.github.narutopig.bors.util.Enchanting
import org.bukkit.Material
import org.bukkit.World
import org.bukkit.block.Block
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.block.BlockBreakEvent

// i hate recursion
class RecursiveThing {
    val blocks = mutableSetOf<Block>()
    lateinit var world: World
    lateinit var blockType: Material

    fun someRecursiveThing(block: Block) {
        if (block.type != blockType || blocks.contains(block)) {
            return
        } else {
            blocks.add(block)
            val loc = block.location
            someRecursiveThing(world.getBlockAt(loc.add(1.0, 0.0, 0.0)))
            someRecursiveThing(world.getBlockAt(loc.add(-1.0, 0.0, 0.0)))
            someRecursiveThing(world.getBlockAt(loc.add(0.0, 1.0, 0.0)))
            someRecursiveThing(world.getBlockAt(loc.add(0.0, -1.0, 0.0)))
            someRecursiveThing(world.getBlockAt(loc.add(0.0, 0.0, 1.0)))
            someRecursiveThing(world.getBlockAt(loc.add(0.0, 0.0, -1.0)))
        }
    }
}```
tender shard
#

wtf is that

#

lateinit var world: World

desert frigate
tender shard
#

since when is lateinit a thing

pliant tundra
#

shut

tender shard
# desert frigate

damn, you got the same problem as this dude a few days ago. please try to reinstall java, it fixed it for the other person

pliant tundra
#

it doesnt go down

tender shard
#

e.g. try to enter java -version, this probably also doesnt print anything, right? @desert frigate

pliant tundra
desert frigate
#

wait am i running the commands in git bash or my intellj terminal

tender shard
pliant tundra
#

oh

desert frigate
#

jdk 17.0.4 right?

tender shard
#

well, depends

#

for 1.19 you definitely need java 17 or later

#

I'd suggest to just get the latest java 17 because 17 is supported for years, while 18 only has 6 months of support

compact haven
#

U never saw lateinit?

tender shard
tender shard
tender shard
#

a variable is either final or not

#

but I don't like ANY of kotlins additions anyway, so I'm probably the wrong person to explain it to anyway lol

pliant tundra
#

well the lateinit part is not the issue

compact haven
#

It’s a variable that will be set later once

tender shard
#

why is there a keyword needed for that

compact haven
#

but it is final

tender shard
#

it cannot be final if it doesnt get a value right now

compact haven
#

because it’s basically saying it’ll only be set once later

tender shard
#

but then it's not final

compact haven
#

inside of the generated setter it throws an error if you set it again after

#

no it’s final

tender shard
#

because obviously it gets changed from "nothing" to "something else" "later on"

compact haven
#

Correct, in compiled JVM bytecode it’s not final attributed

#

in Kotlin it’s final

tender shard
#

yeah that's what I'd imagine of a kotlin dev to think "yeah, this is so useless, let's do it, I'm totally pro this idea"

compact haven
#

it’s not useless lol

tender shard
#

okay can you try to explain a use case in real life

#

for example I just read this

#

and they say "when using DI, you don't have the property yet"

pliant tundra
#
import io.github.narutopig.bors.Main
import io.github.narutopig.bors.enchanting.CustomEnchants
import io.github.narutopig.bors.util.Enchanting
import org.bukkit.Material
import org.bukkit.World
import org.bukkit.block.Block
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.block.BlockBreakEvent

// i hate recursion
class RecursiveThing {
    constructor(world: World, blockType: Material) {
        this.world = world
        this.blockType = blockType
    }

    var world: World
    var blockType: Material
    val blocks = mutableSetOf<Block>()


    fun someRecursiveThing(block: Block) {
        if (block.type != blockType || blocks.contains(block)) {
            return
        } else {
            blocks.add(block)
            val loc = block.location
            someRecursiveThing(world.getBlockAt(loc.add(1.0, 0.0, 0.0)))
            someRecursiveThing(world.getBlockAt(loc.add(-1.0, 0.0, 0.0)))
            someRecursiveThing(world.getBlockAt(loc.add(0.0, 1.0, 0.0)))
            someRecursiveThing(world.getBlockAt(loc.add(0.0, -1.0, 0.0)))
            someRecursiveThing(world.getBlockAt(loc.add(0.0, 0.0, 1.0)))
            someRecursiveThing(world.getBlockAt(loc.add(0.0, 0.0, -1.0)))
        }
    }
}```
tender shard
#

and I just think "okay who tf are you doing your DI then"

pliant tundra
#

guys i fixed it with a scuffed constructor

tender shard
pliant tundra
#

wait no

#

i fixed the late init

tender shard
#

btw do you not care about "diagonal" blocks?

pliant tundra
#

mb should have been mroe spcific

#

ye i dont want diagonal blocks

tender shard
#

oh ok

#

then it looks good

compact haven
#

In Kotlin we have nullable types

tender shard
#

i just wondered because e.g. diamonds can sometimes spawn while only be touching diagonally

compact haven
#

lateinit allows you to say the value will be set when you access it

#

won’t be set again

tender shard
compact haven
#

and you don’t need to test for nullability because of that

desert frigate
#

now git bash isnt even starting up

compact haven
#

nor declare it as nullable

tender shard
tender shard
compact haven
#

like say you have a method that is called in your constructor that sets up the object

desert frigate
compact haven
#

you can say you have a lateinit property

tender shard
compact haven
#

it’s private and you know your class only calls the method once per instance

#

it’s not nullable, and isn’t in the constructor so it can’t be final

tender shard
desert frigate
#

cause everything is in d drive

tender shard
compact haven
#

or if you call it outside, I.e newOvject#setup()

pliant tundra
#

update: it kind of works but only when facing the south east direction

tender shard
compact haven
#

ehm because then you have

#

something = AnotherSergice()

#

you don’t do service or execution on init

#

I don’t use lateinit often, when I need it I know when

#

it’s nice to have, not necessary, it’s QOL like most Kotlin things

tender shard
#
public class FlawedObject {
  public final String myField;
  public FlawedObject() {
    setup();  
  }
  public void setup() {
    myField = "asd"; // Why not do this directly inside the constructor?
  } 
desert frigate
#

same issue

compact haven
#

obviously the field depends on something external

pliant tundra
#

guys help

compact haven
#

like say you need to make an http request for that field first

tender shard
tender shard
compact haven
#

Why would you start doing http requests in the constructor, when that’s something the person initializing the object should start by calling the method

tender shard
#

sorry I edited my last message

compact haven
#

because a final variable cannot be set outside of the constructor

tender shard
#

I meant, NOT final

compact haven
#

oh

#

because it’s only going to be called once

tender shard
#

well, no problem, just not set it again

compact haven
#

if it wasn’t final, you’d need to declare it as nullable in Kotlin

tender shard
#

making it final won't bring any advantages

compact haven
#

because there’s null safety and you don’t have a filler value for it

tender shard
#

just make it not-final and don't set it again

compact haven
#

since you haven’t made the http request yet

#

you don’t understand

#

it would need to be nullable then

tender shard
#

yeah I really don't understand it

compact haven
#

alex

#

got on my pc becuz of this

tender shard
#

haha sorry

#

can you maybe simply show me some code that explains the advantages

compact haven
#

like remember the situation I had just outlined right, you'd need to declare

var somethingNotYetSet: Another? = null;
#

because you havent yet set it in the declaration or constructor

tender shard
#

erm wait whut

#

is that even valid

compact haven
#

yes

#

why wouldnt it be

tender shard
#

wtf

#

does that do

compact haven
#

its

@Nullable
private Another somethingNotYetSet = null;

??

#

what else would it be

desert frigate
compact haven
#

like this is why I dont like it when people bash kotlin unless they've actually used it before, and made shit with it's features

#

because how can you judge something without using it

tender shard
# desert frigate also nothing

your java is fucked up somehow, you need to reinstall your JDK completely, then be sure to run exactly the java.exe file that you just newly installed

#

but @smoky tinsel doesn't do anything

#

it's just an annotation

#

it doesn't do anything

compact haven
#

in Kotlin it's not an annotation

#

nullable types

#

must be handled

#

in kotlin

tender shard
#

wtf

#

but why

compact haven
#

must be handled for nullability

tender shard
#

what if you're fine with it being null

compact haven
#

BECAUSE IT'S TYPE SAFETY

#

then you need to handle it

tender shard
#

kotlin is so weird

compact haven
#

just like how you need to handle Some and None in Rust

#

because it's safe that way

#

every new language has null safety

#

you don't want an NPE to be thrown because you were like "oh yeah I haven't set that yet have I"

tender shard
#

but still adding a ton of ? operators, basically making people ignore null checks

compact haven
#

that's not how that works

tender shard
#

String name = myObject?getName()

#

thats how everyone uses it

compact haven
#

String s somethingNotYetSet?.getName()

#

will NOT compile

#

you MUST handle it

#

String s = somethingNotYetSet?.getName() ?: "Unknown"

#

that's handled null

tender shard
#

:Y

#

damn I am so glad that I dont have to deal with this

compact haven
#

if one of the values up until getName is null, the value of s is "Unknown"

#

no it's so nice wtf

#

you can even throw so like

tender shard
#

how is that nice lol

compact haven
#

String s = a?.b?.c?.getName() ?: throw IlegalStateException("...")

#

you don't need an if check taking up 3 lines for 1 getName

tender shard
#
if(somethingNotSetYet``` there it already ends. in java something cannot be "not set yet". it's either null of has a value. Easy af
compact haven
#

no lol

#

we're past lateinit

#

we're now talking about nullable types

glossy lily
#

is there any way to change the nbt of a projectile? i have a snowball and i want to set the Item tag of it

compact haven
#

forget about lateinit

tender shard
#

we don't need any way to deal with stuff that's "basically finally but also not. It will never change it's value, but I haven't decided yet what it is. Ask me later again pls"
We don't need that in java

compact haven
#

you MUST handle nulls in Kotlin, you can't ignore them and get an NPE like in Java

tender shard
tender shard
#

For example:

#

Bukkit.getServer()

#

would that be "Nullable" in your opinion?

compact haven
#

no

tender shard
#

but it can be set

#

there is Bukkit.setServer(Server)

compact haven
#

it has a NonNull annotation pretty sure

tender shard
#

and this would also be some kinda "late init" thing

compact haven
#

which Kotlin accounts for

#

btw

tender shard
#

but if you'd call it immediately when the server starts, Bukkit.getServer() would return null

compact haven
#

Kotlin, because of your Java stupidities, takes into account Nullable and NonNull annotations on fields and parameters <3

pliant tundra
#

lmao did i really just start this whole argument because i used lateinit in my code

tender shard
#

it's only set by NMS like after 20 lines or so

tender shard
#

I'm only learning stuff by discussing this

compact haven
#

yeah I'm having fun too lol, I was just going to lay in bed doing nothing anyways

#

basically, you don't even call Bukkit.getServer().anything()

tender shard
#

I can't learn new things if I don't try to say they're shitty, until someone explains to me that I#m wrong, lol

#

that's how my learning process always works

compact haven
#

Bukkit.anything() maps to getServer(), so even IF server was nullable, you dont need to handle that

#

Bukkit the interface implementation is assumed to handle that case

tender shard
#

Bukkit.getServer().getPluginManager().registerEvents(...)

compact haven
#

Bukkit.getPluginManager()

#

u do realize the interface has all of the methods of Server right

tender shard
#

yeah okay but that does the same thing

#

FUCKING SHIT

#

AGAIN!!!!!!!!!!!!!

#

why can IntelliJ not have an option to stop trying to decompile the same class over and over again

compact haven
#

anyways, the reason you don't need to specify ? or !! after calling getServer:

tender shard
#

I ctrl+b'ed into CraftItemStack by accident once

#

and now everytime I open it, it tries to decompile it again

compact haven
#

it's because it's annotated, which tells Kotlin that it's almost guaranteed to never be null when you're able to access it

tender shard
#

that's just a javax annotation

#

and it could even be "false"

compact haven
#

indeed, Kotlin and it's infinite wisdom processes that

tender shard
#

what if I annotate something with @urban grotto but return null anyway

compact haven
#

well you've fucked up on several levels, and an NPE deserves to be thrown because of you xd

#

Kotlin retains interopability with Java code

#

in order to do that with nullable types, it needs to make some guesses

tender shard
#

let's imagine for example I have this class:

#

(gimme a minute to write, lol)

compact haven
#

ur good aha

glossy lily
#

i need to ask a question

compact haven
#

you should ask in #general we're discussing help-development here

glossy lily
#

oh ok

compact haven
#

just joking

#

ask here

#

kekw

#

he already moved

tender shard
#
package com.jeff_media.jefflib.data;

public class MyWeirdClass {
    
    public String name;
    
    public void setName(String name) {
        if(name.equals("mfnalex")) {
            throw new IllegalArgumentException("You can't be called mfnalex, that's already my name!");
        }
        this.name = name;
    }
    
}

and now someone does this:

MyWeirdClass thing = new MyWeirdClass();
thing.name = "mfnalex";

does this throw an exception, or not?

tender shard
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!

compact haven
glossy lily
# tender shard ?ask

noone answered me last time and im pretty sure my message got deleted because i was interrupting you

tender shard
#

so it calls setName although I explicitly ask it to not do that

compact haven
#

(we don't have the power to delete messages, no one definitely did)

compact haven
tender shard
compact haven
#

that's a good question

tender shard
#

I am not sure what'd happen in my above example

compact haven
#

I wonder what happens when you have an accessible field and an equally proper setter for it

tender shard
#

yeah, that's exactly my question 😄

#

I think that I have tested this once

#

and IIRC it uses the field if possible

#

and if not possible, it uses the setter

#

and I think that this is a weird behaviour

#

because you can basically change on how it behaves by making the field public or not

#

of course this is probably rare in real life

#

so not really any problem

compact haven
#

hmm

#

I mean you can force it to call setName

tender shard
#

how that?

#

yeah okay, by just making it private

compact haven
#

obj.setName("mfnalex")

#

no I mean in the kotlin code lol

tender shard
#

oh I thought you meant "force others to not set the field directly"

#

I always think about other people using my code when discussing stuff like this

compact haven
#

yeah I mean you wouldn't see that, you'd have either public field or public setter

tender shard
#

i mean, my whole idea is fucked anyway, because obviously the MyWeirdClass class would usually set the name in it's constructor, but yeah

#

it was just an example 😄

compact haven
#

in kotlin this definitely wouldn't happen, because even if you needed it to be set directly elsewhere in the code (bad design), then you can mark it internal

#

but yeah ig that's a bit weird

tender shard
#

internal?

#

that's a thing too?

compact haven
#

yep

tender shard
#

what does it do

compact haven
#

it's a field accessible by any member within the module

#

and unaccessible outside of the module

tender shard
#

isn't this just a weird workaround to describe visibility, like private, public, etc?

compact haven
#

no ;-;

tender shard
#

so what's the difference :X

compact haven
#

it's quite useful

#

like you don't want to expose your Utils class in Java to any plugin dpending on your own, do you?

#

like it's not a problem to, but it's messy

#

so you make it internal

#

(in kotlin you wouldnt have a Utils clas, you'd have top level functions marked as internal, same thing)

tender shard
#

but I also don't see any problem in exposing it

#

I mean, that's what modules are for in java 9+

compact haven
#

lets be real

#

does anyone use Java-native modules

#

you use Maven or Gradle modules xd

tender shard
#

okay I am totally real - I have no clue about modules because spigot doesnt properly support them

compact haven
#

but regardless, internal works for all of those

#

maven, gradle, and jpms

tender shard
#

maven or gradle

#

I know this is a stupid question

#

anyway, answer pls

compact haven
#

I've used Maven for the past 4+ years of developing Java shit

#

I've recently moved to Gradle on this last project I'm working on

#

it's incredibly complex with micrsoervices, I need the smaller build scripts

#

I really do

#

maven is just so bulky

tender shard
#

I think gradle is awesome because it allows you to do everything. but in 99% of cases you simply don't need to do "everything" and then gradle just makes everything more complicated

compact haven
#

I haven't used Gradle long enough to say, but I do like the flexibility it has

#

oh look at that

tender shard
#

e.g. maven needs a THIRD PARTY PLUGIN to shade dependencies

#

why is it not builtin 🥲

#

erm

#

I meant gradle

#

wtf

#

sorry for the confusion

#

gradle needs a 3rd party plugin to shade

#

maven has it builtin (kinda)

compact haven
#

you need a third party plugin to shade in maven anyways

tender shard
#

no

compact haven
#

and to declare it it takes 20 lines

tender shard
#

it's an "official" plugin from org.apache.maven

compact haven
#

okay sorry

#

it's a plugin

tender shard
#

it is a plugin, yes, but it's made by the maven team itself

#

and declaring it doesn't take 20 lines, but yeah... the <executions> part

#

I know what you mean

compact haven
#

eh

tender shard
#

it indeed can be a bit annoying to declare it lol

compact haven
#

honestly where the plugin comes from doesnt matter to me

compact haven
tender shard
#

well I think it matters, because I don't want to rely on "random people's github things" to make my build work

compact haven
#

then make your own 🤷‍♂️

tender shard
#

but why not just have the official gradle team make one

compact haven
#

that's like saying you don't want to rely on Bukkit API

#

or PacketEvents from retrooper

#

or whatever from anyone because it's not made by yourself

tender shard
#

true, true

#

when was this packet events even made

compact haven
#

I have no clue rofl

tender shard
#

it just randomly appeared some day

compact haven
#

only know of it because of kacper's plugin

tender shard
#

never seen it before until I used GrimAC for the first time

tender shard
compact haven
#

the anti popup one

tender shard
#

oh yeah

#

I remember

#

kacper also has a plugin with spigot ID 100000

#

lol

#

anyway, I got another question about kotlin

#

IIRC, kotlin doesn't have "normal" static methods

#

it always uses this weird Companion thing, right?

compact haven
#

correct, we do not have a static modifier

#

that's because we have objects

#

a singleton

tender shard
#

but

#

why

compact haven
#

because static is very anti-OOP and breaks

tender shard
#

what's the problem in saying "There's a class called XY and it has a method that doesn't need any instance"

compact haven
#

like your fields need to be static if it's accessed by a static method

tender shard
compact haven
#

no

#

static belongs to the class, OOP means everything belongs to an instance

#

but I wont argue this point because we have top level functions in Kotlin which aren't OOP either

tender shard
#
Class<Bukkit> clazz = Class.forName("org.bukkit.Bukkit");
clazz.getDeclaredMethod("getServer").invoke(null);
tender shard
#

and we invoke getServer on it

compact haven
#

Bukkit is an object

#

wait]

#

mb mb mb

tender shard
#

well, no

compact haven
#

ignore

tender shard
#

ok

#

lol

compact haven
#

was thinking of Server lol

tender shard
#

Bukkit only has static methods and the constructor is private

#

but yeha, the whole Bukkit class is weird

#

it basically does the same as Server and just "forwards" it to the actual instance

#

so yeah, it's a very bad example

compact haven
#

It's just less verbose, not having the word static and putting it into a companion object

#

you still work with it the same in Kotlin, i.e. MyClass.someVar

tender shard
#

yeah anyway, I know that many people love kotlin for doing some things differently than java, but I also hate everything they do differently. lol. But this is probably just because I'm used to java, and I don't really have any proper arguments to say "kotlin is shit" (because it isn't). I can only say "kotlin is weird", but not that it's shit

compact haven
#

(in java it's a bit more complex, MyClass.COMPANION.getSomeVar() (either getCompanion() or COMPANION)

#

but you still know it's static, because it's in the companion

#

which is indented and separated from your non-static code

tender shard
#

Speaking about verbosity...

#

look at my exception name

compact haven
#

well you're catching Exception

#

so that's your first error 🤣

tender shard
#

huh

compact haven
#

I assume u need to

tender shard
#

no

compact haven
#

could be WorldGuard

tender shard
#

I want to catch FlagConflictException

#

but this class isn't always there in every worldguard version

#

it's WorldGuard 7 +

compact haven
#

oh

tender shard
#

if someone runs WorldGuard 6, then the code would work fine, but throw a NoClassDefFoundError

compact haven
#

I need to read the long name to realize why you're catching Exception

carmine nacelle
#

any experts on bee behavior here??1

compact haven
#

yeah that belongs on a comment

tender shard
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!

compact haven
#

not the variable name, xd

tender shard
#

my worldguard code sucks but it works, and in 99% of cases that's good enough for me

chrome beacon
#

I keep worldguard code in modules just like nms

tender shard
#

yeah that's definitely the better option

carmine nacelle
#

see this little guy

#

he has a hive location

compact haven
#

that's a bee!

carmine nacelle
#

but he would rather wander off randomly

compact haven
#

get he bee away from me pls

#

i dont lik ebees

carmine nacelle
#

instead of returning to the hive with the nectar

#

hes currently like 50 blocks away from his hive.

chrome beacon
#

You could debug what goal it's using

compact haven
#

maybe it has anxiety

#

like what if the bee mother is mad at it

#

and it doesnt want to return

chrome beacon
#

I'd give it time to return

compact haven
#

it's running away from home

chrome beacon
#

It probably will eventually

carmine nacelle
#

Is there a way to give it a goal to not be a lazy piece of ass?

chrome beacon
#

Yeah you can use NMS or Paper API to change goals

carmine nacelle
#

im using mojang maps

#

its an nms entity

#

I dont understand goals... like

#

do they ALWAYS have the goal or does it last for a certain time period or..

chrome beacon
#

They always have one. Which goal it's running depends though

#

For example Villagers will go to work 2 times a day

#

So that goal depends on time and it has a high priority

carmine nacelle
#

How would I get the name/description of its current goal?

#

goalSelector is just giving me an object

chrome beacon
#

You can look at the class name of the goal it's running

#

Use the brain I believe

#

There is no real description of them since it's nms

#

Names do make sense though

carmine nacelle
#

Bukkit.broadcastMessage(nmsBee.getGoalSelector().getRunningGoals().findFirst().get().getGoal().toString());

#

just giving me a nosuchmethod

chrome beacon
#

Make sure you're compiling against the same version you're running

#

Also try the brain

carmine nacelle
#

?

#

i am using my brain

#

lmao

chrome beacon
#

The brain is an object lmao

carmine nacelle
#

the fuq

chrome beacon
#

In the class. It keeps track of stuff

carmine nacelle
#

never heard of it

#

in which class?

chrome beacon
#

It's been a while since I've done this

#

Anyways I'll go back to sleep now. If you can't figure it out I will help you later when I can actually look at the code

tender shard
tender shard
#

you are called VivianMusic but don't have any soundcloud link in your profile

#

BETRAYAL

carmine nacelle
#

lmao

compact haven
#

huh

#

discord has soundcloud connections?

carmine nacelle
#

i cant find a way to get the current running goal.

tender shard
carmine nacelle
#

yes

tender shard
#

well you can't get the "currently running" ones

#

you can only get all the registered ones

carmine nacelle
#
Bukkit.broadcastMessage(nmsBee.getGoalSelector().getRunningGoals().findFirst().get().getGoal().toString());
#

?

tender shard
#

this will not get you all running ones

#

only a random one

carmine nacelle
#

All I wanna know is "what the hell is this entity doing rn"

tender shard
#

ah okay, Yeah then it should work I guess. what's the problem exactly?

carmine nacelle
#
Caused by: java.lang.NoSuchMethodError: 'net.minecraft.world.entity.ai.goal.PathfinderGoalSelector net.minecraft.world.entity.animal.EntityBee.fU()'
        at com.squallz.cadiabees.listeners.BeeEnterHiveListener.hit(BeeEnterHiveListener.java:54) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.19.1-R0.1-SNAPSHOT.jar:?]
        ... 33 more
tender shard
#

your mappings are off

#

you use 1.19.1, are you still using the 1.19 mappings?

carmine nacelle
#

both are on 1.19.1

tender shard
#

hmmm okay gimme a minute

#

it should be "fl()" instead of "fU()"

#

weird, weird, weird. must be some kinda mappings problem

carmine nacelle
#

hm

#

im using mojang mappings tho

tender shard
#

very weird

#

maybe show your pom.xml file

#

?paste

undone axleBOT
carmine nacelle
#

hes just wandering instead of going into the hive

#

hmmmmm...

#

wtf

#

it doesnt have a valid hive even though im setting it in TWO PLACES

#

sometimes it works sometimes it doesnt.

#

makes zero sense.

tender shard
#

hmm

carmine nacelle
#

unless it needs a delay...?

desert frigate
#

this is why I gave up

#

And I think I have a reason behind these errors

#

and i think it's cause the files r not in c drive

#

Cause I put everything in d drive

#

But idk if it matters

tender shard
lost matrix
tender shard
#

it's really weird. as said, some other person had the exact same problem like 2 days ago

tender shard
lost matrix
#

This means that the alias might be taken by a random file that does nothing

tender shard
#

to me, this sounds like some kinda malware replaced the java executable itself

tender shard
#

@desert frigate in the command promot, enter where java.exe and then send what it prints

#

it should normally show you what java.exe exactly is being ran

lost matrix
#

Did you call the folder "javapath"

#

I always add the version 😛

tender shard
#

you also have "javapath" in your path lol

#

and this person from 2 days ago had it too

desert frigate
#

I'll do it tomorrow

tender shard
#

yeah it's also 7 am here

#

and I woke up at 5 am

desert frigate
#

I started at 8am

tender shard
#

kinda weird but ok

desert frigate
tender shard
#

wait

#

you actually go to sleep at 10pm?

desert frigate
#

parents

tender shard
#

that's actually awesome because that means that your sleep schedule is still working fine

chrome beacon
#

^

tender shard
#

everyone else here wakes up at 5pm lol

desert frigate
#

Yeah lol I sleep like an average of 9 hours a day

desert frigate
#

the sun wakes me up

chrome beacon
#

I try to sleep 10+ hours

tender shard
#

olivo incoming "I also go to sleep at normal times" like, I dont belive that bro

desert frigate
#

fr^

chrome beacon
#

My brain stops working if I don't

desert frigate
#

especially the non profile pics

tender shard
#

my brain never properly worked

desert frigate
#

same bro

tender shard
#

I love this server

desert frigate
#

Ikr

chrome beacon
#

You're quite active in it

tender shard
#

the best thing is, you can even insult staff

#

@quaint mantle Fuck you ❤️

desert frigate
#

"damn y'all hate me"

tender shard
#

No, I love imajin

desert frigate
#

bro knows it already

tender shard
#

it's just part of showing love to insult people

desert frigate
#

I hope you step on shit and eat it <3

#

the heart matters

tender shard
#

I hope you step on a lego

desert frigate
#

I hope your bed is warm

tender shard
#

thank you ❤️

desert frigate
#

no problem<3

tender shard
#

recently I fell asleep with a bottle of mint liqueor

#

and now I have a huge yellow stain on the mattress

#

I always tell everyone "I PROMISE, IT'S ONLY MINT LIQUEUR" but noone believes me

desert frigate
#

I did that before but with water

tender shard
#

well but water doesnt create stains lol

#

wait lemme send a pic haha

desert frigate
#

💀

compact haven
#

we don’t want to see your piss stain

tender shard
#

Ok its not yellow but its a stain

compact haven
#

holy shit your bladder

#

that’s like the whole bed Alex

desert frigate
#

LMFAO

compact haven
#

man’s literally rolling in liquor

tender shard
#

D:

tender shard
#

don't tell me that you never fell asleep with an open bottle of mint schnapps in your hands

compact haven
#

I have not

tender shard
#

hm maybe it's just me then

compact haven
#

most likely

tender shard
#

no regrets

compact haven
#

u wasted that whole bottle

#

“no regrets”

tender shard
#

I got so much alcohol here, it doesn't matter

compact haven
#

Germany 🇩🇪

tender shard
echo basalt
#

pov: you're an adult developer

#

or slav

tender shard
echo basalt
#

I know

compact haven
#

bro no u are not

tender shard
#

yes I am 🥲

#

everyone here is like 13

echo basalt
#

Alex is like 27

tender shard
#

yes

#

exactly

compact haven
#

i know

tender shard
#

somebody once told me

desert frigate
#

what's the legal age to drink alcohol

compact haven
#

27 is not old when I’m with 80 year olds very often

tender shard
#

the world is gonna roll me

#

erm I meant

#

somebody once told me you're old if you're > 25

desert frigate
echo basalt
compact haven
#

fuck you

tender shard
echo basalt
#

as I say

#

half the people here are high schoolers

tender shard
echo basalt
#

the other half are boomers

echo basalt
desert frigate
tender shard
#

in germany, you can buy beer/wine with 16, and every other alcohol with 18. but you are legally able to drink even when you're still a baby. it's just prohibited to sell it to underage people

echo basalt
#

there are some states where it's like 19?

#

Like

#

if you look old enough in europe

#

no one will ask

#

but also it depends

desert frigate
#

I have to be 21 to drink hete

tender shard
#

true. I still get asked for ID because I look very young

echo basalt
#

if I go to a massive supermarket chain and decide to buy like 2 bottles of vodka

#

they might ask for ID

#

but if I take a beer or cider then no one cares

tender shard
#

I once was in florida with my dad, my dad was like 55 back then. and they asked him for ID haha

echo basalt
#

yeah that's a thing

tender shard
#

they just ask everyone

#

it's still a bit funny though

echo basalt
#

I'm not a fan of alcohol regardless

desert frigate
#

Alcohol is bitter idk why people like it

tender shard
#

I also once was in new york, in the trump tower (that was like 2009, so years before he was elected) and I ordered a beer and I also got it. I was 15 back then(!)

echo basalt
tender shard
#

the potion effects

desert frigate
echo basalt
#

coffee is weird

tender shard
#

coffee is awesome

echo basalt
#

coffee by itself is kinda bitter but I can drink it

desert frigate
compact haven
echo basalt
#

if I mix it with milk or ice then it's nice

desert frigate
echo basalt
tender shard
#

mfnalex.addPotionEffect(new Beer());

chrome beacon
#

My dad got asked for id when buying vanilla extract and he's over 50

desert frigate
tender shard
desert frigate
lime moat
echo basalt
desert frigate
#

true

tender shard
#

you can just ignore the "original" file

echo basalt
#

the other doesnt

desert frigate
#

my friend tried to snort pixie dust and then he went to the hospital

compact haven
#

^ compare the sizes

chrome beacon
lime moat
echo basalt
#

I've had one halloween where I became the school's dealer

tender shard
compact haven
#

you just don’t

echo basalt
#

people were crushing up candy tablets and snorting in art class

lime moat
#

Hm, okay, it's just a bit weird lol

#

Thank you!

echo basalt
#

and my neighbor happened to give me tons of candy tablets

tender shard
#

but I just used normal sugar or sth

echo basalt
#

I was selling a packet of 4 for about 50 cents

desert frigate
tender shard
#

aaah ok

#

but erm

desert frigate
#

Powered sugar

tender shard
#

how does this bring you to hospital

#

unless he was diabetic, I don't see any reason of why this would make you sick or anything

compact haven
#

It’s a stick filled of sugar

echo basalt
#

so uhhhhhhh

tender shard
#

lol

#

good explanation

desert frigate
echo basalt
#

but you probably mean these

echo basalt
#

in that case, it was accurate yeah

compact haven
#

yeah those smarties

tender shard
#

wtf

#

those are not smarties

desert frigate
#

smarties <

compact haven
#

those are smarties

desert frigate
compact haven
#

you’re just uncultured

tender shard
#

that's smarties

desert frigate
#

LMFAO

#

What-

tender shard
desert frigate
#

Those are skittles

tender shard
#

NO

#

skittles are without chocolate

compact haven
#

LMAO

chrome beacon
echo basalt
#

skittles are weird as shit

#

as well

desert frigate
echo basalt
#

it's like sugar paste

tender shard
#

skittles are great

echo basalt
#

with a shell

#

they are nice

#

but like

#

you get sick of them after a bit

tender shard
# tender shard

but yeah WTF, in my country we call these things smarties, and they are with chocolate

echo basalt
#

unless you're me a year ago buying a large pack a day

chrome beacon
echo basalt
#

these are smarties here

compact haven
#

Reese’s Pieces are the best out of your smarties, skittles, m&m’s

echo basalt
#

we don't have reese's chocolate here

#

I mean we do but no one buys them

tender shard
echo basalt
#

it's that 1 single item in the corner

#

now that I think about it

compact haven
#

Reese’s pieces are like your smarties but with peanut butter inside instead

echo basalt
#

any idea of the target demographic of those 2$ tiny chocolate bars?

tender shard
#

wdym

echo basalt
#

these fuckers

tender shard
#

aah yeah, that's a german invention

echo basalt
#

they're like 2$ and 1/3rd of the size of regular chocolate bars

tender shard
#

yes but they have awesome flavors

echo basalt
#

you can get a 400g chocolate bar for about 60 cents

tender shard
#

you can, but then it's just normal chocolate

echo basalt
#

almond chocolate, white chocolate

#

milk chocolate

#

bootleg crunch chocolate

#

we have flavors and all

tender shard
#

yeah Ritter Sport has crazy flavors. I agree that it's too expensive though

#

but I dont like cholocate that much anyway

echo basalt
#

chocolate is weird

#

it's nice in small quantities

tender shard
#

popcorn is awesome

compact haven
#

yeah you prefer spending money on alcohol to spill on the bed

echo basalt
#

but good luck eating a bar of white chocolate

tender shard
#

when I visited the US the first time, I tried salty popcorn

echo basalt
#

popcorn is ehhhhhhhhhhhhhhhh

compact haven
#

popcorn is great

tender shard
#

and it was awesome

echo basalt
#

I haven't eaten popcorn in a while

tender shard
#

unfortunately in germany we only have sugar popcorn

echo basalt
#

we have both here

compact haven
#

what

echo basalt
#

I prefer sweet popcorn

#

also how are the prices for chips and popcorn there?

tender shard
#

salty popcorn is just awesome imho

compact haven
#

the fuck is sugar popcorn

echo basalt
#

here a pack of shitty chips, or popcorn is about 80 cents

tender shard
echo basalt
echo basalt
tender shard
#

yes

echo basalt
#

And nice chips are about 1.2€

compact haven
#

oh I know what you mean

#

cinema always rips you off

echo basalt
#

cinema popcorn is like 4 bucks

compact haven
#

don’t buy from there

echo basalt
#

and they don't even make fresh popcorn

#

they have big ass bags

tender shard
#

this would be like roughly 1.70€, or way less if you buy a "cheap brand" which basically taste the same

echo basalt
#

pringles are expensive but I love them

#

2.5€ for a can

#

grr

desert frigate
compact haven
#

Jeff-media

tender shard
echo basalt
#

no

compact haven
#

dash not subdomain

tender shard
echo basalt
#

I don't eat that much gum

tender shard
echo basalt
#

there are like 15 mint flavors

desert frigate
echo basalt
#

but I generally take the trident icy-watermelon one

#

3 pack is about 2.2€

tender shard
echo basalt
#

oh

tender shard
echo basalt
#

well I have absolutely 0 cultural knowledge

compact haven
#

I’ve watched the office and don’t remember that either

tender shard
#

it's in one of the later seasons

#

after michael left

#

season 8 or so

echo basalt
#

the office looks like garbage now that I think about it

#

that acting is weird

tender shard
#

WHUT

#

the office is the best series ever made