#development

1 messages Β· Page 109 of 1

sudden sand
#

what do you mean by default one ?

#

new HikariDataSource(new HikariConfig()) ?

#

(ofc with the user password ect.)

lyric gyro
#

yeah default is fine

dusty frost
#

I didn't even touch a config

#

just hikari = new HikariDataSource();

lyric gyro
#

i mean you need to give it the address, username and passwd

sudden sand
#

yes lol

dusty frost
#
        hikari = new HikariDataSource();
        hikari.setDataSourceClassName("com.mysql.cj.jdbc.MysqlDataSource");
        hikari.addDataSourceProperty("serverName", host);
        hikari.addDataSourceProperty("port", port);
        hikari.addDataSourceProperty("databaseName", database);
        hikari.addDataSourceProperty("user", username);
        hikari.addDataSourceProperty("password", password);
sudden sand
#

com.mysql.cj.jdbc.MysqlDataSource

#

do I need to add new mysql dependency or is it in spigot ?

dusty frost
#

Not sure about spigot, but it's in Paper for 1.17 and above

lyric gyro
#

never used it like that lol

#

probably never will

dusty frost
#

yeah i thought it was pretty cute

sudden sand
#

I keep having this error ```java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30001ms.

#

do someone know about it ?

#

I tried to fix it the whole day

#

it's like it freezes the hikaricp connection

#

lol I would even pay to know the solution

lyric gyro
#

how can i get the Anvil Rename field Text and then change the Output of the Item name to something different

lyric gyro
sudden sand
#

after a few statement

#

it does this

carmine crow
#

how to make timer in item lore? like how to change item lore while inventory is opened by player?

cerulean birch
#

Change the item and I’m pretty sure there is an update inventory method

carmine crow
#

ok

tight junco
#

i have a method to save an entire array of itemstacks into a database susEyes

#

somewhere

#

might be your itemstack then

#

what is your itemstack

#

id also remember that i dont catch exceptions there

#

try doing it without that

#

try doing my exact method and just using a single item list

#

or your issue is with your sql table

rigid mountain
#

What can i use to create a custom HUD similar to the hunger bar

dusky harness
#

Unable to make field private java.lang.Object java.lang.ref.Reference.referent accessible: module java.base does not "opens java.lang.ref" to unnamed module
Anyone know how to fix this when doing Gson#toJson(Object, Type, Appendable)?

It works in another plugin on the same server that I also made with the same code πŸ˜’

tried shading & relocating gson but same result

formal locust
#

does anyone know how to sendTitle ;--;

uneven lanternBOT
#
void sendTitle(@Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut)```
Description:

Sends a title and a subtitle message to the player. If either of these values are null, they will not be sent and the display will remain unchanged. If they are empty strings, the display will be updated as such. If the strings contain a new line, only the first line will be sent. All timings values may take a value of -1 to indicate that they will use the last value sent (or the defaults if no title has been displayed).

Parameters:

title - Title text
subtitle - Subtitle text
fadeIn - time in ticks for titles to fade in. Defaults to 10.
stay - time in ticks for titles to stay. Defaults to 70.
fadeOut - time in ticks for titles to fade out. Defaults to 20.

dusky harness
#

title = main text
subtitle = smaller text below the title
fadein/stay/fadeout = time in ticks

formal locust
#

ok

#

i was using this

#

player.sendTitle(ChatUtils.chat("&aSURVIVAL"), ChatUtils.chat(""));

#

and this

#

@SuppressWarnings("deprecation")

dusky harness
#

don't suppress deprecation - just put like 10, 70, and 20 as the parameters

formal locust
#

ok

dusky harness
#

what error?

formal locust
#

'sendTitle(java.lang.String, java.lang.String)' in 'org.bukkit.entity.Player' cannot be applied to '(java.lang.String, java.lang.String, int, int, int)'

#

player.sendTitle("Hello!", "This is a test.", 1, 20, 1);

pure crater
#

it literally says it right there

formal locust
#

player.sendTitle("&aSurvival", "test", 10, 70, 20));

winged pebble
#

It only takes 2 parameters

winged pebble
formal locust
#

i got a util

#

that helps

proud pebble
#

How long in ms does it take to compair a string to another string if they are both the same size?

wheat carbon
#

<1 ms

formal locust
#

does anyone know how to hook papi into plugins

#

i want my plugin configuration also add papi hook

proud pebble
#

if i was to iterate over a string array with 400 different strings checking if each string was the same as my own string how long would that take?

formal locust
#

does just adding it to maven and adding papi as soft depend make it hook into papi?

formal locust
#

then i have to upload it as library

proud pebble
lyric gyro
#

is this where i can ask for help on plugins that i'm working on developing ?

atomic echo
#

Yes

lyric gyro
#

awesome, so i was reading this article a while ago cause it's something i thought about and wanted to actually get to work i just need some help on getting it setup

#

not sure if it'll let me link it lets see

#

oh cool so yeah, the posting by "Nikl" is kinda what i'm trying to do

sudden sand
#

it keeps freezing hikaricp connections

lyric gyro
#

looks like it's not connecting

sudden sand
#

no it is

atomic echo
sudden sand
#

it's after a few statement

lyric gyro
lyric gyro
#

it's a listener for all events sorda

#

this is kinda how i'm gonna get it eventually

formal locust
#

can anyone help me with this

lyric gyro
#

@formal locust what's the problem?

formal locust
#

I want to have multiple COLOURS IN .withColor(Color.GREEN) and i want it to be configured from config

#
    type: BALL_LARGE
    power: 1
    flicker: true
    trail: true
    colors:
      - AQUA
      - RED
      - TEAL
      - WHITE```
#

like ``` colors:
- AQUA
- RED
- TEAL
- WHITE

lyric gyro
#

im not familiar with firework meta, is the withColor method for the trail of the firework or the explosion

lyric gyro
#

no i know, i mean like if you run that code, does green appear as the trail or explosion

formal locust
#

Trail

lyric gyro
#

so you want a multi colored trail right

formal locust
#

yea

lyric gyro
#

have you looked into the FireworkEffect.builder()

formal locust
#

wait i will look

lyric gyro
#

docs i meant, like what you can do

atomic echo
#

@lyric gyro So the problem is that it's not printing the event name?

lyric gyro
#

currently, it would spam my chat log with ChunkLoadEvent which is fine. but I'm trying to get it to print the PlayerJoinEvent whenever i log on but it doesn't

formal locust
#

FireworkEffect.Builder
withColor(Color... colors)
Add several primary colors to the firework effect.

#

i got it

lyric gyro
#

do you know how to use that

#

cause i know bukkit's Color's class doesn't have a Color.getByName

formal locust
#

thats the hard part

#

:(

sudden sand
formal locust
#

?

sudden sand
#
        switch (colorStr.toUpperCase()){
            case "WHITE":
                return Color.WHITE;
            case "SILVER":
                return Color.SILVER;
            case "GRAY":
                return Color.GRAY;
            case "BLACK":
                return Color.BLACK;
            case "RED":
                return Color.RED;
            case "MAROON":
                return Color.MAROON;
            case "YELLOW":
                return Color.YELLOW;
            case "OLIVE":
                return Color.OLIVE;
            case "LIME":
                return Color.LIME;
            case "GREEN":
                return Color.GREEN;
            case "AQUA":
                return Color.AQUA;
            case "TEAL":
                return Color.TEAL;
            case "BLUE":
                return Color.BLUE;
            case "NAVY":
                return Color.NAVY;
            case "FUCHSIA":
                return Color.FUCHSIA;
            case "PURPLE":
                return Color.PURPLE;
            case "ORANGE":
                return Color.ORANGE;
        }
        return null;
    }
**```
formal locust
#

god

sudden sand
#

like this πŸ₯²

formal locust
#

ur awsome

formal locust
sudden sand
#

yes

formal locust
#

ok

lyric gyro
#

with something like this you'll be able to just use the getColorFromList method to get all the colors from your config and just use that in your builder

#

kinda like this

night ice
formal locust
#

@lyric gyro thanks :)

lyric gyro
#

yeah i would've just made it quickly instead of making a whole utils class for him

lyric gyro
#

feel like i'm being doubted here...

night ice
#

loll..nah

sudden sand
#

for this code just use a constant Map why create a new one everytime

lyric gyro
#

there

winged pebble
#

So I'm trying to help someone make an item that is glass but it cycles through the colors, I tried just using a runnable to set the type but that doesn't translate to the actual item. Do I really need access to any inventory that the item is in to modify it like that?

winged pebble
# winged pebble So I'm trying to help someone make an item that is glass but it cycles through t...

ie

public class HelmetThing extends ItemStack {
  // ...

  private void startColorCycle() {
      BukkitRunnable runnable = new BukkitRunnable() {
          private int currentIndex = 0;

          @Override
          public void run() {
              Material material = colorList.get(currentIndex++);
              setType(material);
              if (currentIndex >= colorList.size()) currentIndex = 0;
          }
      };

      runnable.runTaskTimer(RandomTest.getPlugin(RandomTest.class), DELAY, CHANGE_INTERVAL);
  }
}```
#

I tried messing with the ItemMeta as well but same result

sudden sand
# sudden sand I keep having this error ```java.sql.SQLTransientConnectionException: HikariPool...

Keep having this error after a few time a execute this method : ```java
public List<OfflineEPlayer> getOfflinePlayers() {
Database database = Plugin.getInstance().getDatabaseManager().getDatabase();

    ResultSet resultSet = database.getAllValue(SettingsManager.PLAYER_DATA_TABLE);

    List<OfflineEPlayer> offlineEPlayers = new ArrayList<>();

    try {
        while (resultSet.next()) {
            offlineEPlayers.add(OfflineEPlayer.getOfflinePlayer(resultSet.getString("username")));
        }
        resultSet.getStatement().close();
        resultSet.close();
    } catch (SQLException e) {
        e.printStackTrace();
    }

    return offlineEPlayers;
}```
#

this is my get all value function :

public ResultSet getAllValue(String table) {
        try {

            PreparedStatement preparedStatement = getConnection().prepareStatement(
                    "SELECT * FROM `" + table + "`");

            return preparedStatement.executeQuery();
        } catch (SQLException sqlException) {
            sqlException.printStackTrace();
            return null;
        }
    }```
night ice
formal locust
#

plz help!

winged pebble
void orchid
#

ah, didn't realize you extended ItemStack

dense drift
#

I dont think you are supposed to do that

formal locust
formal locust
winged pebble
dense drift
#
  1. Wait
  2. Provide code
  3. Wait
formal locust
#

im a nerd plz help me

dense drift
#

Bukkit.getServer().getScheduler().scheduleSyncDelayedTask((Plugin) this, new Runnable() {

winged pebble
dense drift
#

use plugin, you are casting a listener class to Plugin

winged pebble
#

You need to pass in an instance of your plugin

dense galleon
#

Is a world's time in ticks?

#

I'd assume so

broken elbow
#

yeah

dense galleon
#

Aight

wintry grove
#

so, is 4:45am, I'm about to go on a trip and I want to finish something before leaving: how the fuck do you use ByteBuffers? Like I have been looking for guides and so, but my brain cant understand them, I want to take possible ints and strings, buffer them, get a byte or bytes and use them, how would I do so?

wintry grove
topaz gust
#

I just manually do it. (Make own method to handle it)

#

Ensures it’s does it the way you want it πŸ€·β€β™‚οΈ

#

πŸ‘ŒπŸ»

broken elbow
#

just use base64. ez

dense drift
broken elbow
#

yeah. was looking for that

broken elbow
dusty frost
#

What's on line 32 of Rank.java?

broken elbow
#

probably one of these

        plugin.getRankHandler().getRankSet().add(this);
        this.load();```
#

ah

dusty frost
#

Give me exactly line 32

broken elbow
#

but exactly line 32.

#

is it the declaration?

#

yeah. makes sense. since the initialization is not done yet

#

at least that's what I'm thinking

dusty frost
#

I mean, just go down the list

#
if (plugin == null) {
  return;
} else if (plugin.getRankHandler() == null) {
  return;
} else if (plugin.getRankHandler().getRankSet() == null) {
  return;
} else {
  plugin.getRankHandler().getRankSet().add(this);
}```
#

I was going to ask how you were getting that lol

#

Hopefully not a static getter

high edge
#

wat the

broken elbow
#

well yeah. that's the problem. you should probably pass the plugin in the constructor.

broken elbow
#

kek

dusty frost
#

yes exactly

night ice
#

anyone know any good library for GUI/Menu's for 1.18

broken elbow
#

yes. triumph gui

neat pierBOT
broken elbow
#

see first one ^^^

night ice
#

ha...thx mate

#

oo..it have commands framework too

#

grt

broken elbow
#

yeah. not that good. we're waiting for the 2.0 rewrite

#

still using it tho

night ice
#

xD πŸ˜‚ ...i am always lazy to write those commandHandlers and those abstract classes for each and every plugin...

#

so, always try for some frameworks...Aikars ACF was a bit complicated for me

sharp cove
#

Hey i get a error on the entitydamagebyentity event when hitting a NPC

#

Anyone has that too?

#

Don't mind my code it is a bit old.

broken elbow
#

something on line 42 is null. so either userdamager or userdamaged

formal locust
#

i need some help with code.

i want like Message.<message_string> or the <message_string> it self
and it shall return plugin.getConfig.getString("<message_string>")
for p.sendMessage(<message_string>); or p.sendMessage(Message.<message_string>);

#

plz help me

sharp cove
#

but it still scans it like a player

rigid mountain
#

Anyone know a good HikariCp and SQLite tutorial?

lyric gyro
#

the mc font isn't monospaced so you'd have to estimate and align them (there are many sheets out there with the pixel width of each character)

#

but the second someone uses a resource pack w/ a another font, it's invalid

ocean raptor
flat anchor
hard wigeon
#

any idea why this would be null?
getClass().getResource("patreon.yml")

#

patreon.yml is clearly there

flat anchor
#

try adding /, like /patreon.ymla

dusky harness
#

getClass().getResource has never worked for me πŸ™ƒ

hard wigeon
hard wigeon
#

._.

hard wigeon
#

it won't let me import that

#

maybe the wrong import?

dusky harness
#

getClass().getClassLoader()?

hard wigeon
#

oh

#

i'm

#

an

dusky harness
#

πŸ₯²

hard wigeon
#

there was a static import for it

#

so I assumed it was that

dusky harness
#

oh lol

molten wagon
#

I think I broke maven, i try google on it but not find any help. Maven right now add hidden on every package even org,bukkit

#

Have not add any strange thing inside maven some should cause this, do this and no I not compile spigot/paper or something with the plugin.

wintry grove
lyric gyro
#

what even is the question

lyric gyro
#

what dont you get

slim vortex
#

i think this obscure document might have the answers to life

lyric gyro
#

Yo

#

That's crazy!

wintry grove
wintry grove
lyric gyro
#

thats not a question really tho

wintry grove
#

also sorry for being a dick head, just I'm stupid

still glade
#

Hi! Having some issues creating a player head with players that have never joined the server. I've looked everywhere but I think I'm just dumb (or am missing an import). Using the SkullCreator(https://github.com/deanveloper/SkullCreator/blob/master/src/main/java/dev/dbassett/skullcreator/SkullCreator.java) I wanted to make heads for custom fish. The PropertyMap does not show any functions. The function private static GameProfile makeProfile(String b64)(line 260) when it attempts to call .put() on the PropertyMap it just gets highlighted red as if the function doesn't exist. I have looked for alternate solutions and couldn't find any. I have changed nothing from the class on github into my plugin.

somber light
lyric gyro
#

What error

somber light
#

logging the criteria object gave null

sharp cove
#

Does if (event.getView().getTitle().equalsIgnoreCase(plugin.kgetConfig().GUI_name)){Not work with ChatColor.translateAlternateCodes?

formal crane
#

is it possible to add an nbt tag to a gui ?

lyric gyro
#

just compare the inventories with .equals

sharp cove
#

okay, so that should work?

lyric gyro
#

"that"?

#

what you're doing or using .equals on the inventory instances?

sharp cove
#

Yes

lyric gyro
#

.. ?

#

it was not a yes or no question

sharp cove
#

huh

#

i don't get it

broken elbow
#

kek

sharp cove
#

lol

#

nvm

lyric gyro
#

which one of the two were you referring to by "that"?

sharp cove
#

That if i use ''equals'' and not equalsIgnoreCase the problem is voled?

#

But what would that make a difference?

#

Because the thing i am getting is a string

dense drift
#

for equals, "String" and "STRING" aren't equal

sharp cove
#

yes i do know that

flat anchor
#

instead of checking inventory titles

sharp cove
neat pierBOT
sharp cove
#

lol

#

But why using InventoryHolder?

#

Its gonna be deprecated soon

flat anchor
#

which version

sharp cove
#

i dunno, but google it you will find people saying it will be deprecated

flat anchor
# sharp cove But why using InventoryHolder?

Quick example:


class SomeInvHolder implements InventoryHolder {}

class SomeListener implements Listener { 
  @EventHandler
  void click(InventoryClickEvent event) {
    final Inventory clickedInventory = event.getClickedEventory();
    final InventoryHolder holder = clickedInventory.getHolder();
    if (!(holder instanceof SomeInvHolder)) return;
    // else just cast it and get extra data
  }
}
sharp cove
#

hm thanks but that wasn't exactly what i was looking for

#

i just wanted a simple fix for my problem

flat anchor
#

explain problem

pulsar ferry
#

A soon-to-be deprecated

  • Choco 2018
    Soonℒ️ aka "Tomorrow" brought to you by "we'll definitely do it"
flat anchor
# sharp cove .

stripe colours. Title, after translating codes (basing in &) will return Some title instead &9&lSome title

#

but still, checking inventory using titles is bad practice

pulsar ferry
#

Renames an chest "Some Title" boom it is now a gui

flat anchor
#

ye

#

like that

#

so, use InventoryHolder's

pulsar ferry
#

Or compare inventories

sharp cove
#

oke, thankyou

lyric gyro
#

@sharp cove you seem to not have understood my suggestion

#

I said to compare the inventory instances, not the titles (and using InventoryHolder is kinda iffy anyway)

sharp cove
#

oh sorry

#

didn't read that right i think

sharp cove
#

how do i prevent people from taking items from a gui?

#

when i do shift click on some items they still go in my inventory

wheat carbon
#

listen to the relevant event

#

cancel said event

sharp cove
#

i do cancel it

#

but for some items it works but for other ones don't

#

Don't mind my bad code, gonna clean up after.

shell moon
#

player.setHealth(0) fires entity damage event too right?
Good way to detect using damage event is player received damage or if /suicide command was used from plugins (which set health to 0)

dense drift
#

If it doesnt, maybe you can use Entity#setLastDamageCause? There's DamageCause.CUSTOM

#

@wheat carbon does DocDex support nested classes?

wheat carbon
#

yes

dense drift
#

d;spigot EntityDamageEvent.DamageCause%CUSTOM

uneven lanternBOT
dense drift
#

Well

#

d;spigot EntityDamageEvent.DamageCause

uneven lanternBOT
#
public interface DragonFireball
extends Fireball```
DragonFireball has 1 extensions, and  10 super interfaces.
dense drift
#

d;spigot EntityDamageEvent$DamageCause

uneven lanternBOT
#
public static enum EntityDamageEvent.DamageCause
extends DamageCause>```
EntityDamageEvent.DamageCause has 29 fields, 3 all implementations, 2 methods, and  1 extensions.
Description:

An enum to specify the cause of the damage

dense drift
#

nice

wheat carbon
#

oh

dense drift
#

d;spigot EntityDamageEvent$DamageCause%CUSTOM

uneven lanternBOT
wheat carbon
#

I didn't even know it was $

dense drift
#

Was % your idea?

wheat carbon
#

legit don't remember implementing that

#

yes

dense drift
#

Thats how they are stored inside the jar, as a class that has the main class name and then a $

#

Probably that was your inspiration, or it just works xd

dense drift
wheat carbon
#

might just work

#

well

#

what do you suggest

dense drift
#

Also, CUSTOM is 3rd result 🀣

lyric gyro
#

Or just . tbh

dense drift
#

^ better

wheat carbon
#

can't do .

#

can't distinguish between fields & methods

dense drift
#

Can you even search for a method with .?

#

d;spigot Player.getName

uneven lanternBOT
#
public class PlayerMoveEvent
extends PlayerEvent
implements Cancellable```
PlayerMoveEvent has 1 sub classes, 1 all implementations, 9 methods, 1 implementations, and  1 extensions.
Description:

Holds information for player movement events

dense drift
#

d;spigot Player#getName

uneven lanternBOT
wheat carbon
#

doots r for fqns

dense drift
#

for?

lyric gyro
#

Fully qualified name

#

s

dense drift
#

Sad

#

Then # :)

wheat carbon
#

it can't be the same

#

they need to be unique

#

otherwise you need a better search engine

dense drift
#

hm

sharp harbor
#

How would I send a message with deluxechat format?

broken elbow
#

Can you get the unix time using SimpleDateFormat?.

#

like is there any way to format the date to unix timestamp?

wheat carbon
#

System.currentTimeMillis()?

icy shadow
#

just... System.currentTimeMillis()?

#

damn

sharp cove
broken elbow
icy shadow
#

why not

broken elbow
#

because I'm using the server expansion and I really don't want to edit it rn

#

there is a %server_time_<format>% placeholder which accepts simpledateformat

#

which I was hoping to use (also all this is not for me. )

dusky harness
#

I have a list of numbers: 4, 9, 15, 22, 30, 39, 49, 60, 72, 85 but I need it to go 75 numbers total

the pattern is adding 1 more from last add and 4 being the starting number
0 + 4 = 4, 4 + 5 = 9, 9 + 6 = 15, 15 + 7 = 22, etc

dense drift
#

a for with += 1?

dusky harness
dense drift
#

I think thats all you get

icy grail
#

You can do it with streams

dusky harness
#

yeaa

icy grail
#

Is that what you want

proud pebble
#

or a forloop that runs 75 times

dusky harness
#
 (1..75).map {
        var num = 0L
        var i = 0
        repeat(it) {
            num += 4 + i
            i++
        }
        num
    }
#

this is what i have

#

but

#

it looks ugly

icy grail
#
public List<Integer> pattern(int n) {
  List<Integer> list = new ArrayList<>(List.of(n));
  IntStream.rangeClosed(1, 75).forEach(i -> list.add(list.get(list.size() - 1)) + n + i);
  return list;
}```
#

Not very pretty either lol

#

But should work

proud pebble
#

(1..75).map{var num=0L;var i=0;repeat(it){num+=4+i;i++;}num;}

#

your welcome

icy grail
#

Replace 4 with n and yeah

#

But that's really not much prettier

#

Oh I see

#

You just removed the newlines and replaced them with semicolons from his code lol

proud pebble
#

yes

#

if its ugly in many lines, compress it to one line

#

ugly but with less real estate

icy grail
#

I believe it's (n(n-1))/2

#

That or (n(n+1))/2

dusky harness
#

πŸ‘€

#

big brain redempt

icy grail
#

Yeah it's the latter

#

So you could just map each element to that minus the base amount

#
public int[] pattern(int n) {
  int base = sum1to(n - 1);
  return IntStream.rangeClosed(1, 75).map(i -> sum1to(i) - base);
}

public int sum1to(int n) {
  return (n * (n + 1)) / 2;
}```
#

Something like that

broken elbow
#

Hello. Mysql question.

I have a column with text in it and the text that basically is a timestamp. How would I convert the entire row to type TIMESTAMP? Well I know that what I need is somehwo to convert the data from the column to be formated like this yyyy-MM-dd HH:mm:ss because when I try to run ALTER TABLE husktowns_towns MODIFY COLUMN founded TIMESTAMP; it just errors bcz it doesn't accept timestamps...

tame orbit
#

hey, so im making a plugin that uses the worldguard and worldedit apis, and i added them to the pom.xml but whenever i start teh server i get the error:

java.lang.NullPointerException: WorldGuard is not enabled, unable to access the platform.

i have followed the docs best i can but still no luck. also i added worldguard as a depend in plugin.yml
any help is greatly appriciated, as i have been stuck on this for hours. Thanks!
im using intellij ide btw

lyric gyro
#

share pom xml pls thx

#

also full stacktrace + relevant code

rugged bane
broken elbow
#

that's what I'm struggling to do rn

#

I somehow need to loop thru all rows and format that column for that row.

#

I found the STR_TO_DATE method

#

but idk how to loop

lyric gyro
tame orbit
lyric gyro
#

ah sick

tame orbit
lyric gyro
#

err how are you building your plugin exactly? to get the jar file

tame orbit
#

im just doing Build > Build Artifacts

lyric gyro
#

err yeah no, you'll want to use maven for that, 'cause you're shading (bundling) wg within your jar and it's trying to use those classes instead of the actual wg ones

#

in IJ there's a "Maven" tab on the right

tame orbit
#

yea

#

do i build it throuhg there or smth

lyric gyro
#

yeah, uh can you screenshot it? i don't remember the exact layout

tame orbit
#

ok

#

i cant attach a secrenshot here

lyric gyro
#

?imgur

neat pierBOT
#
FAQ Answer:

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.

tame orbit
#

oh sorry , i just dmd it to you

lyric gyro
#

okay so open the Lifecycles section

tame orbit
#

ok

broken elbow
#

@rugged bane I'm struggling to format them. thats the problem.

#

I have 0 mysql knowledge. but this is one of my attempts UPDATE husktowns_claims SET claim_time = STR_TO_DATE(claim_time, '%d-%m-%Y %H:%i:%s');

#

claim_time is column name, husktowns_claims is table name

lyric gyro
#

Well my wifi just died which isn't very nice, anyway double click the "package" one, it'll build your project into a jar file in the target dir

tame orbit
#

ok, i will try that

#

tysm so far

rugged bane
#

0.0

#

If this is live data and you have no experience

tame orbit
#

omg it worked

#

thanks so much @lyric gyro

broken elbow
tame orbit
#

i have asked liek 5 people are you were the most helpful

lyric gyro
rugged bane
broken elbow
#

ugh. well its a backup of actual data

#

that I need to change

rugged bane
#

Oh

broken elbow
#

error

#

lol

rugged bane
#

…..?

broken elbow
#

[2021-12-24 00:37:33] [HY000][1411] Incorrect datetime value: '1638565370494' for function str_to_date

rugged bane
#

On mobile, but try: UPDATE husktowns_claims SET claim_time = STR_TO_DATE(FROM_UNIXTIME(claim_time), '%d-%m-%Y %H:%i:%s');

#

@broken elbow

broken elbow
#

[2021-12-24 00:39:10] [22001][1292] Data truncation: Truncated incorrect unixtime value: '1638565370494'

rugged bane
#

Oh fuck

broken elbow
#

we have it in ms

#

the timestamp

#

does it only accept seconds?

rugged bane
#

The only other thing I could say to try, is removing STR TO DATE function

#

And just having FROM_UNIXTIME

#

Of course with the column

broken elbow
#

so this? ```
UPDATE husktowns_claims
SET
claim_time = FROM_UNIXTIME(claim_time);

rugged bane
#

If else and you’re stuck I can always try tomorrow if the data itself isn’t sensitive

#

And yeah

broken elbow
#

nah. same truncated error

rugged bane
# broken elbow nah. same truncated error

Try change the column to a VARCHAR and set limit to something like 50, I don’t think you need even that, but just for now, and then try run the command again

#

I’m not sure if TEXT column has a small size

broken elbow
#

ok. so it is what I expected. had to change it to seconds

#

basically have to drop lat 3 chars

#

do you know how I can do that not manually?

rugged bane
#

Divide it by /100 I believe

broken elbow
#

ok. no found SUBSTRING 1, CHAR_LENGTH

#

-3

#

it converted. now to convert to timestamp

#

thank you very much @rugged bane. now time to see if it will load it

icy grail
#

Update the inventory how

#

What do you want to do, make sure the counts are still the same? Track changes?

dense drift
#

Any idea how I can add something like this for a custom recipe?
Edit: By looking at the default recipes, group does this, but I will just use a RecipeChoice.MaterialChoice instead of registering 16 different recipes.

dusky harness
#

rn to reset a map I loop through all the blocks in the region and if it isn't air, I set it to air

However, this lags the server... and doesn't even work thonking

#

is there a faster way? maybe using chunksnapshots and running it async (and the setting blocks part sync)

#

how do chunks work? like how can i get a chunk xyz from location xyz

lyric gyro
#

/ 16

dusky harness
#

o
thats it? πŸ‘€

lyric gyro
#

Well, floor(x / 16.0) but yes

dusky harness
#

alr, ty πŸ‘

#

hmm and im assuming World#getChunkAt is supposed to be ran sync?

lyric gyro
#

Yes

lyric gyro
dense drift
#

d;spigot World#getChunk

uneven lanternBOT
#
@NotNull
Chunk getChunkAt(@NotNull Location location)```
Description:

Gets the Chunk at the given Location

Parameters:

location - Location of the chunk

Returns:

Chunk at the given location

dusky harness
#

also, do chunks have a Y limit?

dense drift
#

no

lyric gyro
#

Subchunks are a thing but they aren't part of API

lyric gyro
dusky harness
#

so if i just replace that with chunk

#

theres probably like a hundred blocks per chunk

#

over a hundred

lyric gyro
#

Yeah… and you can put the chunk in a variable in the exact same fashion you do with x,z

dusky harness
#

is World#getChunkAt(x, z) chunk x z or "real" location x z?

dusky harness
lyric gyro
#

Chunk x,z I assume

dusky harness
#

includeMaxblocky – - if true, snapshot includes per-coordinate maximum Y values
and what's this mean?

#

since doesn't it already contain all the blocks in the chunk?

lyric gyro
#

Probably something to do with spawning or lighting idk

dusky harness
#

hm

lyric gyro
twilit fern
#

Can someone make a plugin for /lobby

#

that tp's you to a certain multiverse

#

1.18.1

#

spigot?

dusky harness
#
// sync
for (x in (min.x..max.x).toSet().map { floor(it.toDouble() / 16.0).toInt() }) {
    for (z in (min.z..max.z).toSet().map { floor(it.toDouble() / 16.0).toInt() }) {
        snapshots.add(world.getChunkAt(x, z).getChunkSnapshot(false, false, false))
    }
}
```any way to speed this up? this takes 3-4 seconds :/
#

and it runs on the main thread

#
// async
val blocks = mutableListOf<Location>()
snapshots.forEach { chunk ->
    for (x in (chunk.x * 16) until (chunk.x * 17)) {
        for (z in (chunk.z * 16) until (chunk.z * 17)) {
            for (y in min.y..max.y) {
                val block = chunk.getBlockType(x % 16, y % 16, z % 16)
                if (block == Material.AIR) {
                    continue
                }
                blocks.add(Location(world, x.toDouble(), y.toDouble(), z.toDouble()))
            }
        }
    }
}
```and this throws an `OutOfMemoryError` on the `blocks.add` line even tho theres only like 10 blocks
lyric gyro
#

d;spigot Chunk#getBlockType

uneven lanternBOT
#
@NotNull
Block getBlock(int x, int y, int z)```
Description:

Gets a block from this chunk

Parameters:

x - 0-15
y - 0-255
z - 0-15

Returns:

the Block

pure crater
#

i mean for speeding maybe you could use paperlib and use parallel computing with chunks or smthing

dusky harness
pure crater
#

Here is when Stream#parallel is so juicy

#

lol

pulsar ferry
#

Was the paper async chunk stuff a thing in 1.8?

dusky harness
icy shadow
#

That looks very suspicious

pure crater
#

lol imagine its just a bunch of book bans or whatever

#

like books filled to the brim

icy shadow
#

I don't have all day

#

Get printing

dusky harness
#

oops

#

alr

icy shadow
#

If my suspicions are correct you're gonna have the same chunk 256 times

dusky harness
#

πŸ‘€

#

its a set tho

icy shadow
#

is it?

#

Doesn't .map turn it back into a list

dusky harness
#

wait

#

OhH

icy shadow
#

Also chunksnapshot might not have a properly defined equals

dusky harness
#

oops

lyric gyro
icy shadow
#

now imagine if kotlin had higher kinded types

dusky harness
#

oops, i think i destroyed part of the map

#

did it very quickly though

icy shadow
#

We wouldn't be in this situation

lyric gyro
dusky harness
#

34ms... is that a good amount or

icy shadow
lyric gyro
#

and not only because of that

icy shadow
#

Weak ass type system

lyric gyro
#

if kotlin is SOOO GOOD and took SOOO MANY THINGS from scala

#

where are the higher kinded types

#

huh?

#

pathetic

dusky harness
#

what are higher kinded types

twilit fern
#

Hi

dusky harness
#

Hi

lyric gyro
#

hello

pure crater
#

Hi

lyric gyro
twilit fern
#

can someone create a /lobby plugin

#

for 1.18

pure crater
#

lol

lyric gyro
twilit fern
#

with just /lobby

pure crater
#

No

#

we cant

#

we are not developers

#

obviously

icy shadow
pure crater
#

we just hit keys on a keyboard and pray it works

dusky harness
#

i thought kotlin supported that

icy shadow
#

No like they're all generics

dusky harness
#

wdym

#

im confused

#

πŸ‘€

pure crater
#

No

lyric gyro
#

Foo<T<B>>

pure crater
#

not that

#

Yeah

#

That

#

Like using another generic in place for a generic

dusky harness
#

can u give example

lyric gyro
#

no thanks

icy shadow
#
fun <I : Iterable, T, R> I<T>.map(f : T -> R) : I<R>
dusky harness
#

wha

#

πŸ‘€

icy shadow
#

Works for all Iterables and always returns the same Iterable

dusky harness
#

oh

icy shadow
#

If you give it a Set<T> you get a Set<R>

lyric gyro
#

now make a monad trait with it

icy shadow
#

but List<T> -> List<R>

#

it's more complicated than that but that's the gist

#

Your generics can be generic (higher kinds)

lyric gyro
#

ur a higher kind

icy shadow
#

thanks

lyric gyro
#

they're actually really good

pure crater
#

wow ur high

icy shadow
#

mostly

#

Not polymorphic but oh well

lyric gyro
#

fun <T, It : Iterable<T>, R, Ir : Iterable<R>> It.map(f : T -> R) : Ir moment

#

very depressing

#

really depressing

icy shadow
#

not the same anyway

#

Is it?

lyric gyro
#

it's not

#

yeah

#

kotlin bad

icy shadow
#

pathetic kotlin fail

dusky harness
lyric gyro
#

you should change every Lombok in here to Kotlin

icy shadow
#

true...

lyric gyro
#

?plsnokotlin when

icy shadow
#

Why is Kotlin bad?

  • It's a compiler hack - the Java compiler isn't designed to modify code, so it can cause difficult to debug errors, or worse
  • It requires an IDE plugin, so unless you've properly configured Maven, Gradle and your IDE, you'll get hundreds of compilation errors. This process takes time too, it's not easy
  • Kotlin'd code won't show in Javadocs
  • The code generation is often unpredictable and difficult to debug, and often you'll have to do it "the hard way" anyway
  • Java is supposed to be explicit, Kotlin hides a lot of key functionality into a subtle annotation which can be easy to miss
  • While IDEs support it with a plugin, it's usually more difficult to find specific things, like usages of a getter because they don't exist in the source code
  • Finally, Kotlin'd bytecode doesn't match the source code, so it causes a pretty annoying warning in IntelliJ
#

Omg so true!!

dusky harness
#

hmmm why does it reset like this πŸ€”

icy shadow
#

@PiggyPiglet isn't insert anything kotlin really poorly implemented though?

#

so true again!!

lyric gyro
dusky harness
#
for (x in (chunk.x * 16) until (chunk.x * 17)) {
    for (z in (chunk.z * 16) until (chunk.z * 17)) {
        for (y in min.y..(max.y.coerceAtMost(chunk.getHighestBlockYAt(x % 16, z % 16)))) {
            if (!map.isInRegion(LocationWrapper(world, x, y, z))) {
                continue
            }
            val block = chunk.getBlockType(x % 16, y, z % 16)
            if (block == Material.AIR) {
                continue
            }
            blocks.add(Location(world, x.toDouble(), y.toDouble(), z.toDouble()))
        }
    }
}
```i need ur guys' help again πŸ₯Ί
#
for (x in (min.x..max.x).map { floor(it.toDouble() / 16.0).toInt() }.toSet()) {
    for (z in (min.z..max.z).map { floor(it.toDouble() / 16.0).toInt() }.toSet()) {
        println("SNAPSHOTS added x: $x, z: $z")
        snapshots.add(world.getChunkAt(x, z).getChunkSnapshot(true, false, false))
    }
}
icy shadow
#

🀧

#

yeah I'm out

#

Have fun

dusky harness
#

πŸ₯²

#

😭

#

ok

icy shadow
#

No they're not

dusky harness
#

its only getting 1/4 of the chunk

lyric gyro
#

yes because kotlin sucks at maths

dusky harness
#

;-;

dusky harness
lyric gyro
#

lol

dusky harness
dusky harness
#

but ive got no idea how to fix it πŸ™ƒ

#

oh wait i think i know

#

pog it works now

#

:D

fallow basalt
#

I need help of the plug-in deluxe menu

hard wigeon
wild nexus
#

hello!

#

I have a question

neat pierBOT
#

There is no time to wait! Ask your question @wild nexus!

wild nexus
#

I get the following error message when I'm starting the 1.18.1 spigot:

Error: LinkageError occurred while loading main class net.minecraft.bundler.Main
java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 60.0

I am running the latest version of java have checked.

mental cypress
#

You are on Java 16, it's requiring Java 17.

wild nexus
#

Ah tysmm, but now I have another error:

#

[10:12:10] [ServerMain/FATAL]: Failed to start the minecraft server joptsimple.UnrecognizedOptionException: o is not a recognized option at joptsimple.OptionException.unrecognizedOption(OptionException.java:108) ~[jopt-simple-5.0.4.jar:?] at joptsimple.OptionParser.validateOptionCharacters(OptionParser.java:633) ~[jopt-simple-5.0.4.jar:?] at joptsimple.OptionParser.handleShortOptionCluster(OptionParser.java:528) ~[jopt-simple-5.0.4.jar:?] at joptsimple.OptionParser.handleShortOptionToken(OptionParser.java:523) ~[jopt-simple-5.0.4.jar:?] at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:59) ~[jopt-simple-5.0.4.jar:?] at joptsimple.OptionParser.parse(OptionParser.java:396) ~[jopt-simple-5.0.4.jar:?] at net.minecraft.server.Main.main(SourceFile:87) ~[server-1.18.1.jar:?] at net.minecraft.bundler.Main.lambda$run$0(Main.java:54) ~[?:?] at java.lang.Thread.run(Thread.java:833) [?:?]

#

I got it to work now!

dense drift
#

Any idea how to get a net.minecraft.advancements.Advancement on 1.18.1 nms (paper)?

#

Or any way to get an Advancement, I need to add a children, any bukkit ones are view-only

winged pebble
#

Alternatively, if you cast a bukkit advancement to CraftAdvancement you can get the handle which is the nms Advancement

dense drift
#

nice, ty

robust flower
#

@dusky harness use cuboid

#

then just adapt the code a bit to give you chunks instead of individual blocks

pallid terrace
#

Hello, how I can make a listener in other class and import this on main class?

public void onEnable() {
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            Bukkit.getPluginManager().registerEvents(Join, this);
        } else {
            getLogger().info("Could not find PlaceholderAPI! This plugin is required.");
            Bukkit.getPluginManager().disablePlugin(this);
        }
    }

And I have a listener class

public class Join implements Listener {

    @EventHandler(priority = EventPriority.HIGHEST)
    public void onJoin(PlayerJoinEvent event) {
        String joinText = "%player_name% &ajoined the server! They are rank &f%vault_rank%";

        /*
         * We parse the placeholders using "setPlaceholders"
         * This would turn %vault_rank% into the name of the Group, that the
         * joining player has.
         */
        joinText = PlaceholderAPI.setPlaceholders(event.getPlayer(), joinText);

        event.setJoinMessage(joinText);
    }
}```
And I have error in main class called "cannot find symbol" because plugin doesn't see listener or I bad implementing this.
Anyone can help?
warm steppe
#

change Bukkit.getPluginManager().registerEvents(Join, this); to Bukkit.getPluginManager().registerEvents(new Join(), this);

#

@pallid terrace

formal crane
#

How do i loop every block between 2 locations?

pallid terrace
warm steppe
#

is the plugin enabled?

robust flower
#

also, add a log.info on the event listener method

warm steppe
#

also, remove that priority thing

pallid terrace
#

Now %player_name% joined the server! They are rank %vault_rank%

#

Wait, maybe i need eclouds placehoders

warm steppe
#

that but without maybe

pallid terrace
#

Of course, that's works now

#

I forgot that I deleted the papi folder with placehoders

#

I'm a novice programmer so thanks for the help, now I know a little more, if I have any problems I'll get back to you

urban grove
#

huuuf finaly now i can login

lyric gyro
#

OK

icy shadow
#

OK

formal locust
#

does anyone know how to swich case

pure crater
formal locust
#

public static Message msg(String message){
switch (message){
case "MESSAGE_1":
return plugin.getConfig().getString("MESSAGE_1");

#

like this?

pure crater
#

No

#

Think about it, you didn't specify what to check

formal locust
#

umm

#

String

pure crater
#

?

#

What String?

#

Nope still not correct

formal locust
#

lmao im new to coding ;--;

pure crater
#

you need to pass a string

#

and use that and check for each of the cases

formal locust
#

ok

#

;--;

#

no-idea

pure crater
#

read the guide again

#

it literally tells you what to do XD

formal locust
#

now

formal locust
pure crater
#

There we go

#

now thats correct

formal locust
#

:))

pure crater
#

Nice

proud pebble
#

in PDC how do you use TAG_CONTAINER Data type cause i cant find anything on it?

#

or would it be better to just use nms's nbt stuff

#
PublicBukkitValues: {
  customenchantments:enchantments {
    customenchantments:telekinesis:1
    customenchantments:protection:5
  }
}

cause this looks really ugly tbh

#

tho it would be better if io could figure out how to make a new tag_container instead of using new PersistentDataContainer() cause it produces a bit of boilerplate that makes no sense to me, the .set, .has and .get

dense drift
#

PDC is basically bukkit's nbt implementation

#

I rarely use it, I instead go with just nbt

#

Plus, it is available from 1.14.4 or something

proud pebble
#

why cant bukkit just have methods for changing nbt without all this messing around

#

ill just use nms then

formal locust
#

and if exists send message Config.yml loaded

formal locust
#

can you teach me

#

about it

warm steppe
#

it's christmas, my man, look it up on the internet. Happy Holidays. ✨

olive dirge
#

when using minecraft development plugin on intellij

#

it generates a shading section in the pom.xml

#

is that needed?

warm steppe
#

maven πŸ˜”

pulsar ferry
olive dirge
#

alright thanks

#

I'm trying to figure out how the intellij hotswap works

#

I need to build artifact rather than build project it seems?

rugged bane
#

Piggy has a guide on it

olive dirge
#

oh shoot, where can I find that?

rugged bane
olive dirge
#

found it, thanks

proud pebble
#

turns out #hasTag doesnt seem to exist anymore atleast not obfuscated so anyone know what its called now?

#

also how would i go about decompiling spigot to figure out how all the nms stuff works?

#

nms, what monkey wrote this

lyric gyro
#

paperweight userdev 😌

hoary scarab
#

Fast wrote this. Any ideas for something cleaner?
if(Arrays.asList(inv.getContents()).stream().filter(i -> (i != null && i.getType() != Material.AIR)).collect(Collectors.toList()).isEmpty()) return;
Checks whether or not an inventory is empty.

icy shadow
#

πŸ₯΄

#

Arrays.stream, redundant parens in your filter lambda

#

and !findAny().isPresent() is probably better than list -> isEmpty

hoary scarab
icy shadow
#

Arrays.stream instead of asList->stream

#

and you don't need the parentheses in your filter lambda

hoary scarab
#

Ah missread my bad

icy shadow
#

you could also just... inv.firstEmpty() != -1

broken elbow
#

lmaooo

hoary scarab
#

not empty ones

#

if(!Arrays.stream(inv.getContents()).findAny().isPresent()) return; Thx.

broken elbow
icy shadow
#

lol

broken elbow
#

yeah ^^^

hoary scarab
broken elbow
#

like you can use firstEMpty for both if the inventory is full or if it has empty slots

broken elbow
dusky harness
#

-1 only works when the inventory is full

hoary scarab
#

^^^^^

icy shadow
#

dude

dusky harness
#

and non -1 is whenever the inventory is not full

#

not full does not mean empty

icy shadow
#

what?

hoary scarab
icy shadow
#

...

#

i said that...

broken elbow
#

kek

hoary scarab
broken elbow
#

yeah. but first he said != -1

icy shadow
dusty frost
hoary scarab
#

Ah yeap misread lol

dusky harness
#

let's say theres an item in the inventory java System.out.println("Is empty: " + (inv.firstEmpty() != -1)); this would print out true even though the inventory is not empty

hoary scarab
#

I'll just test both 🀷

broken elbow
#

wait

#

doesn't inventory literally have a isEMpty

#

method?

broken elbow
#

d;spigot Inventory#isEmpty

uneven lanternBOT
#
boolean isEmpty()```
Description:

Check whether or not this inventory is empty. An inventory is considered to be empty if there are no ItemStacks in any slot of this inventory.

Returns:

true if empty, false otherwise

dusky harness
#

πŸ₯²

hoary scarab
#

What version was that added? Thats probs why I don't have it xD

icy shadow
#

like

dusky harness
#

also who is Fast?

icy shadow
#

always

dusty frost
#

are you on 1.8 or something?

dusky harness
#

d;1.8.8 Inventory#isEmpty

uneven lanternBOT
#
void setItem(intΒ index, ItemStackΒ item)```
Description:

Stores the ItemStack at the given index of the inventory.

Parameters:

index - The index where to put the ItemStack
item - The ItemStack to set

hoary scarab
#

Yeah my plugin is based in 1.8 and supports up to 1.18.1 so for my other plugin I'll just use Inventory.isEmpty.

dusty frost
#

I still can't believe people make plugins for 1.8

hoary scarab
dusty frost
#

Ah well you should upgrade it then!

hoary scarab
#

I've been supporting newer versions ever since

dusty frost
#

Cast away the chains of 1.8

broken elbow
#

then just use Inventory#getContents#isEMpty

hoary scarab
broken elbow
dusty frost
#

Get Java 17

#

Could be very cool stuff

hoary scarab
#

It will have null objects for every slot

broken elbow
#

oh.

#

Ic

hoary scarab
#

Hence the stream/filter

broken elbow
#

yeah. makes sense.

hoary scarab
#

Well I'll test both the first empty and findFirst mthods. Thx guys

#

Is there something other than an array Object[] and map Map<Key, Value> that you can put in 1 entry? I know I could use both of those but just wondering if there is more.

dusty frost
#

I am still confused

hoary scarab
dusty frost
#

What does "put in 1 entry" mean

hoary scarab
#

For like map you can have multiple entries. The array I have is 1 entry but I use Object because its different objects in the array I want. So something like Map but only allows 1 entry rather then multiple.

dusty frost
#

Like, a pair?

hoary scarab
#

Yes!

#

Thank you lol

dusty frost
#

That was such a weird way to describe that lol

icy shadow
#

Multimap / Table

hoary scarab
hoary scarab
graceful hedge
#

Why not

#

When you want something like
Map<K,Collection<V>> even java proposes a Multimap ish by using computeIfAbsent and computeIfPresent, which is basically what something like ArrayListMultimap would do for you, how nice! Free abstraction!

dusty frost
#

see but I don't trust Java with zero-cost abstractions

lyric gyro
#

there are no zero-cost abstractions

dusty frost
#

Everything in this world is an object, and it'll probably sneakily box it fo ryou

#

Oh Emily, have you heard of Rust?

lyric gyro
#

no abstraction is zero-cost

dusty frost
#

Quite a few in Rust are, actually

lyric gyro
dusty frost
#

Such as like the Option enum in Rust

lyric gyro
#

what about it?

dusty frost
#

It's zero-cost. The size is just whatever the actual data is

lyric gyro
#

i have no idea what that even is

dusty frost
#

What what is?

#

The Option enum?

lyric gyro
#

i suppose

dusty frost
#

It's either Some(T) or None

graceful hedge
#

Should be pretty reliable

dusty frost
#

Well see I don't think it's Guava's fault

lyric gyro
#

okay.. how is that zero-cost?

dusty frost
#

It has no overhead over just returning the normal thing

lyric gyro
#

also how is that an enum lol

dusty frost
#

Emily my girl

#

you need to look at Rust

lyric gyro
#

no thank you

dusty frost
#

Aren't you a C++ addict?

lyric gyro
#

it's not zero-cost

dusty frost
#

Zero-cost at runtime bestie

#

That's what matters

lyric gyro
#

not really, wait until you find yourself hitting a compilation timeout lol

dusty frost
#

Try Rust

lyric gyro
#

it's a tradeoff

#

no

dusty frost
#

It's a tradeoff I am extremely willing to make lmao

lyric gyro
#

I know, but you're making claims that aren't

dusty frost
#

And I'm not going to sit here and argue with you about a language you have never even tried

lyric gyro
#

no abstraction is zero-cost

dusty frost
#

It's what Rust calls it

#

And the measure of "cost" is runtime

lyric gyro
#

and it's wrong

dusty frost
#

I mean it's not

#

At runtime, there is zero-cost to the abstraction

#

As with many others

dusty frost
#

Rust compiles extremely quickly

lyric gyro
#

ok and?

#

the overhead is still there

lyric gyro
#

just because it isn't present at runtime doesn't mean it doesn't exist

dusty frost
#

When the point of a language is to write fast code, the cost is speed at runtime

#

You're just arguing pedantry now

lyric gyro
#

the ability to move certain behaviors to compile time execution
so they're acknowledging it exists by moving it to compilation stage

#

that's misleading

dusty frost
#

Oh my god

lyric gyro
icy shadow
#

i think it may be time for :norust:

graceful hedge
#

Lol

dusty frost
lyric gyro
#

but it's more accurate to what you're describing

#

and non-misleading

icy shadow
#

this ratio is zero-cost

lyric gyro
mental cypress
#

Ratio.

icy shadow
#

😩

#

ratio denied

mental cypress
#

B...b...but

dusky harness
#

πŸ‘€

lyric gyro
mental cypress
#

Thought that said depression at first

lyric gyro
#

mood

dense drift
#

🀣

broken elbow
graceful hedge
broken elbow
#

yes I know

#

wait wtf. a few refreshes fixed most of all except for the spigot one

#

gonna do a few more lol

dense drift
#

Thats from vault

#

You gotta exclude it

#
<exclusions>
  <exclusion>
    <group>org.spigotmc</group>
  </exclusion>
</exclusions>```
Add this to vault block
broken elbow
#

yeah idk. it just built

#

like that

#

so I am not going to worry about that anymore

#

just had to remove 4 messages lol

dense drift
#

Okay

clear wing
#

anyone know how to decompile and recompile after editing class files? I need to change some of a plugins features from 1.9-1.8 IDs

cinder forum
#

Hi, how bad idea is to load config into memory on enable and get values from that πŸ€”

dense drift
#

Config is loaded in memory anyways

cinder forum
#

well but accessing it is pain

dense drift
#

Yeah. Feel free to load the data in memory in any way.

cinder forum
#

ooh nice :-) one more question

when config for menu looks like this:

KITS:
    NAMEOFKIT1:
        ICON: MATERIAL1
        SLOT: 0
        DESCRIPTION:
        - "&cHi!"
        - "&dLol :-)"
    NAMEOFKIT2:
        ICON: MATERIAL2
        SLOT: 3
        DESCRIPTION:
        - "&cHi!"
        - "&dLol :-)"
    NAMEOFKIT3:
        ICON: MATERIAL3
        SLOT: 5
        DESCRIPTION:
        - "&cHi!"
        - "&dLol :-)"

Is it better to transform data on enable to something like this

0:
  ICON: MATERIAL1
  DESCRIPTION:
  - "&cHi!"
  - "&dLol :-)"
3:
  ICON: MATERIAL2
  DESCRIPTION:
  - "&cHi!"
  - "&dLol :-)"

then just do inventory.setItem(i, ...) instead of messing with configuration section on the menu load, right? If yes, what is the best way to save that and access it then?

lyric gyro
#

Load into memory onEnable

#

Then it doesent matter

cinder forum
#

does Spigot have some lib that make storing and accessing data in memory easier or should I use some vanilla way

dusky harness
#

oh r u talking about config ymls

icy shadow
#

aa

cinder forum
#

aa?

icy shadow
#

you heard me

cinder forum
#

😳

icy shadow
#

πŸ˜„

lyric gyro
dusky harness
#

I'm trying to make xp bottles increase my own xp in my plugin, not mc xp
How could I do this?

I've tried using PlayerExpChangeEvent but since xp orbs merge together, if I throw the bottles fast, it only calls the event once :/

icy shadow
#

d;spigot PlayerExpChangeEvent

uneven lanternBOT
#
public class PlayerExpChangeEvent
extends PlayerEvent```
PlayerExpChangeEvent has 5 methods, and  1 extensions.
Description:

Called when a players experience changes naturally

icy shadow
#

well

dusky harness
icy shadow
#

getAmount will give you how many

#

so

#

assume that 1 is 1 point and then multiply or smth

#

idk

dusky harness
#

but it's randomized whenever u throw an xp bottle

lyric gyro
#

Ok remake exp bottles

#

Ez fix

dusky harness
#

hm

#

πŸ₯²

lyric gyro
#

Or deal with the randomizing

dusky harness
#

what if i just disable xp orb merging?

#

πŸ‘€

#

via spigot.yml

#

ooh i have idea

#

ExpBottleEvent#setExperience

#

setting that to 1

icy shadow
#

🀨

dusky harness
# icy shadow 🀨

because the xp bottles are what makes it random - so if i make it always 1, then it's not random anymore

#

seems to work

icy shadow
#

but if it merges

dusky harness
#

it combines

#

it doesn't randomize anything when merging

#

it just combines the xp values

icy shadow
#

but if 2 merge the xp will still be 1

#

oh

#

i see what u mean

#

when the bottle throws

#

yea that should work

dusky harness
#

:D

#

pog

#

it works

#

:))))))D)DDDDDDD)))))

icy shadow
#

xDDDDDDDDDDDD

#

:DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD

dusky harness
#

πŸ™ƒ

graceful hedge
#

Lol xd ttyl brb gtg tmi fyi rolfmao

hard wigeon
#

guys, anyone used Prisma in typescript? I can't figure out where to look for docs on things more complicated than examples, and the create method doesn't work correctly