#help-development

1 messages · Page 1906 of 1

restive mango
#

What I’m saying is that would bukkit throw ANY event

pine island
#

i can send the class

#

1sec

ivory sleet
#

Quit or Kick

#

but like

restive mango
#

When a player is made to log on/swap servers via bungeecord

pine island
#
package me.lumina.luminassw.comands;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class mvCore implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        Player player = (Player)sender;
        if(cmd.getName().equalsIgnoreCase("map"))
        {
            if(args.length == 0)
            {
                if(args[0].equalsIgnoreCase("CandyLane"))
                {
                    Bukkit.dispatchCommand(player, "/mv import "+player+" Candylane/Candylane");
                    player.sendMessage("[DEBUG]Command_EXCUTION_SUCCESFULL");
                }
                if(args[0].equalsIgnoreCase("Shaohao"))
                {
                    Bukkit.dispatchCommand(player, "/mv import "+player+" Shaohao/Shaohao");
                    player.sendMessage("[DEBUG]Command_EXCUTION_SUCCESFULL");
                }
            }
        }

        return true;
    }
}
restive mango
#

Conclure sounds like they know a lot

ivory sleet
#

Backend servers consider a server switch to be a quit

restive mango
#

Great

#

Thanks

ivory sleet
#

Gl

ivory sleet
pine island
#

alr!

#

the error is just the /help error

#

plugin.yml:

name: LuminasSw
version: '${project.version}'
main: me.lumina.luminassw.LuminasSw
api-version: 1.8
commands:
  kit:
    description: Gives kit with the argument of type
    usage: /<command> <kit type>
    aliases: [k]
  End:
    description: Ends the game with the winner given
    usage: /<command> <winner>
    aliases: [w]
  start:
    description: Starts the game
    usage: /<command>
    aliases: [s]
  mvCore:
    description: Map Selector!
    usage: /<command> <map>
    aliases: [m]
  refill:
    description: Refills armor
    usage: /<command>
    aliases: [r]

main:

        getServer().getPluginManager().registerEvents(this, this);
        getCommand("kit").setExecutor(new kit());
        getCommand("End").setExecutor(new End());
        getCommand("start").setExecutor(new start());
        getCommand("refill").setExecutor(new refill());
        getCommand("mvCore").setExecutor(new mvCore());
        getServer().getPluginManager().registerEvents(new LuminasSw(), this);
#

that is not the complete class lol

hasty prawn
#

You named it mvCore and your code says map

pine island
#

well its a command that changes the map

onyx fjord
#

why is it called dat

#

im confused as f

ivory sleet
#

idk

hasty prawn
pine island
#

yeah js is weird

onyx fjord
#

i call it variable function

ivory sleet
#

It’s due to lambda calculus

pine island
hasty prawn
#

Yeah, you're registering mvCore, not map

ivory sleet
#

Lambda calculus is a powerful theory where everything essentially is anonymous functions

pine island
#

how does the description matter

ivory sleet
#

Which then also provides us with some cool proofs and some other niceties, especially when implemented in programming

hasty prawn
#

getCommand("mvCore").setExecutor(new mvCore()); is not a description.

#

You're straight up registering a completely different command than you're executing.

pine island
#

oh...

hasty prawn
#

Same thing in your plugin.yml

pine island
#

hmm so just change the cmd.getname to mvcore?

hasty prawn
#

Yeah, or change the plugin.yml and the getCommand to map

pine island
#

hmm alr

unreal quartz
#

I’m assuming this is related to the PR I submitted to your website

unreal quartz
#

Also what was that last function for

onyx fjord
#

i looked into liveatlas history

unreal quartz
#

The one you just named “a”

onyx fjord
#

and saw a commit "switch to lambda"

onyx fjord
#

its for the button

#

purely for debugging ofc

unreal quartz
#

It’s a bit of a strange system

#

Parsing the page title to get the desired page

onyx fjord
#

i dont see anything wrong with it tho

#

but yes

#

i consider switching to json file to define pages

unreal quartz
#

There are better ways to pass data in JavaScript, not storing it in the webpage title

onyx fjord
#

¯_(ツ)_/¯

#

i dont see whats bad in it

#

its not possible to break it

unreal quartz
#

What if you want to change the format

#

Then you gotta rework your regex and all that

ivory sleet
#

It’s just as bad as when you use inventory titles to identify inventories

onyx fjord
#

im not gonna change that lol

#

its gonna use markup

unreal quartz
onyx fjord
#

if u help me with json

#

we can switch

#

cuz i suck at json data extraction

pine island
#

hmm i run this and i wasnt moved

unreal quartz
onyx fjord
#

like

#

i hate json

unreal quartz
#

You are using javascript

onyx fjord
#

i mean

#

the format is okay

#

but the way you retrieve data

unreal quartz
#

JSON.stringify(object)
JSON.parse(string)

onyx fjord
#

is sometimes annoying

#

oh god

#

im gonna cry

#

js fetch 😭

quaint mantle
#

hey you guys

unreal quartz
#

What

quaint mantle
#

what is the equivalent of Feather falling in enchantments?

#

typo

onyx fjord
#

for some reason PROTECTION_FALL

quaint mantle
#

why?

#

thats just weird

onyx fjord
#

it is in fact weird

#

why idk

quaint mantle
#

then what does the WATER_WORKER enum do?

unreal quartz
#

They have descriptions if you look at the javadoc

quaint mantle
#

thx

opal juniper
#

What is the method to get a material from a chunksnapshot at a given coord

#

im assuming something like this:
snapshot.getBlockType(Math.abs(location.getBlockX() % 16), location.getBlockY(), Math.abs(location.getBlockZ() % 16))

spiral light
#

chunk snapshot ? do you mean a section or the complete chunk ?

opal juniper
#

I mean a ChunkSnapshot

spiral light
#

x >> 4, y, z >> 4

sleek turret
#

So, im currently trying to store this into a gson document, anyone have any suggestions?

private Map<String, Location> homes;```
opal juniper
spiral light
opal juniper
#

i think its 0-15

spiral light
#

yes

#

true

#

actually why you dont just read ?

opal juniper
#

basically i wanted a "good" way to go from location -> Location in snapshot but i think i just worked it out

spiral light
#

use >> 4 instead of %16

opal juniper
#

(location.getBlockX() - chunkX * 16, location.getBlockY(), location.getBlockZ() - chunkZ * 16)

#

works now

red sedge
#

how do I set the break stage

#

of a block

spiral light
#

packets

red sedge
#

oops

spiral light
red sedge
#

sorry

opal juniper
neon minnow
#

How do i make a join listener in kotlin?

quaint mantle
#

like you did in java

neon minnow
ivory sleet
#

Usually kotlin devs use an extension inline function

lost matrix
lost matrix
neon minnow
lost matrix
# neon minnow Do you know why it doesnt work ?

Sure. Because you dont write anything that even looks close to kotlin code.
Why did you decide to go for kotlin? You will have a much bigger community
and a greater amount of resources if you just learn java first.

true vault
#

I just switched from the jar library to maven and noticed this

#

Do i have to use ChatColor.COLOR instead of §?

#

I heard that you should do that but i never changed my old code

lost matrix
lost matrix
#

In your pom add a property for the source encoding:

  <properties>
    <java.version>yourJavaVersion</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
spiral light
quaint mantle
#

Do i need to register custom entities in 1.18?

neon minnow
#

how do i make join listener in kotlin

spiral light
quaint mantle
spiral light
lost matrix
spiral light
#

if you just extend FallingBlock and then create the obj with your constructors and then add it to the world you wont need registration

quaint mantle
spiral light
#

i dont register custom entities

#

it rly sucks to register them too

#

what do you want to do with it when its registered ?

lost matrix
true vault
true vault
spiral light
lost matrix
#

Also make sure the file encoding in IntelliJ is set to UTF-8

true vault
#
        <maven.compiler.target>8</maven.compiler.target>
        <java.version>8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>```
#
                "§fRang",
                "§7Todo", "",
                "§6Coins",
                "§7" + MySQLCoins.getFormatedPoints(board.getPlayer().getUniqueId()), "",
                "§eSpielzeit",
                "§7" + MySQLPlaytime.getFormattedTime(board.getPlayer().getUniqueId()),
                "             "```
quasi flint
#

Germanus

vocal cloud
#

Don't have to but it helps with readability

hallow lion
#

What are these "identities" that are returned by the api in getAuthor and findAuthor Also is there a list of them?

chrome beacon
#

Well linked accounts

hallow lion
#

where do you link them on the site?

quaint mantle
#

How do I set the player prefix in the list tab? (packet & PlaceHolderAPI)

chrome beacon
hallow lion
#

how?

chrome beacon
#

You've already done it???

#

!verify

undone axleBOT
#

Usage: !verify <forums username>

sullen marlin
quaint mantle
#

What is the alternative for setPassenger() since setPassenger is deprecated?

sullen marlin
#

read the docs

quaint mantle
#

Thank you 🙏🏼

woeful crescent
#

can I use Player.addAttachment(plugin, "perm", true) to grant a permission to a player?

#

I'm a little confused on what exactly it does

sullen marlin
#

yes

woeful crescent
#

👍

quaint mantle
#

Hello
how i can add prefix to members in the tab ? (PlaceHolderAPi)

feral plank
#

u can have the prefix in the tab AND for nametags if you want

#

everything configurable

#

its a VERY good plugin i HIGHLY recommend it

#

its completely free

sage patio
candid plover
#

How does an entity appear to have an aura and only a specific player can see it? As with pillager when ringing the bell.

woeful crescent
#

I'm so confused. how do i remove a permission from a player

#

and does using addAttachment just... add the permission?

candid plover
feral plank
woeful crescent
#

No

feral plank
#

Download one

#

duh

woeful crescent
#

Why can't i just use addattachment tho

sage patio
woeful crescent
#

what even is a permission attachment

candid plover
#

what is SS?

feral plank
#

LuckPerms is the best

woeful crescent
woeful crescent
#

I thought that's what addattachment was for

feral plank
#

To edit permissions for players

woeful crescent
#

What the hell does addattachment do then lol

feral plank
woeful crescent
#

;-;

#

why

sage patio
#

this guy is crazy

woeful crescent
#

what does it do

feral plank
#

Because it supports SS

woeful crescent
#

ss?

feral plank
#

Use luckperms

sage patio
#

pls help me

woeful crescent
#

what is ss

feral plank
#

You need to use luckperms\

woeful crescent
#

WHAT IS SS

#

lol

sage patio
woeful crescent
#

why

feral plank
#

It means shity sharbage

woeful crescent
feral plank
feral plank
#

i will just ignore

sage patio
#

this channel is for plugin development

feral plank
#

u should to the same

woeful crescent
#

I AM DEVELOPING A PLUGIN

#

lol

feral plank
#

I am just trying to help this person

sage patio
#

not for fucking help about luckperms or TAB

woeful crescent
#

dude im asking how i can use code to add attachments

feral plank
#

with him developing his plugin

sage patio
#

ur a dumb

feral plank
#

OK

#

I KNOW

#

NOW BYBY

feral plank
woeful crescent
#

he's telling me to use a perms manager for my plugin that i am coding

#

lol

feral plank
#

Its the best permission manager

woeful crescent
#

but

woeful crescent
#

why

feral plank
#

Dont you want to give ppl permissions or sf some perms

woeful crescent
#

Yes, cant i just use the spigot api

feral plank
#

No

#

Do you want a link

woeful crescent
#

no?

#

what's addattachment then

#

just tell me

#

i just want to know at this point haha

#

what it is and why its so bad to use it

feral plank
#

idk just hit that if that works idk

feral plank
#

doesnt even work

#

its supposed to be an addon for discordsrv which uses SS that is for sponge

sage patio
#

just gimme ur adress i'll kill u

feral plank
#

letme

#

find

sage patio
#

u r a virus for humanity

sage patio
#

ow ur so far from me

#

kill ur self insted

feral plank
#

bet

feral plank
#

its SS

#

Use LuckPerms

woeful crescent
#

it is a method

#

under Player

#

are we talking about two diff things?

woeful crescent
sage patio
#

WTFFFFFFFFFFF

woeful crescent
#

LMAO

quaint mantle
woeful crescent
#

bro

feral plank
#

Wait

woeful crescent
#

you just posted that so blatantly

feral plank
sage patio
#

i'll pay anyone 100$ to ban this guy

woeful crescent
#

idek if you don't know what's going on

lost matrix
#

Be aware that posting such links is a bannable offense

feral plank
woeful crescent
#

idek why ur so mad

feral plank
#

he told me to give him the download button

#

for luck perms

#

its not SS

woeful crescent
#

no i did not

feral plank
#

idk

woeful crescent
#

i did not ask for a download button

feral plank
#

did u

woeful crescent
#

no

feral plank
#

oof

#

im did

woeful crescent
#

@lost matrix can you explain perms to me

#

like addattachment specifically

lost matrix
#

This is the official site for downloading luckperms:
https://luckperms.net/

lost matrix
feral plank
#

can someone help me how do i turn off mob despawning
so my citizens npcs dont despawn when their type is a mob
is there like a setting for that in multiverse or in another plugin or server setting of smth

woeful crescent
#

I thought it just added a permission, plain and simple

#

but now everyones talking about perms managers?

#

i am very confused

feral plank
#

if u had one

#

it would fix

#

all ur problem

#

s

#

SS dont use it

woeful crescent
#

Why do you need something to manage the permissions, shouldn't setting the permission under the player be enough?

feral plank
#

Its very important

#

IT Dont use SS

lost matrix
#

It will add a new PermissionAttachment which is basically a container that holds permissions of a player.
Those are usually handled by permission plugins.

woeful crescent
#

Adds it to what?

#

The player?

feral plank
#

It is for discordsrv

woeful crescent
#

if so, shouldn't the server just keep track o that itself?

lost matrix
#

To the Permissible which could be a Player for example.

woeful crescent
woeful crescent
#

why do you need to manage it?

#

that's... managing it

#

right?

feral plank
#

Its the best permission manager

#

Forget luckpoerms

#

It is nt ss

#

then download Illusive Endportals, so the endportals look cool

#

And EssentialsK

woeful crescent
#

uhhh

#

bro

feral plank
#

not EssentialsX

woeful crescent
#

this channel is for developing plugins

feral plank
#

Yes

woeful crescent
#

not for managing servers

feral plank
#

U need those

loud haven
#

Just ignore them

woeful crescent
#

that would be in...

feral plank
#

I dont need help server

woeful crescent
#

i dont either

#

😐

feral plank
#

I dont have a problem im just trfghj to help

woeful crescent
#

yeah

#

you're a little confused tho, haha

feral plank
#

Haw

#

I dont confuse ppl

feral plank
#

I try to help my

sage patio
#

its like @feral plank

woeful crescent
#

ok yk what this channel is just going straight to hell im opening a thread

lost matrix
# woeful crescent why do you need to manage it?

Handling permissions can get quite complex if you want to have a limited or broader scope.
For example having permissions that are only applied in the nether. Or a permission that should be given
for 5 minutes. Or a permission that a player should obtain across a whole bungee network.

You dont need a permission manager but it makes handling permissions a bit more comfortable.
However there is nothing from stopping you to just add a PermissionAttachement to a Player and
adding all the permissions you need to it.

feral plank
#

You need to have LuckPerms

quaint mantle
ivory sleet
#

?kick @sage patio off topic

undone axleBOT
#

Done. That felt good.

feral plank
quaint mantle
#

what is going on

feral plank
echo basalt
#

What packet should I send to a player to dismount a vehicle?

ivory sleet
feral plank
#

how do i turn off mob despawning
so my citizens npcs dont despawn when their type is a mob
is there like a setting for that in multiverse or in another plugin or server setting of smth

#

can you pls help me with that

#

pls

ivory sleet
#

This is not the channel

feral plank
#

i pinged u in help server

#

u did not answer

ivory sleet
#

Be patient

feral plank
#

but

#

i have been

#

doling with this probem

#

for

#

dayus now

lost matrix
feral plank
#

where

feral plank
#

i use 1.12.2

#

not 1.18.3

#

For 1.12.2?

static ingot
#

Just because it's 1.18.1 javadocs doesn't mean it's not present for 1.12.2.

feral plank
#

oh ok

lost matrix
feral plank
#

void setPersistent(boolean persistent)
Sets whether or not the entity gets persisted.
Parameters:
persistent - the persistence status
See Also:
isPersistent()

#

how do i do that

#

is that what i need to do

#

to stop mob despawning

lost matrix
#

Would be my first guess

#

try it and see

feral plank
#

but

#

how

static ingot
#

it isn't in 1.12.2 after all

#

lol

feral plank
#

oof

#

any for 1.12?

static ingot
lost matrix
feral plank
#

any plugin to turn off mob-despawning or setting or any possible way thats for 1.12.2 bukkit/spigot servers

lost matrix
#

But 1.12 is not supported anymore

static ingot
#

I also have doubts that Citizens would improperly handle NPCs and allow them to just despawn though, or they at least have a setting for it.

feral plank
#

they act like normal mobs

#

OHHH

#

wait

#

is it because

#

i have the name plates off

#

i toggled the name plates off

static ingot
#

nice

feral plank
#

and dont they need name plates to not despawn

#

but i dont want the name plates

#

so what else would i do

lost matrix
static ingot
#

It isn't.

lost matrix
feral plank
#

Because no one answers in help server

static ingot
#

Then make a thread on the forums.

feral plank
#

i tried

#

no one answer

ivory sleet
#

@feral plank please move to #help-server and be patient, I have told you already

feral plank
#

ok fine

lost matrix
ivory sleet
#

You’re not entitled to instantaneous help just because you haven’t figured a solution out yet

feral plank
#

i need to turn nameplates on

#

ill just put the name as nothing

#

i can only do that in the config

#

so ima do that in the config

hard echo
#

Hey, so when I use

import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin {
}

The plugin in import org.bukkit.plugin.java.JavaPlugin is red and it says cannot resolve symbol 'plugin', and the JavaPlugin in public class Main extends JavaPlugin is red as well and says cannot resolve symbol 'JavaPlugin' I have no clue what I did wrong
I'm following this: https://www.spigotmc.org/wiki/creating-a-blank-spigot-plugin-in-intellij-idea/#wikiPage (1.18.1 spigot)

quaint mantle
#

slimmer shady

hard echo
#

Yeah?

feral plank
feral plank
quaint mantle
hard echo
#

Yes

wary harness
#

What would it be piston event

#

so I can get list of block moved

quaint mantle
eternal oxide
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

quaint mantle
#

omg elgar

#

where have you been

hard echo
lost matrix
wary harness
quaint mantle
#

Is there a link for the associated remapping-mojang variables to the standard obfuscated variables for 1.17.1?

tender shard
#

what's the syntax for this again?

vocal cloud
tender shard
#

It should work somehow like this:

HashSet<EntityType> entities = getEnumFromList(someList,new HashSet<>(),EntityType.class)

but no idea how to properly define the type parameter for the collection D:

vocal cloud
#

Can you even do C<E>?

tender shard
#

no idea

#

actually java should know that C has type parameters because C is defined as C extends Collection<E>

vocal cloud
tender shard
#

but now I'd have to cast it

#

it should specifically return C<E> instead of just Collection<E> 😦

vocal cloud
#

Idk doesn't seem possible for it know if C<E> is even valid

tender shard
#
public static <E extends Enum,C extends Collection<E>> C getEnumFromList(Class<E> enumClazz, List<String> list, C collection) {
#

this seems to work 🙂

vocal cloud
#

generics make me want to die inside

tender shard
#

they are also fun though 😄

buoyant viper
#

what in the hell is that method

tender shard
#

let's see whether this works lol

    public static <E extends Enum,C extends Collection<E>> C getEnumFromList(@NotNull final Class<? extends E> enumClazz, @NotNull final List<String> list, @NotNull final C collection) {
        for(final String element : list) {
            final E value = (E) Enums.getIfPresent(enumClazz, element).orNull();
            if(value == null) {
                JeffLib.getPlugin().getLogger().severe("Could not find " + enumClazz.getSimpleName() + ": '" + element + "'");
                continue;
            }
            collection.add(value);
        }
        return collection;
    }
lost matrix
# tender shard

Return type is just C. Its already in the scope of Collection<E>

vocal cloud
#

Jeez louis batman I feel like theres a better way to do it

tender shard
lost matrix
tender shard
#

C is the return type, how would I not need it?

lost matrix
#

Why do you pass a Collection in there if you just return it anyways?

tender shard
#

I don't understand that question

lost matrix
#

What is the reason for that passed collection?

tender shard
#

The ability to decide what type of collection it returns

Set<EntityType> entities = getEnumsFromList(getConfig().getStringList(EntityType.class, "allowed-entities", new HashSet<>());

List<Material> blocks = getEnumsFromList(getConfig().getStringList(Material.class, "blocks", new ArrayList<>());
lost matrix
#

I think that should be concrete. Looks really weird to me.

buoyant viper
#

i am still so lost in what this method is for

buoyant viper
tender shard
#
allowed-entities:
- ZOMBIE
- SPIDER

blocks:
- DIRT
- GRASS_BLOCK
buoyant viper
#

yeah

willow oar
#

is there a way to force a player to right click?

buoyant viper
#

hack their computer

lost matrix
#

How about

  public <E extends Enum<E>, C extends Collection<E>> C getEnumFromList(Class<E> enumClass, List<String> values, Collector<? super E, ?, C> collector) {
    return values.stream()
        .map(entry -> Enums.getIfPresent(enumClass, entry))
        .filter(Optional::isPresent)
        .map(Optional::get)
        .collect(collector);
  }
tender shard
#

also I can't print out an error message like this when someone uses invalid names

#

as I only have an Optional now and not the original string anymore D:

lost matrix
lost matrix
#

one moment...

#
  public static <E extends Enum<E>> List<E> getEnumFromList(Class<E> enumClass, List<String> values) {
    return getEnumFromList(enumClass, values, Collectors.toList());
  }

  public static <E extends Enum<E>, C extends Collection<E>> C getEnumFromList(
      Class<E> enumClass,
      List<String> values,
      Collector<? super E, ?, C> collector
  ) {
    return values.stream()
        .map(entry -> Enums.getIfPresent(enumClass, entry))
        .peek(YourClass::checkValidity)
        .filter(Optional::isPresent)
        .map(Optional::get)
        .collect(collector);
  }

  private static <E extends Enum<E>> void checkValidity(Optional<E> optional) {
    if (!optional.isPresent()) {
      // Print message here
    }
  }
tender shard
#

I still don't have the original string there

#

it should e.g. print Could not find EntityType ' CREPER'

#

I could just put it into the map function and then filter it later again

lost matrix
#

Then do in the first map...

tender shard
#

why tf does it say this now lmao

buoyant viper
#

wrote this up real quick

#
public static <E extends Enum<E>> Set<E> getEnumsFromList(Class<E> enumCls, List<String> constants) {
        Set<E> validConstants = new HashSet<>();

        constants.forEach(val -> {
            try {
                validConstants.add(Enum.valueOf(enumCls, val));
            } catch (IllegalArgumentException e) {
                System.err.println(String.format("No value '%s' in enum %s.", val, enumCls.getName()));
            }
        });

        return validConstants;
    }```
tender shard
#

it's always a Set now

buoyant viper
#

what else would u need

tender shard
#

a list

buoyant viper
#

what difference would it make

lost matrix
#

What if you had [IRON_ORE, DIAMOND_ORE, IRON_ORE]

tender shard
#

a list can contain the same thing more than once

#

also a list keeps the order

buoyant viper
tender shard
#

I have this now 🙂

    public static <E extends Enum> List<E> getEnumsFromList(final Class<? extends E> enumClazz, final List<String> list) {
        return getEnumsFromList(enumClazz, list, Collectors.toList());
    }


    public static <E extends Enum<E>, C extends Collection<E>> C getEnumsFromList(final Class<E> enumClazz,
                                                                                  final List<String> list,
                                                                                  Collector<? super E, ?, C> collector) {
        return list.stream()
                .map(entry -> {
                    E result = Enums.getIfPresent(enumClazz, entry).orNull();
                    if (result == null) {
                        System.out.println("Could not find " + enumClazz.getSimpleName() + ": '" + entry + "'");
                    }
                    return result;
                })
                .filter(Objects::nonNull)
                .collect(collector);
    }
}
#

now let's see if it actually works 😄

lost matrix
#

horrific piece of code to be honest

tender shard
#

why?

#

how is that horrific

unreal quartz
#

Doesn’t pass the vibe test

tender shard
#

the only thing I don't like about it is that I forgot to make the collector final

lost matrix
tender shard
#

btw next problem

#

I'll just use my first version. it's more versatile anyway since it allows to pass collections that already have items in it I guess

#

although probably noone will ever need that

lost matrix
#

Dont use guavas Optionals

buoyant viper
#
public static <E extends Enum<E>, C extends Collection<E>> C getEnumsFromList(Class<E> enumCls, List<String> constants, Collector<E, ?, C> collector) {
        return constants.stream().map(constant -> {
            try {
                return Enum.valueOf(enumCls, constant);
            } catch (IllegalArgumentException e) {
                System.err.printf("No value '%s' in enum %s.", constant, enumCls.getSimpleName());
            }

            return null;
        }).filter(Objects::nonNull).collect(collector);
    }``` basically what u wrote but no deps
lost matrix
buoyant viper
#

unless u want to get real soft on the filtering then u could additionally iterate through the enum constants of enumCls

#

for a .equalsIgnoreCase or something

young knoll
#

Holy generics Batman

buoyant viper
#

dont u love java

tender shard
lost matrix
tender shard
lavish hemlock
#

Guava's Optionals were replaced by Java's

#

As well as Guava's functional interfaces, like Consumer, Function, etc.

lost matrix
#

Compatability. Future proof. And Guavas Optionals are replaced by Java Optionals.

unreal quartz
#

I fancy a guava right now

tender shard
wide hazel
#

Umm how do you check for nbt tags , Im new to spigot, Btw the item Im reffering to is not an item stack its just a regular item with nbt tag

buoyant viper
#

oh i just got a horrific idea

tender shard
#

*orElse

tender shard
lavish hemlock
#

Can PDC work with pre-existing NBT tags?

#

I've never actually checked that

tender shard
#

oh I didn't read that part

#

no it can't do that

lavish hemlock
#

Terrible API

#

Bukkit should just allow directly interfacing with NBT imo :p

wide hazel
#

what is PDC huh

lavish hemlock
#

Not through Mojang types but y'know

lavish hemlock
#

It's for storing NBT

#

As opposed to reading it

#

Maow will be the one to contribute org.bukkit.nbt maybe possibly :)

wide hazel
#

my plugin is interacting with a large datapack so please do not tell me i have to go and somehow replicate the datapack but make a plugin

lavish hemlock
#

@silk ether Okay 2 things

#

This is the wrong channel

#

and also

#

?services

undone axleBOT
lavish hemlock
#

I honestly wouldn't recommend Fiverr just cuz a lot of the shit on there seems low-quality.

#

Spigot's services recruitment is better from what I've seen.

wide hazel
#

Maow soo please let it be good news and not bad

silk ether
lavish hemlock
#

Fiverr isn't any more trustable :p

buoyant viper
#

ive created the ultimate answer @tender shard

#
public static <E extends Enum<E>, C extends Collection<E>> void populateCollectionWithEnumsFromList(Class<E> enumCls, List<String> constants, C collectionOut) {
        E[] enumConstants = enumCls.getEnumConstants();

        constants.forEach(constant -> {
            for (E enumConst : enumConstants) {
                if (!enumConst.name().equalsIgnoreCase(constant)) {
                    System.err.printf("No value '%s' in enum %s.", constant, enumCls.getSimpleName());
                    continue;
                }

                collectionOut.add(enumConst);
            }
        });
    }``` who needs to be functional when u can just java it
lost matrix
# tender shard then I'll just do Enums.getIfPresent().orNull again

Just rewrite it using javas Optionals:

  public static <E extends Enum<E>> Optional<E> getIfPresent(Class<E> enumClazz, String value) {
    try {
      return Optional.of(Enum.valueOf(enumClazz, value));
    } catch (IllegalArgumentException | NullPointerException exception) {
      return Optional.empty();
    }
  }
lavish hemlock
#

I think that's your problem

#

You're not looking closely into the things you use and therefore you are more likely to have shittier results

#

Stop rushing

silk ether
#

alrighty ill move this to #general

unreal quartz
#

Terrible idea

lost matrix
lavish hemlock
#

Eh, O(n) isn't bad

#

Try uhh

buoyant viper
#

dont use any functional interfacing or ill personally kill u @lost matrix

wide hazel
#

Umm maybe someone else knows how to deal with already existing nbt tags

lavish hemlock
#

Try this

unreal quartz
#

You guys aren’t writing your plugins in Haskell?

lavish hemlock
#

Bogosort-level complexity

wide hazel
#

otherwise ill just find some other workaround

young knoll
#

O(wO)

buoyant viper
#

just go

buoyant viper
#

who cares about complexity if it works Chad

#

youll get what u need, eventually

tender shard
brave sparrow
young knoll
#

Who needs performance when you can just get a better machine

lavish hemlock
wide hazel
#

Umm like if theres 100s of players complexity becomes a thing

buoyant viper
buoyant viper
wide hazel
#

oh

lavish hemlock
tender shard
lavish hemlock
#

(Although most plugins are, so I guess it's safe to say that)

tender shard
#

well it does work but print a ton of error messages

buoyant viper
wide hazel
#

Maow cmon I need my answer which does exist or ill use deprecated methods

#

anything to survive

tender shard
wide hazel
#

whyy

tender shard
#

it's not in the API

wide hazel
#

why do they hate nbt

tender shard
#

because it's useless to do dirty NBT stuff when there actually is an API for stuff like that, called PDC

lost matrix
# buoyant viper ```java public static <E extends Enum<E>, C extends Collection<E>> void populate...

Constant time:

  private static final Map<Class<? extends Enum<?>>, Set<String>> ENUM_CACHE = new HashMap<>();

  public static <E extends Enum<E>> Optional<E> getIfPresent(Class<E> enumClazz, String value) {
    Set<String> enumSet = ENUM_CACHE.computeIfAbsent(enumClazz, EnumUtils::toStringSet);
    return Optional.ofNullable(enumSet.contains(value) ? Enum.valueOf(enumClazz, value) : null);
  }

  private static Set<String> toStringSet(Class<? extends Enum<?>> enumClazz) {
    return Arrays.stream(enumClazz.getEnumConstants()).map(Enum::toString).collect(Collectors.toSet());
  }
buoyant viper
#

what did i say about functional interfacing

#

🔪

lost matrix
#

foit me

wide hazel
#

Hah

#

I can use lore but I will hide it

#

YESS

lavish hemlock
#

Except for the stream.

snow crow
#

Hello

lavish hemlock
#

Hello

lost matrix
lavish hemlock
#

Fair 'nough I guess.

#

Personally I don't use streams.

snow crow
#

so i made a plugin no errors now but its not working as expected

lavish hemlock
#

But I can see how it doesn't matter here.

#

Although I would make a tiny change

#

The result would be the exact same

#

But it's just a little easier to read, personally:

#
return enumSet.contains(value) ? Optional.of(Enum.valueOf(enumClazz, value)) : Optional.empty();
lost matrix
lavish hemlock
#

I just think it's more clear about the intention

#

Although the whole Optional.of is a bit messier but eh

#

Whatever, still manageable

#

You could also put them all on separate lines

buoyant viper
lavish hemlock
#

I personally do that

buoyant viper
lavish hemlock
#

It still requires two iterations though

lavish hemlock
#

It's also much harder to read.

buoyant viper
lavish hemlock
#

Time to maowify Smile's iteration

buoyant viper
#

issue with smiles version is strict checking

#

mine has leniency with equalsIgnoreCase

#

smh

lavish hemlock
#
private static final Map<Class<? extends Enum<?>>, Set<String>> ENUM_CACHE = new HashMap<>();

public static <E extends Enum<E>> Optional<E> getIfPresent(Class<E> clazz, String name) {
    final Set<String> constantNames = ENUM_CACHE.computeIfAbsent(clazz, EnumUtils::getConstantNames);
    return constantNames.contains(name)
        ? Optional.of(Enum.valueOf(clazz, name))
        : Optional.empty();
}

private static Set<String> getConstantNames(Class<? extends Enum<?>> clazz) {
    final Set<String> result = new HashSet<>();
    for (Enum<?> constant : clazz.getEnumConstants()) {
        result.add(constant.toString());
    }
    return result;
}
#

Maow version ^

#

I made some of it easier to read and also improved a few names (and removed that stream, but that's just personal taste)

lavish hemlock
#

The better option would be to use Smile's but add a .toUpperCase() after the name/value parameter in the contains check

buoyant viper
#

what if enum name isnt following java conventions

#

what if its really dumb and like

#

Skeleton_Horse

young knoll
#

Then the person who wrote it sucks

lavish hemlock
#

(You don't actually need Locale.ROOT since Locale.ENGLISH handles it)

buoyant viper
young knoll
#

Push them off an edge

buoyant viper
#

also true

lavish hemlock
young knoll
#

Idk I guess it depends if you know what enums you’ll be using it with

lavish hemlock
#

Anyway

#

In which case

#

You could also just do a toUpperCase() on the toString() as well

#

That would effectively be a "ignore case"

buoyant viper
#

yeah

#

normalize them to something

lost matrix
#

This is a general purpose method that should not break the contract of javas enums.
Iron_Ore should yield null and should not be tinkered with inside this method.
Thats something another method could do with the users input.

lavish hemlock
#

True

young knoll
#

Normalize to lower case like a rebel

lavish hemlock
#

A util method shouldn't do this, you're right

buoyant viper
lavish hemlock
#

Actually could you declare two enum constants of the same name, just with different capitalization?

#

e.g. IRON and IrOn

young knoll
#

📏 🔨

lavish hemlock
#

If so, then you essentially always want to be strict about that name parameter

lavish hemlock
#

Oh yeah and technically you couldn't do valueOf if you did the capitalization either lol

#

So, @buoyant viper, truly being strict here is the best approach to support everything.

buoyant viper
#

what if the enum is out of our control

#

like EntityType

#

or Material

#

we cant add/remove constants to it to handle different capitalizations

tender shard
#
final Optional<E> result = getIfPresent(enumClazz, enumClazz.getName().startsWith("org.bukkit") ? entry.toUpperCase(Locale.ROOT) : entry);
```:D
lavish hemlock
#

That's a dumb idea anyways

lavish hemlock
#

My point was that capitalizing Iron and IrOn retrieves the same result, IRON, even if they're meant to represent different things

buoyant viper
#

yeah

#

i read that wrong and thought you were adding different capitalizations to the enum to cover edge cases of name filtering

#

lmao

lavish hemlock
#

"anme"

#

anime filtering

buoyant viper
#

lole

granite burrow
#

hey how can I disable any messages sent to the player other than messages and player messages?

#

I wanna make a sort of /chattoggle plugin

tender shard
granite burrow
#

like server messages from an announcement plugin, clear lagg messages, buycraft messages

young knoll
#

You’d have to use packets

granite burrow
#

dammit, was trying to avoid those

tender shard
#

or use cglib and override the player's sendMessage function lol

young knoll
#

The heck is cglib

tender shard
young knoll
#

Oooh

#

Wonder if that’ll let me get those tile entities moving

tender shard
#

I have no idea how cglib works. If you find out, let me know pls 😄

young knoll
#

Lol

#

One of these is much easier than the other

rancid snow
#

does anyone know how I would make #2 look more like #1?

round finch
#

Math, Angles etc B_NicoSleep

rancid snow
#

Yes, but how in specific

buoyant viper
#

make the entity orbit, dont just rotate it

rancid snow
#

I don't understand what you are describing, what I did in the gif was just increment the yaw of the armorstand in a loop

buoyant viper
#

yes that is part of it

#

but u also need to make it [the entity holding the item] orbit around a position rather than just rotating it

rancid snow
#

How would I do that?

buoyant viper
#

math, angles, etc

rancid snow
#

Again, I understand that but specifically how

buoyant viper
#

move the entity X units away from the position you actually want the item to be at, make entity look at the position

rancid snow
#

so instead of moving the yaw in a circle, I should be moving the armorstand?

dusk flicker
#

ah cosmic prisons

#

they do have some cool anims

buoyant viper
#

move the armor stand in a circle and make it look at the position yes

rancid snow
dusk flicker
#

LOL

#

Sup

rancid snow
#

sup xP

#

I was wondering how long until you recognized me

#

but once I got this terrible name after I linked my spigot account it was never

dusk flicker
#

I generally dont check actual names, mostly go by the spigot names lol

rancid snow
#

ah I made my spigot account way too long ago

dusk flicker
#

I wonder in your case if it would be possible to set the pickaxe on the head of the armorstand, and then rotate it around. I know you can put certain items on a players head so that might be an idea

rancid snow
#

nope, it isnt

dusk flicker
#

Yeah that'd be too easy lol

rancid snow
#

that gif I sent is the pickaxe on the head

buoyant viper
#

oh yeah, forgot entities can kinda wear anything

rancid snow
#

I have to figure out now how to get the locations of the circle around the center then ig

#

yeah haha

buoyant viper
#

well scratch my idea completely if u could just do the other 1 idk

buoyant viper
#

wear item, rotate

rancid snow
#

thats what I'm showing

#

it revolves around the circle

#

since it's like an item only on the front of the head

dusk flicker
#

Can you show a gif of it with the armorstand visible?

rancid snow
#

yeah i can 1 sec

dusk flicker
#

oh thats gonna be fun

#

lmao

vocal cloud
#

I mean an orbit isn't hard to do you just need to use a formula

rancid snow
#

do you have the formula?

dusk flicker
#

just steal it from cosmic /s

buoyant viper
#

can an armor stand not wear a pickaxe on its head?

rancid snow
#

it can

#

it wears it like this:

vocal cloud
#

Does that work? Cause otherwise you're doing orbiting

rancid snow
#

No, it doesn't work

#

it is the same problem as in the hand

buoyant viper
#

hatted item doesnt sit at entity center?

#

hmm

rancid snow
#

nope

#

same problem as before

buoyant viper
#

ig u just gotta orbit then yea

vocal cloud
#

You'll need a center, a radius, and knowledge of degrees/radians whatever MC uses.

rancid snow
#

I understand all that

#

I have a center and a radius

vocal cloud
#

Now step 1 is to make the armorstand rotate around the fixed point

#

like a planet around the sun

boreal sparrow
#

this is a very dumb question. in a class called commands i have a /start command. i want to define a variable that my other class "events" can use. I want this becuase the events should only execute if the /start command has been run

vocal cloud
boreal sparrow
#

how do i check event player's world?

vocal cloud
#

Event players? You mean the player you get from an event?

boreal sparrow
#

yes

hardy swan
#

getLocation().getWorld()

rancid snow
boreal sparrow
#

ty ^^

vocal cloud
hardy swan
#

it is essential to know

boreal sparrow
#

why cant i call getlocation (non static method)

dusk flicker
#

You require a player object I presume

#

Player#getLocation().getWorld();

boreal sparrow
#

hmm thnx ill try

hardy swan
#

i mean, you know that it isn't a static method

dusk flicker
#

if I had to guess you require a ->

#

?learnjava

undone axleBOT
hardy swan
dusk flicker
#

lmao

rancid snow
#

how can I make an armorstand look at another location?

waxen plinth
#

You mean you know the location you want it to look at?

rancid snow
#

yeah

#

oh hi red

waxen plinth
#

Well let's say stand is the stand and loc is the location you want it to look at

rancid snow
#

yeah

buoyant viper
waxen plinth
#
Vector v = loc.clone().subtract(stand.getLocation()).toVector();
Location standLoc = stand.getLocation();
standLoc.setDirection(v);
stand.teleport(standLoc);```
rancid snow
#

would I be teleporting to standLoc?

waxen plinth
#

Oh yes, my bad

rancid snow
#

okay this is gonna sound weird but I'm not really wanting to look at directly point

#

I want the armorstand's right side of the body to be looking at the point

#

I'm hoping for the pickaxe to stay in the center

#

would that be possible?

waxen plinth
#

Determine how far the pickaxe is from the center

rancid snow
#

I've read online that it's 0.3125 radius from the pickaxe to the center of the armor stand body

#

I'm not sure it's true but I can test with different values if I know what I'm supposed to do

waxen plinth
#

Looks to be more than that

rancid snow
#

then it's probably double that

#

0.625

waxen plinth
#

Then it becomes easy

#

You take the point where you want the pickaxe to be

#

And you also need the angle you want it pointing at

#

Then you create a vector

#
Location loc; //Center
loc.setPitch(0);
loc.setYaw(angle); //I forget if it is degrees or radians
Vector v = loc.getDirection().multiply(0.625);
Location standPos = loc.clone().add(v); //Location of the stand
standPos.setDirection(v);
stand.teleport(standPos);```
boreal sparrow
#

lmao help how do i check an event player's world

waxen plinth
#

getPlayer().getWorld()?

pine island
#

whats the max duration i can set here?

waxen plinth
#

Integer.MAX_VALUE

pine island
#

oh yeah completely forgot abt that!

tender shard
#

hm what could I use instead of ??? in the javadocs?

    /**
     * Returns a new array of the given class type with length 0
     * @param componentType ???
     * @param <T> ???
     * @return Array of the given class type with length 0
     */
    public static <T> T[] createArray(@NotNull final Class<T> componentType) {
waxen plinth
#

The class of the component type for the array

#

The component type of the array

tender shard
#

isn't that actually both always the same? 😄

boreal sparrow
#

What is wrong with this bruuh:
if(event.getPlayer().getWorld() == "Game2"){

}

tender shard
#

it's weird to have to give a description for both

boreal sparrow
#

yea true

undone axleBOT
waxen plinth
#

What does getWorld() return?

#

Because I can guarantee it's not a String

#

It's a World

boreal sparrow
#

hmm

waxen plinth
#

And you shouldn't use == for String comparisons to begin with

#

You want

#

getWorld().getName().equals("someName")

boreal sparrow
#

yay

inner anvil
#

Would it be possible to make my plugin only work on a certain server? Or only work when I am on the server?

waxen plinth
#

But I think you should make sure you have a fundamental understanding of why that is the case

rancid snow
# waxen plinth ```java Location loc; //Center loc.setPitch(0); loc.setYaw(angle); //I forget if...

I'm confused, this is what it looks like now: https://streamable.com/iig2yz here's my bukkitrunnable code: ```java
BukkitRunnable br = new BukkitRunnable() {
@Override
public void run() {
int i = Math.floorMod(rotation.getAndIncrement(), 80);
for (ShowedItem item : showingItems) {
var b = item.locations().get(i);
item.stand().teleport(b.location());
Location loc = item.loc(); //Center
loc.setPitch(0);
loc.setYaw((float) b.angle()); //I forget if it is degrees or radians
Vector v = loc.getDirection().multiply(0.625);
Location standPos = loc.clone().add(v); //Location of the stand
item.stand().teleport(standPos.setDirection(v));
}
}
};

waxen plinth
#

Oh I forgot some of the math

boreal sparrow
#

but cant resolve method event.getPlayer in playerdeathevent :/

waxen plinth
#

It's getEntity

#

Again, read docs

buoyant viper
#

?jd

boreal sparrow
#

bruh

boreal sparrow
#

im dying

waxen plinth
#

All of these things are easily found in the javadocs

#

@rancid snow Can you send me the code for spawning the armor stand initially

pine island
#

why is this grey'ed out?

waxen plinth
#

I will try this myself and show you the resulting code when I get it working

buoyant viper
#

well, it is, but isnt

#

actually no it isnt bc theres no @EventHandler over it

pine island
#

oh yeah!

buoyant viper
#

but even after that itd still be grayed out i think, dont worry about it

pine island
#

nope it isnt

buoyant viper
rancid snow
buoyant viper
pine island
#

yep ty

tender shard
#

lol why do you register your commands in the most cursed way you could thought of?

rancid snow
#

"lol are do you register..."

buoyant viper
#

well

#

do are you register?

rancid snow
#

I don't usually, my brain is turning to mush as red can tell you I've been working on this for days straight

#

I usually use redlib for my projects

inner anvil
#

Would it be possible to make my plugin only work on a certain server? Or only work when I am on the server?

inner anvil
#

How so?

rancid snow
#

can you describe the problem

inner anvil
rancid snow
#

this sounds like an xz problem

#

oh okay

tender shard
#

they can't use it if they don't have it

buoyant viper
#

very true

buoyant viper
inner anvil
#

The point is to make plugins for a server, and have it restricted to that server in case the owner of it decides to share it.

rancid snow
#

just in the onEnable, check to make sure they have access by doing an api call or something, and if they dont, then return early from the onEnable

tender shard
#

and then wait for someone to remove this "protection" within 2 minutes

rancid snow
#

well yeah, security is a when question not and if question

#

you can ofc obfuscate it if you want more protection

inner anvil
#

Not like I'm giving out the source code

buoyant viper
#

obscurity does not equal security

rancid snow
#

java decompilation is basically the same thing as giving away the source code

#

but it usually is a good enough deterrent

#

If people keep taking computers from my office, and now I start screwing them into the desk, it's not an unbeatable security

#

but it's much harder, and takes time to break

hardy swan
#

open source it

#

like the creator of faker

buoyant viper
#

open source everything

#

work towards creating a free internet.

tender shard
#

or get a proper obfuscator 😄

buoyant viper
#

or dont share the plugin

#

thats normally a pretty solid approach to anti-leak

inner anvil
#

not sharing a plugin isn't a reasonable approach when you're making a plugin for someone else

buoyant viper
#

i think its pretty reasonable no matter what

inner anvil
#

your opinion > everything else

#

imo

buoyant viper
#

yeah

#

im always right

hardy swan
#

Unless your plugin worth a fortune, I dun see a need to do what you want to do

#

not saying you should open-source it or openly-distribute it

inner anvil
#

just to have the knowledge of how to keep things secure when I want to restrict it to a singular server (whenever I give the plugin to someone, and they attempt to share it)

#

I just started learning a few weeks ago, so I'm just planning ahead is all

inner anvil
#

I've made good progress, moving into world manipulation

vocal cloud
#

I mean if you want the truth someone could spend a few minutes injecting code into your jar to nullify any check you do. Unless you write something that's a pain for people to use it's not worth the time imo

inner anvil
#

didn't know it was so easy to do these things

buoyant viper
#

a really basic way to /protect/ a program is a killswitch, plugin checks a central server and if server says no, kill plugin

tender shard
inner anvil
buoyant viper
#

u could use a pastebin if u really wanted

#

but if you want proper management, a DB is needed

vocal cloud
tender shard
#

I just have a mariadb for blacklisted spigot IDs

inner anvil
hardy swan
#

run plugin using html protocols

#

big brain

vocal cloud
#

Galaxy brain open source your plugins for everyone to use hes_UwU

inner anvil
#

see honestly I have no idea how to do these things yet, I'm still on the surface of command making and event handling

inner anvil
waxen plinth
buoyant viper
# inner anvil ie?

idk youd have a pastebin document and when the content is true, the plugin will do its initialization sequence, if the content is false (or anything that isnt true), dont load

#

youd send an http request from the plugin on load or on enable

vocal cloud
waxen plinth
#

Yeah it's not 100%

tender shard
waxen plinth
#

The distance was definitely not .625

vocal cloud
#

Probably need to tilt the entity a bit if that's even possible

buoyant viper
waxen plinth
#

Yeah I'm not here to fiddle with the tiny margins in the numbers

rancid snow
waxen plinth
#

I was here to get it working

rancid snow
#

please share

waxen plinth
#
    @CommandHook("test")
    public void test(Player sender) {
        if (stand != null) {
            stand.remove();
            stand = null;
        }
        Location loc = sender.getLocation();
        loc.setPitch(0);
        stand = (ArmorStand) loc.getWorld().spawnEntity(loc, EntityType.ARMOR_STAND);
        stand.setVisible(false);
        stand.setArms(true);
        stand.getEquipment().setItemInMainHand(new ItemStack(Material.DIAMOND_PICKAXE));
        stand.setRightArmPose(new EulerAngle(Math.toRadians(-9), Math.toRadians(90), Math.toRadians(90)));
        float[] angle = {0};
        Task.syncRepeating(() -> {
            loc.setYaw(angle[0]);
            Vector v = loc.getDirection().multiply(0.8);
            Location tp = loc.clone().add(v);
            Vector facing = v.clone().rotateAroundY(Math.toRadians(-90));
            tp.setDirection(facing);
            stand.teleport(tp);
            angle[0] += 5;
            angle[0] %= 360;
        }, 1, 1);
    }```
rancid snow
#

good shit

#

this was about to be my thirteenth reason why

buoyant viper
#

only thirteen?

waxen plinth
#

.8 seems really close to the actual distance

buoyant viper
#

i think im on about 57 right now

waxen plinth
#

You can fiddle with the numbers 🥲

#

Proof of concept

sly trout
#

what was the method to get a block's optimal tool to use

rancid snow
tender shard
sly trout
#

dang it

tender shard
sly trout
#

why are there so many classes

#

what is that

tender shard
tender shard
#

because I was a java noob 2 years ago

buoyant viper
#

isnt there just like a get hardness vs tool method

#

or is that on the client

waxen plinth
#

I would imagine that's clientside

tender shard
#

but how would that help. e.g. some items require certain tools or enchantments

#

what information do you actually need?

#

getting the BEST tool for a block? or just checking if it would drop anything?

#

and the method below, isPreferredTool

waxen plinth
#

Oh

#

In that case, you could just try all the tools

#

Sword, axe, shovel, pickaxe, shears, hoe, I'm probably missing at least one

rancid snow
waxen plinth
rancid snow
#

ohhh ok

pine island
#

getting a error for PlayerJoinEvent:
Caused by: java.lang.NullPointerException

Code:


public class LuminasSw extends JavaPlugin implements Listener {


    @Override
    public void onEnable() {
        // Plugin startup logic

        getServer().getPluginManager().registerEvents(this, this);
        getCommand("kit").setExecutor(new kit());
        getCommand("End").setExecutor(new End());
        getCommand("start").setExecutor(new start());
        getCommand("refill").setExecutor(new refill());
        getCommand("map").setExecutor(new mvCore());

        getLogger().info("Luminas sw was  Started successfully.... ");


    }


    @EventHandler
    public void onJoin(PlayerJoinEvent event){
        Player player = event.getPlayer();
        player.addPotionEffect(PotionEffectType.FIRE_RESISTANCE.createEffect(Integer.MAX_VALUE, 255));
        player.addPotionEffect(PotionEffectType.SPEED.createEffect(Integer.MAX_VALUE, 2));
    }
waxen plinth
#

Well can we see the full stack trace

#

Because a NullPointerException is caused by trying to access something which is null

#

Any one of the things you're accessing here could be null

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.

pine island
#

its onEnable

#
t me.lumina.luminassw.LuminasSw.onDeath(LuminasSw.java:48) ~[?:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_272]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_272]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_272]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_272]

at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]

this might help

tender shard
#

bruh

#

what's line 48

buoyant viper
#

are ur commands registered in plugin.yml

pine island
#

they are

#

wait

quasi flint
#

onDeath