#help-development

1 messages · Page 1534 of 1

smoky oak
#

ah still any clue it works with 1.16

eternal oxide
#

supplying the folder as a Javadoc location it expects an unzipped javadoc set of folders. You need to set a jar location not a directory

woeful crescent
#

How do I detect a player holding right click

eternal oxide
ivory sleet
#

You could with an invisible armor stand

#

Altho hacky workaround

#

Prone to bugs

woeful crescent
#

I know Mineplex does it

#

for the sniper rifle in super paintball

ivory sleet
#

Yeah but then you hold in an item

woeful crescent
#

huh?

ivory sleet
#

I am pretty sure you hold in an item while performing the holding click

woeful crescent
#

Hold in an item?

ivory sleet
#

In which detecting a holding click is possible

smoky oak
#

actually @eternal oxide , @ivory sleet ...
It's possible, just give me a moment to check the relevant cocde

#

*code

hybrid spoke
ivory sleet
#

You can check a holding click through hacky PlayerInteractEvent and some other events but it’s a workaround

woeful crescent
#

hmmmm

ivory sleet
#

Not really a supported way of doing it

woeful crescent
#

maybe I won't

#

Maybe I'll make it so it activates on right click and cancels if you scroll off of it

hybrid spoke
#

.....

ivory sleet
#

That said you will be introduced to a lot of things which might break that

smoky oak
#
public void onPlayerInteract(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        if ((event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)){
                ItemStack s = player.getInventory().getItemInMainHand();
}```
hybrid spoke
ivory sleet
#

Not a holding click

eternal oxide
smoky oak
#

i see

hybrid spoke
#

i'm feeling ignored

woeful crescent
#

Here's what I'm making:

eternal oxide
#

"No one puts God in a corner!"

#

Film quote if you were wondering

hybrid spoke
#

holding rightclick*

eternal oxide
#

It sounds like he's tryign to do a sniper scope on held right click

#

I wonder if the spyglass events could do that

smoky oak
#

In that case, @hybrid spoke 's solution might actually be the best. The javadoc states that the event fires under specific circumstances which translate to 'event gets triggered ~ once/15 ticks, or with every right click', but from what i can see checking the duration without specifically storing it elsewhere is not possible

eternal oxide
#

There are no spyglass events yet, but possibly

smoky oak
#

From experience, a map is a far better solution than the stuff with armor stands. That would trigger a different event (PlayerInteractWithEntity) but pure code that has to NOT run on the server (directly) is much faster

woeful crescent
#

I know @hybrid spoke you're feeling ignored, because to be honest, with my current system, it'd be pretty hard to do that. I wanted to make it so you had to hold right click (it'd be pretty OP if you could do other things while rejuvenating), but I think I'll make it so that you click it once, and then you can't scroll off of the item or else it will cancel the rejuvenation.

hybrid spoke
#

already had this topic because of my anti autoclicker plugin since holding rightclick causes 5 cps

proud basin
#

is it possible to get the top kills with Statistics.PLAYER_KILLS

hybrid spoke
smoky oak
#

well if he wants to keep it active until item in hand changes

hybrid spoke
smoky oak
#

just log that he right clicked and set it to false when that events triggers

proud basin
#

ok so it is then

stoic osprey
#

How can I copy a world folder into my plugins directory?

hybrid spoke
#

the integration would probably be the same by having a boolean if he still clicks/holds it or not

quiet hearth
#

Ok so I have an interface that is opened that displays crafting recipes. The interface is opened via a Knowledge_Book, and it is name and has a lore, and is enchanted with luck for the enchanted effect... However when i open the book it displays an error in the console. https://hastebin.com/gokuluheti.rust
I was wondering if there was a way to bypass this.?

smoky oak
#

@stoic osprey per plugin or manually

stoic osprey
#

i.e From ./world to ./plugins/myPlugin/world

stoic osprey
smoky oak
#

Look up how java works with files

#

there should be a copy method

stoic osprey
#

I tried it

#

it said the target dir already exists

#

but it doesn't?

smoky oak
#

...mind jumping in a vc for that?

stoic osprey
#

I can't VC sorry

#

I can DM though

smoky oak
#

fair enough

ivory sleet
quiet hearth
quaint mantle
#

Can someone help me with Json onEnable/onDisable please, cant make it work

#
    public void onDisable() {

        Map<UUID, Collection<Vector>> map =Territory.getAllTerritories().asMap();
        Gson gson = new Gson();
        String json = gson.toJson(map);


    }```
#

so I have this but it's onDISABLE

ivory sleet
#

Why not use a Multimap

quaint mantle
#

I actually have a multimap

#

but I read that I must turn it into a Map for json

ivory sleet
#

Also you need to write that into a file

compact haven
#

that is broken

#

you need to write it to a file like conclure said

quaint mantle
#

yea no idea what i'm doing actually lol

compact haven
#

and use GsonBuilder instead

ivory sleet
#

I believe Gson adds guava collection type adapters by default

#

Or yeah mb that’s the builder

quaint mantle
#

wdym adding it to a file ? another class ?

compact haven
#

no writing it to an actual file

quaint mantle
#

sorry guys im big noob about it

compact haven
#

it doesnt just stay in memory after restart

ivory sleet
#

No you need a file to store the data like between arbitrary server instances

quaint mantle
#

ah ok so I need to create a "json" file with the name I put it when I call json command, right ?

#

wait

#

the file must be in the server

#

not in the plugin

compact haven
#

but you need write, one sec

quaint mantle
#

ah thanks will look into it see if it helps

compact haven
#

its something like toJson(object, filewriter)

#

so just create a filewriter

quaint mantle
#

Im really confused

#

so 1st of all I need to write in my plugin a command that will create a file in the server disk, right ?

ivory sleet
#

yes a physical file

compact haven
#
public static final Gson GSON = new GsonBuilder()
            .setPrettyPrinting()
            .enableComplexMapKeySerialization()
            .disableHtmlEscaping()
            .create();

...
try {
    File file = new File(dataFolder, "territories.json");
    FileWriter fw = new FileWriter(fw);
    GSON.toJson(Territory.getAllTerritories().asMap(), fw);
} catch (IOException e) {
    e.printStackTrace();
}
quaint mantle
#

ok is there any spigot thing to do that ?

#

hmmm

ivory sleet
#

Just use a FileWriter

#

Like itzdlg showed you (:

quaint mantle
#

damn tysm dude, so it s tailored to my thing already like that ?

#

what does it do

compact haven
#

well dont just copy it, learn what it does

quaint mantle
#

yea

compact haven
#

the first part creates a static object called GSON, all static final constants should be uppercase by convention

ivory sleet
#

Your plugin might leak memory if you copy paste that code considering that it doesn’t close the file writer.

compact haven
#

then we create a builder for the Gson object, enable pretty printing which puts different keys on new lines, enables map key serialization which serializes map's properly, and disables html encoding which prevents your json from being fucked up

#

you should use that new Gson object everywhere, dont copy paste that code to every file you use gson in

quaint mantle
#

hmm okay so all those methods are Gson methods, like the core methods of Gson to copy my shit into json file, right ?

compact haven
#

thats why it's statically available

#

now we create a try catch which is for FileWriter

#

because it throws IOException in some odd cases

#

then simply toJson serializes the object to a json string and then writes it to the FileWriter (fw) provided

quaint mantle
#

hmm

#

so

#

File file = new File(dataFolder, "territories.json");

#

this create an actual file in a folder somewhere ?

compact haven
#

dataFolder needs to be your plugin data folder

#

so get the instance of your plugin then call #getDataFolder()

eternal garnet
#

Is there a way to check of the message author is a player or a bot? If yes, can someone please give me an example?

compact haven
#

event.getMember().isBot()

quaint mantle
#

My plugin has no folder being created when you load it into a server is that what is meant

compact haven
#

I'm assuming you mean JDA since you give no information at all

eternal garnet
#

oh shit wrong dc server

#

soryy

compact haven
#

if it is JDA

#

then that line I gave works for u

quaint mantle
eternal garnet
compact haven
#

oh

hybrid spoke
compact haven
#

never used javacord

ivory sleet
#

JDA all the way (:

hybrid spoke
#

^

#

or python

ivory sleet
#

Jython 🥴

hybrid spoke
#

BrainCord

#

DiscFuck

#

would be a huge lib

#

for brainfuck

compact haven
#

I'd love to see how you can make an http request in assembly

#

kekw

ivory sleet
#

🥲

quaint mantle
#

if (!getDataFolder().exists()) getDataFolder().mkdir();
saveDefaultConfig();

#

will this create a datafolder ?

ivory sleet
#

yes

quaint mantle
#

thanks

chrome beacon
#

You don't need to create the data folder it will do that for you

quaint mantle
#

thanks guys really appericiate the help!

hybrid spoke
#

isnt the data folder pregenerated?

quaint mantle
#

it doesnt for me

#

Ive been loading my plugins many time

ivory sleet
#

I think not in older versions

quaint mantle
#

no datafolder

chrome beacon
quaint mantle
#

not sure what is meant by older version but ive downloaded all this shit recently so

#

maybe only some IDE do that

hybrid spoke
#

no IDE does that

chrome beacon
#

IDE doesn't have anything to do with this

quaint mantle
#

what does then ? isnt it from templated code by IDE ?

chrome beacon
#

Spigot should create it when you save the default config

quaint mantle
#

ah I use paper, maybe it's that

chrome beacon
#

Probably not

#

But hey if your code works that fine let's not over think this

quaint mantle
#

yea right

#

have a good day

unreal quartz
silver wadi
#

how do you create a default config?

ivory sleet
#

saveDefaultConfig() followed by
reloadConfig() iirc

silver wadi
#

oh

ivory sleet
#

Then you need a config.yml resource

silver wadi
#

So I can create that manually?

ivory sleet
silver wadi
#

Thanks

ivory sleet
#

Always check the wiki before asking here in the future

#

It contains a lot of substantial spigot concepts

quaint mantle
#

Guys I'm not sure what to input to retrieve the file onEnable

#

Map<UUID,Collection<Vector>> map2 = GSON.fromJson()

#
            File file = new File(getDataFolder(), "territories.json");
            FileWriter fw = new FileWriter(file);
            GSON.toJson(Territory.getAllTerritories().asMap(),fw);
        } catch (IOException e) {
            e.printStackTrace();
        }
#

this is where I built it on disable

ivory sleet
#

When reading you need a FileReader instead

quaint mantle
#

ah ok

#

so similar to above but with a reader

#

also

#

FileWriter fw = new FileWriter(file);

#

is "file" as input, correct here ?

#

it's hard for me to tell because the IDE doesnt refer the type that should be as inputs

ivory sleet
#

Multimap map = new Multimap()
FileReader reader = new FileReaded(new File(...));
map = GSON.fromJson(new TypeToken<Multimap<UUID,Location>>().getType(), reader);

quaint mantle
#

Hmm thanks ! so Gson will translate its own file directly into the Map, amazing!

ivory sleet
#

Yeah should work I think

quaint mantle
#

Hmm I get an IDE error "expression expected" before the Map<xxx>

rocky glacier
#

@quaint mantle
player.sendMessage(Message.getMessage(player.getUniqueId(), "prefix") + Message.getMessage(player.getUniqueId(), "message_ETC_price").replace("{amount}", money_formatter.format(API.ETC_price)));
}else if(args[0].equals("balance") || args[0].equals("bal") || args[0].equals("check") || args[0].equals("info")){

#

lol it made it spoiler bc of |

#

it would be args[0].equals("bal") with || at start and end

quaint mantle
#

codeblocks, please

#

@rocky glacier

hybrid spoke
#

?paste

undone axleBOT
hybrid spoke
rocky glacier
granite stirrup
quaint mantle
#

lmfao

#

pastebin is blocked by my school district -.-

#

like wtf

hybrid spoke
#

you are in school?

quaint mantle
#

no, i graduated, but my sister has a hotspot from her school which is what we use because we live in the country and the only other internet we have is satellite and its dog shit

quaint mantle
hybrid spoke
#

probably its formatting PepeLaugh

quaint mantle
#

looks like fucking spaghetti

rocky glacier
#

cannot find symbol variable ETC_price

quaint mantle
#

how about you show us the file that actually declares that variable :)

onyx fjord
#

hi

#

whats the entitytype for the exploding bed?

hybrid spoke
#

i think there is none

#

since a bed isn't an entity

onyx fjord
#

soo

#

alr

quaint mantle
#

ffs, codeblocks or paste

#

?paste

undone axleBOT
quaint mantle
hybrid spoke
#

show us your API class

rocky glacier
#

this is api class

hybrid spoke
quaint mantle
#

removed

#

?paste EYES

undone axleBOT
hybrid spoke
#

use the one linked

#

pastebin is shit

quaint mantle
#

gone

#

lol

rocky glacier
hybrid spoke
#

as again

quaint mantle
#

case again

hybrid spoke
#

case sensitivity is a thing

quaint mantle
#

lmao

#

how about, before asking for help, double check your casing :)

rocky glacier
#

🤦‍♂️ lol sry

#

so obviously

silver robin
wraith rapids
#

it probably isn't exposed by the spigot api

#

paper api might expose it

silver robin
#

yeah, there isn't a method to it
isn't it possible to get a handle to the actual packet object itself? (idc about nms)

wraith rapids
#

not from the event, I don't think

#

well, let me check

#

yeah no the bukkit event doesn't retain that information

#

and nms doesn't have an event bus that you could hook into easily afaik

#

consider using protocollib and listening to the incoming packet

silver robin
#

yes thats what i wanted

#

PaperServerListPingEvent has getClient().getProtocolVersion()
so guess i'll have to use protocol lib

wraith rapids
#

or paper :fingerguns:

opal juniper
#

Yeah you have to use the packets

#

Unless you use paper

wraith rapids
#

most people do

opal juniper
#

Ehh - I try and avoid developing against paper

#

But I run paper

wraith rapids
#

i build against paper exclusively because I want my things to actually be performant

#

but I usually add a fallback dependency for spigot

#

for those poor fucks who still run splögget

opal juniper
#

Lmao

hushed lantern
#

Hi, can I make a spigot plugin from a gradle project? (I want to use firebase so I needed a built.gradle file and this seemed the easiest way to get one.)

hexed hatch
#

spoogle

lucid jacinth
#

how does one write to a .yml file in code

wraith rapids
#

new FileOutputStream 😎

opal juniper
rocky glacier
#

?paste

undone axleBOT
rocky glacier
#

but i added 1.17 library

lucid jacinth
#

alright ill check it out tysm

wraith rapids
#

check your plugin.yml

wraith rapids
#

yes, the build tool you use, if any, doesn't matter

#

you can use notepad and javac if you're gay enough

#

java is java

rocky glacier
#

love is love 😂

chrome beacon
wraith rapids
#

i love to hate

#

and i love to discriminate minorities

rocky glacier
chrome beacon
hushed lantern
chrome beacon
wraith rapids
#

google is useful

#

i wonder what search results it gives for "spigot gradle"

granite stirrup
chrome beacon
#

And also exactly what he needs

regal moat
#

can anyone recommend me a hosting? i want it to be good and cheap as possible. its for plugin development.

eternal oxide
#

Self host

#

can;t get cheaper

swift nebula
#

What do you recommend to learn how to create plugins?

hexed hatch
#

Learning Java

#

?learnjava

undone axleBOT
eternal oxide
regal moat
quaint mantle
#

Hey, is it possible to give a custom loot when someone gets a fish? like could I replace the fish with an item of my choice?

eternal oxide
#

If you don't have enough ram to host a home server you don't have enough to develop plugins

regal moat
#

and minecraft

eternal oxide
#

How much ram do you have?

regal moat
#

8 gb's.

eternal oxide
#

thats plenty

#

well, thats JUST enough

granite stirrup
#

i give 2gb to minecraft and 1gb to the server

#

XD

#

normally

eternal oxide
#

But you are going to have to be choosy over what you use. No Intelij, Only Eclipse

regal moat
#

i have just intellij and minecraft open, and i cant open the server with 2 gbs.

eternal oxide
#

Yeah, with 8 gig total you shoudl drop InteliJ

granite stirrup
#

the server doesnt need 2gb ....

#

if its just for testing

#

its fine with 1gb

eternal oxide
#

he needs OS, MC, IDE and Server

regal moat
#

in 1.12.2, yeah but 1.16.5 ... 🤷‍♂️

granite stirrup
#

intellij only uses like 1gb

#

max

eternal oxide
#

1.16 is ok for testing with 1 gig

regal moat
#

i always used 1.12.2 in the past

granite stirrup
#

u can run 1.16.5 with 1gb

#

its possible

#

but only for testing your plugins

#

and i ran a 1.17 server on 1gb just to test my shit

eternal oxide
#

Or you could save the money you would be spending on a host and instead buy more ram.

regal moat
#

its a laptop

eternal oxide
#

They do make laptop ram

regal moat
#

i use 4x2 ram

eternal oxide
#

they also make it in 8 gig sodimms

regal moat
#

and it only has 2 slots

#

wouldnt readyboost would be useful?

eternal oxide
#

not really

hushed lantern
#

Hi, I created a build.gradle project, I copied the code from is link(https://www.spigotmc.org/wiki/spigot-gradle/) to the build gradle, I added some java also to test the plugin. BUT after I built the artifact and started the server, it thrown me error that says "cannot find a plugin yml". I have an plugin.yml file but I don't know where should I paste it where the program can find it

compact haven
#

I test my plugins on a vps kek

granite stirrup
rocky glacier
#

need some help here

limber mica
#
private String kitName;
    private ItemStack[] kitItem;
    private Enchantment enchantmentName;
    private int enchantmentLevel;
    private String requiredPermission;

    public KitManager(String kitName, ItemStack[] kitItem, Enchantment enchantmentName, int enchantmentLevel, String requiredPermission) {
        this.kitName = kitName;
        this.kitItem = kitItem;
        this.enchantmentName = enchantmentName;
        this.enchantmentLevel = enchantmentLevel;
        this.requiredPermission = requiredPermission;
    }

    public String getKitName() {
        return kitName;
    }

    public ItemStack[] getKitItem() {
        return kitItem;
    }

    public Enchantment getEnchantmentName() {
        return enchantmentName;
    }

    public int getEnchantmentLevel() {
        return enchantmentLevel;
    }

    public String getRequiredPermission() {
        return requiredPermission;
    }```
 right so I have
then make a class for each kit
have KitManager extended and have this 
```public t() {
        super(kitName, kitItem, enchantmentName, enchantmentLevel, requiredPermission);
    }```
but now I'm thinking about it and I don't know if this is actually gonna work how I want it to work. So any suggestions?
granite stirrup
#

actually read

granite stirrup
limber mica
#

no

granite stirrup
limber mica
#

wait do you actually?

granite stirrup
#

yep

hushed lantern
granite stirrup
#

idk

#

i dont use gradle

maiden briar
#

I try to center both, for the green line I expect the full line is 127 pixels (and start centering from behind with spaces). The blue line is line 1 of the motd and I also expect here 127 pixels and it starts with spaces at the front

granite stirrup
#

maven is better to me as in user friendly and more easier to use

eternal oxide
#

A class doesn't have to be asbstact to be extended, but you can;t instance abstract classes

granite stirrup
#

i thought it does

eternal oxide
#

no

maiden briar
#

You can actually do new Class() {} even if abstract

hushed lantern
granite stirrup
#

fuck off

dusk flicker
#

@quaint mantle spammer

#

Few messages up

maiden briar
#

Exactly as the error sais, you have a null object

rocky glacier
#

yh if every1 ignores me

granite stirrup
#

doesnt mean you spam

eternal oxide
limber mica
#

idkidk123123 now the reason I was thinking is that this won't work how I want it to is because there will be multiple items that will be in the kit

dusk flicker
#

You spamming us makes us just want us to fucking ignore you even more

granite stirrup
#

read the thing @rocky glacier ALSO show code

quaint mantle
dusk flicker
#

Not sure

quaint mantle
#

😢

granite stirrup
#

but go to ur command class and change the return to true

#

next time read the stack trace and wait for help

limber mica
#

did ya read my response?

eternal oxide
#

They are fairly simple once you understand it.

granite stirrup
#

i forgot how to fix this
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!

#

can someone tell me

#

XD

chrome beacon
eternal oxide
#

alt-F4

granite stirrup
#

ive done it before but i forgot how

eternal oxide
#

which IDE?

granite stirrup
#

intellij

chrome beacon
#

Maven error though

eternal oxide
#

then set it in yoru pom

granite stirrup
#

do i just add <project.encoding>utf-8</project.encoding>?

#

in the properties or what is it

eternal oxide
#

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

granite stirrup
#

thanks

muted idol
#

how would i go about always displaying my actionbar?

granite stirrup
#

bukkit scheduler ?

muted idol
#

so just making a loop?

granite stirrup
#

and making it display to the player every 5 second or something?

muted idol
#

yea but i'd like it to be displayed always

granite stirrup
royal hawk
#

who worked with the neural network?

granite stirrup
#

idk

regal moat
#

how can i detect if a player got off a vehicle

eternal oxide
#

events

#

?jd

regal moat
#

what event doe

dusk flicker
#

?events

#

Damn

eternal oxide
#

use the searchbox

granite stirrup
#

VehicleExitEvent

chrome beacon
undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

granite stirrup
regal moat
#

oh

muted idol
#

oh nvm somebody already answered

granite stirrup
#

lol

#

f i fucking hate that intellij detects typos

#

LIKE WTF

#

I DONT WANT TO KNOW MY TYPOS

quaint mantle
#

Hey, how can I get the itemstack of a mod?

granite stirrup
#

AND IF ITS SOMETHING NOT A WORD IT LIKE FUCKING MARKS IT AS A TYPO

#

i really hate it

#

oh i can disable it

#

f

regal moat
#

lol

chrome beacon
#

I love that feature I'm very good at making typos

granite stirrup
#

i hate it

#

it marks words that dont exist as a typo

hybrid spoke
#

i hate those typo marks

#

deactivated this shit

granite stirrup
#

lol

hybrid spoke
#

if i am creative and creating new words this thing says they don't exist

#

and i don't like that

granite stirrup
#

lol

proud basin
#

What's the enchantment called for unbreaking

chrome beacon
#

Durability

#

Iirc

granite stirrup
#

f paper really hates running with 1gb ram

onyx fjord
#

oh yea the names

#

why not call TNT_MINECART normally

#

but MINECART_TNT

#

like wtf

granite stirrup
#

whats the smallest size someone's made a plugin with just one command?

#

cuz i making a plugin and rn its got 1 command but its like 3.64kb xd

hybrid spoke
#

doingSomethingWithAverages best method name i had by far now

quaint mantle
#

yo why does my plugin work on my hub but not my kitpvp

#

i dont understand

hybrid spoke
#

any errors?

#

what is your plugin doing?

quaint mantle
#

its giving a player an custom item i made

#

but when i look at the logs

#

it sais

#

Caused by: java.lang.IllegalArgumentException: Item cannot be null

#

it doesnt do this on my hub server

hybrid spoke
#

send the full error

quaint mantle
#

25.06 15:04:27 [Server] ERROR null
25.06 15:04:27 [Server] INFO org.bukkit.command.CommandException: Unhandled exception executing command 'giveblindnessitem' in plugin Blindness v1.0
25.06 15:04:27 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:826) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.PlayerConnection.handleCommand(PlayerConnection.java:2185) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.PlayerConnection.c(PlayerConnection.java:2000) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1953) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:49) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:7) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:35) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1266) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1259) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1220) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1134) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at java.lang.Thread.run(Thread.java:829) [?:?]
25.06 15:04:27 [Server] INFO Caused by: java.lang.IllegalArgumentException: Item cannot be null
25.06 15:04:27 [Server] INFO at org.apache.commons.lang.Validate.noNullElements(Validate.java:364) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventory.addItem(CraftInventory.java:293) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO at icalling.blindness.Commands.Commands.onCommand(Commands.java:19) ~[?:?]
25.06 15:04:27 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.16.5.jar:git-Paper-"e04368045"]
25.06 15:04:27 [Server] INFO ... 19 more

hybrid spoke
#

wtf

#

?paste

undone axleBOT
hybrid spoke
#

please

#

put it in a paste

quaint mantle
#

sorry

granite stirrup
#

f paper fixes alot of plugins

compact haven
#

<t:1624648060:R> someone posted a pretty wall of error

hybrid spoke
#

whats on line 19

granite stirrup
#

we need spigot to include paper patches now

hybrid spoke
#

in Commands

quaint mantle
#

player.getInventory().addItem(ItemManager.blindnessball);

granite stirrup
#

how does paper solve plugins but spigot the plugins are broken on 1.17

hybrid spoke
granite stirrup
#

well not all plugins are broken on spigot

#

but some are

hybrid spoke
quaint mantle
#

do you want the code

compact haven
#

<t:unix timestamp:R>

#

<t:1624648168:R>

hybrid spoke
#

<t:unix timestamp:R>

quaint mantle
#

for the ItemManager.blindness

#

because

hybrid spoke
#

huh

quaint mantle
#

i dont understand

compact haven
#

u need to put the unix timestamp

hybrid spoke
#

ahh

quaint mantle
#

so

#

i dont understand

#

why it works on 1 server

#

but the other no

hybrid spoke
#

<t:1624648205 timestamp:R>

#

haha fml

#

<t:1624648205:R>

#

ahh

compact haven
#

<t:1609477200:R> was New Years

quaint mantle
#

so

quaint mantle
hybrid spoke
#

since your error says its null

onyx fjord
#

looks like custom plugin

quaint mantle
#

well it is

#

i made the plugin....

quaint mantle
# onyx fjord what is blindness ?
    public static ItemStack blindnessball;

    public ItemManager() {
        createblindness();
    }

    public ItemStack blindnessball() {
        return blindnessball();
    }

    private void createEffectClearer() {
    }
    private static void createblindness() {
        ItemStack item = new ItemStack(Material.INK_SAC, 1);
        ItemMeta meta = item .getItemMeta();
        meta.setDisplayName(ChatColor.YELLOW + "Blindness Ball");
        List<String> lore = new ArrayList<>();
        lore.add(ChatColor.GRAY + "This is Ghanaman's cool partner item");
        lore.add(ChatColor.GRAY + "When you hit a player with this item they receive blindness");
        meta.setLore(lore);
        meta.addEnchant(Enchantment.LUCK, 1 ,false);
        meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
        item.setItemMeta(meta);
        blindnessball = item;```
onyx fjord
#

im not a java expert

#

ItemMeta meta = item .getItemMeta();

#

this part

#

theres a space

#

it probably breaks the thing

quaint mantle
#

ah

regal moat
#
package org.powder;

import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.ProtocolManager;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketEvent;
import org.bukkit.Bukkit;
import org.bukkit.entity.Bee;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;

import java.util.Objects;

public final class Main extends JavaPlugin {

    @Override
    public void onEnable(){
        System.out.println("[Powder] --- Enabled");
        getCommand("bee").setExecutor(new SpawnBee());
        getServer().getPluginManager().registerEvents(new ListenerBee(), this);
        BeePacket();
    }

    private void BeePacket() {
        ProtocolManager manager = ProtocolLibrary.getProtocolManager();
        manager.addPacketListener(
                new PacketAdapter(this, PacketType.Play.Client.STEER_VEHICLE) {
                    @Override
                    public void onPacketReceiving(PacketEvent e) {
                        Player p = e.getPlayer();
                        if (p.getVehicle() instanceof Bee){
                            Bee b = (Bee) p.getVehicle();
                            b.setRotation(p.getEyeLocation().getYaw(), p.getEyeLocation().getPitch());
                            b.setVelocity(new Vector(e.getPacket().getFloat().read(0), 0, e.getPacket().getFloat().read(1)));
                        }
                    }
                }
        );
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}
``` my main gives me a null pointer exception
hybrid spoke
#

?paste

undone axleBOT
hybrid spoke
#

...

regal moat
#

i used protocollib

hybrid spoke
#

in what line?

regal moat
#

i am using 1.16.5

#
java.lang.NullPointerException: null
    at org.powder.Main.BeePacket(Main.java:28) ~[?:?]
    at org.powder.Main.onEnable(Main.java:23) ~[?:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:351) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
    at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:494) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
    at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:408) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
    at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:435) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
    at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:218) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
    at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:809) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
    at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_291]
#

28 and 23

chrome beacon
#

?paste

undone axleBOT
hybrid spoke
#

so manager is probably null

regal moat
#

how can i fix that?

hybrid spoke
#

do you have protocollib as a soft dependency?

dusk flicker
#

assert manager != null; /s

regal moat
#

i also have it in my plugins folder

hybrid spoke
#

you can add plugins which your plugin depends on to your plugin.yml so your plugin will just be loaded if the dependency is loaded

regal moat
#
softdepend:
  - ProtocolLib
```like this?
hybrid spoke
#

most likely

regal moat
#

also, ```
[22:14:48] [Server thread/WARN]: [ProtocolLib] Loaded class com.comphenix.protocol.ProtocolLib from Powder v1.0-SNAPSHOT which is not a depend, softdepend or loadbefore of this plugin.
[22:14:48] [Server thread/ERROR]: Could not load 'plugins\ProtocolLib.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: Plugin already initialized!
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:139) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:383) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:185) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:809) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_291]
Caused by: java.lang.IllegalArgumentException: Plugin already initialized!
at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:199) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:52) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at com.comphenix.protocol.ProtocolLib.<init>(ProtocolLib.java:58) ~[?:?]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_291]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_291]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_291]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_291]
at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_291]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
... 7 more
Caused by: java.lang.IllegalStateException: Initial initialization
at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:202) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:52) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.powder.Main.<init>(Main.java:16) ~[?:?]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_291]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_291]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_291]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_291]
at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_291]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
... 7 more

#

?paste

undone axleBOT
regal moat
#

this

sage swift
#

so lets think

#

what does this mean

regal moat
#

maybe since i already have protocollib inside of my plugin?

sage swift
#

no

regal moat
#

hm

sage swift
#

Caused by: java.lang.IllegalArgumentException: Plugin already initialized!

regal moat
#

hm

sage swift
#

what does this mean

regal moat
#

i have one clue

#

my plugin initalized it first and spigot tried to initialize it again

sage swift
#

other way around

regal moat
#

Oh?

sage swift
#

since you have it as a softdepend

#

you dont need to initialize it since it's already initialized

regal moat
#

when i got this error

#

i didnt

#

i didnt test it with the softdepend in the plugin.yml

sage swift
#

you initialize it somewhere in your code.

hybrid spoke
#

probably in the spawnbee or listenerbee constructor

regal moat
#

spawnbee is a command

#

it has nothing to do with it

sage swift
#

although i guess in the error above since it's not a softdepend you initialized it first

regal moat
#

so i should add it as a softdepend and try

sage swift
#

you should not initialize it in your code

hybrid spoke
#

what is powder

regal moat
#

its the name of the plugin

hybrid spoke
#

org.powder.Main.<init>(Main.java:16)

regal moat
#

i just typed random shit

sage swift
#

but yes, add it as a softdepend and it will show you the error line

#

from your end

regal moat
#

16 is ```java
public final class Main extends JavaPlugin {

hybrid spoke
#

so you are somewhere creating a new instance of your own plugin ig

sage swift
#

no

#

what are you on about

#

his code is initializing ProtocolLib

regal moat
#

what should i do to fix it then??

granite stirrup
#

wait is this a bug or this intonational when you make a static method in intellij it says its being used when it isnt?

regal moat
#

ok added it as a softdepend

#

now trying

quaint mantle
#

Used/unused checks for intellij is definitely far from good in my experience

regal moat
#

okay no errors

eternal night
#

I think there was a config option to consider static methods entry points by default

granite stirrup
regal moat
#

it works lol

opal juniper
#

EventListeners always appear in unused

eternal night
#

Makes sense ?

ivory sleet
#

Yeah it can only predict compile time shit obv

eternal night
#

They are invoked using reflection lol

upper mica
#

Hello, so I need to log information into file, and I will also use it as for 'history' command, what file type should I choose? I was thinking yaml, because its easier to read and write values, but it's more like for configuration stuff

eternal night
#

How is intellij gonna now

opal juniper
#

Magic 🪄

eternal night
#

:5head:

opal juniper
granite stirrup
regal moat
#

so i am trying to make the bee rideable

#

?paste

undone axleBOT
granite stirrup
#

cuz reflection doesnt work in java 16

regal moat
#

the controls work

#

but the rotation doesnt

#

for some reason

eternal night
#

Omg why is everyone saying reflection doesn't work in java 16

opal juniper
#

It works, but differently…

eternal night
#

Like, read

#

It works perfectly fine

granite stirrup
eternal night
#

Unless the code access is encapsulated by a module

#

And your plugin isn't

#

Neither is the server internals

opal juniper
eternal night
#

Or craftbukkit, spigot or paper code

regal moat
#

help please

granite stirrup
#

can anyone tell me why maven thinks this is bad str.replaceAll("([a-z0-9])([A-Z])", "$1-$2").toLowerCase(); it says uses unchecked or unsafe operations.

#

im using it to convert camel to kabab

opal juniper
#

Dafuq is kebab lmao

#

Never heard of it

eternal night
#

A wild regex matching exactly 2 characters XD

quaint mantle
#

well

cinder timber
#

kebab-case

opal juniper
#

Yeah I got that

#

But what is the format

cinder timber
#

jesus

cinder timber
#

uses -

opal juniper
#

Oh sorry lmao

cinder timber
#

np lmao

opal juniper
#

I didn’t notice the hyphen

granite stirrup
#

yeah but why does it say that it uses unchecked or unsafe operation.

eternal night
#

wild, my intellij says nothing when trying to call this method

opal juniper
#

He said his maven

#

But idk

granite stirrup
#

it doesnt say anything about it but when i do mvn package

#

it says something

regal moat
granite stirrup
#

@eternal night should i just ignore it i mean its just a warning

#

it doesnt stop it from building

eternal night
#

What maven version are you using

#

I cannot reproduce this

granite stirrup
#

idk

eternal night
#

what is the maven warning

granite stirrup
#
[WARNING] /C:/idk/src/main/java/test/idk/idk/Main.java: Recompile with -Xlint:unchecked for details.```
eternal night
#

and you are 100% sure this is caused by the specific line ?

granite stirrup
#

yep

#

because after i added

#

this happend

#

i have Apache Maven 3.6.3

eternal night
#

try to update maven to latest ¯_(ツ)_/¯

#

update compiler as well

granite stirrup
#

i dont really want to update maven

eternal oxide
granite stirrup
#

cuz after i added it

eternal night
#

can you recompile using -Xlint:unchecked

granite stirrup
#

it says this

eternal night
#

so you can compile with exactly this one line removed

#

and the warning is gone ?

regal moat
granite stirrup
eternal night
#

🤔

eternal oxide
#

That line is a simple regex replace, it doesn't cast anything

#

Nothing unsafe about it

granite stirrup
#

oh f i think i figured it out

#

i cast some other class somewhere to a T which is passed in through the class using these <T>

#

but it wasnt causing a warning before

#

so idk why it is now?

burnt current
#

Hey quick question: Is it possible to query the display name of an item not whether it has a certain full name, but only whether a certain word occurs in the item?

eternal night
#

I mean, there is just String#contains

quasi flint
#

Which works

burnt current
eternal night
#

a) you are missing a bunch of null checks there
b) getDisplayName().contains("my substring")

quasi flint
#

Store that in an variable?

quasi flint
#

But i dont know If U need that

#

If Not use Lynx's answer

burnt current
eternal night
#

a switch statement is not an if and does not allow partial checks

#

switch doesn't work like that

burnt current
eternal night
#

switch is just a pretty form to express a lookup table in code

sage swift
#

but dont use display name for custom items

#

pls

#

holy shit

#

or guis

burnt current
quasi flint
quiet ice
#

switch on strings works with hashcodes for anyone interested

burnt current
eternal night
#

pfft, only plebs paste the link

#

?pdc

undone axleBOT
eternal night
regal moat
#

guys

#

i need to move the vehicle

#

with rotation

#

it rotates fine

#

but it doesnt move in the rotated direction

eternal night
#

read up on what the values represent

quasi flint
#

Never worked with persistent data holders

#

Pretty smort things

regal moat
#

i am just new to spigot

eternal night
#

then why are you passing these values as x and z velocity values into the velocity

#

if you know xD

quasi flint
#

Well dis not gonna work

eternal night
# quasi flint Pretty smort things

just, be vary on storing a) half a database on them and b) 100% do store the item meta you are reading them off. getItemMeta is a very very expensive call.

compact haven
#

wot

quasi flint
#

10€ a call

compact haven
#

I never heard that getItemMeta is expensive?

eternal oxide
#

it copies

eternal night
#

the entire thing

#

also parses it all

regal moat
quasi flint
eternal night
#

:5head:

compact haven
#

how is persistent item data stored

#

I assume its just an abstraction for nbt

eternal night
#

it is

quasi flint
#

When u take wallets to seriously in minecraft

compact haven
#

like it could be implemented in any version, not just 1.14

eternal night
#

internally it uses NBT yea

#

just do not think of it as a NBT API

compact haven
#

mmm?

eternal night
#

the API very specifically does not allow generic nbt modification

compact haven
#

right

eternal night
#

e.g. you couldn't modify the items display name with it

granite stirrup
#

any better way than what i have done XD java public static String kababToCamel(String str) { String result = ""; String[] strings = str.split(""); for (int i = 0; i < str.length(); i++) { if (strings[i].equals("-")) { result = result + strings[i + 1].toUpperCase(); continue; } else if (i == 0) {} else if (strings[i - 1].equals("-")) { continue; } result = result + strings[i].toLowerCase(); } return result; }

eternal night
#

use a StringBuilder

regal moat
granite stirrup
eternal night
#

the values in the packet only represent if the player pressed the forward,backwards or left and right buttons

#

not actually the rotation

#

you will need to calculate the vector from it

quasi flint
sage swift
#

java.lang.NullPointerException: Cannot invoke "org.bukkit.World.getBlockAt(org.bukkit.Location)" because the return value of "org.bukkit.Location.getWorld()" is null
getting this on startup despite having load: POSTWORLD because it's loading before the worlds for some reason... any ideas for a fix other than delaying it by a tick?

eternal night
#

Seems more like a question as to where your location comes from

sage swift
#

well not really

#

the World is null

quasi flint
#

Or am I smooth brain

eternal night
#

Yes, the locations world. I can create a location at runtime that doesn't have a world assigned to it

sage swift
#

the location includes the world.

#

it's just that the plugin enables before the worlds

#

oh

#

it might be that i need softdepend on multiverse

#

one sec

regal moat
eternal night
#

then maybe look for existing plugins to do what you are trying

sage swift
#

yep, it was because the plugin was enabling before multiverse loaded custom worlds

#

thanks for all your help guys 😉

quasi flint
sage swift
#

exactly

eternal night
#

mental support

#

smh

#

that counts for something

quasi flint
#

From a mentally unstable person

granite stirrup
#

isnt looping slow?

quasi flint
#

Seems reasonable

granite stirrup
#
    public static String kababToCamel(String str) {
        String result = "";
        String[] strings = str.split("");
        for (int i = 0; i < str.length(); i++) {
            if (strings[i].equals("-")) {
                result = result + strings[i + 1].toUpperCase();
                continue;
            } else if (i == 0) {} else if (strings[i - 1].equals("-")) {
                continue;
            }
            result = result + strings[i].toLowerCase();
        }
        return result;
    }``` can someone help me revamp this XD
quasi flint
#

Stringbuilder says henlo

granite stirrup
#

thing is idk how to use that

sage swift
#

why not split via "-"

eternal night
#

^^ could just uppercase each array start

sage swift
#

if youre trying to get the characters why not use toCharArray

granite stirrup
sage swift
#

word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase()

quasi flint
#

?paste

undone axleBOT
eternal night
#

the fuck

#

is that formatting

granite stirrup
#

@quasi flint thats snake to camel

#

and not kabab to camel

eternal night
#

snake and kabal just different delimiters no ?

#

one uses _ the other -

quasi flint
#

Brain smooth

granite stirrup
#

kabab-case

turbid wind
#

Minecraft commands naturally suggest stuff like "[<level>] above the message when there's no tab complete and all. How can I do the same?

sage swift
quasi flint
#

The same shit just with -

#

So replace my _ with -

#

And workes I guess

eternal night
#

no guarantees tho

wraith rapids
#

Pattern.compile("[-_](\\w)").matcher(input).replaceAll((r) -> r.group(1).toUpperCase());

lunar wedge
#

How do I get UUID of an offline player by just their Name?

wraith rapids
#

call getOfflinePlayer with the name

#

note that it can and probably will make a blocking network request to mojang

#

so you don't want to do it synchronously on the main thread

#

i don't know how to put it any clearer

granite stirrup
wraith rapids
#

call getOfflinePlayer

#

pass the name as an argument to it

#

it is deprecated but it is still a perfectly valid operation, not subject to removal, and fine to use

#

read the deprecation note

hybrid spoke
#

its just deprecated cause it sends the request to mojang

granite stirrup
#

lol

regal moat
wraith rapids
#

bukkit deprecations aren't real deprecations

hybrid spoke
#

not sure if iterating over the offline players would make more sense

#

or if getOfflinePlayer already checks them

wraith rapids
#

it does

hybrid spoke
#

ah good

wraith rapids
#

it uses the local usercache if the name is cached

#

in fact paper has a specific overload or a variant that does not make the network request

#

and only checks the usercache

regal moat
wraith rapids
#

what even is your issue

#

and no, I can't see replies

#

you'll have to put some actual effort into it and cuntpaste the thing instead of .'ing it

hybrid spoke
granite stirrup
hybrid spoke
#

~ Core

wraith rapids
#

what is that supposed to mean

lunar wedge
#

Thanks! I got it to work

wraith rapids
#

how do you move something with rotation

#

do you mean relative to its rotation

eternal night
#

and he doesn#t understand that the packet does not send the actual rotation but rather boolean style int flags what keys were pressd

granite stirrup
#

nn why cant u see replys?

hybrid spoke
#

i am not sure how you can rotate something without rotating

#

wait

#

what version is it

regal moat
#

1.16.5

wraith rapids
#

probably 1.8

regal moat
#

its a bee damn it

wraith rapids
#

were boats even in the game in 1.8

hybrid spoke
#

the entities looks like they've been rotated

#

but they doesn't

eternal night
regal moat
#

...maybe?

hybrid spoke
#

if you spec them in spec mode you can see that they still are looking into the direction like before

wraith rapids
#

vehicles are pretty buggy with rotation

#

well, boats are

granite stirrup
regal moat
#

so, what do i have to do here?

#

i have no idea

wraith rapids
#

dunno bout minecarts

hybrid spoke
#

couldn't find a fix yet but probably didn't looked deep enough into it

wraith rapids
#

give up i suppose

regal moat
eternal night
granite stirrup
wraith rapids
#

MEIN NEIN ELEKTRON

verbal oriole
#

hello

wraith rapids
#

are you waiting for a "hello" response before you're going to ask your question

quaint mantle
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

verbal oriole
#

well i have the griefprevention plugin but the /trust isnt working

hybrid spoke
verbal oriole
#

oof

wraith rapids
#

unless you are the developer of griefprevention, this isn't the right channel

verbal oriole
#

sorry

quasi flint
#

Makes sense

#

Relatable

wraith rapids
#

myes

#

i don't actually know a word of german

#

i just pull from a catalogue of nazi german associated words

eternal night
#

must be a brit then

steep nova
#

how do i cancel drops with EntityDeathEvent?

eternal night
#

clear the getDrops list

steep nova
granite stirrup
quasi flint
#

Tf Electrons related to Germans?

granite stirrup
#

:)

steep nova
#

wait

granite stirrup
#

what lynx said

wraith rapids
#

electron isn't related to germany, I wouldn't think

steep nova
#

nvm

wraith rapids
#

it is closely related to shit, though

quasi flint
quasi flint
wraith rapids
#

that is anti german

quasi flint
#

But the Americans did it so more related to em

granite stirrup
#

apparently this works java StringBuilder s = new StringBuilder(); char[] chars = str.toCharArray(); for (int i = 0; i < chars.length; i++) { if (chars[i]=='-') { s.append(("" + chars[i + 1]).toUpperCase()); continue; } if (!(i==0) && ("" + chars[i - 1]).equals("-")) { continue; } s.append(("" + chars[i]).toLowerCase()); } return s.toString();

hybrid spoke
# regal moat ...

you could probably deep search it. already tried the nms and normal way. good luck. @ me if you found smth

wraith rapids
#

built by the amerimutts and conceptualized by a jew

quasi flint
#

Well then good

wraith rapids
#

about as not german as you can get

quasi flint
#

Good it wasn't dropped here ;7

quaint mantle
#

how i can get CustomModelData from armorstand's ArmorItems in spawner?

granite stirrup
wraith rapids
#

is this your first plugin

proud basin
#

if I'm correct this should give a speed potion

#

ItemStack potion = new ItemStack(Material.POTION, 1);
PotionMeta potionmeta = (PotionMeta) potion.getItemMeta();
potionmeta.setMainEffect(PotionEffectType.SPEED);
potion.setItemMeta(potionmeta);
p.getInventory().addItem(potion);

granite stirrup
wraith rapids
#

maybe, dunno; potion meta and shit has been changed since 1.8

#

i don't know how the new system works, and I don't remember how the old system worked

granite stirrup
#

i thought you use the PotionCreator for potions

#

PotionBrewer

#

i mean

wraith rapids
#

neverheard

granite stirrup
#

it a interface tho so it might not be how you do it

#

lol it got deprecated cuz it doesnt work XD

earnest sonnet
#

I guess you play with getDrops()

wraith rapids
#

also for the snake to camel conversion, on java 1.9 this should work
Pattern.compile("[-_](\\w)").matcher(input).replaceAll((r) -> r.group(1).toUpperCase());

#

will convert it to lower camelcase

granite stirrup
#

uh

wraith rapids
#

Pattern.compile("([-_]|^)(\\w)").matcher(input).replaceAll((r) -> r.group(1).toUpperCase());
will convert to upper camelcase

granite stirrup
#

that way might be better than what i have done it but im gonna stick to the way i have currently

eternal night
#

just please cache the compiled pattern

wraith rapids
#

of course you don't want to compile the pattern every time

eternal night
#

yes

wraith rapids
#

but that is for the sake of brevity

granite stirrup
#

yeah i dont understand regex so ima stick to loops and stuff XD

#

even if its bad idrc

earnest sonnet
ivory sleet
wraith rapids
#

i doubt there is any internal caching going on in there

eternal night
#

I don't think JIT would actually cache yea

ivory sleet
#

Hmm fair then

wraith rapids
#

not sure if the compiler does anything about it

regal moat
#

maybe i found it

#

PacketPlayOutEntityHeadRotation?

wraith rapids
#

JIT might do something about it

granite stirrup
#

what if the string changes and you want to do it like every time you ran a command?

wraith rapids
#

the string doesn't change, if you mean the regex string

eternal night
#

no way JIT caches instances of pattern

wraith rapids
#

if you mean the input string, you call pattern.matcher(input)

#

where pattern is the precompiled pattern

#

and input is your input

granite stirrup
#

oh

novel mauve
granite stirrup
#

yeah i dont understand regex so i might just use for loops and stuff

wraith rapids
#

can't see embed txts

eternal night
novel mauve
#

yeah i know im not using hte right version but i dont know which one to use

wraith rapids
#

it probably says that

eternal night
#

you compiled with java 15

#

and run with java 10

#

so, just run with java 15

granite stirrup
#

LOL

novel mauve
#

Ohh okay

granite stirrup
#

or java 16

eternal night
#

or better, upgrade both to java 16

#

yea

novel mauve
#

Thanks

granite stirrup
#

java 16 is evil tho

eternal night
#

it. really isn't

granite stirrup
#

to me it is

eternal night
#

Are you modifying static final fields using reflection ?

wraith rapids
#

anything past 8 is

main dew
#

what is this CraftComplexRecipe and CraftSmithingRecipe?

wraith rapids
#

a complex recipe and a smithing recipe, respectively

eternal night
#

I'll start a list of people that like java 8

wraith rapids
#

the concrete classes part of the craftbukkit server implementation that each implement the corresponding bukkit api classes

#

java 1.8

#

how fitting

granite stirrup
#

and you cant do that in java 16

wraith rapids
#

no the smithing bench thing i think

#

whatever it's called

#

i don't think anvils use recipes

eternal night
granite stirrup
wraith rapids
#

your mom

granite stirrup
#

?

hybrid spoke
#

reflections are bad

#

and should nearly never be used

granite stirrup
#

but you need it for some things

hybrid spoke
#

not really

granite stirrup
#

packets?

#

nms

hybrid spoke
#

reflections are a bad usage except your are doing your own framework

granite stirrup
#

¯_(ツ)_/¯

ivory sleet
#

Yeah kinda agree with luzifer, shouldn’t be used unless you have a decently justified reason for it

quaint mantle
#

maven is such a bitch, just sayin

main dew
#

what is this CraftComplexRecipe?

proud basin
#

So i did ```java
ItemStack potion = new ItemStack(Material.POTION);
PotionMeta potionmeta = (PotionMeta) potion.getItemMeta();
potionmeta.setMainEffect(PotionEffectType.SPEED);
potionmeta.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 3600, 0), true);
potion.setItemMeta(potionmeta);
p.getInventory().addItem(potion);

#

So now im just wondering should I just get console to give them it

sage swift
#

PotionMeta#setColor

proud basin
#

nope

sage swift
#

what do you mean "nope"

worn tundra
#

lmao

main tangle
#

how can i change the entity a skeleton shoots

#

like arrow to tnt