#help-development

1 messages ยท Page 2 of 1

sterile token
#

Yes

#

Yes i was refering to that, Alex* AHAHA

#

What the name of the operator "bla >> other"

vocal cloud
#

Bit shift?

sterile token
#

Oh ok

#

I seen it many times and i didnt know the name

vocal cloud
#

<< shift left

right shift

quaint mantle
#

i think ima just use worldedit api. Probably the best solution

sterile token
#

I seen it a lot when i was working with the protcol

sterile token
#

Worledit == slow

quaint mantle
#

that's what i meant

vocal cloud
#

It's because it's extremely fast for doing certain operations

sterile token
#

๐Ÿ˜‚

vocal cloud
#

I'm not sure that bit shifting is gonna improve your performance with setblock

slate delta
#

Hey, how i can create a new Furnace Recipe,
but that the entry is with a specific custom name

sterile token
vocal cloud
#

Oh, well, depending on what you're doing that's just how to do it.

#

Hence why an ID system is superior to string-based

lost matrix
quaint mantle
#

where would the fastasyncworldedit api be?

#

this is useless

#

or im blind

#

probably the second one

dusk flicker
#

its right there?

slate delta
lost matrix
slate delta
#

new RecipeChoice().ex..... ?

lost matrix
sterile token
#

A nooby question but when reflecting to command map and not doing Field#setAccessible() could lead on a null instance or commands not being registered?

slate delta
#

okay thank you for your help !!

lost matrix
sterile token
#

okay

#

Because im getting an exception

#

But im so idiot that didnt do ex.printraceStrace()

#

๐Ÿ˜‚

#

Nop is not that

lost matrix
sterile token
#

Yeah i will get it now

#

1m

quaint mantle
#

@lost matrix pardon the ping
I dont understand how the jvm performs operations in nanoseconds
I dont think it really does, but maybe its some sort of delay offset thing
Where this code:

long now = System.nanoTime();
System.out.println("Hi");
System.out.println(System.nanoTime() - now);

Is always 20ns, which shouldnt be possible at all
Unless that snippet of code results in like 3 machine code instructions
Its not possible

lost matrix
quaint mantle
#

is there a way to remove a dependency from the output?

#

because with the worldedit api its going to be like 25mb

#

and i already have worldedit installed on the server

sterile token
#

In the dependency label add this label: <scope>provided</scope>

quaint mantle
#

146 micros

quaint mantle
lost matrix
#

That sound more reasonable

quaint mantle
#

Wtf

#

Thats so slow

#

That cant be right

tender shard
lost matrix
#

std out is really slow

quaint mantle
#

My language is uhhh

tender shard
#

well it's not thaaat slow

quaint mantle
#

A shit ton faster than the JVM

tender shard
quaint mantle
lost matrix
#

sysout gets quite a bit faster really quick because the jit tackles it early

tender shard
#

"provided" = not shade

#

"compile" = shade

torn badge
#

146ms for one single sout is way too slow

lost matrix
#

us

#

it was micros

tender shard
torn badge
tender shard
#

I recently tried the speed of stdout and it was like one second to print a million lines (numbers from 0 to 1 mil)

lost matrix
#

I just ran a quick test. Lowest was around 1.3 us for a sysout.
Doesnt seem too bad

quaint mantle
#

Like wtf

sterile token
#

๐Ÿ˜‚

quaint mantle
#

How is it so fast

tender shard
#

the first sout always takes longer

dusk flicker
#

computers go brr

lost matrix
#

Because i ran it 10 million times

quaint mantle
#

Yeah i know

#

Oh

sterile token
#

Wait CommandMap field is not anymore on 1.19 spigot?

tender shard
dusk flicker
#

my command system uses it and I'm running 1.19 so I would hope its there

sterile token
#

Okay? Im getting a no such field exception

quaint mantle
#

@lost matrix im getting around 27 micros

#

ivm is still faster

tender shard
sage patio
dusk flicker
#

my command system is so wack lmao

sterile token
sterile token
sterile token
#

๐Ÿค”

tender shard
#

I always wonder - is "whack" a good or bad thing?

#

or wack

quaint mantle
#

whack means hit

tender shard
#

no idea how its spelt

quaint mantle
#

wack is bad

tender shard
#

wtf

#

you are kidding me

#

lol

quaint mantle
#

"I whacked him upside the head"

tender shard
#

english ยฏ_(ใƒ„)_/ยฏ

lost matrix
#

whacking is wack

dusk flicker
#

like how micrometer and micrometer are the same word but said differently
micro meter
mike rom eter (yeah no idea if this will make sense spelled out like this lol, but still is an actual word)

quaint mantle
#

wtf

#

you say mick

#

i say mike

dusk flicker
#

lmao

tender shard
#

@sterile token what error do you get?

dusk flicker
#

actually ur right

#

I did spell it wrong

dusk flicker
#

generally a micrometer is reffered to as a Mike so

sterile token
tender shard
sterile token
#

ok

tender shard
#

or just copy paste my whole method

#

it definitely works in 1.16+

lost matrix
sterile token
#

There you have mfalex

CommandMap getCommandMap(Plugin plugin) throws Exception {
  Field field = plugin.getServer().getClass().getDeclaredField("CommandMap");
  field.setAccessible(true);
  return (CommandMap) field.get(Bukkit.getServer());
}```
tender shard
#

CASE

#

CommandMap != commandMap

sterile token
#

Oh **

#

Its comandMap right?

dusk flicker
#

I feel you could remove the plugin argument and just use Bukkit.getServer

tender shard
#

no

#

it's "commandMap"

dusk flicker
#

I found a hacky way to make my command map implenetation work lol

#

I have absolutely 0 background of reflection so I took like three weeks just testing to find something to work lol

tender shard
#

I love reflection so much lol

dusk flicker
#

the former system like fully replaced the entire thing and what not

sterile token
tender shard
#

one of my finest reflection

sterile token
pseudo cradle
#

why is the flying packet called the flying packet if its sent when your not flying

tender shard
sterile token
tender shard
#

it is

sterile token
#

I dont know about plugin obf

tender shard
#

it's my original code

sterile token
#

Lol

#

How

#

and wh?

tender shard
#

it's the unobfuscated, original source code

sterile token
#

what the heck

lost matrix
sterile token
#

๐Ÿ˜‚

tender shard
pseudo cradle
#

sent every tick

sterile token
sterile token
#

What an amazing level

#

I wish i can get a decent name obfuscation one

tender shard
#

I use allatori with the highest allowed settings as additional thing for everything that's not free on spigot

tender shard
#

it can't do anything besides name obf anyway

sterile token
tender shard
#

if you wanna get a proper obfuscator, buy allatori

tender shard
sterile token
#

I want something more powerfull

tender shard
#

allatori!

#

download Angelchest free and decompile it

#

then you see what allatori can do on lowest settings

sterile token
#

None of github obfuscators have name, unicode characters obfuscation, methods obfuscation

#

Also i want to ask something

#

Its there a posibility that a plugin inject code into spigot so it cannot be craked?

tender shard
#

lol

#

no

sterile token
#

A friend told me something but i dont really know

#

I dont think

tender shard
#

EVERYTHING can be cracked

#

ALWAYS

#

EEEEEVERYTHING

#

you cannot avoid that

sterile token
#

Atm that man havent get anything cracked

#

๐Ÿง

#

HAhahah not being rude!

tender shard
#

only thing you can do is to make cracking so hard that crackers think "nah that's not worth my time"

sterile token
#

Yeah

#

That is what the man did probably

tender shard
#

I mean even denuvo (ALL versions IIRC) was cracked and that was like the best "protection" that there ever was for games

sterile token
#

Because as said "every thing redeable by machine can be by human"

tender shard
#

as I said, check out angelchest free and decompile it

sterile token
#

I mean you understand

sterile token
tender shard
#

It's definitely not "readable", but yeah with enough time you get the idea of what does what

tender shard
sterile token
#

Okay i will try

tender shard
#

and why would you get banned from spigot for decompiling a plugin

#

you can decompile everything you want

sterile token
#

Lol really?

tender shard
#

yeah well I don't know your country's laws

sterile token
#

I think it was agains psigot ToS

tender shard
#

but you definitely will not get banned from spigot even if you tell everyone "I decompiled CMI/AngelChest/ItemsAdder/WhatEver yesterday"

sterile token
#

Can i send you a pic of obf code and tell if this possible with a free one?

#

If you not bussy obviously

tender shard
#

but obfuscating is shit. I only do it to avoid leaks

sterile token
#

Me too i only want to avoid leaks too

#

Its obviously that ill be leaked but will be harder

#

Have u heard about PandaCommunity?

tender shard
#

but do you even have a paid plugin? doesnt really make sense to obfuscate free plugins

tender shard
sterile token
#

its big a comm where they sell plugins and someone of their plugins have been leaked

#

So there i have the prob that obf doesnt matter when you want to leak something you do all to do it

#

Also mfalex what does that type of obf that "hide code" when you decompile them? Is t secure?

tender shard
#

nothing is secure, ever

sterile token
#

Sorry for being really annoying but for me its really interesting this topic

#

I know but its decent or not?

tender shard
#

as said, the only thing that obfuscation does is "make the cracker need more time to crack"

sterile token
#

I know bro

#

Im just trying to learn

#

I didnt find much info about this on internet

tender shard
#

okay so I'll explain how I'm obfuscating my stuff

sterile token
#

I was planning something like a loader which download the jars on random directory and them inject into spigot

pseudo cradle
tender shard
#
  1. Name obfuscation, but heavily. All methods, fields and classes use "reserved names". E.g. in my obfuscated code, you will see stuff like this:
private static final int false = 3;
tender shard
#
  1. Flow obfuscation. Let me send an example for that, 1 sec pls
#

Original Code:

int sumOfElements(int[][] matrix, int rowsCount, int columnsCount) {
        int sum = 0;
        for (int row = 0; row < rowsCount; row++)
            for (int column = 0; column < columnsCount; column++)
                sum += matrix[row][column];
        return sum;
    }
#

Obfuscated:

int sumOfElements(int[][] matrix, int rowsCount, int columnsCount) {
    int a(int a[][], int a, int a) {
        int i = 0;
        int j = 0;
          goto _L1
_L6:
        int k = 0;
          goto _L2
_L4:
        i += a[j][k];
        ++k;
_L2:
        a;
        JVM INSTR icmplt 17;
           goto _L3 _L4
_L3:
        ++j;
_L1:
        a;
        JVM INSTR icmplt 10;
           goto _L5 _L6
_L5:
        return i;
    }
#

oh wait

pseudo cradle
#

native everything

tender shard
#

copy pasted it wrong but anyway, you get the idea

tender shard
pseudo cradle
#

yaya

sterile token
tender shard
#
  1. String encryption. I combine allatori's string encryption with my own one
sterile token
#

Do u remember mfalex??

tender shard
#

so instead of this

public String asd = "asd";
#

itll look like this:

sterile token
#

mfalex do you have an obf with all this? Im really imterested on one

tender shard
#
public String asd = "%%__USER__%% DONT CRACK ME PLS awfzjfawia7t937t5193trug13tgfziawfiq27r";
sterile token
#

Ok

tender shard
#

also, another thing allatori does:

#

it will combine classes / move some methods to different classes

#

imagine you have a method in class X, allatori can move it to class Y so it will confuse whoever is trying to decompile it

pseudo cradle
tender shard
tender shard
sterile token
#

I also would like to learn more about how they obfuscate

pseudo cradle
sterile token
#

I know they obfuscate over bytecode using libraries which allow them to do things like that

tender shard
pseudo cradle
tender shard
pseudo cradle
#

have you implemented it into a obfuscator so its automatic?

tender shard
#

So I have different ways of encryption, they get combined randomly. E.g. "PackageNameOffsetDecryption" for example takes the name, method and line number of the calling class to somehow "obfuscate" the string. Then at runtime, I check via reflection "which method, class, line unmber requested to decrypt this string"

tender shard
#

You can tell allatori "pls use method XY in class YZ to obfuscate strings, and use method AB in class ASD to decrypt them at runtime"

sterile token
#

i always see that method on many obf jars

tender shard
#

however most of the stuff needed to PROPERLY do that in allatori isn't documented. I got a custom version by allatori that's not public. I'm currently using version 8.2.1 IIRC while officially the latest version is 8.2 lol

#

I know someone at allatori

sterile token
pseudo cradle
vocal cloud
#

You can of course decrypt this by grabbing the class code at runtime and writing it to a file

tender shard
sterile token
#

Yeah i think it has a name right?

tender shard
sterile token
#

My final goal is just to bother those shity skidders who leaks your code

sterile token
tender shard
vocal cloud
#

You shouldn't have to worry about them. Most people who pirate aren't going to bother paying anyways

pseudo cradle
#

you can also use ssvm to deobf most string obfuscation

tender shard
#

just invest your time into your actual plugins instead of worrying about catching leakers

tender shard
vocal cloud
#

Write great code and people will pay for it.

sterile token
#

Okay chaging topic i having lot of problems trying to learn and understand how to await on java. Because on javascript its so easy that i cannot do it on java

pseudo cradle
vocal cloud
#

Except that's false and never happrns

tender shard
#

e.g. here's a tiny example of my custom encryption

vocal cloud
#

No server worth it's salt uses cracked plugins.

sterile token
tender shard
#

but for custom string encryption, you gotta get it approved by md5 anyway

sterile token
vocal cloud
#

Provide premium support like Alex does with Proof Of Purchase

sterile token
tender shard
#

also my encryption is different all the time ofc. here's 10 times the same string encrypted, they of course all can be decrypted to the originnal

vocal cloud
#

Well you can start by asking your question.

sterile token
#

I dont really understand how works await on java

#

That the main issue

vocal cloud
#

Await is futures in java.

sterile token
#

Allright, but that is blocking hmn

tender shard
#

if you wait, it blocks

#

that's the purpose of waiting

vocal cloud
#

In JS/Rust you have futures which you can pass to threads to prevent thread blocking behavior.

#

You do the same in java

sterile token
#

I mean javascript does that things on his own so you dont care do i explain?=

#

So that why i cannot do it on java

#

In java you have to create the new thread, etc

vocal cloud
#

Yes, JS has the ability to implement a .await.xyz.etc

#

Java, however, you need to provide an anonymous class usually or write your own callback system.

sterile token
#

So i want to learn but learn future on Java

slate delta
#

How can I add a texture pack on my server that contains files related to optifine?

Because it makes me when download: "The server resource pack could not be applied"

"Any functionality that requires custom resources may not work as expected"

sterile token
vocal cloud
#

Well you can look into how JDA for example does the .queue() stuff

sterile token
#

Okay

vocal cloud
#

It's pretty much the exact same thing as how js does it

sterile token
#

I will look on the src thanks

#

Thank mike

tender shard
#

I love and hate JDA so much

sterile token
#

Also you mfalex that i lost plenty of your time

tender shard
#

np lol

sterile token
#

Lol EnumMap<K, V> exists?

tender shard
#

Where K is <K extends Enum<K>>

sterile token
#

Okay, sounds weird

#

Still cannot make the commands get registered on 1.19 thru command map

noble lantern
#

Works for my lib

sterile token
#

Weird

noble lantern
#

Your likely not injecting the right type of command

#

Or injecting into the wrong command map

sterile token
#

getCommandMap().register(plugin, command)

#

Burch also my CommandAPI class extends from org.bukkit.Command

noble lantern
#

Im at doct appointment rn so I cant look at my code and see

sterile token
#

Okay dont worry man

#

Just ignore me im really annoying

#

๐Ÿ˜‚

noble lantern
#

If you go to my github

#

Go to

#

BurchAPI

#

I beileve the CommandInjector class is in commands package

sterile token
#

ok

noble lantern
#

That code in there is confirmed working i unjust used it yesterday

sterile token
#

thanks i il ltry it

#

okay

#

Burch i dont know what was happening but the command get registered

lost wolf
#

Why do Wolves and PigZombies have an isAngry method but Warden and Bees do not?

noble lantern
#

Wouldn't be suprised if spigot implements an AngerIssue object

subtle folio
#

ladies, does anyone know how to remove only 1 of i?

lost wolf
#

And what about neutral creatures such as Endermen, Dolphins, Polar Bears, Piglins, Pandas? How do we know if they are in "attack" mode?

subtle folio
#

i is a non-stackable item

noble lantern
#

getSlot().setType

subtle folio
#

yes yes

#

ty

noble lantern
#

Player#updateInventory

#

Thats important^^^

subtle folio
#

alr alr

noble lantern
#

Or else client issue

noble lantern
#

Might need nms

#

They have a navigator option so you could just check if theyre aggressive

#

Ie has entity target

subtle folio
noble lantern
#

GetItem

#

getItem*

#

getItem(slotNum) iirc

subtle folio
#

I see

#

tyty

noble lantern
#

Ofc

subtle folio
#
p.getInventory().getItem(slot).setType(Material.AIR);
            p.updateInventory();```
#

๐Ÿ†’

noble lantern
#

Yep should work might wanna make it a method with a for loop if you want

subtle folio
#

it is a method ๐Ÿ˜›

noble lantern
#

Ahh okay :))

subtle folio
#

well in one already

noble lantern
#

I would just make a wrapper that allows multiple removals

#

Eg removeItem(Material, IntegerCount)

subtle folio
#

I see

#

then pr to spigot

#

:)

noble lantern
#

Would need slight refactoring

subtle folio
#

slight lmao

noble lantern
#

Cause removeItem is weird ngl

subtle folio
#

mhm mhm

noble lantern
#

Would need to rename it to removeAllOf

#

Then need removeSlot

#

And final removeAmountOfType

subtle folio
#

mhmmhm

patent horizon
#

is there a discord for protocolsupport help?

waxen plinth
#

expunge

patent horizon
#

?

#

can u dm me the link

blissful elm
#

Im new to java and I'm wondering, how can I add a cooldown to a bow with a custom name? A 10 seconds cooldown between shooting arrows

torn shuttle
#

is there a clever way to get both blocks of a double chest assuming you have the object for one of the blocks in the double chest?

vocal cloud
torn shuttle
#

my life is a lie

#

thanks

#

actually there's only one location, one x, one y and one z? is it even possible to get the block they're at from there?

#

I mean to get both halves of the double chest

ornate patio
#

more of a java question but how do I read a random line from a txt file without loading the entire thing into memory

brave sparrow
#

Depends on what you mean by a random line

ornate patio
#

random line of text..

#

anyways i got it nvm

sage patio
#

wdym?

#

u mean something like Bedwars?

sterile token
#

Lovely

sterile token
#

You want to develop a game?

sage patio
#

they are making they're game with game engines not with Bukkit API

sterile token
#

Okay? Why asking on spigot?

#

Nothing to do here but idk

gleaming grove
#

Is there any way I can set comments to yml file using YamlConfiguration class or I need to code own yml writer? expected result on the img

sterile token
#

And what have that to do?

#

I dont understand you

sterile token
brave sparrow
#

They want to implement the bukkit API in their own game

brave sparrow
#

I suspect itโ€™s legal

#

Provided the implementation complies with the apiโ€™s license

gleaming grove
sterile token
gleaming grove
sterile token
#

What happening? I have checked everything

#

Never happened that console doesnt have perms

dusk flicker
#

show code

sterile token
#

Ok

quaint mantle
#

Hello! I'd appreciate if someone could help me with the following, as im new to developing plugins and struggling a bit;

https://pastebin.com/Zj3uXhUm

I want to get a boolean from my config.yml and if the boolean is true, allow the command to be used, if the boolean is false, then send a message telling the player that the command is disabled in the config.yml.

I don't get any errors on the console, but it doesn't work, if I put God.Command on the config to false, im still able to use /god

sterile token
gleaming grove
#

maybe just check permission only in case Player is a command sender

sterile token
#

But i dont know if player or not

#

๐Ÿค”

dusk flicker
#

honestly I cant really see any errors but honestly that command system you have seems to make it horrible to debug anything

sterile token
#

Because some aguments should be able to execute from console* and some not

dusk flicker
#

There's so much bloat in it where you could make it a lot easier to debug

quaint mantle
#

You mean my command system?

dusk flicker
#

No, VERANOs

sterile token
gleaming grove
#

if(sender instanceof Player player){ }

vocal cloud
quaint mantle
#

it's defined in the config.yml, I'll send it:

vocal cloud
#

Try to use GetBoolean() and don't use a default

quaint mantle
#

God.Command: true

vocal cloud
#

Yeah, don't use a default it makes debugging a pain

sterile token
dusk flicker
#

ConsoleCommandSender - it's console
Player - it's a player
CommandSender - it's any of these
ProxiedCommandSender - Proxy
BlockCommandSender - a block

vocal cloud
#

You also don't need to assert it's true just if(config.getBoolean()) {}

gleaming grove
quaint mantle
#

Well it asks for two parameters, string and def

#

the == true was just me getting annoyed it didn't work xd

brave sparrow
#

@sterile token the problem is youโ€™re missing a !

quaint mantle
#

Still, I don't understand if im doing something wrong, maybe im not getting the boolean from the config.yml correctly ?

brave sparrow
#

In your permission check

dusk flicker
#

gj alex

#

we're all blind

#

lol

brave sparrow
#

if (!(argument.getPermission().isEmpty() && sender.hasPermission(argument.getPermission()))) {

#

Youโ€™re checking if the permission is empty AND they have the permission

sterile token
quaint mantle
brave sparrow
#

Actually you should be able to just change the && to ||

sterile token
quaint mantle
#

as in printing the variables to the console, so I know what they are ?

dusk flicker
#

I still believe if the command system was cleaned up a bit that VERANO is using, it would make it a lot easier to find errors such as this (and could reduce issues) by making some tasks more 'auto'

brave sparrow
#

It does not (a AND b)

#

So for example

#

If a is false, b is true

sterile token
#

Oh shit i have logic class and the teacher explain us that

brave sparrow
#

Thatโ€™s always returning true

sterile token
#

And it was today mornings

#

๐Ÿคก this face describes me perfectly

vocal cloud
quaint mantle
#

System.out.println(main.getConfig().getBoolean("God.Command", true));

#

I did this, does that suffice what you mean Mike?

#

Okay I ran it with the config.yml in false and it returned true

vocal cloud
#

Okay I'll say it again, stop adding the default

quaint mantle
#

Actually I should use IsBoolean for this, right ?

vocal cloud
#

No

#

getConfig().getBoolean("name.to.boolean"); no true in there

quaint mantle
#

ok ok I took the default out

vocal cloud
#

Because you're in debugging hell right now with that true

quaint mantle
#

Ok understood

#

I'll compile and run

#

and lyk

#

Thank you

vocal cloud
#

I recommend using lower case only for names in configs. Don't have to but it makes debugging easier

quaint mantle
#

It returned true aswell

#

in my main class I have the following:

getConfig().options().copyDefaults();saveDefaultConfig();

#

this is good right ?

vocal cloud
#

Why are you copying defaults?

quaint mantle
#

so it generates the config with the defaults values that I want I guess

#

Or at least I believe its what im trying to achieve

quaint mantle
vocal cloud
#

So if the config is already created you're still doing that? Should make that only run if the file doesn't exist

quaint mantle
#

I bought a spigot course and the dude said that it wouldn't override edits to the config

#

that it did it if the config was not created

vocal cloud
#

Spigot Course? Dear God

quaint mantle
#

lol

vocal cloud
#

โœ๏ธ

quaint mantle
#

nah its good g

#

very useful tbh

#

I mean, at least I understand a bit now

vocal cloud
#

Yeah, but there is so many free resources sadge

quaint mantle
#

I guess

#

How would you recommend I do the config at the main class then ?

#

Either way I don't think that's the problem. I've set god.command to false in the config.yml before compiling and it still returns true

vocal cloud
#

Did you try disabling that part of the code just in case

#

Cause it should only return true if the config contains true or you've overwritten it somewhere

#

Ugh I need to finish my gradle server plugin

brave sparrow
vocal cloud
#

I suppose.

quaint mantle
#

let me send you the latest. Thank you !

brave sparrow
#

Paste the config as well please

quaint mantle
#

okay

vocal cloud
#

Send the main class actually

#

Or wherver the config is loaded

quaint mantle
#

config only has: god.command: false

sterile token
#

AlexTheCoder, now i can run the command but still tell me i dont have permissions

vocal cloud
#

I want to see the config loading stuff

brave sparrow
#

The . means nested

vocal cloud
#

How would the . always return true though?

brave sparrow
#

it should be

        command: false
quaint mantle
brave sparrow
quaint mantle
sterile token
#

ok

quaint mantle
quaint mantle
#

name: Commandsversion: '${project.version}'main: com.guille.commands.Mainapi-version: 1.19authors: [ Guille ]description: Programming commandscommands: nv: description: Gives Night Vision heal: fly: feed: nickname: god:

#

this is the plugin.yml

brave sparrow
#

Not plugin.yml, config.yml

quaint mantle
#

so would it be ok if I just did

#

god = true

sterile token
quaint mantle
#

or GodMode = true

quaint mantle
brave sparrow
#

Not =

quaint mantle
#

oh yea true not =

#

:

#

Right right

brave sparrow
#

It has to be Key: Value

vocal cloud
#

rename it to god_mode: true
no need to nest it or anything. Then just get god_mode

brave sparrow
sterile token
quaint mantle
vocal cloud
#

Use _ to to imitate a space

sterile token
quaint mantle
#

What does nesting mean ?

brave sparrow
sterile token
brave sparrow
#

Like this

#
example:
    nested: value
vocal cloud
#

Also the code getConfig().options().copyDefaults(); doesn't do anything
'

brave sparrow
#

That would be example.nested

sterile token
#

Wait alex i fixed dont worry man i have tested again and the message doesnt appear

#

Sorry man for disturbing you

brave sparrow
#

Also you shouldnโ€™t have it return false @sterile token

#

It should return true

quaint mantle
#

Got it , thank you !

brave sparrow
#

return false is when they do the command incorrectly

quaint mantle
#

omg it works

#

finally

sterile token
#

I will change that

quaint mantle
#

appreciate it @brave sparrow and @vocal cloud

brave sparrow
#

No worries

vocal cloud
#

Stop paying for courses KEKLEO

brave sparrow
#

The vast majority of people involved in plugin development are not qualified to teach a free course, much less a paid one

quaint mantle
brave sparrow
quaint mantle
#

there's more than 30 hours of classes, im just on the first 10.

sterile token
#

Does any one used nMessage before? I need to make this option configurable from lang file:

this.arguments.forEach(argument -> sender.sendMessage(Chat.style(String.format("&f- &7/&f%s %s &7-&e %s", label, argument.getUsage(), argument.getDescription()))));
vocal cloud
#

Maybe, but there are plenty of free courses out there that I've seen that explain the concept well.

quaint mantle
#

just for the sake of understanding the concepts that he explained, such as grabbing a boolean from config.yml. just instead of printing it I tried to make it decide if a command could be ran or not

#

But that's beside the point. Everyone do whatever they want with their money, appreciate the help and i'll probably be back with further issues!

quaint mantle
#

i have warps setup but i want it so when someone press button from command block it send themm to the warp what command do i need to run on command block to get tp to warp

last swift
#

Iโ€™m very unfamiliar with multi-threading, but how can I read a text file on a different thread? Iโ€™m reading a large text file and upon doing so it causes the TPS to drop and the server to freeze.

vocal cloud
#

Schedule a bukkit runnable to do it.

#

Just make sure it's async

sterile token
#

I need a good tutorial for reading about async in java please if you can send links

#

Thanks

#

?paste

undone axleBOT
sterile token
#

Paste everything on the url and explain a bit what happens + the url

#

Because if not its a mess for helping

patent horizon
#

nvm i think i found it

quaint mantle
#

I would

#

Ykw I should

#

the wiki already covers some good stuff though

patent horizon
quaint mantle
#

Anyone here know anything about the worldedit API?

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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

quaint mantle
#

Anyways. How would I get the amount of blocks ( if the hashmap contains that specific block) in a worldedit region ( ex makeCircle() )

wet breach
#

do you want to know the amount of blocks

#

or the amount of a specific block

quaint mantle
#

Amount of all the blocks that the hashmap contains

wet breach
#

then that is just getting the size of the hashmap

#

unless you want it broken down by specific block numbers

quaint mantle
wet breach
#

if you need specific numbers, you will need to get access to the clipboard

quaint mantle
#

So like if the hashmap contains stone and granite. Itll get the amount of only stone and granite

wet breach
#

which isn't overly difficult

#

but if you have the hashmap already you can just do your counting though

#

there isn't any specific api's that worldedit would have I don't think that would do that for you

quaint mantle
#

Like the command //dirtr i think it's called

quaint mantle
#

wat ๐Ÿ’€

#

Did you add the repository

#

Like it told you to do

quaint mantle
#

Send full pom

#

dont mind all the dependencies i was testing things

noble lantern
#

by chance whats the size of this compiled jar lol

#

just curious

quaint mantle
#

not that big

noble lantern
#

ah

quaint mantle
sterile token
#

My plugin is throwing that exception and i dont even using that

worldly ingot
#

viarewind-legacy-support-1.4.2-SNAPSHOT.jar

#

?????

solemn igloo
#

can someone help me with visual bukkit?

sterile token
#

First time i seen something like that happen

worldly ingot
#

The issue is ViaRewind and the fact that its installed lol

sterile token
#

okay

solemn igloo
sterile token
#

So the issue is because of viaversion?

#

But why?

brave sparrow
#

Thereโ€™s an error in their plugin

#

Itโ€™s not something youโ€™re doing

sterile token
#

oh ok

worldly ingot
#

Yeah it's ViaRewind's bug

sterile token
#

So maybe open a thread right?

worldly ingot
#

You can forward it to them if you really want

sterile token
#

yeah

#

I want to forward them

#

How do i contact them?

worldly ingot
#

Probably GitHub

sterile token
#

Hmn allright

worldly ingot
#

Include the stacktrace, plugin, and reproduction steps. But note the difference between ViaVersion and ViaRewind

sterile token
#

What i can tell them

#

Sorry but never have another plugin bug cause of mines

#

The server has via version and via rewind

solemn igloo
#

what do i set "Set Velocity" to?
(I want when i sneak i get launched 10 blocks in the air but idk what to set in Entity and Velocity)

brave sparrow
#

Their plugin is calling an NMS method that doesnโ€™t exist

#

On block place

#

It has nothing to do with your plugin

sterile token
#

olkay

quaint mantle
solemn igloo
#

what do i set tho?

quaint mantle
#

@worldly ingot does Entity#getVelocity return a copy

worldly ingot
#

yes

quaint mantle
#

shitty

#

pr a change

worldly ingot
#

why?

#

what do you want it to return?

quaint mantle
#

Ok

quaint mantle
#

Do your node programming

sterile token
#

@worldly ingot sorry for ping but the issue could be cause because im calling block place?

quaint mantle
#

Are you doing it async

sterile token
#

Me?

noble lantern
quaint mantle
#

Yes

noble lantern
#

you compiled the plugin on a newer version

#

and ran it on a lower version

#

hence no such method

sterile token
#

The plugin core has api version 1.13 and the plugin spigot api 1.19

#

๐Ÿค”

noble lantern
#

so your cross compiling between versions?

quaint mantle
noble lantern
#

^^

sterile token
#

we are in troubles

noble lantern
#

if you have a core

#

it should be the provider for spigot

sterile token
#

What burhc?

#

Didnt understand that

noble lantern
#

IE if you have a plugin core, and your plugins depend on it you should be using the spigot api from your core

#

not your one imported in on the new plugin

#

that way your not running into this stuff

#

and everythings the same version

sterile token
#

okay, so if claims-core is spigot api is 1.13 claims-plugin-1.19 should use 1.13 right?

noble lantern
#

claims-plugin shouldnt even need to import spigot if claims-core already is

sterile token
#

claims-core doesnt extends javaPlugin

#

Not matter right?

noble lantern
#

nope, claims-core will still have the spigot api

However im not sure if it stays in a pom import, i assume it does tho so test it

sterile token
#

Okay, i use spigot 1.13 for everything then i having flag mobs and animals flag issue

noble lantern
#

you use the lowest supported version you want

sterile token
noble lantern
#

yeah spigot-api should still be present then i imagine

sterile token
#

okay

noble lantern
#

if not then you just use the same version from your core

sterile token
#

So need remove spigot api 1.19 and use only 1.13

#

And what about the mobs and animals entites? Because they are diff on each version

#

๐Ÿค”

#

That is my main issue

noble lantern
#

yes, remove spigot 1.19 first and see if claims-core provides you spigot API, and run your spigot imports off claims-core

If claims-core doesn't provide spigot API then yes import 1.19

You can have special catch cases for your code, and run stuff on different version basis but i doubt its much help in this situation

sterile token
#

Okay i mainly have issues with entities types

#

๐Ÿ˜ฌ

noble lantern
#

Doesnt EntityType have a getEntity method like Material does

sterile token
#

But dont worry i will have to find a solution

noble lantern
#

lemme check

sterile token
#

Allr because i need to protect mobs and animals killing on 1.13 and 1.19

#

So someone recomemnd me this

noble lantern
# sterile token Allr because i need to protect mobs and animals killing on 1.13 and 1.19

https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/EntityType.html#valueOf(java.lang.String)

Catch IllegalArgumentException

And pass your config loaded animals through that method, if the exception is thrown notify the user that the entity they are using is invalid for the current server software

sterile token
#

public EntityType getType(String type) {
try {
return EntityType.valuedOf(type);
} catch (IllegalArgumentException | NullPointerException ignored) {
return null;
}
}

if (getType("HUSK") == null) {
Bukkit.getLogger().info("Please use a version that supports husks!");
}

noble lantern
#

there u go

#

perfect

#

big brain

#

good job

sterile token
#

Someone recommend me that

#

Yesterday

noble lantern
#

yep

sterile token
#

But i didnt understand much

noble lantern
#

well

#

ill explain

sterile token
#

I was trying to get NMS version, so if either 1.13 load the entites types for that version and same with 1.19

#

is it okay?

noble lantern
#

https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/EntityType.html#valueOf(java.lang.String)

So, when this code runs on 1.13, and someone sets in config they want an ALLAY to spawn (Not possible)

The string ALLAY passes through, searches the enum names and, if no enum key is valid it will throw the IllegalArgumentException

This code is cross version safe, so the return values are ALWAYS version dependent

noble lantern
#

you only need NMS version for things like

sterile token
#

wait burch checking no? i have realized tha plugin 1.19 and core have already 1.13 api

noble lantern
#

Actual Entity object (EG Zombie class)

Or an event thtat doesnt exist on a specific set of servers

noble lantern
#

that core was on 1.13

#

and plugin was 1.19

sterile token
#

No no wait wait

#

Let me start again

#

I want to my plugin run on 1.13 and 1.19, so i have a claims-core and claims-plugin-1.19 modules both using spigot api 1.13

noble lantern
#

i have no idea how modules work

#

for that gotta ask someone else

#

sounds confusing ngl

sterile token
#

Dont worry they are like little proyects

#

But all together, and you can connect them as maven dpeendencies

#

Also burch

#

Can cause issue running the plugin on paper using spigot api?

#

Maybe is that the issue

noble lantern
#

no but if it was the other way around (You using paper API on a spigot server)

Then 100% yes

sterile token
#

I did /version and is not either spigot nor paper

#

what the heck

#

๐Ÿ˜‚

noble lantern
#

press f3

#

that might show

#

near top left

balmy valve
#

Hey is there anyway to check if an item stack is a piece of armor? without an elaborate if statement

noble lantern
#

and it is true for all leggings

worldly ingot
#

Ew no

noble lantern
#

oh god

sterile token
#

its said my own version

noble lantern
#

choco z_aCRYYY

#

what i do wrong now

echo basalt
#

might be a registry

noble lantern
#

does isArmor exist yet

worldly ingot
#

It doesn't, nor does a Tag, but at the very least make yourself an EnumSet

noble lantern
#

okay fair enough

#

but

#

what if im lazy

sterile token
#

Burch also the issue only happen with block place and not with block break really weird

worldly ingot
#

Then sure you can do that

echo basalt
#

You can do some looping and cache the values on an enumset

#

that way it's future-proof

#

:)

noble lantern
#

i guess it could be bad ngl now that i think about it

#

cause the endsWith call might be tasky on events that fire alot

sterile token
#

burch so all in all i have to open a github issue right?

noble lantern
#

for?

sterile token
#

This shit

#

Abouut via version

#

or via rewind

#

im annoyed know

#

๐Ÿ˜ฌ

noble lantern
#

maybe im not entirely sure, show the error to them in discord

#

you get a faster resposne that way

sterile token
#

okay

#

via rewind o version?

#

Im messed up

#

Really sorry man

#

I always fucking you and being annoying

noble lantern
#

at viarewind-legacy-support-1.4.2-SNAPSHOT.jar//de.gerrygames.viarewind.legacysupport.listener.SoundListener.onBlockPlace(SoundListener.java:63)

I assume via rewind but i thought vie-rewind got renamed

#

isnt it something else named now

sterile token
#

because there are so much types im confuse

#

via version, via rewird, protcol support

#

๐Ÿ˜‚

noble lantern
#

i like protocol support

#

i never rly use via rewind ngl i thought it was a dead project

#

and protocol support was the standard

#

but it might not have 1.19 yet from review si see

#

so he acknowledged it at least

#

guess ill do it myself nerd

sterile token
#

What does protocl support

#

Does it support all mc versions?

noble lantern
#

1.18 to all lower versions

#

by chance

#

is this plugin public

#

or private

sterile token
#

is more private atm

noble lantern
#

you could cheat and only develop on highest version and just use protocol support/via-rewind when its fixed

kek

sterile token
#

Because im not using themas dependency

#

I was testing the plugin on the server and find that issue

desert frigate
#
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/bukkit/craftbukkit/bootstrap/Main has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 52.0```
#

how can i fix this error?

sterile token
desert frigate
#

so i need to redownload java?

sterile token
#

What are u doing?

noble lantern
#

you can run multiple versions of java

#

^

desert frigate
sterile token
#

Okay what version?

#

1.19?

desert frigate
#

1.18

noble lantern
#

run java -version pls

sterile token
#

yeah

noble lantern
#

you need java 16 iirc

sterile token
#

burch i was telling you that im not depend on via version it just happen the issue when i set it up

noble lantern
desert frigate
#
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) Client VM (build 25.261-b12, mixed mode)```
noble lantern
#

just use 1.19 api import and run your server in 1.19

noble lantern
#

and then run via whatever on your running server

#

yes

sterile token
#

ok

noble lantern
#

no ones gonna want that on a public one

desert frigate
#

i installed it

#

but im still having the issue

sterile token
#

๐Ÿค”

#

burch can this be causing the problems?

#

It was on true i just setted to false to test

noble lantern
#

try it and see

sterile token
#

BURCH

#

Fucking works

#

๐Ÿ˜ฎโ€๐Ÿ’จ

#

๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘

noble lantern
sterile token
#

really thanks burch for trying to help man

#

I really appreciate

#

๐Ÿฅฐ

noble lantern
#

"C:/PathTo/Java/jdk-16.0.2/bin/java.exe"

@desert frigate

#

use that instead of the java keyword for your server startup

#

im too lazy to teach you registries

#

you can google it if you like

#

"How to switch my java version on windows"

sterile token
#

burch

desert frigate
#

it was in the wrong drive

noble lantern
sterile token
#

He can either change the %java_home% ENV var or tell the path of the java version

noble lantern
#

yeah im just lazy

#

plus

#

it useful for devving

desert frigate
#

Unsupported Java detected (62.0). Only up to Java 17 is supported. bruh

noble lantern
#

cause i may need 1.19 and1.16 -

#

HAHA

#

SORRY

#

I THOUGHT IT WAS 16

desert frigate
#

ITS FINE LOL

noble lantern
desert frigate
#

D:\stuff\MoodyCoreTestServer>java -jar spigot-1.18.jar nogui

D:\stuff\MoodyCoreTestServer>``` what did i do wronbg bro
#

the server just stops instantly

noble lantern
#

put PAUSE at the end of your start script

desert frigate
#

java -Xms2G -Xmx2G -XX:+UseG1GC -jar spigot.jar nogui pause

#

i tried this

noble lantern
#

your not doing what i told you

noble lantern
#

but change 16 with 17

#

or change your JAVA_HOME registry

desert frigate
#

D:\Program Files\Java\jdk-17.0.4\bin\java.exe

#

so this

noble lantern
#

Yes

#

make sure its in quotes

#

" "

#

i would google how to change your registries tho for java

desert frigate
#

"D:\Program Files\Java\jdk-17.0.4\bin\java.exe" -Xms2G -Xmx2G -XX:+UseG1GC -jar spigot.jar nogui pause

#

ok this should work right

noble lantern
#

remove java

#

the quotes point to the java exe directly

#

java does the same thing but its based on your registry

desert frigate
#

ahh alr

noble lantern
#

this is for like, programming and shiz

earnest forum
#

creating plugins

#

basically everything else goes in server

cedar oyster
#

I was checking the paper Timingsv2 for my plugin. I don't really understand the timings that well, but I was wondering if the results it shows are bad (or a major source) for lag.

desert frigate
#

anyways it worked thanks

noble lantern
cedar oyster
#

yeah

#

I'm thinking it might be bad, because its the only plugin that is highlited red for the tests

noble lantern
#

Are you tping into unloaded chunks?

cedar oyster
#

but I don't understand how coreprotect isn't red, even though its making thousands of more operations

noble lantern
#

nvm

#

nvm

#

its a click event

cedar oyster
#

yea

noble lantern
noble lantern
#

the events CP listens to is relatively low in resource power

cedar oyster
#

oh ok

#

so it shouldn't really effect it too much?

#

oh nvm

echo basalt
#

imagine making laggy or buggy code lmao

noble lantern
#

I think whats more concerning is how a InvClickEvent is causing so much tick % when only called 5 times

echo basalt
#

my test server crashes every time I die to the void

noble lantern
#

the high % and red numbers are okay if you are doing decently heavy tasks that cant be async

#

like tping players has a slight overhead and will spike the cpu slightly

echo basalt
#

paper has async teleports

noble lantern
#

yee

cedar oyster
#

interesting

noble lantern
noble lantern
echo basalt
noble lantern
#

ohhh

#

it y <= 0

#

ez

#

dingus

echo basalt
#

and some fake blocks to get the player stuck in the floor

noble lantern
#

jkjk

echo basalt
#

thing is the floor was 1 block thick

#

person would die and phase through the floor

noble lantern
#

ohh

echo basalt
#

then die in the void and crash the server

#

๐Ÿ‘

noble lantern
#

math sucks

echo basalt
#

I forgot about that tiny detail (it was fixed on my test map) and did a test round with the whole team

cedar oyster
echo basalt
#

and immediately crashed everything

#

now I know to add a second fake block under the player

#

plugin's so optimized that the main lag source for the server are the bats spawning on dark areas of the map

#

doing 0.01mspt

noble lantern
#

and your fine

#

always rate limit player controlled tps

#

i will crash your server so fast if you allow me insta tp requests

#

ill just bot it and tp the bots

#

10 would likely do it

echo basalt
#

I can't tell if my test server can't do timings or if the plugin is that optimized

noble lantern
#

or did you for loop 60k times

echo basalt
#

it's a task

cedar oyster
echo basalt
#

and I left it on for like 7 hours straight

noble lantern
#

do note, async stuff doesnt show up on timings well for main tick %

echo basalt
#

async stuff doesn't really cause tps loss

noble lantern
#

yee

#

but it could

echo basalt
#

That's my main focus

#

Even my async stuff is millisecond-limited

noble lantern
#

yee

#

whats that plugin do?

echo basalt
#

zombies minigame

noble lantern
#

ahh

#

i left ollij's astar algo runing on my test server

echo basalt
#

async particles, async clientside blocks

#

with the world's shittiest raytracing

#

but hey it works

sterile token
#

I wish I can find a good tuto about future

noble lantern
#

future.oncomplet.finished

#

jk

echo basalt
#

CompletableFuture go brr

sterile token
#

Something async

#

Is it like javascript?

echo basalt
#

best part about the zombies plugin was the NMS pain I had to go through