#help-development
1 messages ยท Page 2 of 1
Yes i was refering to that, Alex* AHAHA
What the name of the operator "bla >> other"
Bit shift?
<< shift left
right shift
i think ima just use worldedit api. Probably the best solution
I seen it a lot when i was working with the protcol
FAWE*
Worledit == slow
It's because it's extremely fast for doing certain operations
Specially when need to set blocks and dont need to break your mommie with NMS
๐
I'm not sure that bit shifting is gonna improve your performance with setblock
Hey, how i can create a new Furnace Recipe,
but that the entry is with a specific custom name
Oh no no, shifting i seen it on the protocol tutorials
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
Insert a RecipeChoice.ExactChoice as input
where would the fastasyncworldedit api be?
this is useless
or im blind
probably the second one
with a itemstack parameter ?
ty
Yes create an ExactChoice with an ItemStack
new RecipeChoice().ex..... ?
new RecipeChoice.ExactChoice()
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?
okay thank you for your help !!
No it would rather lead to some ReflectiveOperationException
okay
Because im getting an exception
But im so idiot that didnt do ex.printraceStrace()
๐
Nop is not that
Stack trace pls
@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
The nano clock is very dependent on your cpu and operating system. For very small operations its not really reliable.
20ns seems a bit small here. Did you look at the compiled binaries? Could be an optimisation with your sysout.
Try
long now = System.nanoTime();
System.out.println("Hi");
long delta = System.nanoTime() - now;
System.out.println(delta);
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
on maven scope provided
In the dependency label add this label: <scope>provided</scope>
Ok wow was I wrong
146 micros
okay we good then
That sound more reasonable
I'll call the police
std out is really slow
My language is uhhh
well it's not thaaat slow
A shit ton faster than the JVM
use maven ๐
i am lol
sysout gets quite a bit faster really quick because the jit tackles it early
then set the scopes properly
"provided" = not shade
"compile" = shade
146ms for one single sout is way too slow
this shades "CustomBlockData" but doesn't shade "worldborderapi"
Ahh okay
I recently tried the speed of stdout and it was like one second to print a million lines (numbers from 0 to 1 mil)
I just ran a quick test. Lowest was around 1.3 us for a sysout.
Doesnt seem too bad
Isnt what i said?
Like wtf
๐
How is it so fast
the first sout always takes longer
computers go brr
Because i ran it 10 million times
Wait CommandMap field is not anymore on 1.19 spigot?
ofc it is
my command system uses it and I'm running 1.19 so I would hope its there
Okay? Im getting a no such field exception
lol
my command system is so wack lmao
I will check but i think is the same thing
wack
Could be because im doing field.get(plugin.getServer()) instead of field.get(Bukkit.getServer())?
๐ค
whack means hit
no idea how its spelt
wack is bad
"I whacked him upside the head"
english ยฏ_(ใ)_/ยฏ
whacking is wack
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)
nah that's the same thinng
lmao
@sterile token what error do you get?
generally a micrometer is reffered to as a Mike so
NoSuchFieldException
show full code
ok
Meanwhile we in germany have words that describe literally anything. I could build a word that describes the smell
of food you cook for a midnight snack.
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());
}```
I feel you could remove the plugin argument and just use Bukkit.getServer
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
I love reflection so much lol
I have 0 idea how I made this work, but it does https://cdn.rackdevelopment.tech/img/bBmBjacCda.png
the former system like fully replaced the entire thing and what not
commands.foreach(CommandMap::register) ๐ก
one of my finest reflection
why unicode chars?
why is the flying packet called the flying packet if its sent when your not flying
it's "baseXX encrypted" lmao
Dont bullit me
it is
I dont know about plugin obf
it's my original code
it's the unobfuscated, original source code
what the heck
There is a dedicated flying packet? Which one?
People is really illness
๐
it's basically "manually obfuscated" to make leakers have a bad time
PacketType.Play.Client.FLYING
sent every tick
I just try to use the mc protocol and get kicked out on 10th round imagine with that
So you obfuscate your plugins manually?
What an amazing level
I wish i can get a decent name obfuscation one
ofc not lol. this is just a tiny additional step in my "anti piracy" library
I use allatori with the highest allowed settings as additional thing for everything that's not free on spigot
proguard, is free
it can't do anything besides name obf anyway
All says its shit and i agree
if you wanna get a proper obfuscator, buy allatori
it's totally fine for name obf
I want something more powerfull
allatori!
download Angelchest free and decompile it
then you see what allatori can do on lowest settings
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?
only thing you can do is to make cracking so hard that crackers think "nah that's not worth my time"
I mean even denuvo (ALL versions IIRC) was cracked and that was like the best "protection" that there ever was for games
Because as said "every thing redeable by machine can be by human"
well "readable", not so much
as I said, check out angelchest free and decompile it
I mean you understand
i dont wanna get banned form spigot
It's definitely not "readable", but yeah with enough time you get the idea of what does what
huh? that's my plugin
Okay i will try
and why would you get banned from spigot for decompiling a plugin
you can decompile everything you want
Lol really?
yeah well I don't know your country's laws
I think it was agains psigot ToS
but you definitely will not get banned from spigot even if you tell everyone "I decompiled CMI/AngelChest/ItemsAdder/WhatEver yesterday"
Can i send you a pic of obf code and tell if this possible with a free one?
If you not bussy obviously
sure
but obfuscating is shit. I only do it to avoid leaks
Me too i only want to avoid leaks too
Its obviously that ill be leaked but will be harder
Have u heard about PandaCommunity?
but do you even have a paid plugin? doesnt really make sense to obfuscate free plugins
no
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?
nothing is secure, ever
Sorry for being really annoying but for me its really interesting this topic
I know but its decent or not?
as said, the only thing that obfuscation does is "make the cracker need more time to crack"
I know bro
Im just trying to learn
I didnt find much info about this on internet
okay so I'll explain how I'm obfuscating my stuff
I was planning something like a loader which download the jars on random directory and them inject into spigot
that obf changes methods to synthetic. some decompilers won't decompile them. others do.
- 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;
so the field is called "false". If you would just copy/paste that, you couldnt compile that because "false" is not an allowed name for a field
- 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
native everything
copy pasted it wrong but anyway, you get the idea
then include a DLL? Lol nah
yaya
yeah
I thought that tho
- String encryption. I combine allatori's string encryption with my own one
Do u remember mfalex??
mfalex do you have an obf with all this? Im really imterested on one
public String asd = "%%__USER__%% DONT CRACK ME PLS awfzjfawia7t937t5193trug13tgfziawfiq27r";
as I said: allatori
Ok
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
how does that get back to "asd"?
I can show you an example, one sec gotta clone my repo
I'll give you an example first, then nshow some code
I also would like to learn more about how they obfuscate
research asm library
I know they obfuscate over bytecode using libraries which allow them to do things like that
interesting
have you implemented it into a obfuscator so its automatic?
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"
Sure, allatori can easily do that
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"
i always see that method on many obf jars
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
Is it from allatori?
yep thats the string decrypt method
You can of course decrypt this by grabbing the class code at runtime and writing it to a file
that's some basic string encryption and 99% of "deobfuscators" can automatically decrypt those
yeah
Yeah i think it has a name right?
String encryption is no magic. It's just some additional thing but of course, easily crackable if someonne really knows what they are doing
My final goal is just to bother those shity skidders who leaks your code
Also because you are serving them the key HAHA
I have spent DAYS into all my anti piracy stuff, and I can tell you - it's not worth it
You shouldn't have to worry about them. Most people who pirate aren't going to bother paying anyways
you can also use ssvm to deobf most string obfuscation
just invest your time into your actual plugins instead of worrying about catching leakers
well well well
Write great code and people will pay for it.
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
and then it gets cracked and everyone has it
Except that's false and never happrns
e.g. here's a tiny example of my custom encryption
No server worth it's salt uses cracked plugins.
Also if you have DMCA rights over your code (In general software) you can break their mommies lmao because you take legal actions
but for custom string encryption, you gotta get it approved by md5 anyway
md5 is not really good for that type of things
Provide premium support like Alex does with Proof Of Purchase
This was lost, sorry for asking it again ==> <==
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
Well you can start by asking your question.
Await is futures in java.
Allright, but that is blocking hmn
In JS/Rust you have futures which you can pass to threads to prevent thread blocking behavior.
You do the same in java
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
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.
So i want to learn but learn future on Java
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"
Maybe a functional interface with a generic param right?
Well you can look into how JDA for example does the .queue() stuff
Okay
It's pretty much the exact same thing as how js does it
I love and hate JDA so much
Also you mfalex that i lost plenty of your time
np lol
Lol EnumMap<K, V> exists?
any ideas?
Okay, sounds weird
Still cannot make the commands get registered on 1.19 thru command map
Works for my lib
Weird
Your likely not injecting the right type of command
Or injecting into the wrong command map
getCommandMap().register(plugin, command)
Burch also my CommandAPI class extends from org.bukkit.Command
Im at doct appointment rn so I cant look at my code and see
If you go to my github
Go to
BurchAPI
I beileve the CommandInjector class is in commands package
ok
That code in there is confirmed working i unjust used it yesterday
thanks i il ltry it
okay
Burch i dont know what was happening but the command get registered
Why do Wolves and PigZombies have an isAngry method but Warden and Bees do not?
Wouldn't be suprised if spigot implements an AngerIssue object
ladies, does anyone know how to remove only 1 of i?
And what about neutral creatures such as Endermen, Dolphins, Polar Bears, Piglins, Pandas? How do we know if they are in "attack" mode?
i is a non-stackable item
Remove the slot its in
getSlot().setType
alr alr
Or else client issue
Hmm
Might need nms
They have a navigator option so you could just check if theyre aggressive
Ie has entity target
errr I dont see the method in getInventory()
Ofc
Yep should work might wanna make it a method with a for loop if you want
it is a method ๐
Ahh okay :))
well in one already
I would just make a wrapper that allows multiple removals
Eg removeItem(Material, IntegerCount)
Would need slight refactoring
slight lmao
Cause removeItem is weird ngl
mhm mhm
Would need to rename it to removeAllOf
Then need removeSlot
And final removeAmountOfType
mhmmhm
is there a discord for protocolsupport help?
expunge
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
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?
Store the current time in a hashmap along with the user id. Use PDC to determine what the bow is
declaration: package: org.bukkit.block, class: DoubleChest
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
more of a java question but how do I read a random line from a txt file without loading the entire thing into memory
Depends on what you mean by a random line
Lovely
console and no permissions amaizng
You want to develop a game?
they are making they're game with game engines not with Bukkit API
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
You can use my filehandler which uses YamlConfiguration and allows to copy and create the whole file
They want to implement the bukkit API in their own game
Ohh okay
I suspect itโs legal
Provided the implementation complies with the apiโs license
If your code can generate comments then sure
It doesnt generate comments, let say you create the file on resource folder and the file will be created with all the content from the resource file
thanks a lot but it is not my goal
What happening? I have checked everything
Never happened that console doesnt have perms
show code
Ok
Hello! I'd appreciate if someone could help me with the following, as im new to developing plugins and struggling a bit;
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
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
https://paste.md-5.net/emipeqipap.java there you have
maybe just check permission only in case Player is a command sender
honestly I cant really see any errors but honestly that command system you have seems to make it horrible to debug anything
Because some aguments should be able to execute from console* and some not
There's so much bloat in it where you could make it a lot easier to debug
You mean my command system?
No, VERANOs
He is taking to me
if(sender instanceof Player player){ }
Maybe the issue is it's not defined in the config? Then it's defaulting to true?
it's defined in the config.yml, I'll send it:
Try to use GetBoolean() and don't use a default
God.Command: true
Yeah, don't use a default it makes debugging a pain
and what about if some commands cannot be execute from console and other console and player?
ConsoleCommandSender - it's console
Player - it's a player
CommandSender - it's any of these
ProxiedCommandSender - Proxy
BlockCommandSender - a block
You also don't need to assert it's true just if(config.getBoolean()) {}
I mean just skip permission checking code for ConsoleCommandSender
Well it asks for two parameters, string and def
the == true was just me getting annoyed it didn't work xd
@sterile token the problem is youโre missing a !
Still, I don't understand if im doing something wrong, maybe im not getting the boolean from the config.yml correctly ?
In your permission check
Where?
if (!(argument.getPermission().isEmpty() && sender.hasPermission(argument.getPermission()))) {
Youโre checking if the permission is empty AND they have the permission
they have ! and conditions are inside bracket?
You should add some logging
Sorry I don't know what you mean by that
Actually you should be able to just change the && to ||
Doesnt negate the 2 conditions when they are inside brackets?
as in printing the variables to the console, so I know what they are ?
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'
Not independently
It does not (a AND b)
So for example
If a is false, b is true
Oh shit i have logic class and the teacher explain us that
Thatโs always returning true
Lmao im really idiot
And it was today mornings
๐คก this face describes me perfectly
Yes, but use a logger so it's nicer.
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
Okay I'll say it again, stop adding the default
Actually I should use IsBoolean for this, right ?
ok ok I took the default out
Because you're in debugging hell right now with that true
I recommend using lower case only for names in configs. Don't have to but it makes debugging easier
It returned true aswell
in my main class I have the following:
getConfig().options().copyDefaults();saveDefaultConfig();
this is good right ?
Why are you copying defaults?
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
would this prevent me from editing the config.yml ?
So if the config is already created you're still doing that? Should make that only run if the file doesn't exist
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
Spigot Course? Dear God
lol
โ๏ธ
Yeah, but there is so many free resources 
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
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
Not necessarily, if they remove the option from the config you want to re-add it with the default
I suppose.
Is this the latest code
let me send you the latest. Thank you !
Paste the config as well please
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
okay
config only has: god.command: false
AlexTheCoder, now i can run the command but still tell me i dont have permissions
I want to see the config loading stuff
Thereโs your problem
The . means nested
How would the . always return true though?
it should be
command: false
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Presumably thatโs the default they have set
Main class
Send your code
ok
could you explain this please
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
The . character isnโt treated as a literal string, itโs treated as nesting
Not plugin.yml, config.yml
Also please format the messages!
or GodMode = true
don't know how, care to explain please
Not =
It has to be Key: Value
rename it to god_mode: true
no need to nest it or anything. Then just get god_mode
So with that code, from console you get a permissions error?
The argument code is executed but i get the no permission message
Okay thank you, and thanks alex
Use _ to to imitate a space
Really weird ๐
What does nesting mean ?
Can you show me the message you get
yeah
Nesting means one under the other
Like this
example:
nested: value
Also the code getConfig().options().copyDefaults(); doesn't do anything
'
That would be example.nested
Wait alex i fixed dont worry man i have tested again and the message doesnt appear
Sorry man for disturbing you
Got it , thank you !
Okay?
return false is when they do the command incorrectly
Ohh ok
I will change that
appreciate it @brave sparrow and @vocal cloud
No worries
Stop paying for courses 
+1
The vast majority of people involved in plugin development are not qualified to teach a free course, much less a paid one
nah man I disagree. This dude explains well, and I get to learn from a "teacher". This is more hobby than anything, I tried following resources before but didn't get jack.
He did a small java introduction and then started with plugin dev
It doesnโt sound like theyโre explaining the correct information to you
there's more than 30 hours of classes, im just on the first 10.
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()))));
Maybe, but there are plenty of free courses out there that I've seen that explain the concept well.
I mean, I should of been following the class but i got myself creating things outside of what is being teached
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!
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
#help-server for server questions
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.
I need a good tutorial for reading about async in java please if you can send links
Thanks
?paste
Paste everything on the url and explain a bit what happens + the url
Because if not its a mess for helping
nvm i think i found it
// Plugin startup logic
fr
https://paste.md-5.net/kitunociwe.java no errors, but the colors dont get applied to the shulkers that are spawned
Anyone here know anything about the worldedit API?
?ask
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!
Anyways. How would I get the amount of blocks ( if the hashmap contains that specific block) in a worldedit region ( ex makeCircle() )
Amount of all the blocks that the hashmap contains
then that is just getting the size of the hashmap
unless you want it broken down by specific block numbers
I need the amount of blocks in that said hashmap has in the worldedit region
if you need specific numbers, you will need to get access to the clipboard
So like if the hashmap contains stone and granite. Itll get the amount of only stone and granite
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
Like the command //dirtr i think it's called
ye
Send full pom
dont mind all the dependencies i was testing things
like 500kb
not that big
ah
https://paste.md-5.net/vakawodoha.java - im like what the fuck
My plugin is throwing that exception and i dont even using that
can someone help me with visual bukkit?
Hmn i dont know the issue happen when i place a block with my protection plugin
First time i seen something like that happen
The issue is ViaRewind and the fact that its installed lol
okay
pls help
oh ok
Yeah it's ViaRewind's bug
So maybe open a thread right?
You can forward it to them if you really want
Probably GitHub
Hmn allright
Include the stacktrace, plugin, and reproduction steps. But note the difference between ViaVersion and ViaRewind
What i can tell them
Sorry but never have another plugin bug cause of mines
The server has via version and via rewind
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)
Their plugin is calling an NMS method that doesnโt exist
On block place
It has nothing to do with your plugin
olkay
Wtf people actually use visualbukkit
@worldly ingot does Entity#getVelocity return a copy
yes
Ok
velocity should be entity.getvelocity().normalize().multiply(1, 10, 1)
Do your node programming
@worldly ingot sorry for ping but the issue could be cause because im calling block place?
Me?
This looks like
Yes
you compiled the plugin on a newer version
and ran it on a lower version
hence no such method
so your cross compiling between versions?
Well that doesnt seem very stable
^^
we are in troubles
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
okay, so if claims-core is spigot api is 1.13 claims-plugin-1.19 should use 1.13 right?
claims-plugin shouldnt even need to import spigot if claims-core already is
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
Okay, i use spigot 1.13 for everything then i having flag mobs and animals flag issue
its how multi version support works
you use the lowest supported version you want
claims-core is shaded into claims-plugin
yeah spigot-api should still be present then i imagine
okay
if not then you just use the same version from your core
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
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
Doesnt EntityType have a getEntity method like Material does
But dont worry i will have to find a solution
lemme check
Allr because i need to protect mobs and animals killing on 1.13 and 1.19
So someone recomemnd me this
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
declaration: package: org.bukkit.entity, enum: EntityType
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!");
}
yep
But i didnt understand much
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?
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
declaration: package: org.bukkit.entity, enum: EntityType
You dont need that for this
you only need NMS version for things like
wait burch checking no? i have realized tha plugin 1.19 and core have already 1.13 api
Actual Entity object (EG Zombie class)
Or an event thtat doesnt exist on a specific set of servers
So its not my issue
and thats relatively unsafe its the same thing you said earlier
that core was on 1.13
and plugin was 1.19
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
i have no idea how modules work
for that gotta ask someone else
sounds confusing ngl
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
no but if it was the other way around (You using paper API on a spigot server)
Then 100% yes
Hey is there anyway to check if an item stack is a piece of armor? without an elaborate if statement
if (getType().endsWith("LEGGINGS")) {}
and it is true for all leggings
Ew no
oh god
its said my own version
might be a registry
does isArmor exist yet
It doesn't, nor does a Tag, but at the very least make yourself an EnumSet
Burch also the issue only happen with block place and not with block break really weird
Then sure you can do that
You can do some looping and cache the values on an enumset
that way it's future-proof
:)
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
im not sure
burch so all in all i have to open a github issue right?
for?
maybe im not entirely sure, show the error to them in discord
you get a faster resposne that way
okay
via rewind o version?
Im messed up
Really sorry man
I always fucking you and being annoying
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
because there are so much types im confuse
via version, via rewird, protcol support
๐
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
https://github.com/ProtocolSupport/ProtocolSupport/issues/1383
Dev added enhancement tag here
so he acknowledged it at least
guess ill do it myself 
is more private atm
you could cheat and only develop on highest version and just use protocol support/via-rewind when its fixed

Because im not using themas dependency
I was testing the plugin on the server and find that issue
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?
You are compiling with old or newer java versions
so i need to redownload java?
What are u doing?
starting mc server
1.18
run java -version pls
yeah
you need java 16 iirc
burch i was telling you that im not depend on via version it just happen the issue when i set it up
you dont need to depend on it
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)```
that why
just use 1.19 api import and run your server in 1.19
Me?
ok
install jdk 16
only use this hack on private plugins tho
no ones gonna want that on a public one
alright ill try. i dont have any experience with java lol
i installed it
but im still having the issue
๐ค
burch can this be causing the problems?
It was on true i just setted to false to test
try it and see
BURCH
Fucking works
๐ฎโ๐จ
๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐
sec
"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"
burch
i fixed it
it was in the wrong drive
?
He can either change the %java_home% ENV var or tell the path of the java version
Unsupported Java detected (62.0). Only up to Java 17 is supported. bruh
ITS FINE LOL
running at the same time
D:\stuff\MoodyCoreTestServer>java -jar spigot-1.18.jar nogui
D:\stuff\MoodyCoreTestServer>``` what did i do wronbg bro
the server just stops instantly
your not doing what i told you
.
but change 16 with 17
or change your JAVA_HOME registry
Yes
make sure its in quotes
" "
i would google how to change your registries tho for java
"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
remove java
the quotes point to the java exe directly
java does the same thing but its based on your registry
ahh alr
and next time this is more suited for #help-server
this is for like, programming and shiz
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.
ohh alr
anyways it worked thanks
timings are rly weird to read at times
yeah
I'm thinking it might be bad, because its the only plugin that is highlited red for the tests
Are you tping into unloaded chunks?
but I don't understand how coreprotect isn't red, even though its making thousands of more operations
yea
Because core protect does its data read/writes async
ohhhhh
the events CP listens to is relatively low in resource power
imagine making laggy or buggy code lmao
I think whats more concerning is how a InvClickEvent is causing so much tick % when only called 5 times
my test server crashes every time I die to the void
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
paper has async teleports
yee
interesting
how tf
What are you doing in that inventory click event
I did a thing where whenever you take a killing blow, it spawns a corpse
and some fake blocks to get the player stuck in the floor
jkjk
ohh
math sucks
I forgot about that tiny detail (it was fixed on my test map) and did a test round with the whole team
well, I was running the test on a server that I help run, and there were 8 people online, and it there was some lag. So I ran the timings. But the click event will tp a player when they click it
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
add a rate limit
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
I can't tell if my test server can't do timings or if the plugin is that optimized
why tf is code calling 60k times
or did you for loop 60k times
it's a task
alright, thakns
and I left it on for like 7 hours straight
do note, async stuff doesnt show up on timings well for main tick %
async stuff doesn't really cause tps loss
zombies minigame
async particles, async clientside blocks
with the world's shittiest raytracing
but hey it works
I wish I can find a good tuto about future
CompletableFuture go brr
best part about the zombies plugin was the NMS pain I had to go through

