#help-development

1 messages ยท Page 43 of 1

eternal night
#

I mean, if you don't need them, just exclude them

arctic moth
#

it doesnt let me package without it

tardy delta
#

ah dependency i mean

eternal night
#

yea but you can exclude it from the essentialsx dependency

dense pine
#

hey, ive never built plugins with gradle, what do i do with this error?

eternal night
#

just google "maven exclude transitive dependencies"

arctic moth
#

ok worked thx

#

lol

worldly ingot
#

Either it's just got some downtime and Aikar's working on bringing it back up, or it's been permanently relocated. Not sure. Aikar's been mostly MIA for a while

dense pine
#

so i basically cant compile the plugin rn

eternal night
#

aren't those in maven central too ?

boreal seal
#

Task #1 for Plugin v1.0-SNAPSHOT generated an exception
java.lang.ArrayIndexOutOfBoundsException: Index 12 out of bounds for length 8

#

what does it mean

#

it points to line which if i remove it works fine

#

the line just plays sound

desert frigate
#

How can I upgrade seeds to the next state? Basically like bonemeal

kind hatch
late sonnet
sacred mountain
#

how do people understand mojangs fields

kind hatch
#

Trial and error. And the mappings I guess. :PP

sacred mountain
#

i've seen videos of people just coding with it

#

like on the fly

#

bru ok

#

thought there was some sort of tutorial for it

tardy delta
#

it doesnt know what to do with locations and now not with records too pff

kind hatch
cold tartan
#

how do you make text not italic with the component system?

kind hatch
#

Give it a color code. Vanilla minecraft applies an italic look to custom text for some reason. So if you want to get rid of it, you need to overwrite the default styling.

tardy delta
#

or ChatColor.RESET + "test"

cold tartan
#

ok

#

oh shoot

glossy scroll
cold tartan
glossy scroll
#

truthfully, it can sometimes take me hours to understand the code even with the mappings

#

deciphering all the decompiled code can be tricky

sacred mountain
#

oh

glossy scroll
#

reset will reset the text do its default state in context

#

e.i. if i used reset on an item name, it would be italic, because custom item names are normally italic

kind hatch
#

Code Review & Suggestions

last swift
#

How can I modify the way damage/knockback works in 1.8? I have this method, but the animation isn't sent (ex. the player doesn't flash red), the knockback is too consistent (isn't different based on where the player is hit, what item is used to hit them, etc.), the damage isn't affected by armor (they take the same damage as if they didn't have armor), etc. Is there a way to only affect knockback? I want to specifically modify the knockback the player takes and reduce the amount of damage an arrow deals.
Event Listener: https://sourceb.in/31lklRP6Zd
Combat class: https://sourceb.in/b6wGxxn4g9

glossy scroll
#

?1.8

undone axleBOT
last swift
#

I'm using 1.8 for the way PvP functions in that specific version.

delicate lynx
#

add that to the bingo card

lost matrix
last swift
#

That's fair enough. Mb

vocal cloud
#

1.19 can definitely do very similar PvP. Not only that but if you want a successful server you'll either need to innovate on an ancient system or get really lucky.

vital sandal
#

How to respawn player without killing him first

vocal cloud
#

Uh in order to respawn they kinda have to die

#

You can always clear their inventory and such manually then move them to their spawn

amber vale
#

How could I convert a string (command argument) into EntityType?

lost matrix
vital sandal
#

Is there anyway to fake respawn

glossy scroll
#

@vital sandal

#

?xy

undone axleBOT
lost matrix
amber vale
vocal cloud
#

Wipe the player inventory, reset levels, teleport them to where you want them to be?

lost matrix
amber vale
vital sandal
#

I tried setHealth(0) then spigot.respawn()
But that make chunk around reload

tranquil viper
#

Anyone know any libs or apis that can easily do full armor set effects like particles or potion effects?

lost matrix
undone axleBOT
vocal cloud
amber vale
glossy scroll
#

you should probably do args[0].toUpperCase or something like that

lost matrix
tranquil viper
amber vale
# lost matrix good

I know how to google stuff ive coded plugins for like a year but sometimes my brain just farts and I be asking the most basic shit :D

tranquil viper
#

I have an update in like 10 mins and I forgot to put haste on the full set

vocal cloud
#

Better yet you can add the ability to have autocomplete and pass in all the enum values so they can tab complete the right entity

amber vale
lost matrix
vocal cloud
#

Ah time constraints. Bugs I hardly knew ya

tranquil viper
#

eh people will just have to deal with it for 30 mins until I finish it tbh

lost matrix
#

Is this some type of kit pvp fkery?

vocal cloud
tranquil viper
#

nah

glossy scroll
#

i mean ideally you would wait until the code is complete to announce an update

#

and between announcement and release youre constantly testing it

amber vale
lost matrix
#

Cancel the damage in 50% of the events to have effectively 50% more durability

waxen plinth
#

Cancel PlayerDamageItemEvent

vocal cloud
#

You can also limit the damage taken to 1 point per hit maximum

waxen plinth
#

Yeah

#

Does your armor have unbreaking

#

Cause that's what unbreaking does

#

It just completely cancels the damage a certain % of the time

lost matrix
#

Use a combination of the suggestions

tranquil viper
#

Bro

vocal cloud
#

Snort a tonne of cocaine and write your own durability system works too

tranquil viper
#

Anyone know why intellij dies every time I paste

waxen plinth
#

Probably windows

tranquil viper
#

Like it freezes up and takes 37 years to process

lost matrix
tranquil viper
#

and maxes cpu usage

vocal cloud
#

Certified MC plugin moment

tranquil viper
waxen plinth
#

Windows moment

tranquil viper
#

It's not a potato

#

It's intellij

vocal cloud
#

If you're using the MC plugin that's a part of it

lost matrix
waxen plinth
#

lol

vocal cloud
#

Also increase the max memory

tranquil viper
#

This is what I pated for reference:

ArrayList<String> decentLore = new ArrayList<>(Arrays.asList(format("&c"), format("&f&m                &r&f[EFFECTS]&m               "), format("&l&7ยป&r &eHaste II"), format("&c"), format("&f&m                 &r&f[STATS]&m                 "), format("            &8(In Deep Mines)"), format("&l&7ยป&r &cMob Damage &f-40%"), format("&l&7ยป&r &aPlayer Damage &f-20%"), format("&c"), format("&8Must Have Full Decent Set")));
                            player.getInventory().addItem(createLeatherArmorPiece(hexColor("#2935FFDecent Cap"), Color.fromRGB(41, 53, 255), Material.LEATHER_HELMET, 1, decentLore, "DECENT"));
                            player.getInventory().addItem(createLeatherArmorPiece(hexColor("#2935FFDecent Tunic"), Color.fromRGB(41, 53, 255), Material.LEATHER_CHESTPLATE, 1, decentLore, "DECENT"));
                            player.getInventory().addItem(createLeatherArmorPiece(hexColor("#2935FFDecent Slacks"), Color.fromRGB(41, 53, 255), Material.LEATHER_LEGGINGS, 1, decentLore, "DECENT"));
                            player.getInventory().addItem(createLeatherArmorPiece(hexColor("#2935FFDecent Booties"), Color.fromRGB(41, 53, 255), Material.LEATHER_BOOTS, 1, decentLore, "DECENT"));
waxen plinth
#

pated

vocal cloud
#

Disable MC plugin try again

tranquil viper
#

Love how that freezes intellij

tranquil viper
tranquil viper
amber vale
tardy delta
vocal cloud
#

Disable MC plugin then

tranquil viper
#

It's just a blank maven project

vocal cloud
#

Do you have the MC plugin?

tranquil viper
#

no

#

I don't even know what that is

vocal cloud
#

Oh well then ur PC is a potato

tranquil viper
#

It's not tho

amber vale
waxen plinth
#

I was only half joking about it being windows

tardy delta
#

average linux user

waxen plinth
#

There's a very good chance that if you run it on linux you would not encounter that issue

hybrid spoke
#

probably not the OS, nor the the pc

lost matrix
# tranquil viper wdym?

Get jetbrains toolbox and update to the latest version. Then make sure your plugins are up to data.
Im almost certain that this is caused by an external ij plugin, your anticheat, a virus or your potato specs

hybrid spoke
#

its intellij

waxen plinth
#

Well it might not necessarily be windows itself

tranquil viper
lost matrix
#

I can run intellij on my raspberry pi...

waxen plinth
#

It might be something else about the environment

tranquil viper
#

Linux is so horrible

waxen plinth
#

And if you run it on linux it will be in an entirely different environment

hybrid spoke
#

do you have any code inspec plugins?

waxen plinth
#

So it'd probably be different enough to work

tranquil viper
#

I have no plugins

lost matrix
#

Update your ide

tranquil viper
#

I know it's better than windows

glossy scroll
#

have u tried restarting ur pc

tranquil viper
#

yes

#

It stopped for a while

waxen plinth
#

Have you tried reinstalling intellij

#

Do you have any other things running that might be hogging cpu

tranquil viper
#

yes I've literally tried everything at this point

#

All I have is mc and intellij

glossy scroll
#

are u using community edition

waxen plinth
#

Ok then that's why I recommend trying to run it on linux

tranquil viper
#

than yes

waxen plinth
#

Doesn't wsl support graphical now

lost matrix
waxen plinth
#

Yeah you could try running it within wsl

tranquil viper
#

Imma just go back to eclipse if this don't work

glossy scroll
#

ultimate edition ๐Ÿ˜Ž

waxen plinth
#

Try running it within wsl

#

If you really want to try everything

tranquil viper
#

I have like 20 mins to code this

waxen plinth
#

Oh

lost matrix
waxen plinth
#

Why so little time

tranquil viper
#

Cause I have an update and forgot to add a feature

glossy scroll
#

or the ms paint editor

waxen plinth
#

lol

#

Just push it back dude

vocal cloud
#

Gotta pay for intellij

opal epoch
#

Bump

waxen plinth
#

Nobody's gonna be so mad if it's one hour late

glossy scroll
#

or literally just say this feature will come tomorrow

tranquil viper
waxen plinth
lost matrix
waxen plinth
glossy scroll
#

get new players

opal epoch
#

Cock

#

Ok

waxen plinth
opal epoch
#

Thx

tranquil viper
waxen plinth
#

Bruh

amber vale
#

Start with 15 minutes

#

Next update 30

golden kelp
#

Is there anyway I can compress a Location object? I just want XYZ

amber vale
#

Then an hour

waxen plinth
#

Why would you make a promise about the exact time an update will drop anyways

tranquil viper
#

imma just perm shutdown

golden kelp
amber vale
#

Slowly get them used to it c:

golden kelp
tranquil viper
waxen plinth
#

Normally updates are at some unspecified time within a 24 hour window

tranquil viper
#

It's for my server

#

Not a random spigot pluign

amber vale
glossy scroll
#

i mean

lost matrix
#

I always do mine monday night at 3 AM
Automated update with a 1h notice.

glossy scroll
#

we're not the ones to complain about your poor planning lol

#

we help with dev solutions

#

not necessarily server management

lost matrix
#

Having an exact schedule for updates is important for production servers.

waxen plinth
#

You can also get me to write the feature

golden kelp
#
    public static HashMap<Vector, Material> blocksForIceman = new HashMap<>();

Whytf does intelliJ ask me to generify my class

waxen plinth
#

Send me the code I'll do it

#

Because it should be Map

lost matrix
glossy scroll
#

public static

#

seems like static abuse here

#

also final... maybe?

waxen plinth
#

There is no functionality that is specific to HashMap that isn't exposed by the Map interface

#

So use the Map interface

golden kelp
waxen plinth
#

It's always best to use the least-specific type you need for every field

#

It makes things more flexible

lost matrix
waxen plinth
#

^

glossy scroll
#

?di

undone axleBOT
waxen plinth
golden kelp
#
  • Half of the package names are in spanish ๐Ÿ˜‚
waxen plinth
#

blocks for iceman

golden kelp
#

I need to ask the guy what specific package means just so I can work on it

#

oh yea and checkout this monstrosity

#

?paste

undone axleBOT
amber vale
golden kelp
#

Its not me

lost matrix
golden kelp
amber vale
#

Like if they were all in Spanish it would be understandable but HALF?

glossy scroll
#

yea i swear you could perform a satanic ritual with some of those errors

gritty sierra
#

Having trouble changing the skin here's my code

glossy scroll
#

same with the serialization errors

golden kelp
#

sometimes i regret working here but man is the pay good

amber vale
golden kelp
waxen plinth
#

Setting a player's skin, presumably

#

I've done that before, I think it's a lot more involved than that

#

Like a lot

#

Best to use an existing api if you can

#

The last solution I made for that was for 1.12 and used nms

lost matrix
golden kelp
golden kelp
waxen plinth
#

JSONSimple?

#

No use RedJSON

opal juniper
#

shill

waxen plinth
#

lol

golden kelp
#

oh i finally found you

gritty sierra
golden kelp
#

you are the guy who names his plugins with the prefix Red right?

glossy scroll
#

gson is a lot less robust than i wish it was

waxen plinth
#

Yeah, which ones have you seen

golden kelp
#

RedLib

waxen plinth
#

I mean the only one I put on spigot that starts with red is RedLib

#

lol yea

lost matrix
#

Setting a players skin in 1.19 is like 3 lines

waxen plinth
#

Where did you even see it

amber vale
#

Okay but I was ment to fix a bug with an existing plugin for a server I play with friends, instead ive spent 2 hours straight working on my own rpg stats plugin

opal juniper
#

PlugWoman chefskiss

golden kelp
#

i took inspiration from you

#

now I name my plugins "oUHC" "oCrypt"

glossy scroll
#

PlugTheySlashThem

waxen plinth
#

Oh lol

golden kelp
waxen plinth
#

๐Ÿคจ

golden kelp
#

but did they actually change the name to PlugWoman?

waxen plinth
#

I made PlugWoman

glossy scroll
#

i shouldnt have said anything.

lost matrix
opal juniper
#

i love how there is literally 0 docs on how pdf encryption works

golden kelp
amber vale
golden kelp
#

NerdNovato xd

waxen plinth
#

It's not all of my plugins that start with Red

#

Though many of my projects do

golden kelp
#

yo red, so i searched up "PlugWoman", and the 2nd result is butt plugs

waxen plinth
#

Usually when I can't think of a better name lol

amber vale
#

Like literally every plugin ive made in the past few months as personal projects have started with Nerd

#

It's a funny story, it's cause only nerds will ever use my plugins

#

(me)

waxen plinth
#

Must be personalized search results, vinesh

golden kelp
#

man i want a plugin idea that i can make a youtube video out of

#

like fundee made snake in minecraft

waxen plinth
amber vale
golden kelp
waxen plinth
#

duckfuckgo?

golden kelp
#

yea

waxen plinth
#

which is what

golden kelp
#

beastiality version

#

nah jk i use the new brave thing

opal juniper
#

i find ddg too goofy of a name to use

lost matrix
# waxen plinth Setting a player's skin, presumably
  public void changeSkin(Player player, URL skinUrl) {
    PlayerProfile profile = player.getPlayerProfile();
    profile.getTextures().setSkin(skinUrl);
    player.setPlayerProfile(profile);
    player.spigot().respawn();
  }

Something like this

golden kelp
#

its basically duckduckgo but red theme

golden kelp
lost matrix
#

Nope

lost matrix
#

all api

golden kelp
#

idk why i wet my pans when I see nms

waxen plinth
#

Holy shit the api has come such a long way

golden kelp
#

indeed

#

from being made by a nerd to being sold to metaverse

lost matrix
#

based

waxen plinth
golden kelp
#

Say your favourite color without saying your favourite color

#

Red:

waxen plinth
#

Purple

golden kelp
#

well

waxen plinth
#

Genuinely, purple is my favorite color

opal juniper
#

i havent looked at ordinate, lemme take a gander

opal juniper
waxen plinth
#

Ollie can I show you some code samples

golden kelp
#

then name it RedPurpleLex, the prefix is longer than the name

waxen plinth
#

A function from each

golden kelp
waxen plinth
#

Nope

lost matrix
eternal night
#

yea the player textures exist

#

but no setter on the player

#

on spigot

#

iirc

amber vale
#

Whoever asked for an idea just make chess into minecraft with 3d models n stuff

lost matrix
amber vale
#

Like you have to aim at the piece on the board and then at the spot to move it on

golden kelp
amber vale
#

And it just works as chess

golden kelp
#

thats actually a sick idea

opal juniper
golden kelp
#

imma make it

waxen plinth
#

Eh

#

Purple is way better

golden kelp
#

nah

#

oh actually

#

transparent is the best colour

#

or white cuz it can be anything

waxen plinth
#

This flag is set as my profile mostly because purple is so aesthetic and it has a lot of purple lol

#

Neither of those are colors

golden kelp
#

not the straight flag tho

amber vale
#

Imagine planning projects and not just vomiting on your keyboard and hoping that it works

glossy scroll
#

transparency is the absence of color

waxen plinth
#

Well white is

#

It's not a wavelength though

golden kelp
#

anyways i gotta work xdd my adhd

waxen plinth
#

Don't you have like 5 minutes by now

#

Wait no

#

That was the other guy

opal juniper
#

whats the gradle command to build a project to m2

#

is it buildToMavenLocal

amber vale
#

33% of my time goes to coding 33% to listening to music and 33% to talking random crap on discord

#

dont ask where that 1% goes you dont want to know

eternal oxide
#

only 1%

eternal night
#

publishToMavenLocal

eternal oxide
#

your a Nun

amber vale
#

Yeah man i dont last long

waxen plinth
opal juniper
#

yes

waxen plinth
#

lol nice

amber vale
#

More time for coding though

waxen plinth
#

It's not really in a workable state right now

#

Like it'll work but you have to do some things yourself

lost matrix
waxen plinth
#

Essentially just implement CommandManager

#

But all CommandManager does is return other dependencies

#

Which you also have to implement

opal juniper
#

great

waxen plinth
#

I basically wrote the core of the framework and all it needs to work

#

But then didn't write the platform-specific implementations of it

opal juniper
#

FYI you need a mavenCentral() in the spigot module

waxen plinth
#

Do I though

#

I don't use any maven central dependencies

opal juniper
#

it doesnt fuckin work if not

waxen plinth
#

It did for me

opal juniper
#

couldnt find guava or some shit

waxen plinth
#

Weird

lost matrix
#

The spigot repo should provide it

#

Because spigot pulls it transitively through its own repo

opal juniper
#

idk then

#

weird

waxen plinth
#

The stuff with chat signing and adventure honestly really killed my motivation to finish the implementation of the command manager

vocal cloud
#

Yeah, you get the dependencies of the dependencies you use unless they scope them as provided

waxen plinth
#
  • brigadier support
#

All the stuff I would need to do to make it properly professional

#

No motivation for it

opal juniper
#

this ComponentFactory is ๐Ÿ˜ตโ€๐Ÿ’ซ

golden kelp
opal juniper
#

i honestly never bother with command frameworks and just register them normally

sacred mountain
#

wrong chat lmfa

opal juniper
#

looks cool, but not necessarily designed to just be a simple boilerplate killer

eternal night
#

โ˜๏ธ cloud โ˜๏ธ

opal juniper
#

lol, anyways i need to get back to finding any documentation on PDF's

golden kelp
#

my mind is kinda fucked up

#

so

import com.annihilation.core.kits.*;
import com.annihilation.core.JuegoAnni.*;
import com.annihilation.core.mapaAnni.*;
import com.annihilation.core.utils.*;

Why do star imports not work sometimes

opal juniper
#

define not work

river oracle
#

Start imports ๐Ÿ’€

#

Don't get them just use an ide

golden kelp
#

ou so, when i compile, it works

glossy scroll
#

they should always work

golden kelp
#

maybe intelliJ is drunk

glossy scroll
#

ur ide must just be fucked

golden kelp
#

yea

glossy scroll
#

is it on the right java vesion

golden kelp
#

yea

#

suck it intelliJ

glossy scroll
#

Build -> Rebuild Project sometimes works

golden kelp
#

uhm so

#

I got two plugins, lets name em X and Y

Y uses X as a dependency, I made a change in X, now what do I do to get the changes in Y, do I just need to reload my IDE?

river oracle
#

Reload maven dependencies

#

Then they should apply if not reload your ide

golden kelp
#

its not maven, its my local jar

river oracle
#

Wtf is wrong with you

#

Use a dependency manager

golden kelp
#

nvm it is

vocal cloud
#

Install the one you want to use and use it

golden kelp
#
 <dependency>
            <groupId>com.annihilation.core</groupId>
            <artifactId>AnnihilationCore</artifactId>
            <version>1.0-SNAPSHOT</version>
            <scope>compile</scope>
        </dependency>
#

and boom now intelliJ thinks it doesnt exist

river oracle
#

Make sure you run maven install

#

On the other one

golden kelp
#

the dependecy or?

river oracle
#

Yea that's how you build it to the m2

golden kelp
#

brah now we are just playing ring around the rosy

#

oops wrong channel

crimson scarab
#
    public void SetLore(ItemStack IS, String piece) {
        ItemMeta IM = IS.getItemMeta();

        if (IS.getType() == Material.LEATHER_BOOTS || IS.getType() == Material.LEATHER_LEGGINGS || IS.getType() == Material.LEATHER_CHESTPLATE) {
            LeatherArmorMeta LM = (LeatherArmorMeta) IM;

            LM.setColor(Colour);
            LM.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, true);
            LM.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_DYE, ItemFlag.HIDE_ENCHANTS);
            LM.setDisplayName(ChatColor.LIGHT_PURPLE + Name + " " + piece);

            Key = new NamespacedKey(GreatGear.getPlugin(GreatGear.class), Name);
            PersistentDataContainer container = LM.getPersistentDataContainer();
            container.set(Key, PersistentDataType.INTEGER, 1);
            IS.setItemMeta(LM);
        } else {
            IM.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, true);
            IM.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_DYE, ItemFlag.HIDE_ENCHANTS);
            IM.setDisplayName(ChatColor.LIGHT_PURPLE + Name + " " + piece);

            // SET PDC
            Key = new NamespacedKey(GreatGear.getPlugin(GreatGear.class), Name);
            PersistentDataContainer container = IM.getPersistentDataContainer();
            container.set(Key, PersistentDataType.INTEGER, 1);
            IS.setItemMeta(IM);
        }
        
    }
#

How can I make this more efficient

#

i feel like this could be done another way

glossy scroll
#

you need to install the dependency to your local maven repo

eternal night
#

I mean, naming conventions won't make this more efficient

#

just more readable

glossy scroll
#

mvn clean install on X

eternal night
#

beyond that, you have a lot of duplicate logic

glossy scroll
#

and your IDE should re-index the changes on your local maven repo

golden kelp
#

oh i need to clean as well

#

i was like, i m mvn installing, and then i m reloading but still

glossy scroll
#

i mean clean is just good practice

golden kelp
#

ou

tardy delta
#

is it worth to check if an item is a hoe by Tag.HOE.isTagged(material) or is hoe material.name().endsWith("HOE") also good?

eternal night
#

use the tag

golden kelp
#

thats how i do it

#

but yea some women find it offensive

eternal night
#

tag ends with stuff is like,

#

idk, jumping from the building hoping a trampoline is down there

#

while a parachute was right there

tardy delta
#

hmm i was thinking about storing some Map<Tag, SkillCategory> but cant really get a tag from somewhere

crimson scarab
golden kelp
golden kelp
eternal night
#

and tbf kind of useless

tardy delta
#

like meh

eternal night
#

just do an instanceOf check on the item meta

#

and check if it is a leather meta

#

instead of the material check

solid jungle
#
package aioplugin.aioplugin.events;

import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import org.bson.Document;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.jetbrains.annotations.NotNull;

import java.util.UUID;

public class PlayerJoinEvent implements Listener {

    MongoCollection<Document> NewJoins;

    @EventHandler
    void onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event){

        if(!event.getPlayer().hasPlayedBefore()){

            @NotNull String PlayerName = event.getPlayer().getName();

            UUID uuid = event.getPlayer().getUniqueId();

            Document document = new Document();
            document.append("Name", PlayerName);
            document.append("UUID", uuid);

            NewJoins.insertOne(document);

        } else {
            System.out.println("User has Played Before.");
        }

    }

}
``` im trying to Log a new User in MongoDB whenever they join for the first time, but when i tested it it did not log the new user in the db
tardy delta
#

oh god @urban grotto

golden kelp
#

uhm so guys

I made a change in my local dependecy

I did clean, using intelliJ< and then install

I reloaded my plugin in the IDE

but still it aint showing my changes

eternal night
#

iirc hasPlayedBefore is basically always true in the join event

balmy valve
#

How would i remove the "Custom" and "Burst" from the lore of a firework star

solid jungle
golden kelp
solid jungle
# golden kelp did you register the event?
package aioplugin.aioplugin;

import aioplugin.aioplugin.database.DBConfig;
import aioplugin.aioplugin.events.PlayerJoinEvent;
import com.mongodb.ConnectionString;
import com.mongodb.MongoClientSettings;
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import org.bson.Document;
import org.bukkit.plugin.java.JavaPlugin;

public final class AIOPlugin extends JavaPlugin {

    // Setup Mongo
    ConnectionString connectionString = new ConnectionString(DBConfig.AIO_CONNECTION);
    MongoClientSettings settings = MongoClientSettings.builder()
            .applyConnectionString(connectionString)
            .build();

    MongoClient mongoClient = MongoClients.create(settings);

    // Get Db
    MongoDatabase AIO = mongoClient.getDatabase("AIO");

    // Get Collections
    MongoCollection<Document> AIO2 = AIO.getCollection("NewJoins");

    @Override
    public void onEnable() {

        // Log to Console Once Plugin is Enabled
        System.out.println("[ AIO ] - AIO Plugin Has Been Enabled");

        saveDefaultConfig();

        getServer().getPluginManager().registerEvents(new PlayerJoinEvent(), this);

    }

    @Override
    public void onDisable() {

        // Log to Console Once Plugin is Disabled
        System.out.println("[ AIO ] - AIO Plugin Has Been Disabled");

        saveConfig();

    }
}
golden kelp
balmy valve
solid jungle
crimson scarab
#

it is required for my usecase

#

wait could i use a try except

#

to set colour

golden kelp
kind hatch
# balmy valve ah ty

Keep in mind that some items are weird. So you may need to use HIDE_ENCHANTS in some cases.

solid jungle
golden kelp
#
    MongoCollection<Document> NewJoins;

You add stuff to this

#

but never send it back to mongo

solid jungle
#

ohhh

golden kelp
#

or idk cuz i have never used mongo

solid jungle
#

ok

golden kelp
#

all iknow is that it uses BSON, Baby Script Object Notation

eternal night
crimson scarab
#

whats the point on telling me its useless if your not going to tell me why

eternal night
#

that is why I am getting the spoon

#
final ItemMeta itemMeta = ...;
if (itemMeta instanceof LeatherArmorMeta leatherArmorMeta) {
    leatherArmorMeta.setColor(color);
}
itemMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, true);
itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_DYE, ItemFlag.HIDE_ENCHANTS);
#

here

tender shard
eternal night
#

basically, you double all your logic in those ifs

#

which is just not very DRY

golden kelp
#

why does maven not load my changes from my local plugin

eternal night
#

additionally, checking all material types is useless if you can just instanceOf check the item meta

tender shard
#

unless you're doing something wrong

tender shard
#

are you sure that the version you built is the same as in your other pom?

golden kelp
#

so maven creates a new version everytime you install?

crimson scarab
tender shard
#

try File -> Invalidate Caches

golden kelp
#

and then?

tender shard
#

then basically check everything and click on Restart

golden kelp
#

aye aye sir

reef lagoon
#

Why does this work (AKA SHOWS THE CORRECT LOCATION)

        Location middle = location.clone();
        Location edge1 = middle.add(length/2, 0, width/2).clone();
        Location edge2 = location.add(-length/2, 0, -width/2).clone();```
But this doesn't
```java
Location edge1 = location.add(length/2, 0, width/2).clone();
Location edge2 = location.add(-length/2, 0, -width/2).clone();```
tender shard
#

?notworking

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.

tender shard
#

sorry but "not working" is totally useless

reef lagoon
#

I thought you can understand from the variable names but ok

tender shard
#

I do understand what you are trying to do

#

what I don't understand is what's not working

reef lagoon
#

it shows the incorrect location when using the second part

#

but for some reason works using the first one

tender shard
#

that's because you add something to "location"

#

so location changes

reef lagoon
#

but I used .clone()

kind hatch
#

You need to clone first

tender shard
#

but you used it wrong

#

Location edge1 = location.clone().add(...)

#

clone first, then add

#

not the other way around

golden kelp
reef lagoon
#

Oh I get it, tysm

tender shard
#

np

tender shard
undone axleBOT
steady otter
#

Hello, I am receiving this error. Anyone know what might be happening?

Error:

Caused by: java.lang.NullPointerException

Code:

public File getPlayerDataFile(String playerUUID) {         
  return playerDataFile = new File(plugin.getDataFolder(), playerUUID+".yml");
}

The file is in the path

reef lagoon
#

NPE ๐Ÿ™

kind hatch
#

File is probably null.

golden kelp
undone axleBOT
golden kelp
#

cuz man is it hard to debug NPEs under java 14

tender shard
#

well only if you got like 100 variables in one line

#

I mean, it normally tells you exactly the line number

eternal night
#

if only one would use an updated java version ๐Ÿ˜ญ

tender shard
#

and every plugin had something like "YOU MUST!!!! USE JAVA 8 FOR THIS PLUGIN TO WORK"

#

and they all got 1 star reviews because "why no workings"

eternal night
#

lmao xD ngl I am very happy with the current JDK development

tardy delta
#

my school be using java 7 smh

steady otter
tender shard
eternal night
#

the changes to the 6 month iteration is really doing nice work for jdk

steady otter
tender shard
#

unfortunately it will again take months for people to update ๐Ÿ˜ข so I'm still using java 8 for public stuff

kind hatch
tender shard
#

what's IFileManager line 40?

tender shard
eternal night
#

^ this is the plugin being null

#

alex right once again ๐Ÿ˜ญ

tender shard
golden kelp
#

alex is never wrong lynx

eternal night
#

hmmm

steady otter
eternal night
#

true

tender shard
eternal night
#

not wrong once before

tender shard
#

but when I'm wrong, I delete all my previous messages

golden kelp
#

when you said i m secksy, u were wrong

eternal night
tender shard
#

so there's never any trace

#

:3

golden kelp
#

thats a big brainer move

steady otter
tender shard
steady otter
tender shard
kind hatch
steady otter
golden kelp
kind hatch
tender shard
#

your local repo is at ~/.m2/repository

steady otter
tender shard
#

?paste

undone axleBOT
kind hatch
steady otter
#

ok

waxen vapor
#

How do i in the InventoryClickEvent get the block just clicked? So when the player clicks a chest, i can do stuff with the chest

tender shard
tender shard
kind hatch
#

@tender shard It's looking more and more like a missing file. ๐Ÿ˜

tender shard
#

what exactly are you trying to do? detect a chest being clicked inside an inventory, or detecting if a "real" chest is about to be opened?

tender shard
#

because new File(nonExistent) doesn't throw a NPE

#

how else would you create files

golden kelp
#

i dont think i have enough braincells to read it

tender shard
azure hawk
#

Hello Guys, i have a question...
Heres the code: https://paste.md-5.net/ocusiyifug.cs
Is it possbile so the messages are like "Acacia Planks" like with the pickup event but when i craft acacia wood e.g. to planks i get "WOOD" in chat and all is toUpperCase and with "_". Do you guys have any ideas how i can fix this?
Thx ^^

tender shard
#

download JD-GUI or Luyten or Recaf or whatever can decompile .jar files

golden kelp
#

oh wait

#

intelliJ can do that

tender shard
waxen vapor
# tender shard what exactly are you trying to do? detect a chest being clicked inside an invent...

Well this is still the generator thing if you remember. Basically there is a chest in the center of the generator, that when the player clicks open some UI. That works. In the UI i have a button to pickup the generator. So i thought the best way to do that and the easiest would be to just get the coordinate of the chest clicked, and then set it to air, and the surrounding blocks around it that form the generator. So i need to access the chest block they clicked when opened the UI

golden kelp
steady otter
kind hatch
tender shard
tender shard
golden kelp
#

where is it generated?

tender shard
waxen vapor
#

cause i dont see any .setBlock or anything

tender shard
waxen vapor
#

Ohh

#

OHH

#

yeah!

#

Thanks!

tender shard
#

np ๐Ÿ™‚

waxen vapor
#

or wait

tender shard
golden kelp
tender shard
#

then the full log is on the right

golden kelp
#

ou

glossy scroll
#

instead of this

#

opt of translations as part of a json string

waxen vapor
#

will that work?

glossy scroll
#

and use the translation feature

tender shard
glossy scroll
#

that would give you what you want

tender shard
#
Block chestBlock = (Block) event.getInventory().getHolder();
tender shard
#

myPlugin.getDataFolder().mkdirs();

golden kelp
#

?paste

undone axleBOT
golden kelp
glossy scroll
#

does bungee chat even have translations?

tender shard
#

no, bungee has nothing

#

it simply forwards stuff

steady otter
glossy scroll
#

huh

golden kelp
#

sometimes i think my code tests me rather than me testing it

waxen plinth
#

I am so bored I will write someone's code for them

eternal night
#

maybe do a command framework

golden kelp
#

so, i got u

waxen plinth
#

Two, even

golden kelp
#

write an minecraft speedrunning AI

eternal night
#

third times the charm

golden kelp
#

and then give it to me

#

ill sell it

#

and you get 10 github green squares

waxen plinth
#

Green squares?

#

Oh commits lol

golden kelp
#

yea

waxen plinth
#

I think I'll be good

golden kelp
#

lets get a life bois

tender shard
kind hatch
glossy scroll
#

๐Ÿ˜ญ

golden kelp
tender shard
waxen vapor
tender shard
#

then do it

waxen plinth
#

I'll write a bash script

waxen plinth
#

Here I finished

#

It's called sed -i

tender shard
waxen plinth
#

lol

tender shard
waxen plinth
#

sed -i s/%%__USER__%%/hello/ filename

tender shard
#

but not for compiled stuff

waxen plinth
#

For real?

#

I could have sworn

tender shard
#

yes, for real

#

have you never looked into a .jar file?

waxen plinth
#

I have

golden kelp
#

its squigly characters

#

it once formed (this is really rare) a ascii art

#

it would say "ur mum" and then "sus" and then "never gonna give you up"

waxen vapor
tender shard
glossy scroll
#

you beat me

tender shard
#

๐Ÿ˜„

kind hatch
golden kelp
#

its not taking my latest changes

#

i added two variables in a file and they aint there

kind hatch
#

Did you clean install?

tender shard
waxen vapor
tender shard
#

there is no "getCurrentItem" in this case

golden kelp
tender shard
tender shard
golden kelp
#

enter?

kind hatch
tender shard
golden kelp
#

terminal right?

tender shard
waxen vapor
kind hatch
golden kelp
#

ou foq

waxen vapor
#

but it works?

#

the stuff in the switch works

#

huh

golden kelp
#

DAYUM THIS SHIT IS COOL

waxen vapor
#

im confused

#

the only thing not working is getting the block

golden kelp
tender shard
#

it's annotated with @Nullable

#

that means, sometimes it's null, so you cannot use getType() if it's null

#

so, simply check if event.getCurrentItem() is null. If no, you can do your switch thing

waxen vapor
#

wait but

#

the other stuff works?

#

am i just dumb

#

wait let me send video xD

honest badge
#

thoughts on making a block (a specific itemstack) unplaceable? Blockplaceevent.getblockplaced.equals doesn't work

golden kelp
waxen vapor
#

Here you can see it works, it get the current item clicked, so it works with different. But when i add ```java
Block chestBlock = (Block) e.getInventory().getHolder();
chestBlock.setType(Material.AIR);

It stops working, that single item
#

when i click that item only

#

the barrier to be exact

sterile token
#

Any recommendation to execute it using CompletableFuture?

#

Because the shity ComplatableFuture doesnt allow to execute code which throws exception

sterile token
waxen plinth
honest badge
#

specific itemstack

waxen plinth
#

Then compare it to e.getItemInHand()

honest badge
#

alr

iron glade
#

why is spigots editor of resources so bad

#

can't even resize images

waxen vapor
#

How do i get the block the player is currently looking at?

waxen plinth
#

Isn't it raycast or something

sterile token
#

mfalex nice to see you

waxen plinth
#

Oh it's Player#getTargetBlock

sterile token
#

No

#

It doesn tbruh

tender shard
sterile token
#

It doesnt mfalex

tender shard
#

or maybe I am too stupid to use it

waxen vapor
tender shard
waxen plinth
#

It probably depends on how accurate you need it to be

tender shard
#

Redempt, where's the jar string replacer now

sterile token
tender shard
#

I demand to see it

tender shard
#

aso WTF

#

why do you instantly do join

waxen plinth
sterile token
tender shard
#

that's like not using a future at a

tender shard
young knoll
#

Copilot is clearly 13 steps ahead

tender shard
sterile token
#

Im also figuring how to do a CompletableFuture which allow me to throw checked eceptions

waxen plinth
#

Wow

#

I can help you out with that alex

tender shard
tender shard
waxen plinth
#

Alright

sterile token
waxen plinth
#

One parser coming right up

tender shard
sterile token
#

wait which alex?

#

๐Ÿคก

tender shard
#

me-fnalex

waxen plinth
sterile token
#

ohh => <=

waxen plinth
#

And why parse to string instead of int?

sterile token
#

I thought he was going to help me

tender shard
waxen plinth
#

Do you want a fast dedicated int[][] parser?

tender shard
#

right now it doesnt need to support quotes properly, but obviously it would be good for future stuff

waxen plinth
#

Or do you just want String[][]

tender shard
#

I want a real csv parser

#

one that can read any valid csv file

waxen plinth
#

Why not use an existing one then

tender shard
#

I checked and they were all like 2 MB

waxen plinth
#

Oh lol

#

Alright

tender shard
#

and people would then think "why tf is this plugin 5mb" lol

waxen plinth
#

I'll write you a one-file csv parser

tender shard
#

โค๏ธ

waxen plinth
#

Could I just get credit for it if you use it

tender shard
#

NO

#

I WILL GET YOU BANNED

waxen plinth
#

Ok

tender shard
#

I mean... ofc

dusk flicker
#

ill send one too

tender shard
#

โค๏ธ

dusk flicker
#

what mail program is that?

tender shard
#

Thunderbird

#

btw md5 donated to himself

dusk flicker
#

lmao where is that

tender shard
#

in an email we exchanged lol

dusk flicker
#

LOL

tender shard
#

hump*

#

well well well @golden kelp now decompile the .jar in your target folder

#

does this include your changes?

golden kelp
#

No Sir

tender shard
#

wait wtf

#

I am talking about the target folder, not the local maven repo

golden kelp
tender shard
#

e.g. ~/IdeaProjects/MyPluginThatDoesntWork/target/

golden kelp
#

oh yea it does

frosty tinsel
#

he maybe donated to the other contributors as well

young knoll
#

I mean

#

It says itโ€™s a test

frosty tinsel
#

ah

#

haven't noticed

desert frigate
#

Does the player have to be online for Player#sendBlockDamage to work?

tardy delta
#

uh dont work with invalid player objects ig?

glossy scroll
#

im making a request-response type pattern for some servers, in which i want to be able to retrieve all online servers of a specific type

#

currently

#

I have this:

glossy scroll
#
    private ArrayList<ServerInfo> requestServers(ServerType serverType) {
        UUID requestId = UUID.randomUUID();
        infoResponses.put(requestId, new ArrayList<>());
        new RedisRequestServerInfo(new ServerInfoRequest(requestId, serverType));

        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        ArrayList<ServerInfo> serverInfos = new ArrayList<>(infoResponses.get(requestId));
        infoResponses.remove(requestId);
        return serverInfos;
    }```
#

I was wondering

#

if infoResponses should be a ConcurrentHashmap

desert frigate
glossy scroll
#

(its being updated in a different async thread)

young knoll
tender shard
#

whom would you show the block damage?

#

the next nearby skeleton?

#

it doesn't care about that

waxen vapor
#

in the getTargetBlock() i need to set "transparent:" to something. What does this do? The description says: "transparent - Set containing all transparent block Materials (set to null for only air)" But im too stupid to understand it

tender shard
#

pls don't send block damage to me though

waxen vapor
#

what does it want me to set it too?

tender shard
#

I'm looking at LEAVES right now

#

if however OAK_LEAVES would be inside the "transparent" set, it would just ignore it, and gimme the grass block undernearth

#

so it's basically a list of materials you can "look through"

#

normally you just want to set it to only have AIR or maybe WATER as transparent

waxen vapor
#

Ohhh

#

so its like a filter, that it dont care about?

tender shard
#

exactly ๐Ÿ™‚

desert frigate
#

like that

golden kelp
tender shard
#

I really don't understand why you want to get rid of the player object

waxen vapor
tender shard
#

to invoke a method on that player

desert frigate
#

wait-

tender shard
desert frigate
#

does it only show for that player?

tender shard
#

obviously, yes

desert frigate
#

oh bruh

desert frigate
tender shard
#

otherwise it'd be part of Block or World class, instead of Player ๐Ÿ˜›

desert frigate
#

๐Ÿ˜

golden kelp
# golden kelp oh yea it does

NO THIS CANT BE REAL, I SPENT 1 HOUR TRYING TO FIX IT

apparently the problem is i also imported the jar which overwriten the changes

desert frigate
#

like the final Player

tender shard
#

it's basically useless

#

but

#

?learnjava

undone axleBOT
sterile token
#

Why CompletableFuture is so shity and try-catch checked exceptions ๐Ÿ˜ก ๐Ÿ˜ก

desert frigate
tender shard
#

CompleteableFuture is not shit

sterile token
#

Lmao its really shity bruh it doesnt allow to execute methods which THROWS Exception

#

I think they are called checked exceptions

river oracle
#

don't do me like that I need to feel validated for finaling most of my fields and local variables

tender shard
#

I dont understand the problem

sterile token
river oracle
#

you could create a method that just wraps a completable future

sterile token
#

Okay can you help me?

#

Because also the CompletableFuture#get() throw exceptions

#

๐Ÿ˜ก

naive bolt
#

can i use spaces in the commands.yml commands

naive bolt
#

dam

tender shard
#

you should never have to use get() anyway

sterile token
tender shard
#

if you use get() on a future, you shouldnt have used a future (in most cases)

sterile token
tender shard
#

this makes noooo sense at all

#

you think that this makes it async?

#

because it doesn't

#

you still query the database directly on the main thread

sterile token
#

Okay so i need to define an executor right?

tender shard
#

what are you actuay trying to do?

sterile token
#

To run aysnc queries without needing to try-catch that method when call it

river oracle
#

you realize that the main thread still has to await the result of this async query right

tender shard
#

whenever you do .get() or .join() or simiar on a future, you lose all the advantages that futures have

tender shard
#

it doesnt work like this

river oracle
#

thats not a proper implementation of async

azure hawk
tender shard
#

by calling get(), you make it wait for the result

tender shard
#

but it's indeed annoying to code

vocal cloud
#

It's complex because it allows for complex behavior

tender shard
#

?jd-c

#

?jd

glossy scroll
#

well philb is a loser

river oracle
sterile token
#

I mean i need to do something like:

ResultSet result = ClassName#query("sql here");

tender shard
#

I have never met him or talked to him, but

#

I can confirm

tender shard
#

it still blocks the main thread whereever you call it

sterile token
#

I know so that why im asking help for doing it

river oracle
sterile token
#

Ok so its really diff from javascript

#

IThat what i most hate from java

#

In java async need much shities

azure hawk
river oracle
river oracle
#

you can actually read a lot of stuff async on spigot

glossy scroll
#

well i dont even think you can add translations with the current component api

peak depot
tardy delta
tender shard
tender shard
young knoll
#

JavaScript has that weird magic with await

tender shard
#

you just don't understand that you can't just do calls to a synced method and then expect it to magically go async while still returning something instantly

sterile token
#

So give a small example

tardy delta
tender shard
#

your method should either return a CompletableFuture<ResultSet>

river oracle
tender shard
#

or return it directly

#

you cannot make it do something in a future but then just use get() to return the object

#

it literally makes no sense

young knoll
glossy scroll
#

just use a callback with a Consumer

tardy delta
#

gotta implement the tools too

azure hawk