#help-development

1 messages · Page 881 of 1

ivory sleet
#

Lmao

torn shuttle
#

have you guys ever taken content down from 9minecraft

tender shard
#

yes

#

but that was like a year ago or even longer

torn shuttle
#

'member how you did it?

tender shard
#

I just wrote to their email, told them "yo this is my project, I have only uploaded it to spigotmc <link> and I don't want some other person to upload it to your site without my permission" or sth, and then it got removed

https://www.9minecraft.net/contact-us/

torn shuttle
#

thanks

#

out of curiosity, I don't even want to try it out but do they even distribute the correct jars or is this just malware

tender shard
#

oh I don't remember whether I even checked the download

chrome beacon
#

I believe it's the correct jar but usually quite outdated

#

They just make a ton of money from ads on the site

torn shuttle
#

yeah these are outdated and worse yet they have automatic hyperlinks based on keywords that link to the wrong software

tender shard
torn shuttle
#

so my spigot page mentions worldedit and has the correct plugin link but here they are automatically directing to client-side worldedit

#

I swear I use my professional game studio email for takedown notices more than anything else

#

guess I made something worth stealing

tame wolf
#

My plugin is on there :/ but we are kind of afraid of writing to them, since previous devs got doxxed by a similar website after asking to take it down

torn shuttle
#

the message limit on gpt 4 is such bs man, come on

eternal oxide
#

lol, they are crack dealers and you are all junkies

cobalt sphinx
#

Hey! Does anyone know if there is EnderDragon death event? Is it separate from Entity Death event?
I'd like to create a plugin that places dragon egg every time dragon is killed.

Maybe there already is some API I could use.
If not, then I probably could iterate blocks at "0,0" and start Y from 0, going up and check if it's bedrock and if bedrock next block is not bedrock then place dragon egg on next block.

cobalt sphinx
# cobalt sphinx Hey! Does anyone know if there is EnderDragon death event? Is it separate from E...

Something like this:

Location egg = null;
for (double y = 0.0D; y < 256.0D; y++) {
    Location loc = new Location(world, 0.0D, y, 0.0D);
    Location loc2 = new Location(world, 0.0D, y + 1, 0.0D);
    if (loc.getBlock().getType() == Material.BEDROCK && loc2.getBlock().getType() != Material.BEDROCK) {
        egg = loc2;
        break; // Exit loop early since condition is met
    }
}

if (egg != null) {
    egg.getBlock().setType(Material.DRAGON_EGG);
}
#

Or maybe there is easier way to get egg location? Without iteration?

river oracle
#

Like??

#

Last I checked they were all scheduled

#

?jd-s

undone axleBOT
river oracle
# river oracle Like??

Ig you're right I'd use runTask they do the same thing. Maybe those are missing the deprecated tag is my guess

dapper harness
#

is there an event that's called when the player right clicks with an armor in their hand to equip it ? or do we need to use player interact event

flint coyote
river oracle
flint coyote
#

Sounds hacky but guess imma do it

chrome beacon
#

You can always filter by name

river oracle
#

That's not hacky at all :P another alternative is to get the values and run a boolean check isLegacy

flint coyote
young knoll
#

Pretty sure the legacy ones won’t be in the enum if you have an api version set

flint coyote
#

They are when accessed via reflection since the enum hasn't got a fixed type. But I'll filter by name I guess. Can save that in a static variable.

young knoll
#

?

#

Why do you need reflection

flint coyote
#

Because it could be any enum. I'm basically trying to map a unique material to each enum value using the enum values hashcode

#

or "unique" since obviously if there would be too many options it can't be unique

young knoll
#

Am confusion

#

Is it any enum or the material enum

flint coyote
#

It's any enum but I want to display all options in a GUI inventory and therefore want to map materials to the gui buttons

young knoll
#

I see

#

Anyway, yeah legacy stuff is at the end

#

The first one is legacy air, so any ordinal after that is legacy

river oracle
#

Can't wait for ItemType

flint coyote
#

I'll just check if the enum is a material enum and give that a special handling so I can use the non-reflection way

young knoll
#

Im surprised values() isn’t part of Enum

flint coyote
#

Yeah all you got is
#.getEnumConstants()

river oracle
#

Wdym enum has a values call I stg it does

young knoll
#

Not in the base class

river oracle
#

Unless for the past 3 years I've been hallucinating this

flint coyote
#

Not the abstract enum class

river oracle
young knoll
#

Idk

#

Compiler magic

river oracle
#

Method Handles are pretty much just as fast

young knoll
#

Idk will the asm catch that

tardy delta
river oracle
wet breach
#

its an Enum function

flint coyote
wet breach
tardy delta
flint coyote
flint coyote
wet breach
#

Well not sure if its because of generics, but ord and values are both functions of enum

flint coyote
#

Since only values() is overwritten

hazy parrot
wet breach
#

mmm right I suppose it does make a difference between after and before compiling lol

shadow night
wet breach
#

and then extend that class that simulates being an enum

shadow night
#

hmm

#

I just tried extening and I just can't extend

#

it just won't let me

wet breach
#

One thing an enum can do

#

is implement

young knoll
#

I’ve discovered a small hatred for records

wet breach
echo basalt
#

records were never useful

#

change my mind

tardy delta
#

they reduce the bytecode size though

flint coyote
#

They are as object holders

wet breach
tardy delta
#

they do, their equals/hashcode/toString/etc implementation needs to be generated through a bootstrap method at runtime

#

thus the compiler doesnt generate those methods

#

apart from that..

young knoll
#

Yeah they are nice holders

#

Buttttt

wet breach
#

because I don't think it ever was lol

young knoll
#

When we develop api we often need to modify things that Mojang has made private or final

tardy delta
#

if youre concerned about milliseconds of vm startup times, otherwise it isnt

young knoll
#

Normally we can just patch the variable/method

#

Can’t do that with a record

young knoll
#

So I had to wrap the entire thing with a normal class

tardy delta
wet breach
#

not sure if traditional ways was or is bloat

river oracle
#

Records are nice as long as you're not patching them

#

Then they are not nice

wet breach
#

well, I don't have a particular use for them unfortunately

#

however I don't really care that they exist either lol

#

same goes with lambda's I don't really use them

river oracle
#

They're only useful for immutable data which isn't super common depending on how you code

tardy delta
#

for me its a way to compensate the lack of tuples

river oracle
slender elbow
#

Executor async = task -> scheduler.runTaskAsync(plugin, task)

tardy delta
#

could probably get it to work in kotlin, where there are destructuring semantics

river oracle
#

Should work for most cases

tardy delta
#

if only we had template <typename... Args> generics

river oracle
#

I love how Marco forgot what a tuple was

tardy delta
river oracle
#

Isn't that all that really matters

river oracle
echo basalt
#

fuck dedicated classes we tuplin

tardy delta
river oracle
#

Oh my lord

#

Need to look at the blame so I know who to blame

tardy delta
#

wouldve been maybe only 200 lines of code if they decided to write that in kotlin data classes

slender elbow
#

dinnerbone or fry probably

tardy delta
ivory sleet
kindred valley
#

How can i split a list to two

#

And add them to another list

#

2 list

warm mica
#

Google is great for these simple kind of questions

kindred valley
#

I use yandex

knotty aspen
#

any good search engine should be able to help you find answers to those simple questions

kindred valley
#

Sometimes i cant find it on google

quiet ice
#

You're writing in paradoxes

kindred valley
#

Wow you didnt block me

#

I remember u blocked me

worthy yarrow
#

No worries haha, I'm also on like 8 different meds so I've certainly not been "normal" as it were

lunar forge
#

Hi, how to get the statistic BLOCKS_PLACED? It isn't in Player#getStatistics

worthy yarrow
#

Well... it was more like skateboarding without a helmet. I got a solid 7-8 foot fall, to be fair it was a near death experience... if you're interested I have a couple videos haha (nothing too gruesome)

knotty aspen
lunar forge
knotty aspen
#

keeping track in your plugin of that value

#

the server doesn't keep track of that for you, it only tracks blocks mined and items used. items used includes block placements, but also other things

#

You could probably loop through all blocks and get the item_used statistic for each and then add that together though

keen abyss
#

Hi, im trying to make a custom fishing plugin, my plugin listens for the "onPlayerFish" event, how can i ensure that the hook got into the water?

icy beacon
#

By the way don't forget to remind me you're on meds

#

Are you on meds by chance?

worthy yarrow
#

Why don't you go clutter your phone storage with more cat gifs

icy beacon
#

Happily 😛

#

My telegram pfps are like 400 cat gifs/photos

worthy yarrow
#

Dear god I knew it when I saw the poorly animated discord pfp

icy beacon
#

I just looked up blehh in tenor directly lol

icy beacon
worthy yarrow
#

It's alright man I can take it

icy beacon
#

😛

worthy yarrow
#

You think after almost (accidentally) killing myself while skating, I cant take a joke? cmon now

icy beacon
#

Well you are on meds (btw you are on meds (btw you are on meds (btw you are on meds))) so I just felt the need to clarify myself

echo basalt
#

make sure to include the accidentally

#

btw did you get in an accident? you're taking pills for that right?

worthy yarrow
#

Some people make assumptions... also I have never read spigot discord rules so I am not exactly sure on what is appropriate to mention

tender shard
#

benzodiazepines are great

worthy yarrow
#

Clearly I have an issue with being on meds how many times I've said it...

icy beacon
#

So you can probably talk about whatever but in #general

echo basalt
#

yeah being on meds is pretty light compared to some of the stuff I've seen

#

had mfs try to doxx me

worthy yarrow
#

I was just replying to the comments cuz I got tagged in here haha

icy beacon
echo basalt
#

called a guy a skid

worthy yarrow
#

Probably anything

icy beacon
worthy yarrow
#

Man you can doxxed for telling someone to have a good day D:

#

People are ruthless

tender shard
tender shard
#

oh

worthy yarrow
#

Skid is like calling someone a crackhead imo

icy beacon
#

If that can get you doxxed then what can't

worthy yarrow
echo basalt
#

thing is he came up with the wrong person lmfao

icy beacon
#

I mean he did dox somebody which is not better than not doing that at all

worthy yarrow
#

To be fair the most people want to do is act scary so in most cases the worst thing that happens is you get send a google pic of your house... either that or the whole doxfile lol

echo basalt
#

I mean yeah but dude posted "my info" here

#

and got banned

#

and joined on an alt and got banned again

icy beacon
#

The fool-proof solution against people that dox others is to dissolve their organs in fluoroantimonic acid

worthy yarrow
#

goofy goobers am I right?

echo basalt
#

april fools: replace all the soap in your house with sulfuric acid

icy beacon
worthy yarrow
#

Also wanted to make it clear, I am on meds guys just so you know

icy beacon
#

Are you on meds?

#

oh my fucking god the DataStore in android is such a fucking pain

worthy yarrow
#

Ok back to dev questions tho... could someone show me an example of how to properly manage commands + arguments? I've always just used the generic one class per command / their arguments, but I've seen a couple of other methods of handling commands, if anyone has a better method than this please let me see an example haha

icy beacon
#

i've been trying to properly read from it for like 3 hours

tender shard
worthy yarrow
#

That looks rather large haha

tender shard
#

alternatively, which is more annoying but also more flexible, is to just get args[0] in your executor, and then do a switch or sth

public boolean onCommand(...) {

  String subCommand = args[0];
  args = shift(args); // Remove the first entry

  switch(subCommand) {
    case "sub1": return onSubCommand1(args);
    // ...
  }
}
worthy yarrow
tender shard
#

yeah that's how I usually do it

floral drum
#

or make your own flexible command api 😌

worthy yarrow
#

I've never designed any api before...

worthy yarrow
#

Oh oh and perhaps configurable 😄

#

As in allow people to change the command arguments (not sure why you'd want that but hey more configurability am I right?)

icy beacon
#

Not as hard as it may sound

worthy yarrow
worthy yarrow
#

I know, but in the sense of using the api as opposed to designing one

#

Plus it would seem I'm still not that great at using spigot lol

icy beacon
#

Well this is a very simple API:

package some_package;

public class MyAPI {
  public void doNothing() {}
}
#

Create it as a maven project for example (because I have no idea how to do it with gradle), run mvn install

#

Now you have this API in your local repository

#

Import it into your other projects and use it

worthy yarrow
#

doNothing.doNothing lol

icy beacon
#

some_package.MyAPI.doNothing()

floral drum
#

“Method isn’t static!”

icy beacon
#

Ah shit

#

Yeah instantiate the class

#

Doesn't change the point xD

worthy yarrow
#

actually imports a complete index of custom player evnets for a skyblock core kek

icy beacon
#

I mean I'd call this a library over an API but technically API is also perfectly fine

worthy yarrow
#

Well I just kinda saw the difficult part is in designing the functions related to the api calls, I'm not very creative and wouldn't really even know where to start

icy beacon
#

wDYM

#

CAPS

#

Shit

worthy yarrow
#

for example MyApi.doNothing() I would have no idea where to start with the functions... When it comes to what you can do with that method

icy beacon
#

This method, evidently, does nothing

worthy yarrow
#

Well yeah but just as the example at foot

icy beacon
#

It's not like you are just sitting there thinking "ah, yes, I need more methods for my API"

#

It's when you need to do something that your API is designed for but doesn't have, that you come code it

#

For example, you are coding a math library, you are out of ideas

#

Then you need to find the hypotenuse of a right triangle and you think

#

Wow this could be in my library

#

So you go and add it to your library

worthy yarrow
#

So essentially just try to come up with some sort of base idea that is broad enough to expand into something great

icy beacon
#

Exactly

worthy yarrow
icy beacon
#

I'm too tired to check the code rn but I assume you could put some of that stuff (if not all of it (i have no idea what's in there)) into an API yes

clever lantern
#

is there a way to hide player or just make them invisible but their nick wont be hidden?

worthy yarrow
#

ehm

worthy yarrow
worthy yarrow
#

It's pretty old and a lot of the stuff written in there is deprecated I'm pretty sure haha

icy beacon
# worthy yarrow I mean to be fair I think I'm just slow... it already looks pretty similar to yo...

Basically if you have a project you don't need to put all of that into an API. For example, if you have a homes plugin, you can create an API which allows developers to get people's homes' location
This could be done like this:

// Your API
public interface HomesAPI {
  /** Some docs */
  @Nullable Location getPlayerHomeLocation(@NotNull UUID uuid);
}

// Your plugin
public class MyHomesPlugin extends JavaPlugin implements HomesAPI {
  @Override
  @Nullable Location getPlayerHomeLocation(@NotNull UUID uuid) {
    // some implementation...
  }
}

// Someone else using your API
HomesAPI api = null;
if (Bukkit.getPluginManager().isPluginEnabled("MyHomesPlugin") {
  api = (HomesAPI) Bukkit.getPluginManager().getPlugin("MyHomesPlugin");
}

api.getPlayerHomeLocation(uuid);

This requires you to publish your API somewhere like Maven Central or Jitpack (for which there are sufficient guides) and for the developer to import your API in their project with maven/gradle. In this particular case, since the API depends on your plugin (because the API itself is just an interface that does nothing, and your plugin implements the methods of the interface), the plugin is also required to run on the server.

echo basalt
#

Instead just initialize a dedicated thing

#

Use the service provider system on bukkit

icy beacon
#

Or you could do that yes

#

I never thought of that lol

echo basalt
#

Or a static provider class (LuckPermsProvider.get())

icy beacon
#

Imma refactor my plugin to use the service provider system

quaint mantle
#

You should callback when inited

worthy yarrow
#

Right yeah I get the usage of an api, It just opens up some base methods available for other devs to use for rather "custom implementation" of my project right? Essentially more times than not the api is written into the git repo?

#

Or the project itself?

#

I see a lot of "api" folders that look like entire projects dedicated to the api functionality

worthy yarrow
#

But it could be either right? Instead of making it as complex as another project, could just be included in the "plugin" for simplicity eh?

tender shard
#

talking about dev stuff here, I made a siri shortcut "turn on the bathtub" lol

icy beacon
#

I mean you could combine the API and plugin projects but I wouldn't do that

#

Just separate the responsibilities

upper hazel
#

Is it possible to replace all enchantments over 5 Lvl with attributes?

tender shard
#

it only sets two timers 🥲

#

20 minutes and 25 minutes. after 20 minutes it's full of burning hot water, then I turn on cold water for 5 minutes and then it's perfect temperature lol

worthy yarrow
icy beacon
#

Did I just say Lmao nice twice

#

I am very emotional clearly

worthy yarrow
#

yeah

tender shard
icy beacon
tender shard
icy beacon
tender shard
#

I shall make a rusty spigot one

#

for 1.8 users

icy beacon
#

This reminded me that if I somehow manage to get so much free time that I can do nothing the entire day for months on end, I wanna (at least try to) make a Rust core for plugin development

#

Wonder if I'll ever get my hands on that project

worthy yarrow
#

Isn't minecraft / rust comparable in prices?

icy beacon
#

What

#

Rust programming language

worthy yarrow
#

Oh

#

I thought you meant rust the game

#

As in rust core for mincraft...

icy beacon
worthy yarrow
#

Did I mention, I am on meds?

#

ahahaha

icy beacon
#

About 9302 times

worthy yarrow
#

I think its been a couple more than that

upper hazel
#

Why don't level 11 enchantments work?

tender shard
icy beacon
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.

upper hazel
# icy beacon ?notworking

This is not a code, I’m literally talking about enchantments beyond level 5 that don’t work when you give them to an item

#

the item has them, but they just don’t work and it’s not the code

icy beacon
#

How do you apply the enchantments

upper hazel
#

item.setUnsafeEnch.(Ench,level)

icy beacon
#

You can see the enchantment tag on the item, correct?

upper hazel
#

yes

rotund ravine
#

Seems like a skill issue

icy beacon
#

Yeah something like that

icy beacon
#

And by "don't work" you mean that they behave as if there's no enchantment? As if there's an enchantment of a different level?

#

Etc

tribal zephyr
#

xd

#

gif didn't work 💀

upper hazel
#

yes

icy beacon
#

Run /data get entity @s SelectedItem and verify that the enchantments are on the item

upper hazel
#

like char not exists

#

they exists

icy beacon
#

Peculiar

#

?cba then

undone axleBOT
#

pluggg definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.

upper hazel
#

I remember someone said that enchantments beyond lvl 5 do not work and need to be replaced with attributes, but are there all attributes suitable for all enchantments?

worthy yarrow
#
if (CooldownTimerTask.hasCooldown(targetPlayer.getName(), "TownHop Cooldown")){
                    CooldownTimerTask.addCooldownTimer(targetPlayer.getName(), "TownHop Cooldown", 0);
                }

void addCooldownTimer(String, String, int) Target, cooldown type, duration... Given the inputs, this should (probably) remove the cooldown?

#

Theres no remove cooldown timer method for towny's cooldown system aha

desert loom
worthy yarrow
#

Yeah

#

Oh..

#

gross ok let me try

#

CooldownTimerTask.getCooldowns().remove(targetPlayer.getName());
This should be fine yeah?

desert loom
#

It looks like it forms the key from key(string object, string cooldownTypeName)

#

so removing CooldownTimerTask.key(targetPlayer.getName(), "TownHop Cooldown") from the map is right probably

#

just glancing at the code

worthy yarrow
#

Well the map itself takes String "playername", Long "duration (i assume)

desert loom
#

it transforms the 2 parameters into a string key with that key method

worthy yarrow
#

Ah gotcha

glad prawn
wide coyote
#

i doubt this is their plugin

#

i guess its towny advanced's code

worthy yarrow
worthy yarrow
sage patio
#

scheduleAsyncDelayedTask is deprecated, what should i use instead?

remote swallow
#

runTaskLaterAsynchronously

sage patio
#

thanks

worthy yarrow
#
String subcommand = args[0];
  switch (subcommand){
    case "remove":
      Player targetPlayer = Bukkit.getPlayer(args[1]);
        if (targetPlayer == null) break;
        if (!CooldownTimerTask.hasCooldown(targetPlayer.getName(), "TownHop Cooldown")) break;
                
        if (CooldownTimerTask.hasCooldown(targetPlayer.getName(), "TownHop Cooldown")){
          CooldownTimerTask.getCooldowns().remove(targetPlayer.getName(), "TownHop Cooldown");
          player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&l&c " + targetPlayer.getName() + "&r&f have had their cooldown &l&c removed&r!"));
          break;
         }
          break;
     case "start":
       targetPlayer = Bukkit.getPlayer(args[1]);
          if (targetPlayer == null) break;
          if (CooldownTimerTask.hasCooldown(targetPlayer.getName(), "TownHop Cooldown")){
            player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&l&c " + targetPlayer.getName() + "&r is already on&l&c cooldown!"));
            player.sendMessage(ChatColor.translateAlternateColorCodes('&', epirateTownyAddon.getRemainingCooldownHours(targetPlayer)));
            break;
            }
           if (!CooldownTimerTask.hasCooldown(targetPlayer.getName(), "TownHop Cooldown")){
             int cooldownTime = Integer.parseInt(args[2]);
             CooldownTimerTask.addCooldownTimer(targetPlayer.getName(), "TownHop Cooldown", cooldownTime);
             player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&f Started cooldown on &l&c" + targetPlayer.getName() + "&r for &c&l" + cooldownTime + "&r seconds!"));
             break;
             }
             break;
            default:
                player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&f Usage : &l /cooldown &c remove &f | &a start &f {Player Name} (duration, in the case of starting a cooldown)"));
                break;
        }```

Does this look correct?
#

I can put it in a hastebin if needed

rotund ravine
#

Balls

#
String subcommand = args[0];
Player targetPlayer = Bukkit.getPlayer(args[1]);

switch (subcommand) {
    case "remove":
        if (targetPlayer == null) {
            break;
        }
        if (CooldownTimerTask.hasCooldown(targetPlayer.getName(), "TownHop Cooldown")) {
            CooldownTimerTask.getCooldowns().remove(targetPlayer.getName(), "TownHop Cooldown");
            player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&l&c " + targetPlayer.getName() + "&r&f have had their cooldown &l&c removed&r!"));
        }
        break;
    case "start":
        if (targetPlayer == null) {
            break;
        }
        if (CooldownTimerTask.hasCooldown(targetPlayer.getName(), "TownHop Cooldown")) {
            player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&l&c " + targetPlayer.getName() + "&r is already on&l&c cooldown!"));
            player.sendMessage(ChatColor.translateAlternateColorCodes('&', epirateTownyAddon.getRemainingCooldownHours(targetPlayer)));
        } else {
            int cooldownTime = Integer.parseInt(args[2]);
            CooldownTimerTask.addCooldownTimer(targetPlayer.getName(), "TownHop Cooldown", cooldownTime);
            player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&f Started cooldown on &l&c" + targetPlayer.getName() + "&r for &c&l" + cooldownTime + "&r seconds!"));
        }
        break;
    default:
        player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&f Usage : &l /cooldown &c remove &f | &a start &f {Player Name} (duration, in the case of starting a cooldown)"));
        break;
}
rotund ravine
#

anything wrong?

#

oh

#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
sage patio
rotund ravine
#

```

#

\`\`\`

sage patio
#

ow back slashes

rotund ravine
#

Yee

sage patio
#
public static Location findNearestLocation(List<Location> locationList, Location targetLocation) {
        return locationList.stream().min(Comparator.comparingDouble(targetLocation::distanceSquared)).orElse(null);
    }

any idea how can i return this in a async runnable?

rotund ravine
#

Depends

#

Does it need to return a value NOW

#

or can it return it at any point in the future

sage patio
#

now

rotund ravine
#

Then no

#

It can't be async

sage patio
#

what about one tick later?

worthy yarrow
rotund ravine
#

CompletableFutures are a thing you can play with xii69

#

As well as the scheduler

sage patio
#

thanks

sage patio
# rotund ravine CompletableFutures are a thing you can play with xii69
public static Location findNearestLocation(List<Location> locationList, Location targetLocation) {
        return CompletableFuture.supplyAsync(() -> locationList.stream().min(Comparator.comparingDouble(targetLocation::distanceSquared)).orElse(null)).join();
    }

using get(); throws exceptions and i don't want to handle those for now, is .join(); ok?

young knoll
#

get and join both block until the future is complete

#

Therefor defeating the point

grand flint
young knoll
#

Enchantments beyond 5 work fine

#

They just don't display properly without a resource pack

grand flint
#

Well that's why you code it your self like essentialsx

young knoll
#

I don't think they do that

grand flint
young knoll
#

Exactly what I said

#

They don't have any special code for enchantments

grand flint
young knoll
#

And?

grand flint
#

yeah so it sets the lore it self no?

young knoll
#

no

river oracle
#

anybody else got this where intellij just completely hallucinates errors for kotlin?

young knoll
#

Also I was wrong, the display breaks after 10

tender shard
#

it analyzes the whole kotlin-dsl stuff

young knoll
#

That’s a lot of warnings in Kotlin

#

That means it’s bad

river oracle
#

@tender shard do you know how I could create a buildSrc for something like if I wanted to beable to add a plugin that applies a standard set of settings for some of my modules right now I use some weird if checks but I'd much prefer to use a plugin. e.g. I can just add something like this to a subproject

plugins {
  id("mybuildsrcplugin")
}
autumn cave
#

Did bukkitEntity from nms entities get removed in 1.20.4?

river oracle
#

idk lets check

river oracle
tender shard
#

you also have to setup your buildSrc/build.gradle.kts to use kotlin-dsl as plugin

river oracle
echo basalt
lean pumice
#
  if (finalKill) {
            teamVictim.getPlayers().removeIf(playerInTeam -> playerInTeam.equals(victim));
            arena.getPlayers().removeIf(playerInArena -> playerInArena.equals(victim));
            // error here
            arena.getTeams().removeIf(team_ -> team_.getPlayers().isEmpty());
        }

why i get ConcurrentModificationException???

river oracle
echo basalt
karmic mural
lean pumice
#

?paste

undone axleBOT
karmic mural
#

Changing the language file*

tender shard
river oracle
river oracle
#

it finds it fine if I declare it explicitly

#

in my core gradle.kts

river oracle
#

it still exists

tender shard
worthy yarrow
tender shard
#

if you want to change the checkstyle settings in your buildSrc script then your buildSrc script must ofc declare the plugin

river oracle
echo basalt
#

That looks problematic

autumn cave
# river oracle which class is this from?

All the nms entity classes, I probably did something wrong while updating to 1.20.4? I use remapped mojang and all the rest is fine, just the bukkitEntity reference are all missing. Any clue why?

river oracle
#

@tender shard nvm I'm stupid

river oracle
#

it isn't a task

river oracle
lean pumice
#

my problem is arena.getTeams().removeIf(team_ -> team_.getPlayers().isEmpty()); @tender shard

lean pumice
#

get error getPlayers

echo basalt
#

isEmpty is just checking for comod, you're probably editing getPlayers on another thread

lean pumice
echo basalt
#

arena.getPlayers().removeIf(playerInArena -> playerInArena.equals(victim));
replace that with
arena.getPlayers().remove(victim)

echo basalt
#

But honestly you shouldn't have any sort of player collection

autumn cave
echo basalt
#

and instead store UUIDs

lean pumice
#

@echo basalt No one can figure out how to do it and I'm getting desperate.

autumn cave
tender shard
#

IJ's code inspection is so stupid...

lean pumice
#

@echo basalt the problem is arena.getTeams().removeIf(team_ -> team_.getPlayers().isEmpty());

echo basalt
#

team.getPlayers() is being modified in that case

#

I'll blame your poor structure for this

lean pumice
#

but if i do .size() == 0 get error

#

Also

echo basalt
#

It's still poor structuring, not the wrong call

lean pumice
#

I can't understand the problem

#

@echo basalt Do you have ideas?

tender shard
#

How did i ever dislike kotlin, its so awesome

ivory sleet
#

screenshotted

#

caught in 4k

remote swallow
ivory sleet
#

let me just pose one question

#

do you use lombok + kotlin?

tender shard
#

I will never use java again unless i have to

tender shard
#

I dont think it works

ivory sleet
#

iirc yes

river oracle
#

oh lord

#

why would you ever

ivory sleet
#

well idk

remote swallow
#

conclube can you type ?ban @tender shard

tender shard
#

Doesnt it require a javac plugin

orchid gazelle
ivory sleet
#

ive seen ppl in helpchat use it alex lmao

tender shard
#

Huh ok well kotlin has everything that lombok adds

remote swallow
#

@Getter? @Data?

ivory sleet
#

mfnalex just upgraded from checkers to 4d gpu accelerated chess

tender shard
ivory sleet
#

gotta agree tho

#

immutability by default is so nice

#

and semantic nullability types

river oracle
#

what's the dif between
checkstyle
and id("checkstyle") in build source

rotund ravine
#

@young knoll control conclube

ivory sleet
#

lol

river oracle
#

alr

dry hazel
#

checkstyle is just a DSL accessor cause it's an org.gradle plugin

river oracle
#

how can I grab a projects sourcsets in gradle kotlin?

#

project.sourceSets isn't a thing

young knoll
#

You wot

dry hazel
#

sourceSets

river oracle
#

why tf does it say it doesn't exist

#

is this just a buildSrc issue?

dry hazel
#

java plugin applied?

rotund ravine
#

Gradle has always been awfully broken

#

did u try it?

#

If it builds

#

gradle works

river oracle
#
plugins {
    java
    checkstyle
}

checkstyle {
    toolVersion = "10.12.5"
    configFile = file("config/checkstyle/checkstyle.xml")
    sourceSets = listOf(project.sourceSets.main)
}
river oracle
tender shard
#

works for me

river oracle
#

I'm switching from gradle groovy I still got a lot to do before i Can test

#

@rotund ravine it breaks when I use the explicit checkstyle instead of id("checkstyle") in plugins

tender shard
#

yes that is correct

river oracle
#

whatever ig I'll just use id("checkstyle")

tender shard
#

because it's not a core plugin

#

id("checkstyle") is the correct way

river oracle
#

it is? afaik

dry hazel
#

it is a core plugin

remote swallow
#

it has no id

#

so its a core plugin

tender shard
#

oh ok mb

river oracle
#

whatever converting to the id fixed it for some reason

#

wack as hell

rotund ravine
#

gradle works great once it works

#

the setup though

#

👀

river oracle
#

I was using groovy before

#

anything is up from that

rotund ravine
#

Yeah

#

gradle groovy

#

was the worst

#

gradle kotlin dsl

echo basalt
#

me using groovy eyeszoom

rotund ravine
#

has a bit more safety and ease

young knoll
#

Me also using groovy

rotund ravine
#

Coll

#

banned

#

Basics don't want ya

tender shard
#

yeah remove him from the trello pls

#

i bet he doesnt even hear kotlin underpants smh

rotund ravine
#

I have dreamt in kotlin before, it was unpleasant and didn't get to sleep the full night.

#

Would rather dream about irl stuff

echo basalt
#

Is there any event for natual mob spawning?

#

i.e cow spawning on grass

rotund ravine
#

Do

#

You perchance use paper?

echo basalt
#

Uh yeh

rotund ravine
#

EntityAddToWorldEvent or smth

#

iirc

echo basalt
#

slimeworldpaper

#

hm

rotund ravine
#

Otherwise

echo basalt
#

Like there's EntitySpawnEvent

#

but no cause

rotund ravine
#

CreatureSpawnEvent

young knoll
#

Does the regular spawn event not fire for that?

rotund ravine
#

Probably would

echo basalt
#

yeah creaturespawn has a reason alr

fervent robin
#

I need to store 3 strings, 2 enum, a list of item stacks, a list of strings, 2 ints in an SQL table. I assume creating a new column for each would be horrible inefficient. So what would be the best way to store it?

river oracle
#

having many columns isn't super inefficent its how SQL works

fervent robin
#

Yeah but wouldnt it better just to store in one column in binary?

river oracle
#

no at that point don't even use SQL

#

throw everything into a binary format like NBT

#

and store it in a flatfile

fervent robin
#

It has to be stored in MySQL cant be anything local

#

So the best way is to just have a ton of columns?

rotund ravine
#

what does ur types represent

fervent robin
river oracle
#

nothing is wrong with having 7 columns

#

how is this a problem?

#

its not inefficent its just 7 columns

fervent robin
#

Someone told me some time ago it wasn't the best way

#

I guess there wrong then

river oracle
#

did they tell you to use blobs instead?

rotund ravine
#

We would want to know what ur saving

#

Like

#

We can tell u how to optimize and shitz

fervent robin
rotund ravine
#

What ur types represent

hasty oyster
#

JSON/GSON and Datatypes

timid hedge
kind hatch
#

You're not verified.

rotund ravine
#

bro

#

ask the shitman who posted shit

river oracle
kind hatch
#

Oh, woops

fervent robin
# rotund ravine What ur types represent

Strings:
Quest name
Quest desc
Quest permission

Enum:
Quest objective type (Break blocks, Place blocks, etc)

Item stack list is a list of items to give to player as rewards

List of string is for commands to run on player as rewards

integers:
xp amount to give as rewards
coin amount to give as rewards

river oracle
hazy parrot
fervent robin
river oracle
#

oh well in that case looks fine

#

nothing here seems super inefficent

rotund ravine
#

Should be fine to have that as a table

fervent robin
#

Wym by permission though?

rotund ravine
#

Thought

#

A quest could be a table of itself

#

and a quest could have an idf

#

id

#

and the whatever ur doing now

#

could just reference that id

young knoll
#

I would put all the single stuff in one table

#

Then another table for rewards

#

and another for the commands

fervent robin
#

Oh thats actually a good idea

#

another table just for commands?

young knoll
#

Yes

#

Rather than combining them all into a single column, you store a row per command

fervent robin
#

I was thinking quest gets a ascending reward ID which correlates to a reward table entry that has all of it stored there

kind hatch
#

There's nothing wrong with adding a null check. They are in fact necessary sometimes.

fervent robin
young knoll
#

Ehhh

#

Kinda janky

young knoll
#

Plus you’d have to use something to divide them, and what if you then want to use that something in a command

fervent robin
#

Would that be better performance wise since you can limit to 1 row? Instead of having to go through all of a tables entries?

rotund ravine
#

Hello! I see that you are looking for the best way to store multiple data types in an SQL table. You are correct that creating a new column for each data type would be inefficient. There are several ways to store multiple data types in a single column. One way is to use a varchar column and store the data as a JSON string. Another way is to use a sql_variant field, which can store multiple types and preserve the type metadata (type, precision, scale) ². You can also create a separate table for each data type and use a foreign key to link them to the main table ¹. I hope this helps!

Source: Conversation with Bing, 02/02/2024
(1) sql - What is the best way to store multiple data type into database .... https://stackoverflow.com/questions/5724618/what-is-the-best-way-to-store-multiple-data-type-into-database.
(2) mysql - How to store multiple data types for same column (for many .... https://dba.stackexchange.com/questions/286540/how-to-store-multiple-data-types-for-same-column-for-many-columns.
(3) sql server - Best way to store a value which could be multiple types .... https://dba.stackexchange.com/questions/140518/best-way-to-store-a-value-which-could-be-multiple-types.
(4) Multiple data types in column – SQLServerCentral Forums. https://www.sqlservercentral.com/forums/topic/multiple-data-types-in-column.
(5) undefined. https://stackoverflow.com/questions/10455783/different-types-for-the-same-column.
(6) undefined. https://www.sqlservercentral.com/forums/topic/multiple-data-types-for-the-same-column.
(7) undefined. http://rads.stackoverflow.com/amzn/click/1934356557).

#

Ignore me just getting my msgs up

#

thought bing might be right

#

i didn't read shit

fervent robin
young knoll
#

I assure you going through more rows isn’t going to destroy your performance

#

This is what sql is built for

fervent robin
#

👍

river oracle
#

You are correct that creating a new column for each data type would be inefficient
Wild it suggests just storing json

#

over actually idk using SQL properly

hazy parrot
#

?learnjava

undone axleBOT
river oracle
#

we are built different

timid hedge
tender shard
river oracle
#

lol

lost matrix
river oracle
#

@tender shard like this?

plugins {
    id("java")
    id("io.github.patrick.remapper") apply false
}

dependencies {
    compileOnly(":pineapple-nms:api")
}

tasks.jar {
    finalizedBy(tasks.getByName("remap"))
}
lost matrix
timid hedge
#

I know it would be smarter in a switch or something, but rn its just for testing
Ill fix it up when its working

river oracle
young knoll
#

Bootleg specialsource

tender shard
#

basically you do it like this

parent

plugins {
  id("com.johnrengelnman:shadow") version "1.2.3.4" apply false
}

some other thing

plugins {
  id("com.johnrengelman:shadow")
}
river oracle
kind hatch
river oracle
#

so it has no specific parent

fervent robin
#

Is storing UUID's as binary in MySQL the proper way? (The person who told me many sql columns is inefficient also told me this and im starting to doubt some of the things he said)

river oracle
#

the issue is I keep getting this error because I haven't specified a version

Plugin [id: 'io.github.patrick.remapper'] was not found in any of the following sources:
timid hedge
river oracle
#

^ mind you the plugin is on maven central

tender shard
young knoll
#

Binary for uuid is fine

river oracle
#

?learnjava

undone axleBOT
young knoll
#

Char(36) probably won’t kill you though

kind hatch
#

There is a UUID method in mysql though.

young knoll
#

Ah yeah that too

fervent robin
#

i thought

lost matrix
young knoll
#

Why would they not

kind hatch
#

It doesn't matter where they come from.

tender shard
#

ok like this:
buildSrc/build.gradle.kts

dependencies {
  implementation("com.johnrengelman:shadow:1.2.3.4")
}

buildSrc/src/main/kotlin/myscript.gradle.kts

plugins {
  id("com.johnrengelman:shadow")
}
fervent robin
#

I swear I saw someone say that on the forum

remote swallow
#

i just realised something

young knoll
#

There are multiple versions of uuid but they are all 128 bits

remote swallow
#

godnattid is <none>

timid hedge
kind hatch
fervent robin
#

👍

echo basalt
tender shard
icy monolith
#

What would be the best way to read enchants from a yml file and apply them to the item?

        - DIG_SPEED: 1
        - LOOT_BONUS_BLOCKS: 2```

```        for (String key : keys) {
            item.addEnchantment();
        }```
I have the loop loping through them, but how do i pull the name and convert it to an enchant and then pull the value and set that as the amount
river oracle
tender shard
#

currently your enchants thing is a MapList where each map only contains one entry

icy monolith
young knoll
#

Enchantment.getByName or something

#

You should use the key instead though

#

Since they have better names

tender shard
#

yeah getByName will work but it's deprecated

young knoll
#

Namespaced keys for the win

tender shard
#

getByKey is deprecated too, one shall use the registry it says

young knoll
#

Yes

#

Thou shall use registry

tender shard
#

Registry.ENCHANTMENT.match("unbreaking") ? or how does it work?

young knoll
#

Match or getByKey

#

Actually I think it’s just get

icy monolith
#

So i shouldnt use the deprecated stuff?

young knoll
#

match should accept unbreaking or minecraft:unbreaking

tender shard
#

so yeah just do Registry.ENCHANTMENT.match("fortune") etc

#

that's the easiest way

icy monolith
#

Ok

tender shard
#

it also uses the proper names and not DIG_SPEED, LOOT_BONUS_BLOCKS etc

icy monolith
#

It is complainign about using ConfigurationSection object as loop

#

foreach not applicable to type 'org.bukkit.configuration.ConfigurationSection'

young knoll
#

Notice the getKeys in the code

fervent robin
#

Huh? java.sql.SQLException: Unknown data type: 'UUID'

tender shard
#

which database?

chrome beacon
#

Looks like your database doesn't support uuids

fervent robin
tender shard
#

you must be using a really old mysql version

#

then use varchar(36) and toString the uuid

fervent robin
#

👍

chrome beacon
#

Or just store two longs

#

Takes less space

rotund ravine
#

LONGS

#

smh

#

./s

echo basalt
#

looks uggo

river oracle
#

don't you need 2 different columns tehn

rotund ravine
echo basalt
#

yeah you do

rotund ravine
#

min and max

echo basalt
#

composed primary key or some bs

echo basalt
young knoll
#

Store a BINARY(16)

tender shard
#

either varchar(32) or varchar(36) or binary(16) or get rekd

rotund ravine
young knoll
#

Smh why varchar and not char

tender shard
#

oh yeah

echo basalt
#

nah I'd rather have 1 int column for each char that represents its index in the ascii table

#

36 columns

#

there

tender shard
#

yes that is also very good

#

I'll ask chatgpt for the best way

rotund ravine
#
CREATE TABLE my_table (
  col1 CHAR(1),
  col2 CHAR(1),
  col3 CHAR(1),
  col4 CHAR(1),
  col5 CHAR(1),
  col6 CHAR(1),
  col7 CHAR(1),
  col8 CHAR(1),
  col9 CHAR(1),
  col10 CHAR(1),
  col11 CHAR(1),
  col12 CHAR(1),
  col13 CHAR(1),
  col14 CHAR(1),
  col15 CHAR(1),
  col16 CHAR(1),
  col17 CHAR(1),
  col18 CHAR(1),
  col19 CHAR(1),
  col20 CHAR(1),
  col21 CHAR(1),
  col22 CHAR(1),
  col23 CHAR(1),
  col24 CHAR(1),
  col25 CHAR(1),
  col26 CHAR(1),
  col27 CHAR(1),
  col28 CHAR(1),
  col29 CHAR(1),
  col30 CHAR(1),
  col31 CHAR(1),
  col32 CHAR(1),
  col33 CHAR(1),
  col34 CHAR(1),
  col35 CHAR(1),
  col36 CHAR(1)
);
echo basalt
#

perfect

tender shard
tender shard
remote swallow
#

frick you

tender shard
#

I even was faster than md5 today when he demanded tree fiddy again

rotund ravine
#

👀

rotund ravine
#

alex

#

a hacker

#

confirmed

tender shard
#

yes I wrote a shell script today

#
cd /home/minecraft/buildtools && java -jar BuildTools.jar --rev 1.20.4 && cp spigot-1.20.4.jar /home/minecraft/singleplayer
remote swallow
#

why

#

just use the flag for it

rotund ravine
#

CP

#

Alex

tender shard
#

i didnt remember the flag name

rotund ravine
#

Ur disgusting smh

remote swallow
#

--o or --output-dir

tender shard
#

too fancy

#

I rather cp it

#

oh btw I wrote a zip task for basics

#
tasks.register<Zip>("zipDistribution") {
    group = "basics"
    description = "Bundle the plugin and all modules into a single zip file."

    archiveFileName = "basics-$version.zip"
    destinationDirectory = file("build/dist")

    from(project(":plugin").tasks.getByName("shadowJar", ShadowJar::class).archiveFile)

    for(module in project(":modules").subprojects) {
        from(module.tasks.getByName("shadowJar", ShadowJar::class).archiveFile) {
            into("Basics/modules")
        }
    }
}
remote swallow
#

i use this for some stuff

@echo off
set source="C:\Users\immrt\Desktop\Epic Plugins\RestAPI\build\libs\RestAPI-1.0-SNAPSHOT-all.jar"
set destination="C:\Users\immrt\Desktop\RestAPI"

echo Copying JAR file...
copy %source% %destination%

echo JAR file copied successfully.
exit
#

i should find out how to hash check stuff and auto restart jars

tender shard
#

just compare the output of sha1sum <file>

echo basalt
#

meanwhile I wrote an abstraction around if checks

remote swallow
#

is that an actual windows cmd

rotund ravine
tender shard
#

it's part of git bash

rotund ravine
#
@echo off set source=“C:\Users\immrt\Desktop\Epic Plugins\RestAPI\build\libs\RestAPI-1.0-SNAPSHOT-all.jar” set destination=“C:\Users\immrt\Desktop\RestAPI”

echo Copying JAR file… copy %source% %destination%

echo JAR file copied successfully.

echo Adding hashcheck… set hashcheck=“C:\Program Files\HashCheck\HashCheck.dll” regsvr32 /s %hashcheck%

echo Hashcheck added successfully.

echo Adding autostart… set autostart=“C:\Users\immrt\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\RestAPI.bat” echo @echo off > %autostart% echo cd %destination% >> %autostart% echo java -jar RestAPI-1.0-SNAPSHOT-all.jar >> %autostart%

echo Autostart added successfully. exit
tender shard
#

wow can it get even more complicated

remote swallow
#

sus amobus

tender shard
#

windows cmd is so overly shitty

echo basalt
rotund ravine
#

disgustng

echo basalt
#

I can't bother dealing with some startup exception and then more exceptions onDisable

#

because variables never initialized type deal

rotund ravine
#

I was joking, tbh that would be smth i'd write to disregard nullchecks

echo basalt
#

There's also this

tender shard
remote swallow
#

no thsnka

glossy venture
#

ugly ahh

echo basalt
#

shut up kotlin addict

#

imagine being so confused you go islandManager??

glossy venture
#

if u didnt know kotlin how does it make sense

tender shard
silver dagger
#

Hi im a noob with all this. Actually just started today developing some Plugins, because I wanted to host a server for my friends. Im writing a plugin, that kicks everybody from the server, then deletes all the world files and then restarts the server. The world files keep getting deleted, but they are kinda coming back in the process of shutting down the server??!! is there any way to turn this off?

glossy venture
#

tf does let do

echo basalt
#

I've had this kind of issue before

#

my way of solving it was to just delete them on startup

#

Instead of onDisable

#

I'd legit just write some empty file and see if it existed in the world folder

rotund ravine
# silver dagger Hi im a noob with all this. Actually just started today developing some Plugins,...

Hello! I'm glad you're exploring the world of Spigot plugins. It sounds like you're trying to delete all the world files on your server, but they keep coming back when you shut down the server. I can help you with that.

To delete a world's data directory on a Spigot server, you need to first unload the world and its chunks. After that, some files and directories may still not be deleted. Here's some sample code that should work for you:

Server server = getServer();
World world = server.getWorld("world");
File active = world.getWorldFolder();
// Unload the world and its chunks
server.unloadWorld(world, true);
// Delete the world's data directory
deleteDirectory(active);

The deleteDirectory method is defined as follows:

public static void deleteDirectory(File file) {
    if (file.isDirectory()) {
        File[] files = file.listFiles();
        if (files != null) {
            for (File f : files) {
                deleteDirectory(f);
            }
        }
    }
    file.delete();
}

This method recursively deletes all files and directories in the specified directory. You can use it to delete the world's data directory.

I hope this helps! Let me know if you have any other questions.

Source: Conversation with Bing, 02/02/2024
(1) How to to delete a world's data directory on a Bukkit server?. https://stackoverflow.com/questions/46747905/how-to-to-delete-a-worlds-data-directory-on-a-bukkit-server.
(2) How to delete a world folder (PROPERLY) - Bukkit Forums. https://bukkit.org/threads/how-to-delete-a-world-folder-properly.156344/.
(3) github.com. https://github.com/glotovauv/Messenger/tree/ab69b3dfbd0f0a41cae9a4368cbfdca5d14ef31d/src%2Fmain%2Fjava%2Fmessenger%2Fservices%2FTalkServiceImpl.java.

echo basalt
#

shut up bing bing

rotund ravine
#

ahaha

tender shard
echo basalt
glossy venture
quaint mantle
#

hi how i get spigot api?

tender shard
#

it's in the maven repo

echo basalt
#

?buildtools

undone axleBOT
rotund ravine
#

?jd-s

undone axleBOT
silver dagger
silver dagger
silver dagger
#

But that would always remove the world when i need to restart the server, right?

tender shard
# glossy venture like fuck does that mean

well basically whatever you call "let" on, it can be referred to as "it" inside the block

val name = "my dog"

name.let { println("$it has pooped on the sofa again") }

By combining it with the ?. operator, you can make it run only if it's not null

glossy venture
#

i know

#

but why "let"

tender shard
#

let it be my dog

glossy venture
#

thats the top 7 question science cant solve

glossy venture
#

almost as poetic as cmarco using half a percent of his exceptional skill

tender shard
#

i guess it's like how in some languages you do let a = 3 or sth

#

so here we just do let whatever = it, no clue

#

The usage of let can be seen as "letting" the object on which it is called to be available within a temporary scope in the form of a lambda parameter.

glossy venture
#

hmmmmm

#

highly peculiar language design.

tender shard
#

it's probably the best code I have ever written

glossy venture
#

i like being able to use it in a block like a this value

#

but id prob do smth like

expr -> { statement... }
#
commands.create("abc") -> {
    then(otherocmandorsomrthing);
}
tender shard
#

otherocmandorsomrthing

glossy venture
#

yes

fervent robin
#

would make sense if you recomend doing it for commands

young knoll
#

Sure

olive lance
#

Anybody experienced with PAPI can answer this?
I just updated my papi extension (had to remake it cause i lost project files) but I basically just updated the onRequest function and thats it. Supposedly the end user is testing and only the old placeholder is working and the new one just displays the %% text he typed for the placeholder. Is there anything else needed for the new placeholder other than the onrequest function or is the user just not updating correctly?

ivory sleet
#

if its built in w the plugin ik u need to override the persists() function

quaint mantle
#

Guys

#

Wait nvm

kind hatch
#

Frick. I forgot to jump back to the master branch and now my changes from the other branch I was working on are now a part of this new branch.

#

Is there an easy way to fix that?

remote swallow
#

have you commited it already

kind hatch
#

Yea

remote swallow
#

shit thats out of my knowledge but im quessing if you bring the new branch to head of that then revert commit it should be fine

#

i hope

#

dont quote me

river oracle
#

help this man

remote swallow
#

wasnt he reading a book on it

river oracle
#

and an interactive website

tender shard
#
  1. check the commit id of the commit you wanna move over git log
  2. switch to master git checkout master
  3. cherry pick the commits git cherry-pick <commit-hash>
#

if you also want to remove the commit from your other branch, you can go remove the last X commits with git reset --hard HEAD~X (e.g. HEAD~1 for the last commit)

sullen marlin
#
{

    public interface TestInterface
    {

        Object getObject();
    }

    public interface DefaultInterface
    {

        default Object getObject()
        {
            return this;
        }
    }

    public class Class implements DefaultInterface, TestInterface
    {

    }
}
#

why does this not work 😦

remote swallow
#

md

#

why

sullen marlin
#
{

    public interface TestInterface
    {

        Object getObject();
    }

    public interface DefaultInterface
    {

        default Object getObject()
        {
            return this;
        }
    }

    public class Class implements DefaultInterface, TestInterface
    {

        @Override
        public Object getObject()
        {
            return DefaultInterface.super.getObject();
        }
    }
}

Is this legit?

tender shard
#

yes that's also what IJ suggested

sullen marlin
#

lame

river oracle
#

this is some locked ass java code

sullen marlin
#

why doesn't the first snippet work

tame wolf
#

Both of those things look evil

#

So I'd say some deity is stopping you

sullen marlin
#

the real code is even worse

#

there's an abstract class I omitted

river oracle
#

that's so weird

tender shard
#

hm I guess it's just so that it's the same behaviour as if both interfaces would have a default method, then you'd also still have to implement an actual method

rotund ravine
#

I am, under a GABA depressor

tender shard
#

you're drunk?

rotund ravine
#

shh, don't be that smart.

tender shard
#

kek cheers

rotund ravine
#

Heading to bed soon or smth

young knoll
#

I read GBA depressor

#

I was confused what the gameboy advanced had to do with this

tender shard
#

super mario against depression

#

obv

tame wolf
fervent robin
#

What's the best way to store an ItemStack in a MySQL DB? I know many people use itemStack#serialize() but I am not sure what to do with the map it returns

tender shard
#

you can use a BukkitObjectOutputStream to get a byte[]

river oracle
#

otherwise do what alex said

tender shard
#

you can also use my json lib to turn it into json if you want it to be human readable

fervent robin
#

nah idc abt that

#

thanks

tender shard
#

then BukkitObjectOutputStream, that's the easiest way to safely save it

#

or however its called

river oracle
tender shard
river oracle
#

any of the classes in my library

#

but I downloaded the jar and they are all there

#

which is why I'm confused

tender shard
#

so what exactly do you depend on? which artifact?

#

beause your parent thing doesn't have any sources and hence probably has no artifact?

river oracle
#

I just add the dependencies like this

    implementation("sh.miles.pineapplechat:pineapplechat-core:1.0.0-SNAPSHOT")
    implementation("sh.miles.pineapplechat:pineapplechat-bungee:1.0.0-SNAPSHOT")
tender shard
#

ah ok

river oracle
#

do I need to configure something in the jar plugin?

#

all of my subprojects logic is in the subprojects section

tender shard
#

what's the purpose of this?

remote swallow
#

add the aggregated javadoc jar

river oracle
#
                this.artifact(tasks.jar)
                this.artifact(tasks.aggregateJavadocJar)
tender shard
#

does it add it, or does it set it to only publish that?

remote swallow
#

it should add it

#

or thats what it did in groovers

river oracle
#
Creates a custom MavenArtifact to be included in the publication. The artifact method can take a variety of input:```
remote swallow
#

does kotlin say that the stuff there is this = publication or is it using this as project

river oracle
#

the javadocs are fine the published jar is seemingly fine I mean it has all of the classes you'd expect to be there

rotund ravine
#

I just farted

#

and i smell it

remote swallow
#

do ur balls not absorb it

river oracle
#

JanTuck is def on those GABA depressors

tender shard
rotund ravine
#

1.13

river oracle
tender shard
#

hmm is it just IJ not showing the classes, or can you also not compile it if you try to access any

remote swallow
#

oh im judging you on publishing under sh.miles.pineapplechat over sh.miles

rotund ravine
#

tbf always try to compiel with gradle and see if IJ sucks ass

river oracle
rotund ravine
#

buttons

remote swallow
#

clean reload or that jar caching thing i sent you

river oracle
#

I just published a new jar with the changes

remote swallow
#

caching thingy

tender shard
river oracle
#

I'm gonna do ./gradlew clean --refresh-dependencies

#

that should work right

#

my project doesn't build atm

#

too many java errors

#

@remote swallow send me the depependency thingy thingy again

young knoll
#

We love setting cache changing modules to 0

remote swallow
#

configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

river oracle
#

@tender shard idfk

#

lol

rotund ravine
#

vroom vroom

river oracle
#

I tried this instead

        publications {
            create<MavenPublication>("Maven") {
                this.artifact(tasks.jar)
                this.artifact(tasks.aggregateJavadocJar)
                this.groupId = "sh.miles.pineapplechat"
                this.artifactId = project.name
                this.version = rootProject.version.toString()
            }
        }``` but adding the tasks.jar result didn't do anything either
remote swallow
#

i mean

#

from whats on there the jar exists

#

check external libraries on the project menu

#
  • check you have the right repo extension
river oracle
remote swallow
#

tf you got that from

river oracle
#

that's in the external libraries section

remote swallow
#

oh right at the bottom

#

i mean in the end project

#

that wants to use pineapplechat

tender shard
#

must be sth in your new project because in a random maven project, it works fine

river oracle
#

wtf

quaint mantle
#

I gotta say

river oracle
#

wonder if invalidating my caches might work

quaint mantle
#

Coming from 1.7 - 1.8.8 Spigot API to the latest version, i feel like a lot has changed and im so happy their is new methods, and Ray tracing!!!

river oracle
#

more change is on the block

#

probably

#

if it ever gets merged

young knoll
#

Yeah a lot tends to change in 10 years

quaint mantle
river oracle
#

@young knoll when ItemType CH_AngryCry

quaint mantle
#

ItemType??

#

Thats an Enum now?

young knoll
#

Hey I don’t control the merges

#

No

#

Enums are bad

#

And deserve to die

quaint mantle
#

Enums are great fuck u on about mate

young knoll
#

||/s but not really||

river oracle
tender shard
quaint mantle
#

No they don't and why do they 'suck'?

young knoll
#

If it’s registry based

quaint mantle
tender shard
#

oh

quaint mantle
#

Not in 1.8

young knoll
#

It shouldn’t be an enum

river oracle
quaint mantle
#

Had to use a public library for raytracing

#

Oh ima be honest, im not on the nerd level you guys are on

remote swallow
quaint mantle
#

So i dont understand what u mean by registry

#

But i use enums for PlayerStates, and CooldownTypes shit like that, Enums are great for the things i do

river oracle
quaint mantle
tender shard
#

but does mc even allow custom blocks meanwhile?

quaint mantle
#

lol

tender shard
#

I mean real custom blocks

quaint mantle
river oracle
river oracle
#

I believe Blocks moved to a Codec recently

#

which is good news

#

granted this is the mojang timeline so it could still be years

tender shard
kind hatch
#

coq?

quaint mantle
#

^

young knoll
#

Yes blocks moved to codecs

quaint mantle
#

What is a COQ and what is a codec?

#

lol

remote swallow
#

i didnt know blocks were gay

tender shard
young knoll
#

It’s Mojangs fancy and maybe a bit over engineered serialization system