#help-development

1 messages Β· Page 316 of 1

tender shard
#

It's to get user input

atomic violet
#

im trying to use (Advancement::fromString) for an advancement list and its saying it cannot resolve method, is there a workaround for this?

tender shard
#

e.g. "Please enter you rname". Then you enter your name. Then your plugin can get the reply

atomic swift
#

hmm I'll mess with it

undone axleBOT
buoyant viper
compact haven
#
        CompletableFuture<Boolean> future = new CompletableFuture<>();

        if (CACHE.getDocument(playerId) != null) {
            System.out.println("cached != null");
            future.complete(CACHE.getDocument(playerId).containsKey("loadouts." + loadoutId));
            return future;
        }

        collection
                .countDocuments(Filters.and(
                        Filters.eq("_id", playerId.toString()),
                        Filters.exists("loadouts." + loadoutId)))
                .subscribe(new SubscriberHelpers.ObservableSubscriber<>() {
                    @Override
                    public void onSubscribe(Subscription s) {
                        super.onSubscribe(s);

                        System.out.println("C Subscribed");
                    }

                    @Override
                    public void onComplete() {
                        super.onComplete();

                        System.out.println("C Completed");
                        future.complete(first() > 0);
                    }

                    @Override
                    public void onError(Throwable t) {
                        future.completeExceptionally(t);
                    }
                });

        return future;

can anyone figure why this Subscriber is only subscribed to, but never completed?

#

like I can't imagine why countDocuments is not completing ;c

humble tulip
#

@tender shard If I'm creating a plugin that will have a Parent, API, Build and Implementation module, where do I import spigot

#

parent doesnt build anything ofc

tender shard
#

the complete thing?

humble tulip
#

it builds api and implementation and anything else

tender shard
#

you can throw it into the parent, or into API and implementation

solemn frigate
#

hello, my plugin is throwing a strange error and i cant figure out why. im getting "java.lang.IllegalArgumentException: Plugin already initialized!" "at rocks.craftclue.connectioncontroller.Events.onConnect(Events.java:48)"
my code is https://paste.md-5.net/imufamowup.cs

humble tulip
atomic violet
tender shard
humble tulip
#

i need a good example of how to do multi module stuff

tender shard
#

you gotta use Bukkit.getAdvancement

solemn frigate
buoyant viper
tender shard
#

also why are you using a List<UUID> if you want a List<Advancement>?

atomic violet
atomic violet
solemn frigate
humble tulip
tender shard
# atomic violet so how would i use that
        List<Advancement> advancements = getConfig().getStringList("array.advancementName")
                .stream()
                .map(advancementName -> Bukkit.getAdvancement(NamespacedKey.minecraft(advancementName)))
                .collect(Collectors.toList());
buoyant viper
#

nothing gets instantiated here

solemn frigate
buoyant viper
#

but i ended up seeing where u went wrong anyway, a few lines down

#

u cant instantiate a Plugin

tender shard
#

you cannot just create a new instance of your plugin

buoyant viper
#

u need to pass a reference to ur plugin there

#

?di

undone axleBOT
solemn frigate
#

i see

#

thanks for the help

buoyant viper
humble tulip
# solemn frigate oh

think abt it, when you schedule a task to run later, that runs at some point in the future. The rest of the code in the method continues executing. WHen the end of the method is reached, spigot doesn't know to wait 20 ticks for you to disallow the event. And if it did know to wait, it would have to freeze the player

atomic violet
buoyant viper
#

altho ive opted for just using DI instead of a master instance

humble tulip
#

i'm tired of using DI

#

there's always gonna be one instance of my plugin

buoyant viper
#

what if i make an instance sunglasses

tender shard
tender shard
buoyant viper
tender shard
atomic violet
solemn frigate
humble tulip
#

you can just kick the player

solemn frigate
#

damn

humble tulip
#

OR

buoyant viper
humble tulip
#

use AsyncPlayerPreLoginEvent

tender shard
solemn frigate
tender shard
sterile token
buoyant viper
sterile token
buoyant viper
#

its technically open if u look at my smp-core plugin ig

#

lol

solemn frigate
humble tulip
#

so

#

use asyncplayerpreloginevent

solemn frigate
#

alr

humble tulip
#

and do it then, wait for response

buoyant viper
#

its pretty barebones n WIP, i think @quaint mantle has much more polished annotation based configuration system in BlueLib

humble tulip
#

and then allow/disallow

#

dont use a runnable

solemn frigate
#

how would i wait for a response without a runnable tho?

buoyant viper
#

what did that player do 😭 why r they on the block list

solemn frigate
#

actually its more of a whitelist

#

they get to bypass it

buoyant viper
#

oh

humble tulip
#

do you HAVE to use a webserver?

buoyant viper
#

rite

solemn frigate
buoyant viper
solemn frigate
#

damn i didnt know people in this server knew about eaglercraft

buoyant viper
#

i only know of it because of this discord lol

#

someone sent it ages ago i think when there was a 1.5.2 browser build

#

i hear now theyre up to 1.8?

tender shard
#

what is an eaglercraft lol

buoyant viper
#

minecraft java edition in the browser

tender shard
solemn frigate
tender shard
#

what did they use before? beta 1.3?

tender shard
#

lmao

#

okay that's funny

buoyant viper
#

its an impressive project tbh

#

i think it uses a lib called like IcedTea to run java in browser

tender shard
#

yeah it's interesting, but also completely useless ig

humble tulip
#

can have voice chat and stuff

#

soo

#

might allow for more socialization

#

which alot of people look for in games

solemn frigate
#

I had another idea of going about my problem and it was running a JavaScript file which would do the websocket stuff

#

But it turned out that you can’t use web sockets in javas js runner

tender shard
#

java's JS runner? which one do you mean

solemn frigate
#

The nashorn thing

tender shard
#

wasnt that removed a long time ago?

#

I FUCKING HATE THIS

#

EVERY

#

TIME

solemn frigate
buoyant viper
buoyant viper
tender shard
#

oh isnt that long ago, I just checked

#

it was removed in java 16

buoyant viper
#

oh wait java 8

#

bc ur on

tender shard
#

i wonder why, they should have just kept it

buoyant viper
#

1.8 i assume?

solemn frigate
#

Perhaps

humble tulip
#

learn rust?

#

y or n?

buoyant viper
#

this doesnt run too terribly tbh

#

why the fuck is there optifine zoom

solemn frigate
#

The dev of eaglercraft specifically included it so people wouldn’t complain about it

buoyant viper
#

oh, its a little buggy

#

might be a firefox thing, webgl on FF isnt the greatest

#

i took fall damage and the game crashed

#

nice

sterile token
#

It is possible using the component api, to add a click event that when clicked executes code, instead of actions pre-defined by the component action.

worldly ingot
#

I'd imagine IJ has something similar'

humble tulip
#

didn't i explain how to do this earlier?

worldly ingot
#

I added java.awt.List specifically but I realize that I can also just enable the java.awt.* package filter

humble tulip
#

here @sterile token

worldly ingot
#

There are open source continuations of the Nashorn engine among other JS engines that have support for ES6

sterile token
#

Because what if the player doesnt have permission?

humble tulip
#

you intercept the command with commandpreprocessevent

#

iit's not a real command

#

the command will look like /<fixed random string> <random uuid>

#

gonna just create it

#

cuz i wanted to do this for a while

sterile token
#

Oh never realize that

worldly ingot
#

PlayerCommandPreprocessEvent runs even for commands that don't exist

#

So if you write a command that would be relatively unique to you, (e.g. yourplugin:command_that_does_an_action), then you can do whatever you want

humble tulip
sterile token
#

Wait

#

you broken my brains

humble tulip
#

How

#

show how you create the component

#

and i'll guide u

buoyant viper
buoyant viper
#

and GraalJS iirc

worldly ingot
#

Rhino is a good one, yeah

worldly ingot
#

Eclipse lets you do it on a project-by-project basis so I'd just disable it for that one specific project

buoyant viper
#

o

sterile token
#
TextComponent component = new TextComponent("My awesome text");
text.setClickEvent(new ClickEvent(CLickEvent.Action.RUN_COMMAND, "/tp " + player.getName() + Utility.format(region.getCuboid().getCenter()));
humble tulip
#

generate a uuid with UUID.randomUUID()

#

check if the map contains it (1 in a trillion so i'm not sure if it's necessary)

#

if it doesn't, you can store the uuid and the code u wanna execute when the component is clicked

#

then set the command to /<pluginname>:<uuid>

#

listen to playercommandpreprocessevent

#

see if command starts with <pluginname>:

#

if it does, split at :

sterile token
#

My question, why the event doesnt allow you to directly pass a void or a lambda expresion

#

πŸ€”

humble tulip
#

when the click is done, the client automatically executes the command

#

it's not like spigot can detect the click

warm light
#

can a player change his/her name when on a server?

humble tulip
#

when on the server itself

#

no

#

BUT some plugins do it

#

even though they shouldn't

quaint mantle
humble tulip
#

because a player's name is expected to stay the same for a single session

#

the display name can change

#

but their name itself shouldn't

warm light
#

okay thanks

tender shard
#

which swing element would be the best to display logs etc? Basically like the console in intellij?

#

sth like this

humble tulip
#

the notepad looking one?

tender shard
#

yeah

#

I guess JTextArea but that one looks so weird

humble tulip
#

can u send how it looks?

tender shard
#

I dont have any yet, I'll try it now

sterile token
torn shuttle
#

@echo basalt The spice must flow


    //Get locations in zone
    protected Collection<Location> getZoneLocations(ScriptActionData scriptActionData, ScriptTargets actionTarget) {
        //Get the locations from those zones
        return switch (actionTarget.getTargetBlueprint().getTargetType()) {
            case ZONE_FULL ->
                    consolidateLists(generateShapes(scriptActionData).stream().map(Shape::getLocations).collect(Collectors.toSet()));
            case ZONE_BORDER ->
                    consolidateLists(generateShapes(scriptActionData).stream().map(Shape::getEdgeLocations).collect(Collectors.toSet()));
            case INHERIT_SCRIPT_ZONE_FULL ->
                    consolidateLists(generateShapes(scriptActionData.getInheritedScriptActionData()).stream().map(Shape::getLocations).collect(Collectors.toSet()));
            case INHERIT_SCRIPT_ZONE_BORDER ->
                    consolidateLists(generateShapes(scriptActionData.getInheritedScriptActionData()).stream().map(Shape::getEdgeLocations).collect(Collectors.toSet()));
            default -> new ArrayList<>();
        };
    }
tender shard
#

Yaaay I fixed all the swing issues I had so far

torn shuttle
tender shard
#

thank you

compact haven
#

erm

#

to use Bukkit operations like opening an inv

#

I guess I can't use CompletableFuture#thenAccept?

#

like I thought thenAccept will run on the current thread, being Bukkit's main thread, no?

tender shard
#

you can just use the scheduler

#

thenAccept(o -> { Bukkit.getScheduler().runTask(...); });

compact haven
#

i dont want to wrap my completablefuture's with another runTask rho

#

that's lame

tender shard
#

well most API methods do ensureMainThread or however it's called

#

at least stuff related to worlds, e.g. spawning or removing entities, changing blocks etc

#

opening an inv, I am not sure

compact haven
#

am I in Bukkit's thread atm?

tender shard
#

you'll just have to try whether this works. However, whether that works could change between spigot/paper and different versions

tender shard
compact haven
#

smh this is so confusing

tender shard
compact haven
#

yeah im on the actual javadocs page and it says that

#

but the debugger seems to make it out that im on a diff thread

tender shard
#

yeah probably the one that completed the future

compact haven
#

my thought process was to do the mongo operations async, then accept the result on Bukkit's main thread

#

is that not how it works 😒

#

OH

#

i think the orange highlight and orange checkmark means that just those methods were on the other thread

#

okay next problem

#
[23:12:34 INFO]: [org.mongodb.driver.cluster] Exception in monitor thread while connecting to server localhost:27017
com.mongodb.MongoSocketReadTimeoutException: Timeout while receiving message
    at com.mongodb.internal.connection.AsynchronousChannelStream$BasicCompletionHandler.failed(AsynchronousChannelStream.java:263) ~[CPvP-Kits.jar:?]
    at com.mongodb.internal.connection.AsynchronousChannelStream$BasicCompletionHandler.failed(AsynchronousChannelStream.java:233) ~[CPvP-Kits.jar:?]
    at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:131) ~[?:?]
    at sun.nio.ch.Invoker$2.run(Invoker.java:221) ~[?:?]
    at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:113) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.nio.channels.InterruptedByTimeoutException
    at sun.nio.ch.WindowsAsynchronousSocketChannelImpl$ReadTask.timeout(WindowsAsynchronousSocketChannelImpl.java:621) ~[?:?]
    at sun.nio.ch.WindowsAsynchronousSocketChannelImpl$2.run(WindowsAsynchronousSocketChannelImpl.java:656) ~[?:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
    ... 3 more

is this error.. erm how do I get rid of it?

tender shard
#

set a keepAlive thingy

#

do you got a MongoClientOptions object?

#

do socketKeepAlive(true)

atomic swift
#

how do i strip a message of its ChatColor

tender shard
#

ChatColor.strip

#

or sth like that

atomic swift
#

makes sense

tender shard
#

yes lol

compact haven
#

@tender shard do you have an example xd

#

MongoClientOptions doesn't exist

#

I have MongoClientSettings but it doesnt have socketKeepAlive

tender shard
#

what about SocketSettings.Builder or sth?

#

what version of the driver are you using?

#

in 3.6 keepAlive is enabled by default

compact haven
#

4.8.0

#

so my code is the problem

#

I'm ready to just turn it all into sync and make it async myself

#

this is ridiculous this publisher nonsense

unkempt peak
#

Hey, anyone here have expeirence with MerchantRecipe? I'm trying to modify a villagers trades but I've never worked with MerchantRecipies before. When i try to set a recipe with Villager#setRecipe I get the IllegalStateException "No offered ingredients". I am using MerchantRecipe#setIngredients but it doesn't seem to be working, Any idea why? recipe.setIngredients(Arrays.asList(new ItemStack(Material.BOOK, 1), new ItemStack(Material.EMERALD, ThreadLocalRandom.current().nextInt(16, 65))));

compact haven
#

it's not well documented at all

unkempt peak
unkempt peak
tender shard
#

if you call getIngredients() on your on your recipe before adding it to the villager, does it contain the ingredients?

unkempt peak
tender shard
#

it seems like somehow the ingredient list is actually empty

unkempt peak
#

Let me check

#

The list isn't empty: [ItemStack{BOOK x 1}, ItemStack{EMERALD x 48}]

tender shard
#

hmmm that makes no sense

unkempt peak
#

Got that from this List<ItemStack> ingredients = Arrays.asList(new ItemStack(Material.BOOK, 1), new ItemStack(Material.EMERALD, ThreadLocalRandom.current().nextInt(16, 65))); recipe.setIngredients(ingredients); System.out.println(ingredients.toString());

tender shard
#

oh no

unkempt peak
#

wait hold on

tender shard
#

do System.out.println(recipe.getIngredients())

unkempt peak
#

Same thing

#

[ItemStack{BOOK x 1}, ItemStack{EMERALD x 52}]

tender shard
#

eyo

unkempt peak
#
                recipe.setIngredients(ingredients);
                System.out.println(recipe.getIngredients());```
tender shard
#

here's your problem

unkempt peak
#

wait I'm dumb

tender shard
#

dude got me searching through NMS for 5 minutes lol

#

you create a new recipe instead of using your existing recipe lol

unkempt peak
#

God I'm dumb sometimes

#

Lmao thanks for the help, sometimes you just need another set of eyes

#

I was very confused for a minute

tender shard
#

np πŸ˜„

compact haven
#

How can I set a skull's ItemMeta to have a custom texture/from the base64?

compact haven
#

you know what's funny

#

I've actually done that without using your blog

#

(I had a bit of help in PaperMC for the createPlayerProfile in Bukkit, is that new?)

tender shard
#

1.18

compact haven
#

ah yep

unkempt peak
#

Hey do you know if there is any way to get a villagers gossips without nms?

worldly ingot
#

There was a PR waaaay back in the day but it never got merged

#

So no, only NMS at the moment

unkempt peak
#

Ok thanks

worldly ingot
#

Though if you want to PR a more modern API, definitely welcome to

#

?contribute

unkempt peak
#

Hey choco do you know where the price multiplier for villagers is calculated?

humble tulip
#

i can tell you where it's calculated

#

i have craftbukkit src open

#

looking into creating a gossip api btw

unkempt peak
#

Oh nice

#

Yeah I'm trying to find where it's calculated

humble tulip
#

how do you get it though?

#

or is there no way to get it?

#

damn

unkempt peak
#

I'm referencing the mappings fabric provides and I am looking at the villager class and there is a prepareOffersFor method ```private void prepareOffersFor(PlayerEntity player) {
int i = this.getReputation(player);
if (i != 0) {
Iterator var3 = this.getOffers().iterator();

        while(var3.hasNext()) {
            TradeOffer tradeOffer = (TradeOffer)var3.next();
            tradeOffer.increaseSpecialPrice(-MathHelper.floor((float)i * tradeOffer.getPriceMultiplier()));
        }
    }

    if (player.hasStatusEffect(StatusEffects.HERO_OF_THE_VILLAGE)) {
        StatusEffectInstance statusEffectInstance = player.getStatusEffect(StatusEffects.HERO_OF_THE_VILLAGE);
        int j = statusEffectInstance.getAmplifier();
        Iterator var5 = this.getOffers().iterator();

        while(var5.hasNext()) {
            TradeOffer tradeOffer2 = (TradeOffer)var5.next();
            double d = 0.3D + 0.0625D * (double)j;
            int k = (int)Math.floor(d * (double)tradeOffer2.getOriginalFirstBuyItem().getCount());
            tradeOffer2.increaseSpecialPrice(-Math.max(k, 1));
        }
    }

}```
humble tulip
#

whatya typing

unkempt peak
#

The getPriceMultiplier just goes back to TradeOffer and I don't know where the TradeOffer classes are initialized for the trades

humble tulip
#

wait you mean you wanna know how tradeoffers are generated

#

or in this case merchantrecipes

unkempt peak
#

Right but where is the special price generated

humble tulip
#

you mean the base price?

unkempt peak
#

I want to get the value i need to multiply the base cost by

#

actually wait that won't quite work how I want it to

#

Ok so I am adding a custom trade to villagers on VillagerCareerChangeEvent when they become a librarian and I want to apply the price multiplier like the vanilla trades have, what is the best way to do that?

#

Ah so it seems MerchantRecipe does have a priceMultiplier arg but what's the best way to get that value

humble tulip
unkempt peak
#

Yeah I am looking for where the priceMultiplier is calculated based on the villagers gossips

humble tulip
#

ohhh

#

now i see

unkempt peak
#

Is that in EntityVillager?

humble tulip
#

nah

#

dw

#

lemme look around a bit more

unkempt peak
#

Wait could I just use getOffers and use the getPriceMulitplier method from one of the offers?

compact haven
#

@remote swallow

java.lang.ClassCastException: class org.bukkit.configuration.MemorySection cannot be cast to class java.util.Map (org.bukkit.configuration.MemorySection is in unnamed module of loader java.net.URLClassLoader @504bae78; java.util.Map is in module java.base of loader 'bootstrap')
    at me.epic.betteritemconfig.BetterItemConfig.fromConfig(BetterItemConfig.java:176) ~[CPvP-Kits.jar:?]
    at

values.put(id, new SelectionItem(itemSection.getInt("display_slot"), BetterItemConfig.fromConfig(itemSection.getConfigurationSection("item"))));

Am I doing something wrong :<

humble tulip
#

this is for librarian i assume

river oracle
#

Wtf lol

#

Nooooo

humble tulip
river oracle
#

It's hard coded :(

humble tulip
#

oh

#

lol

#

i thought i got it wrong

humble tulip
unkempt peak
#

Wait but how does that work with the gossips?

#

Is it just 0.2 more if the gossips are negative or what?

snow compass
#

Seams this issue will stay in spigot or no one cares about making recipes because how broken the system is.

humble tulip
#

seems to be that way

unkempt peak
#

So I just need to pass in 0.2 to the priceMultiplier of MerchantRecipe then?

humble tulip
#

idk what other types of villagers there are btw but all villagers seem to use 0.2 except for 2 types

#

i cant tell u what the types are sinced they're named a and b

humble tulip
#

can't u use spigot?

unkempt peak
#

No just the normal way with org.bukkit.inventory.MerchantRecipe

humble tulip
#

ah ok

unkempt peak
#

Thanks for the help, 0.2 seems to work

#

I have no idea why it's hardcoded like that but whatever

tender shard
#

it works when it downloads maven the first time, but after that it's just empty D:

humble tulip
#

@unkempt peak

#

so i'm working on the gossip api

#

what should i call the interface that represents all of a villagers gossip data?

#

we could just go the nms way and use Reputation?

unkempt peak
#

That seems logical to me

tender shard
#

call it Swagness

humble tulip
#

should there be Villager#getReputationData#getReputation(Player)

compact haven
#

alex can i borrow ur eyes

humble tulip
#

or just Villager#getReputation(Player)?

#

i feel like the second one right?

tender shard
#

not sure, I'm going for a smoke and then I gotta sleep, it's 7 am and the chimney dude comes at 1pm

unkempt peak
#

I'd say the latter

compact haven
#
    public Map<String, SelectionItem> loadoutItems() {
        Map<String, SelectionItem> values = new HashMap<>();

        ConfigurationSection section = getConfig().getConfigurationSection("kit-items");
        for (String id : section.getKeys(false)) {
            ConfigurationSection itemSection = section.getConfigurationSection(id);
            int displaySlot = itemSection.getInt("display_slot");
            ItemStack item = BetterItemConfig.fromConfig(itemSection.getConfigurationSection("item"));

            values.put(id, new SelectionItem(displaySlot, item));
        }

        return values;
    }
java.lang.ClassCastException: class org.bukkit.configuration.MemorySection cannot be cast to class java.util.Map (org.bukkit.configuration.MemorySection is in unnamed module of loader java.net.URLClassLoader @504bae78; java.util.Map is in module java.base of loader 'bootstrap')
    at me.epic.betteritemconfig.BetterItemConfig.fromConfig(BetterItemConfig.java:176) ~[CPvP-Kits.jar:?]
    at us.cpvp.kits.CPvPKits.loadoutItems(CPvPKits.java:79) ~[CPvP-Kits.jar:?]

what's going on here?

humble tulip
compact haven
#

well let me borrow just an eye then xd

tender shard
#

how does the config look like?

humble tulip
#

and you should be able to get each one

compact haven
#
kit-items:
  healing_potion:
    display_slot: 0
    item:
      type: potion
      amount: 1
      effects:
        STRENGTH: 3 ; 60
  diamond_sword:
    display_slot: 1
    item:
      type: diamond_sword
      amount: 1
      enchants:
        mending: 1
        sharpness: 3
humble tulip
#

so if i were to create a ReputationData class, what should it be called?

tender shard
#

which line is BetterItemConfig 176, and what's CPvPKits 79?

humble tulip
#

it should be called gossips πŸ™‚

compact haven
#

:79 -> ItemStack item = BetterItemConfig.fromConfig(itemSection.getConfigurationSection("item"));

#

as for line 176 of BetterItemConfig..

tender shard
#

just Ctrl+B into it

compact haven
#

in github it's builder.potionEffects(potionEffects);

#

in intellij's decompiler,,, it aint even in the method I'm calling

unkempt peak
#

Yeah you could have Gossip class that has that data and the getReputation player can return a list of Gossips

compact haven
#

that's why im so confused

tender shard
#

you got the github link?

compact haven
unkempt peak
#

Like an enum GossipType with the gossips value and decay or whatever

compact haven
#

ah it could be this alex?
for (Map.Entry entry : ((Map<String, Object>)itemMap.get("enchants")).entrySet()) {

#

he's casting a configurationsection to a map right there

#

or no

#

an object to a map

tender shard
#

yes, or this: (line 170 on github)

compact haven
#

well that's an object as well

#

my head hurts :C

tender shard
compact haven
#

could it be that something changed?

#

his gradle build is compiling against 1.17.1

#

am in 1.19.3

tender shard
#

i gotta go to sleeep

compact haven
#

but like.. this doesn't seem like a highly changing API

tender shard
#

bb

compact haven
#

gn :<

#

I need sleep as well

#

ty alex

solemn frigate
#

how would i repeat something in my code until a condition is met?

#

ive tried bukkit runnable's runTaskTimer but it seems that the server is skipping it and going to the next code for some strange reason

humble tulip
#

are you on the main thread?

solemn frigate
#

yeah

#

does run task timer run that code until it gets cancelled and then moves ahead or does it move ahead while also running that code?

eternal oxide
#

you can't halt your code and wait for a task to finish

solemn frigate
#

oh

eternal oxide
#

you run a timer and when yoru condition is met you run the code you want

humble tulip
#

It's just not reccommend for spigot

#

Your main thread shouldn't wait for anything to be done async

compact haven
#

me laughing in Thread.sleep()

tardy delta
#

Real pro's use Unsafe#park

quaint mantle
#

?paste

undone axleBOT
sour aurora
#

is there any way I can instead code and compile spigot plugins without using and IDE

#

using maven or gradle or whatever

#

is there any tutorial for that?

round finch
#

mathematical notation

#

i just figured out

worn tundra
#

You could always use maven with the terminal

#

and type the commands out there

round finch
#

I don't have enough math knowledge but my wish is to write math formulas into java code

sour aurora
sour aurora
worn tundra
#

The default maven commands my guy

#

Just google "maven" xd

round finch
#

maven is pretty neat

#

fast libraries

hybrid spoke
#

simplify in what way

#

functionality, readability, cleanyness...?

#

debugging?

#

improving?

#

well the core functionality would stay the same

#

what you can do is: add logs, use Optional, make the parameters non null, fail fast, comment your code, dont just throw in an entire codeblock, ENTER exists

#

or even the smallest stuff like: is the database connected?

eternal night
#

also, as a heads up, you are closing the statement before returning it

hybrid spoke
#

descriptive names, not just glue your code together

eternal night
#

your method barely makes sense as is

eternal night
#

yes

hybrid spoke
#

oh read that wrong

eternal night
#

that method returns you a closed prepared statement

#

idk what the point of that is

quaint mantle
#

does anyone know what this.bP.a(0,new PathfinderGoalMeleeAttack(this, 1,true)); (from 1.17.1 EntityZombie) is in 1.18.2?

#

or similar

eternal night
#

that is still returning a closed statmenent

#

your try-resource block closes before the method ends ?

#

that is the entire point of it

#

yea

#

not building a rather useless method like this tbh

#

idk what kind of monsters of SQL queries you are writing

#

but like

#

this saves you, 3-4 lines ?

#

maybe ?

#

sure

#

now your caller has to try-resource

wet breach
#

Shouldnt use throws if you are able to handle the error unless you want the user to handle or should

#

Also why are you using generics?

#

Then you should just handle it in the method

glossy venture
#

anyone know how i can still do this?
rewriting all data classes as non records would suck

for (int i = 0; i < l; i++) {
    Field field = declaredFields[i];

    Class<?> type = field.getType();
    FieldData data = new FieldData(ObjectSerializer.getPrimitiveType(type),
            ObjectSerializer.unsafe.objectFieldOffset(field)); // err here
    fieldData[i] = data;
}
tardy delta
#

Trying to Instantiate records?

glossy venture
#

doesnt work with records

glossy venture
#

component

#

which is a field afaik so i dont get why it wouldnt work

#

but ig ill have to create a seperate prototype for those then

tardy delta
#

Uhh

glossy venture
#

one ms per pass to deserialize an array of 500 objects

#

pretty decent i think

#

bruh nvm object input stream faster

tardy delta
#

Lol

glossy venture
#

certified bruh moment

#

ok with one object, not an array, object input stream is much slower

echo basalt
gray merlin
#

on runTaskTimer, what's delay and what's period?

remote swallow
#

Delay is before it runs, period is how often

gray merlin
#

thank you

#

i completely forgot about that

#

could've been delay and frequency tho.

subtle folio
#

there aren’t many good words that could describe it better

ivory sleet
gray merlin
#

yep

compact haven
#

alex and I tagged you abt a problem last night, you were probably asleep; once you get a chance can u take a look and just lmk if I'm doing something wrong

remote swallow
#

dafork

#

i didnt see a ping in here when i woke up

compact haven
#

Am using 1.19.3 without the NMS imports, incase I need em

#

did u leave your Discord open in this channel?

remote swallow
#

closed discord and turned pc off

#

one sec

remote swallow
#

ahh

#

does the item have effects by chance

compact haven
#

Yep! Potion effects

remote swallow
#

send the config

#

im guessing i fucked up the to config formatting stuff

compact haven
#
kit-items:
  healing_potion:
    display_slot: 0
    item:
      type: potion
      amount: 1
      effects:
        STRENGTH: 3 ; 60
  diamond_sword:
    display_slot: 1
    item:
      type: diamond_sword
      amount: 1
      enchants:
        mending: 1
        sharpness: 3
#

mm perhaps it's INCREASE_DAMAGE instead

#

I could'nt even narrow it down to what line was causing the error so didn't even think about the enum matching for effects

remote swallow
compact haven
#

mm

#

that also shouldnt make that error anyways tho

#

the casting, it's super weird

remote swallow
#

its comming from this

#

specificly the entry set of effects

#

ah i think ive figured it out

#

a config section is a MemorySection and i dont call the value stuff on that section

#

i just call entrySet

compact haven
#

but you use .get() then cast, no?

#

which'll return as an Object

#

ah yk what it is, that's exactly why

remote swallow
#

memory sections are weird

compact haven
#

the Object is an instance of MemorySection

#

welp you figured it out

remote swallow
#

yeah one sec, ill update it

compact haven
#

ty!

remote swallow
#

i think ive fixed it, just gonna get the test project up and test it

compact haven
#

Many thanks aha, glad it didnt work tho because I would've been up for longer

remote swallow
#

lol

compact haven
#

put a good stop to my 5+ hours of debugging last night (unrelated problems)

fallow violet
#

in spigot 1.8 there is no ItemStack#setLocalizedName so is there any other method? (I use it to detect the specific item)

river oracle
#

Nms probably

fallow violet
#

damn

#

but what if i wanna use it multiversion?

river oracle
#

Old api no new api support

fallow violet
#

how u detect items in 1.8? without nms

river oracle
#

Just use maven modules

#

Use a non legacy version and it'll be easy

chrome beacon
fallow violet
#

damn hate this api

chrome beacon
#

Update then

fallow violet
#

wow nice xdd

#

imagine using 1.19 api on 1.8 server

#

wait

#

does this work

river oracle
#

Imagine using a 1.8 server

#

No it doesn't work

fallow violet
chrome beacon
tender shard
tender shard
fallow violet
#

so i cant use setLocalizedName

tender shard
#

what does that even do?

kind hatch
#

setLocalizedName is supposed to be used for servers that have a different language set. It represents the name for the language being used.

tender shard
#

but from what I know, the client never sees the localized name

kind hatch
#

AFAIK, it does get sent to the client, it just depends on how it's applied to the item. However, I know very little about it to begin with.

#

I just know people use it for a quick and easy way to add unique data.

tender shard
#

yeah I've also read about that lol

#

I wonder why they don't just use PDC

kind hatch
#

It didn't exist back then.

tender shard
#

anyway, still better then using the lore lol

kind hatch
#

I am also guilty of misusing it. lol

#

PDC came in clutch.

tender shard
#

yeah I also only learnt about PDC in 1.16

#

when it was already added in 1.14 / kinda added in 1.13

molten hearth
#

bruh

#

wait wrong channel

#

sheeit

sterile token
#

I think thats the correct name

tender shard
#

what does isSimilar(ItemStack) have to do with saving custom information in an item?

#

also legacy versoins are outdated versions that should be dead

#

1.8 is so old, it's old enough to sign contracts in germany

wet breach
#

?1.8

undone axleBOT
wet breach
#

or is this some sarcasm lol

tender shard
#

under certain circumstances that is, ofc

#

Β§Β§ 107ff, 110 BGB

wet breach
kind hatch
#

Lol, why is the age so low?

tender shard
#

well why should an 8 year old not be allowed to buy sweets in a supermarket

wet breach
#

in the US, minors can not enter into contracts without parent consent or a guarantor

glossy venture
#

probably with parental permission

tender shard
#

imagine being 17 and you wanna buy a bottle of water but you cannot do that without parent's permission lmao

#

that's kinda weird

glossy venture
#

you need to sign a contract to buy a bottle of water?

tender shard
#

no, almost all contracts are valid without signature

wet breach
#

No, but it is implied as they are so called rendering services

glossy venture
#

so its not signing

tender shard
#

a contract is merely proposition and acceptance

kind hatch
tender shard
#

almost everytime, a signature is not needed for a contract to "work"

glossy venture
#

what

tender shard
#

"yo do you wanna buy my car for 20k€?" - "yes".
that's already a valid, enforcable contract

wet breach
#

there is such things as verbal contracts

tender shard
#

Β§ 125 BGB says that in general, no "form" (such as written contract) is needed

glossy venture
#

unless they clearly accept the terms by performing the action, im pretty sure you cant just write a document saying some shit directed at someone random and it will work

tender shard
sterile token
tender shard
tender shard
sterile token
glossy venture
#

yeah

wet breach
#

also in the US contracts in general are only valid if there is some kind of value that is recognized by law

sterile token
kind hatch
# tender shard that's obviously a buying contract

Ehhhh, not the way it's viewed over here in the states. While I can see the reasoning behind it, I'm not sure I can 100% agree with it. While sales are may technically be a contract, it's pretty cut and dry. It's an exchange. It shouldn't require extra laws to ensure that minors can spend their money.

glossy venture
#

the law is enough contract

#

no need for a contract on sales

wet breach
#

the US does in indeed have laws covering the exchange of money for goods and does state its an implied contract for goods

tender shard
tender shard
tender shard
#

you guys seem to confuse the word "contract" with "written contract"

harsh badge
#

I’m using my own plugin for lightspigot (a custom fork) and for some reason my plugin works perfectly fine on spigot but I get this error when using the custom plugin. Does anyone know why? https://pastebin.com/xGYq4yRW

wet breach
#

if it isn't an item its a service

sterile token
#

oh ok

#

now makes sense, tho, because without context i dont really understand

wet breach
tender shard
#

yeah

tender shard
harsh badge
tender shard
wet breach
tender shard
#

all I can tell you is that "cmd" is null in PingCOmmand line 24

harsh badge
#

Do u know any forks to fix 1.8 pvp hit reg then?

tender shard
wet breach
tender shard
wet breach
tender shard
#

then just pretend it

#

lol idk I dont go to rave parties

#

but my best friend always comes home totally wasted at 1pm the next day

wet breach
#

from them?

tender shard
#

yeah

wet breach
#

interesting, anyways reason being I want to go to one is because from my listening experience of techno

#

German techno routinely tends to be better

#

also, them clubs for techno seem to be like 10x better then the ones in the US

proven sierra
#

Can you add extra rows of hearts with a plugin in later versions? (ie does increasing max health of a player display clientside now?)

wet breach
#

not entirely sure

#

but it has always been a client side limitation, so I would imagine a datapack probably could solve it

tender shard
proven sierra
tender shard
#

yes, I'll send you a screenshot in a few minutes

#

I gotta code it first

proven sierra
#

that's what I'm after, I just need to figure out if I can make this a plugin or need to make a mod

#

cheers, appreciate it massively ❀️

tender shard
#

k thats a bit much

#

wait

kind hatch
#

Oh yea alex, did you ever figure out that issue with your GUI that you're making?

tender shard
kind hatch
#

Oh cool. What was it? I was messing around with it and I couldn't figure out why resizing it was adding extra padding.

#

The best I was able to get it was this.

tender shard
#

i dont know what the issue was. I rewrote it from scratch, one JFrame with a JTabbedPane. every tabbed pane is a JScrollPane with a JPanel inside that has a GridBagLayout (or BorderLayout for the Generate tab)

remote swallow
#

you should totally add better item config when i finish it

tardy delta
#

can you like use css with smth graphical in java?

kind hatch
#

Huh, then I might have been going down the right path.

#

I had to put the tabs in their own containers/panels so that they would stick to the left.

wet breach
#

at that point might as well just not use it

kind hatch
tardy delta
#

oh thats a no

tender shard
#

JavaFX does many things using css and stuff

sterile token
buoyant viper
#

at least i think javafx

tardy delta
#

hmm was just wondering

wet breach
#

have to shade it or include it with your app

#

or just hope they have it installed

buoyant viper
#

true

sterile token
wet breach
#

which it did speed up JDK development as they wanted to

kind hatch
#

Does anyone know how the leak detection threshold works in hikari? I keep getting the Apparent connection leak detected warning and I just don't know why it's happening. The threshold is 30 seconds and I get it more or less after the plugin loads. From what I've found, it might just be a warning, but ideally it wouldn't be throwing them in the first place.

wet breach
#

leak detection works by detecting the time outs

#

basically what it is for is detecting when you are not closing connections

#

to close a connection properly you have to use the hikari API to close it

#

I personally don't like hikari

kind hatch
#

That's the thing though. I am closing connections. From what I've been reading, the warning is there to let you know that one of the connections has been out of the pool for longer than the threshold. Apparently in some cases, it's queries that are taking too long, but I don't believe that I'm even sending queries on startup.

wet breach
#

I recommend giving BoneCP a try

#

its the predecessor of Hikari but it works just fine. Caveat is that it isn't actively developed anymore and some people will tell you using something that doesn't have support is bad lol

#

but I think it works better then Hikari and has a nicer more intuitive API

tardy delta
#

hikari is just like making a connection pool and asking a connection from it, simple isnt it?

kind hatch
#

Hmm, the weird thing is that if I remove the threshold it doesn't throw the error. However, that makes me wonder if it's still happening in the background. The only issue I have with it is its lack of clarity. I'm closing the connection, so that leaves how long the query is taking. Which they should be short, but very frequently sent. Maybe I should try other config options?

wet breach
#

there is a command in MySQL that lets you see the statistics in regards to queries

#

specific statistic you would be interested in, is mysql calls them slow queries

kind hatch
#

What's the command?

tender shard
wet breach
#

just run the mysqltuner script

#

it will help you optimize your db server as well as show you some stats

#

the link alex gave is pretty good too

kind hatch
#

Yea, I was reading though that and from what I've been checking, it doesn't look like I have slow queries.

wet breach
#

Well give mysqltuner script a try

#

I doubt you actually have any problems in regards to your queries and it is just hikari

kind hatch
#

Yea, looking though the script, the recommendations are minimal. Also, a lot of failed tests. Probably due to it being for personal use.

#

But, I did see a slow queries stat and it was 0%.

#

Highest usage of available connections: 33%

#

So wtf is wrong with hikairi?

wet breach
#

helps with statistic gathering and reading

robust mulch
#

how can I fix this ?
'java.util.Collection org.jetbrains.idea.maven.server.MavenServerEmbedder.resolveProject(java.util.Collection, java.util.Collection, java.util.Collection, org.jetbrains.idea.maven.server.security.MavenToken)'

tender shard
#

show the full stacktrace

wet breach
#

to resolve the hostname

kind hatch
wet breach
#

in the event the DB server is used only on localhost, then you should have that set anyways and just use the localhost ip

wet breach
#

its not typically version dependent

wet breach
#

seems that it is included in mysql

#

already after those versions

#

just need to run mysql --initialize

#

however not sure if that would hurt your DB server if you ran it

kind hatch
#

Well apparently it doesn't exist anymore. :p

#

Guess I gotta figure out how to run that other script.

wet breach
#

you don't run it inside the mysql console

#

you need to invoke mysqld with that argument

kind hatch
#

I wasn't in the console when I ran that command.

glossy venture
#

tf?
a field named this$0?

#

ooh

#

wait prob because its not static

wet breach
harsh badge
#

Anyone know how to use the Lunar API in order to disable freelook?

river oracle
#

Shouldn't you ask lunar they have a discord

kind hatch
wet breach
#

it refers to the daemon. You do have mysqld installed otherwise you wouldn't have a DB server lmao

kind hatch
wet breach
#

but

#

bin/mysqld --initialize --user=mysql

#

user being whatever is your user

kind hatch
#

No such file or directory. lmao

buoyant viper
harsh badge
#

I’ll ask in their discord

wet breach
kind hatch
#

I did install the sys script. Although looking that the documentation, it looks like it just runs a bunch of scripts that generates tables that you have to search through yourself.

wet breach
river oracle
kind hatch
#

Oh, so I need to rerun the tuner script?

wet breach
#

well you can, but I thought you were referring to the sys schema stuff

#

either way, once you have sys schema if you ever decide to put it on the mysql server, yes you would re-run the tuner script

#

I recommend running that script every so often to keep tabs on your DB servers performance πŸ™‚

#

servers are meant to be tweaked regularly lol

sterile token
#

So its not possible on TextComponent ClickEvents run some code, instead of any default action?

chrome beacon
#

Make it run a command

#

and then listen for that command

weak bear
#

Hello I try to use vault for my plugin but when I want to use a function that's return that

#
        at fr.spectr2155e.shinobicraft.Main.onEnable(Main.java:62) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:316) ~[server.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [server.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:412) [server.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugin(CraftServer.java:476) [server.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.enablePlugins(CraftServer.java:394) [server.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.reload(CraftServer.java:866) [server.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
        at org.bukkit.Bukkit.reload(Bukkit.java:301) [server.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23) [server.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:181) [server.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServer.java:767) [server.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchServerCommand(CraftServer.java:753) [server.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]```
sterile token
weak bear
#

Java null Pointer Exception

remote swallow
#

?npe

undone axleBOT
#

The NullPointerException, (commonly referred to as NPE), is thrown in the following cases, but not sealed to: 1. null is passed into a method or constructor which does not allow it; 2. When trying to access a field on an object pointing to null; 3. Casting null to a primitive. See https://stackoverflow.com/a/3988794/17047120 for information on how to debug NPEs.

remote swallow
#

whats main.java line 62

sterile token
remote swallow
#

tell them not me

weak bear
#

economy.bankDeposit("Spectr2155e", 100);

remote swallow
#

economy or the player is null

weak bear
#

okay

sterile token
#

Wait wait

kind hatch
sterile token
#

I know the problem

#

With vault you must pass an OfflinePlayer, name is deprecated on neers versiosn and wont work

weak bear
#

Okay

sterile token
#

Try that, atleast that is how newest docs are document

buoyant viper
#

this mf usin 1.7.9

sterile token
kind hatch
sterile token
weak bear
#

No that saying that need a String

#

Okay

sterile token
#

Dont you use maven?

weak bear
#

No

sterile token
#

Because maven must told you that you are an old version from the dependency

#

Oh that why, i wouldnt work without any dependency manager like Maven or Gradle

weak bear
#

Okay but I need to use Vault 1.4.1

#

Unfortunatelly

sterile token
weak bear
#

1.7.10 ...

sterile token
#

So you are using legacy versions...

#

πŸ’€

weak bear
#

πŸ˜‚

sterile token
#

haha i understand you tho

#

Im 1.8 dev, but mainly trying to work only on 1.16 up projects

weak bear
#

Yes that's horrible

sterile token
#

Do you want to chat via dms then?

tender shard
weak bear
tender shard
#

Why not at least use 1.7.12

#

Or 1.8.9

#

Or be a normal person and use 1.19.3

buoyant viper
tender shard
#

Everything besides 1.19.3 is outdated

#

And sucks, and not in the good way

buoyant viper
#

something i dont understand abt mc is the distribution of versions ppl stick to

weak bear
#

So did have a solution for my problem ?

buoyant viper
#

1.7.10, 1.8.8, 1.12.2, and then latest

#

and maybe 1.5.2 or 1.6.4 for modded players

tender shard
#

1.7.9 is like this weird slimy grandma from the other side of the road that always stands there and stares into your windows at night but you cant do anything agsinst it because even police is afraid of her. nobody knows whats in her handbag

sterile token
buoyant viper
#

oh wait doesnt spigot 1.8 (like, 1.8, not 1.8.8) support 1.7.10 and 1.8 players?

tender shard
buoyant viper
#

like for some odd reason it had cross version support

kind hatch
# wet breach odd

My installation should be fine even though it's a local install for personal use. Based on the other things I've looked at, I doubt it's an issue with the configuration.

weak bear
#

πŸ˜‚ Yes but that's unfortunatelly not an option

tender shard
wet breach
#

just be nicer if you got to see the pretty data though

#

anyways, its a hikari issue it looks like

harsh badge
#

I can’t find any lunar client API does anyone know how to disable Lunar features using a plugin?

harsh badge
#

I found one on GitHub but it doesn’t work

sterile token
sterile token
undone axleBOT
#

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

remote swallow
harsh badge
#

Yeah it’s not working on my server

remote swallow
#

did you restart, did you add the freelook disable

harsh badge
#

I’ll get the error and put it in a paste. In

sterile token
buoyant viper
#

hes getting the error for us

weak bear
#

My function return false...

        RegisteredServiceProvider<Economy> economy = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
        if(economy == null) this.economy = economy.getProvider();
        return (this.economy != null);
    }```
sterile token
#

Check if your plugin is loaded

weak bear
#

Yes when I using /pl the plugin is here

#

But I think that vault load after my plugin

#

How can I load it before my pl?

kind hatch
# wet breach anyways, its a hikari issue it looks like

πŸ₯² I don't understand. I'll try messing around with some more settings and maybe try out BoneCP as I have used it in the past. However, there shouldn't be a reason why hikari shouldn't work. Maybe I've just written it wrong? My code is far from perfect. ;3

remote swallow
#

make it a depend

weak bear
#

Thx you !

wet breach
wet breach
#

so I have just stuck with bonecp. I am not a fan of changing something when it isn't broken

kind hatch
#

Does BoneCP also have the leak detection?

#

Or is it a lot more barebones? No pun intended.

sterile token
spiral light
#

Guys... i cant find the spigot forum thread for buildtools with mojang mapping stuff ... anyone can help ?

buoyant viper
#

isnt there a uh

#

?nms

buoyant viper
#

oh its offsite

#

@spiral light

spiral light
#

ahhh

#

nice thank you

chrome beacon
#

It's also on every version release post since they were added

buoyant viper
#

true

kind hatch
robust mulch
#

'java.util.Collection org.jetbrains.idea.maven.server.MavenServerEmbedder.resolveProject(java.util.Collection, java.util.Collection, java.util.Collection, org.jetbrains.idea.maven.server.security.MavenToken)'

spiral light
#

Yeah i needed a help for a friend. thank you

robust mulch
sterile token
#

When occurs?

#

Compiling? Runtime? Code itself?

hexed falcon
#

How do i check is this is not null

#

i thought this was how i do it but it's showing errors

harsh badge
keen mantle
#

Interesting, should people try to ask chatgpt instead of asking in forums?

sterile token
kind hatch
kind hatch
# hexed falcon block

Then use the included getter. rayTraceBlocks()#getHitBlock() Just check if that is null.

sterile token
#

If you used to code on Javascript and want to use a Library/Api on Java, i would suggest learning Java, because Javascript is not the same language as java

sterile token
#

noxmil, i would straight suggest learning Java because its totally diff from Javascript

#

Jsut a recommendation, not wondering to be rude

#

You take it as you want, cuz many ppl think Java and Javascript are same lang or have the same sintaxis. But they are not even the same langs

humble tulip
tender shard
#

there is no === operator in java

tardy delta
#

java is as much javascript as car is related to carpet

hexed falcon
tender shard
tender shard
#
if(something == null) // something is null
#

=== does not exist in java

#

= is to assign variables

#

== is to compare identity of objects

#

=== is a syntax error

tardy delta
#

isnt js be like if (!something)

hexed falcon
#

im trying to check if it's not null

tender shard
#

then do ```java
if(something != null) {
// something is NOT null

tardy delta
#

if (!(something == null)) hehe

humble tulip
tardy delta
#

thats what happens when coding at 1am

tender shard
tardy delta
#

bruh its in F again

humble tulip
#

@sterile token were you able to "run code when a component is clicked on"?

tender shard
#

Here's an overly complicated way to check whether sth is null

    public static Boolean isNotNull(@Nullable Object anotherObject) {
        if(!Objects.isNull(anotherObject)) {
            return Logic.UNFALSE.getMyInvertedInvertedValue();
        }
        return !!!Logic.NOT_TRUE.getMyInvertedInvertedInvertedValue();
    }
    
    private enum Logic {
        NOT_TRUE(!true),
        UNFALSE(!!!false);
        
        Boolean myInvertedValue;

        Logic(boolean b) {
            myInvertedValue = !b;
        }
        
        public Boolean getMyInvertedInvertedValue() {
            return !myInvertedValue;
        }
        
        public boolean getMyInvertedInvertedInvertedValue() {
            return !getMyInvertedInvertedValue();
        }
    }
tardy delta
#

oh no

kind hatch
#

Wtf

tender shard
#

KIUCSS principle

kind hatch
#

Does the triple exclamation mark represent anything? Or wouldn't two of them just cancel out?

keen mantle
#
if (anything == null) { //do blablabla }
tender shard
#

true == true
!true == false
!!true == !false == true
!!!true == !!false == !true == false

#

so no, triple exclamation is just another "not" operator

kind hatch
#

Ok, but is there a point to writing it like that?

tender shard
#

none

keen mantle
#
if (t == null) { System.println("Null"); }
kind hatch
#

Then wtf. xD

tender shard
#

there is no point in ever doing that

#

lol

keen mantle
#

.out.

tender shard
#

unless you wanna contribute to terrible-plugin on github

tender shard
sterile token
#

Sorry

tender shard
#

maybe in english, verano

#

no hablo uruganian

sterile token
#

I was copying the answer that minion sent but in spanish to explain my friend what happening

tender shard
#

the only uruguanian words I know are "kitchen roosted" and "wheel"

kind hatch
tender shard
tardy delta
#

dont even see what it does

sterile token
#

Tell that boy, that for loops exists

tender shard
kind hatch
#

The uncapitalized class name. Random kotlin integration. And the cherry on top.

#

This is top tier

tender shard
#

lmao build failing is the best one

#

however last time I cloned it, it compiled just fine

sterile token
#

I never could understand then

tardy delta
#

πŸ’€

sterile token
#

I just know they insert it somwehre

tardy delta
#

i just grab it from a site somewhere

sterile token
#

is there any posiblity to crash OS while using JAva?

#

Or would never be posible, its a question dont kill me

tender shard
tardy delta
#

no

tender shard
tardy delta
#

well not really with std libs

sterile token
#

"std libs"

tender shard
#

and then the index.php takes in the text=asd parameter and turns it into whatever it likes, and returns a png

tardy delta
#

segfault while trying to open browser wouldnt do much ig

#

but windows is weird

molten hearth
#

Just Google build succeeding png and add it

tender shard
sterile token
#

I will keep it

tender shard
#

that's the "maven version abdge"

tardy delta
#

ive literally seen people code like this

tender shard
#

@sterile token I got it from here https://shields.io/ / https://github.com/badges/shields

GitHub

Concise, consistent, and legible badges in SVG and raster format - GitHub - badges/shields: Concise, consistent, and legible badges in SVG and raster format

tardy delta
#

ah i was looking for that site recently

#

bruh they removed the star on my repo

kind hatch
#

Have mercy please. Spamming sounds is the worst thing you could have done.

tardy delta
tender shard
tardy delta
#

πŸ’€ πŸ’€

lapis lark
#

Hello! Does anyone know if there is any way to remap plugin class from obfuscated to mojang-mapped?

From 1.17 we can develop under mojang-mapping and then compile it into obfustaced variant. But I have asked a question to myself, it there any revert way?

buoyant viper
#

feeling like a dumbass trying to figure out why my simple fuckin php wont work

kind hatch
buoyant viper
#
<?php
if ($_SERVER['REQUEST_METHOD'] !== 'POST') return;
if (!isset($_FILES['uploaded_file'])) return;

$uploaded_file = $_FILES['uploaded_file'];
$upload_err = $uploaded_file['error'];
if ($upload_err != UPLOAD_ERR_OK) {
    echo $upload_err;
}

$file_name = basename($uploaded_file['name']);
move_uploaded_file($uploaded_file['tmp_name'], "uploads/$file_name");``` except it doesnt fuckin work for this *one* file i need to move
lapis lark
tender shard
#

quck question:

Bukkit.getPluginManager().callEvent(new SomeEvent());

obviously this will throw an exception when some plugin cannot handle the event properly. But what about:

try {
  // call event
} catch (Exception e) { }

will this also print the stacktrace, or not?

#

I gotta go in 5 minutes so I cannot check rn

buoyant viper
tender shard
quaint mantle
#

Pretty sure callevent doesn't throw any exceptions, just logs them

#

Because otherwise a lot of shit would break if a plugin errors

tender shard
quaint mantle
#

so catching it wouldn't do anything

tender shard
#

that's what I feared

#

yeah

buoyant viper
#

Stash time!

tender shard
#

I'd check it out myself but I literally gotta go in 5 minutes or 10 D:

#

fuck birthdays

kind hatch
tender shard
#

why do people always have one birthday per year? can't it be one birthday every 5 years? we'd also all live much longer

tardy delta
#

answer, no

buoyant viper