#help-development
1 messages Β· Page 64 of 1
Split by ':', then split by ';', check the first without @ tocheck type and get the second for value
Looks like first a split at : and then each entry can be split by ; where left is key and right is value.
Kinda bad tbh.
wouldn't like
\@(.);(.+)\: be a pattern for that?
tbh it's kinda bad
Right
except the last one
so what should i do
What we suggested
parse(text + ":") would fix lol
Is it you who convert to string ?
convert what?
I just made that regex pattern on the moment
with my limited regex knowledge
why the plugin just done that
crappy location to string method
My bad I mentioned the bad message π₯Ί
just use spaces
Is it you who converted the location to string ?
you blind
he not
on a side note, am I the only one who loves this logo?
man just made a gradient and drew on top
well you're asking us how to parse a string
the string is just not a normal one
Yes it is, char after char
it's special
no its serialized in the worst way
you can still use regex or substringing to parse it
imIllusion proposed a clean way actually
If we take apart the + ":" (that is kinda smart)
the regex I proposed captues 2 groups
i don't know regex
π€¦
so i should removeAll the :
split by :
man its so good
ty for the idea
then you'll have
["@w;world", "@x;53.0", "@y;64.0", "@pi;0.0", "@ya;0.0"]
you can then apply some parsing
You put too much effort on this
yes
why not just steal the code from the original plugin?
so i should split by : and ; and i will have this ?
Let's go, then now where are you stuck?
not open source
help stepbro, i'm stuck
No, it's just a split by :
Just split your stuff at BiBaBuzzeMann
So a location with world "world" x "100" y "200" and z "300" pitch "1.0" yaw "2.0" would be
BiBaBuzzeMannworldBiBaBuzzeMann100BiBaBuzzeMann200BiBaBuzzeMann300BiBaBuzzeMann1.0BiBaBuzzeMann2.0
decompile
so i can just startsWith @w; and stuff like that ?
for(String content : text.split(":")) {
int semicolonIndex = content.indexOf(";");
String context = content.substring(1, semicolonIndex - 1);
String value = content.substring(semicolonIndex);
}
you might need to mess with the indexes a lil
so you'll have
@w;world ->
context = w
value = world
--
@x;53.0
context = x
value = 53.0
Jd-gui good tool for extract code form Jar file
i don't use windows
you don't use your brain either fml
It's multi platform
not putting any more effort
i can decompile the thing
Java is mutliplaform
jd gui
Its made with java
we should make an integrated circuit that's specifically made to parse these strings
oh wasnt it exe ?
You just literally solved the problem, but our brother can't read java
π€‘ me rn
if you say decompile
i tried decompiling and the code was obfuscated
π€‘
You're not putting much effort into the solutions we provide
And ImIllusion wrote the code for you dude
and then some random guy replied jd gui after i started coding
Sorry i didn't expected you get confused
@lost matrix feature suggestion: Does your resourcepack maker project thing modify sounds in real time? π
I got like 20 sounds I gotta upload to my resource pack and I figured you might've faced similar pain
ew, use luyten
Ew, use Recaf
Ew, use bytecode-viewer
I;ve got similar problem, good solition is to make small script in python that generate Sounds.json
hey guys can you quickly tell me which player event represents switching slots
PlayerItemHeldEvent
ty <3
Hello i'm searching for way to execute commandS that i put in a named category, and all this commands will be executed in consol when arg[0] of my command is call :
ex: category name: hello
Commands:
- tell to %player% hello
- heal %player%
- give %player% ....
i though about cross hashmap with an arraylist but dispatchCommand doesnt approve arraylist
can you help me pls
Iterates through you're list, and Server#dispatchCommand each one of them
What do you mean by modify?
okay, i'll try, thx
giev fou feedback soon
And before dispatching, replace your placeholders
For sure gl
let's say I want to add sounds
is it as painless as dragging onto a folder or do I have to mess with the sounds.json file?
I just drag them into a folder and add an enum entry
The json files all get generated
fancy
I have a crappy tool that just assigns model ids to exported jsons and sorts pngs
but it doesn't go as far as making a whole pack
how does this 'tool' sends resoucepack to players? Does it run instance of Http or Ftp server?
I wonder if you go as far as I do and make a whole start, loop and end sound stage system
Becouse this resourcepack is included to plugin rescources?
I sometimes wonder like
It starts an http server to serve the resourcepack. It can also inject data from ModelEngine or ItemsAdder or whatever.
if we dedicated time into making a sound engine
how good would it be
Minecraft already has a somewhat spatial audio system
The plugin just contains the raw files. The resourcepack gets assembled when the server starts.
After that an http server is started which serves the zip.
so what if we implemented things like echo
and reverb and such
then we integrate it with a map canvas plugin and make bootleg audacity
it was trying to mess up with generating sounds, it is not that easy
Sounds like it would need client modifications
hm
or heavy server modifications hehehe
why limit ourselves at 20 tps?
what if we made a bitmask system to represent hz
and we sent waves at like 2k tps
that just play a different frequency
so we can replay any sound
on demand
and we fry the player's cpu with the amount of incoming packets
sometimes I just wonder like
how can we exploit the upper limits of a minecraft server
by ignoring tps and just doing stupid stuff
Origin realms moment
true
sounds like something they'd do
what about using trilinear interpolation and making smooth camera cinematics and complex shots?
or making each color combination with heads to make a very shitty modelengine that doesn't rely on texture packs
that uses 2k armorstands
heads, why not to use particles
or what if we play like 15 tracks at once to make a sort of audio DRM
which we can then use to play concerts in minecraft
about 1k particles to make a 3d cube
of course you do that
was the trajectory pre-planned or did you do some circle motion?
lol i found a video of one of my first plugins XDD
you make me feel bad about my career :/
I laughed so hard at this
U can use head instead
why, particle are better for burning client CPU
U can turn that off :d
There is also a limit
Is it possible to create a custom particle
ugh, for some reason when i increase the attribute attack speed for an item, it deals 1 damage
Gotta set attack damage too
Nope
can someone explain me please how to make for example a command that can get the player's ip and then do something? Just like BanIP, but for example, muteIP
As soon as you add a custom modifier the defaults go bye bye
?jd-s It is interesting that I like this command so much. I wonder why
private void setTarget() {
List<Entity> nearbyEntities = arrow.getNearbyEntities(50, 50, 50);
if (nearbyEntities.size() == 0)
setTarget();
Optional<Entity> optionalEntity = nearbyEntities.stream()
.filter(entity -> entity instanceof LivingEntity && ((Projectile) arrow).getShooter() != entity)
.filter(entity -> ((LivingEntity) entity).rayTraceBlocks(entity.getLocation().distance(arrow.getLocation().add(0, 1, 0))) == null)
.min(Comparator.comparing(entity -> entity.getLocation().distanceSquared(arrow.getLocation())));
target = optionalEntity.get();
}
how can i prevent enemys behind blocks
if (nearbyEntities.size() == 0)
setTarget();
Is this your server off button?
How can I install the text component API?
that would cause a loop crash right
i meant to add a limit
so if it fails so many times
You mean adventure? Because components are already a thing in Spigot.
If it fails it always fails
or more specifically, bungee-chat
Weird, I can't use it. It's probably because of 1.7.10 being outdated then. Thanks.
Oh yes lol
I'll go to JSON messages then
components are a rather recent thing
Ahahaha. You troll.
i want to create different bukkit runnables for every plyer and disale it when they leave?
but i dont knwow how
I would just create one runnable and add/remove players from it
I'm no troll, not sure why I passed that idea.
1.7.10 bukkit is a rather strange idea
i need different ones for every player
You are using 1.7.10. Im assuming that you use half a kilo of white makeup each morning
and have a decent collection of red noses in different shades in your closet.
this thing is to count hit delay
Why?
What do you mean by that?
Just save a counter for each player, and update them all in one runnable
how come my arrow will target entites with blocks behind
if i ray trace
and check there are no blocks
As I had mentioned many times before, I'm not using 1.7.10 by preference, it's a client requirement.
Get a new client
There are still many servers on 1.7.10, be it for mod limitations or anything else, and these still have needs.
cant i bypass it by setting the player's attack speed, or the fact that he is holding a sword ignores player's attack speed?
You can set the players speed
custom gui in chest
no
Thatβs just an image
wdym then
i guess with css and html
i can click on items
Probably JavaScript
probably
is this thing public?
like
can i get url of it and drop it somewhere
will it appear like that?
You can code it yourself pretty easily I guess
What do you exactly want to do?
Ahah very detailed π I mean, do whatever you want while you respect the licenses and the guidelines
There are tons of way doing it. Easiest one are to iterate each keys and update the value, or there are more advanced one using lambdas
And much more
Stop what you are doing and tell us what you are trying to achieve.
i disable EntityDamageByEntityEvent and trying to code it by myself
What the hell, can you explain more precisely?
you can see the source for it on the fandom website since it's publicly editable
https://hypixel-skyblock.fandom.com/wiki/Template:UI
It's actually lua that they use for it
i do my own knokcack system
lua?
wdym
those mfs really made their own lua parser for skyblock guis
But why do you need to increase all values of your hashmap? What is it for?
I know that the admins were in charge of the wiki a bit
Then you can simply change the velocity one tick after the event. No need to cancel it.
ofcourse they did its hypixel
can you check if blocks lie between two points in the spigot api
knock cock system
its community made, not hypixels
I know because I spoke to half the team
to register hits once in 10ticks for every player
is it easy to make?
π€·ββοΈ
i dont want to waste my time if its hard
It's either game designer's notes or admin/community made
looks all custom, so you'd have to start from scratch I'd imagine
https://codepen.io/aaronsoto/pen/bGEXObJ found that in 0.6ms on google
Think Greened is looking for something a bit more complex than that, I also saw that
(not every tick)
if you wanted to do it, using javascript or some js framework would be a lot easier than making it in lua and using some templating library to convert to js
As 7smile7 said, there is no need to do that, just change the velocity 1 tick after the event
complex? look i want something like a web link and if i drop that link here it would appear like this
@EventHandler
public void onDamage(EntityDamageByEntityEvent event) {
Bukkit.getScheduler().runTask(plugin, () -> event.getEntity().setVelocity(evaluateVelocity(event)));
}
private Vector evaluateVelocity(EntityDamageByEntityEvent event) {
// Calculate your custom knockback here
}
This is all you need for a custom knockback system
also, by the looks of it, the lua templating language for it was made by fandom and not by the authors of the skyblock wiki
Are you ordering someone to do all the work for you?
how does one get mojang mappings
no
but is it possible on discord?
so you just want an image?
No, you have to go through the forum
He wants the whole thing, image + interaction
there would be no may to make it interactive on discord
you'd have to link to a webpage
xyproblem moment
Ohhhhhh
Is there any way to make the hologram made by armorstands not be a "actually placed" on the world?
When moving my cursor on a block with a armorstand on it(hologram), u cant select the block if u target it right in the middle where the armorstand is.
any way to make the armorstand "a ghost"?
but what if i want to change hit delay to be able hit player once in 5 ticks?
There is vanish and or marker stuff
as a marker u can't target?
setNoDamageTicks ?
marker has no hitbox
oh okay, ty
Save the last time the player was hit, compute time difference and apply or not velocity
wow, I'd never heard of this before
LivingEntity entity = ...;
entity.setNoDamageTicks(5);
No idea they were even added
How can I disaplay custom text over player slots?
interesting
sendActionBar
or in older versions
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.whatever)
fromLegacyText most likely
thx
or pre-1.9
new Textcomponent
with packets and json
Action bar, change item name, use custom resource pack with offsets and ect to place the text as you wish
might be 1.10 not sure but around there
Im working only on version 1.17-1.19
good
Everyone should do like you. Continue like that!
java 16 is too good to use older versions
surprisingly most customers I have are asking for newer versions
I used to have a bunch of 1.8 or 1.12 commissions
Does anyone have a good NickAPI. I wanna code my own Nick Plugin with skin in 1.18.2 but i dont know how bc theres nearly 0 things i could find with nick in 1.18.2 exept own plugins. And the only API i could find is "closed". Please help
My metrics are also telling that people are going on average for last versions. Finally
or just use kotlin where most java 16s features are available whilst targetting JDK8 π π
That's actually disgusting lmao what
it sounds even more complicated than add 1 for every player hit delay timer every tick and set it to 0 when they get hit
even record? I think this is most valuable change
I was joking, people get triggered with the kotlin argument
but yes, record (data classes)
It's easier to write, take less memory, and less compute every tick :)
data object
useless
thanks
well I'm protecting my eyes from the Kotlin language syntax so I don;t know anything about its features
why are you reacting with KEKW this is serius
data class SomeData(val name: String, val age: Int)
but @ Data it's only fancy wrapper for class, Record actually change behaviour of object in memory
does it change the behaviour? Lombok could definitely do what it does, but its just unnecessary
Is it possible to implement tab completion outside of commands? I have an emoji system setup, but it'd be nice if I could have a symbol like : in chat trigger a completion list of the emoji phrases.
Am I doing something wrong when importing craftbukkit? I'm trying to use CraftWorld, CraftPlayer, EntityCow etc. but it's not getting resolved.
I wanna get into Custom Mobs (e.g. angry cows)
These are my dependencies
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
No need to depend on craftbukkit
can i somehow get the line of sight of a non living entity
spigot includes it
i need to check if a arrow can see a entity / entity is not hiding behind blocks
hmm but I get normal spigot imports. Just not those
Just ray trace from the arrow to the entity
Did you manually add a jar to your project?
nah only with maven
Did you set up the special sources plugin for maven?
Did you run BuildTools with --rev 1.19.2 --remapped
I don't say Lombok is useless, Record is just better for memory performance because every property inside is private final
yes. This is my complete pom (removed craftbukkit now and made a variable for the version)
The build is successful but I can't resolve CraftPlayer
Not going to comment any further on that but you might want to double check why records have a different memory layout (and in what circumstance) than normal objects.
that was only simple example
of course there is more things that distinguish records from objects
Invalidate caches and restart your IDE
aight
Anyone help pls
Go to #help-server if you need a plugin
Yup that did it. Should have asked earlier D:
Spent like an hour figuring that out
Thanks
theres this from a hypixel dev https://www.spigotmc.org/resources/nicknamer-integrated-api.5341/ if this is what you're looking for
yes but it includes an API
so your plugin would depend on that plugin, and use its api
that was literally the first search result, can't attest to how good it is
not at my place lol
i only found the closed one
Alternatively just shade in https://github.com/InventivetalentDev/NickNamer/tree/master/API
entity.getWorld().rayTraceBlocks(arrow.getLocation(), ((LivingEntity) entity).getEyeLocation().toVector(), arrow.getLocation().distance(((LivingEntity) entity).getEyeLocation())) == null)
How is this?
- if you do use this it still depends on PacketListenerAPI
As well as paper
The result is not always null
Why do you want to code your nick plugin?
You need to also check if the hit block is null
is there a way to disable pinging automatically on reply? not spigot related
Do I need Lombok classes inside my plugin jar?
done this lemme check if it works
how
donno. First step is to identify it's maven artifact
No
Lombok generates code at compile time. You do not need to shade it
Yes and there are a good number of videos on them
3blue1brown has a fantastic series of videos on them on YouTube
input layer, a bunch of activation functions, output layer
i know the terms but i dont understand how they actually work
alright ill check that
I think sabastian lague also posted something the other day about neural networks
Both highly recommended
Yeah they both delve into the theory and math behind them
nice ill try that
3blue1brown is more mathy, sebastian's uses code examples if I recall correctly
Can't remember which language. C# or something
Again, I recommend watching both lol
does ray trace go through windows?
How do I store player preferences that persists over resets?
Sure, though you're not limited to just Python
You can write neural networks in any language you want
Hell no
I'm doing data science in C, just imagine the pain
Depends of what you mean by "reset"
TensorFlow's library is written in Python by default but they have ports for all sorts of languages like JavaScript, C#, Julia, R, Rust, and more
Server reset, onDisable() called and onEnable() cycles
basically when you do stop
and then rerun it
So what's your version ?
1.192
So I advice you to have a look at PDC if you don't want to bother urself, or save it to a config/database
Ohh persistent data containers
Would you recommend PDC or the latter?
Exactly
Well I'm always using DataBase cause I do not have one server but multiple
But PDC is great for short data locally
Ah I see, so databases for scalability?
do I need another dependency for net.minecraft.server classes when I used the --remapped param for the buildtools or should it be bundled inside spigot?
Idk if my IDE is messing up again. I can get CraftPlayer now but something like EntityZombie is still missing.
For now I only have
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>${mc.version}</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
</dependencies>
And maybe performance, but I can't assure that, never benchmarked these
What are the neurons, why are there layers, and what is the math underlying it?
Help fund future projects: https://www.patreon.com/3blue1brown
Written/interactive form of this series: https://www.3blue1brown.com/topics/neural-networks
Additional funding for this project provided by Amplify Partners
Typo correction: At 14 minutes 45 seconds, th...
yeah i lost him at minute 9
lmao. Neural networks aren't an easy concept at first
lol
Ah I see, which DBMS do you suggest? SQL NoSql?
immma repeat the vid like 10 times or smth
For minecraft server it really depends on your preferences. The difference in performance wouldn't be notable, or just useless
So take the one you prefer
SQL is sometimes easier for some
Basically what you have to remind from this video, is that a neural network, is a network of neuron. And a neuron is basically a parameter with a specific weight
Check the mathematical experession, if you're familiar with maths it makes way more sense
Great thanks
Is there a way to permanently make it day?
Can do it with a gamerule. /gamerule doDaylightCycle false
Tysm
how do you get the size of an optional
Its either there or not
You can use orElse(Object) to get the element or a replacement if the optional is empty
also got orElseGet for lazy evaluation, and orElseThrow
did someone already created a skywars plugin and can help me to create a skywars plugin
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Why does everyone want to make a skywars plugin as if they can somehow compete with the big boys
did someone already created a skywars plugin??
I really want to start storing player data in my plugin with a database but I really dont want to program in SQL lmfao
or like
get set up with it
but probably not one of us
Try sqlite. You don't need DB software to get started
Im trying to add some plugins via dependencies to my project and I get this error 'dependencies.dependency.systemPath' for us.myles:viaversion:jar should not point at files within the project directory. what can I do?
Why are you adding local jars? Do they not have a repo?
I dont think so
Install the jar into your local repo then access it via that
Don't point directly to jars
how can I do that?
Hello, how would you prevent a thread from closing the sql connection of an other thread?
thx
By not closing it on the other thread
Why i get this error?
https://pastebin.com/hPLrKaac
from where do I get the groupid?
You can enter anything in to that command
ok
and the artifactid?
plugin name
how can i check how central an entity is in the players line of sight
what about the dpackaging?
jar
okay ty
plugin null
that means?
Also wait? Are you trying to add ViaVersion
yes
They have official dependency information
No need to install a jar directly
cool thanks
that you didnt set your plugin lol
WDYM BY THAT
Where
BedEnter
my hand wants to do ?learnjava
Same
Dont you dare~
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
I added viaversion and got this error: 'dependencies.dependency.version' for com.viaversion:viaversion-api:jar is either LATEST or RELEASE (both of them are being deprecated)
got the same error for 3 other dependencies
it works thanks
stray away from using LATEST versions as your code could break if you compile it later on because you're using the lastest version rather than the one it was developed with which may have changed things
Does anyone know what this error means:
java.lang.NoClassDefFoundError: com/zaxxer/hikari/HikariDataSource
Caused by: java.lang.ClassNotFoundException: com.zaxxer.hikari.HikariDataSource```
buts its already registerd tho
Show your code
Is their any good documentation/guide regarding pathfinder goals? I always see those float values but I got no clue what they actually mean.
you probably need to shade Hikari
^^
You need to include its source code inside your plugin
a shaded depoency
shode
then you could instead add the dependency to the libraries section of the plugin.yml instead if you want a smaller jar https://www.spigotmc.org/wiki/plugin-yml/
^^
which file?
BedEnter?
^^
so call the depenency in the libraries in my plugin yml instead of my pom?
ok
ill try that
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.*;
public class BedEnter implements Listener {
NetChat plugin;
@EventHandler
public void OnPlayerBedEnterEvent(PlayerBedEnterEvent e){
Player p = e.getPlayer();
p.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("sleep-message")));
}
}```
you'll still need it in your pom, just not shaded (use scope provided if you are using the shade plugin)
Hi guys, could anyone help me? I'm using Geyser/Floodgate to allow Minecraft Bedrock players to join the server, however every time they join the UUID changes right away and as I have some servers, there are servers that these players never joined and this ends up breaking some plugins as they never existed on that server. I can get the correct UUID when the player joins the first server and I can send that UUID to the other servers, but how can I create a playerdata based on that UUID on the other servers that the player never joined? GameProfile? EntityPlayer?
You're never setting the plugin variable
is that the plugin = plugin thing?
that isn't in this file
if you declare a instance level variable in one class, you cannot use it in another by just using its name plugin
so this is all I need to do in my pom?
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>5.0.1</version>
</dependency>
Yes
okay
can you explain what the scope is?
Im still quite dumb with Maven and pom files lmfao
I mean I can google it too
this is how I add libraries to my plugin yml right?
name: NewLife
version: '${project.version}'
main: me.projectbrady.newlife.Main
api-version: 1.19
authors: [ ProjectBrady ]
description: A New Life style to Minecraft! Economy, Custom Enchants/Items, New Recipes, New Dimensions & More!
libraries:
-com.zaxxer:HikariCP:5.0.1
commands:
balance:
description: shows a players balance
ping:
description: a ping/pong command```
ohhh
yeah im getting an invalid plugin file error
so that must have been it
It worked!
Thanks @dim bronze
& @chrome beacon
Hi i want know if its possible to get the message the server is sending to the user for example a plugin and change them?
Can someone explain me how does spigot library loader works?
In particular, where should I look if I wanna add this feature to pre-1.16 version?
What would be the point if other plugins didn't use it?
Listen to packets and overwrite them, but don't do that
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/plugin/java/LibraryLoader.java is a good first start I assume
is there a way to get the cursor item whenever a player closes an inventory?
Im doing this for a translator plugin more automatic in some other way i can do that or only this?
so you essentially want to replace console lines with a translated version?
if so, you could add a filter to the log4j root logger... idk tho if it works for ALL messages, or only spigot/bukkit-ones, but as minecraft itself uses log4j, i think it should work for all of them
Alternatively Hijack UnsafeValues#processClass to modify the Classes' Constant pool
@EventHandler
public void onEntityDamage(PlayerTeleportEvent event) {
Player player = event.getPlayer();
System.out.println(event.getCause() + " ");
if (event.getCause().equals("ENDER_PEARL")) {
event.setCancelled(true);
//player.teleport(event.getTo());
System.out.println("called ");
}
}```
it doesnt work (Spigot 1.8)
[22:57:48 INFO]: PLUGIN
[22:57:53 INFO]: ENDER_PEARL
[22:57:53 INFO]: PLUGIN```
this is what im getting in console
whats the problem?
Your IDE should be screaming the reason at you
lol
The event cause is an enum, not a string.
its not.
if (event.getCause() == PlayerTeleportEvent.TeleportCause.ENDER_PEARL) {``` i was trying this
but im getting the same result
should work
^ spigot development in a nutshell
development in general
i mean
if your console says "PLUGIN"
you got teleported by Player#teleport
idk if its from you or another plugin
Yes
in that case ^
or well
this instantly hard crashes the server, anyone got an optimized version?
for(int x = ((Player) sender).getLocation().getBlockX() - 100; x < ((Player) sender).getLocation().getBlockX() + 100; x++) {
for(int y = ((Player) sender).getLocation().getBlockY() - 100; y < ((Player) sender).getLocation().getBlockY() + 100; y++) {
for(int z = ((Player) sender).getLocation().getBlockZ() - 100; z < ((Player) sender).getLocation().getBlockZ() + 100; z++) {
Block block = ((Player) sender).getWorld().getBlockAt(x, y, z);
if(block.getLocation().distance(((Player) sender).getLocation()) <= 100) {
((Player) sender).getWorld().createExplosion(block.getLocation(), 4, true, true, ((Player) sender));
}
}
}
}
honestly i dont even know if you can modify these with filters... you can disable them at least
please
ffs
use variables
please
for what
for(int x = ((Player) sender).getLocation().getBlockX() - 100; x < ((Player) sender).getLocation().getBlockX() + 100; x++) {
this is way too long
but yea, you're modifying hundreds, if not millions of blocks at the same time
i'm bad at math, so i cant tell
it's not fine. This is a performance drain
idk if there is one since youβre making like 1 million explosions
at least they are only explosion power 4
thats normal tnt sized
You are creating 200 * 200 * 200 * 2 + 200 * 200 * 2 + 200 * 2 location objects which is a HUGE number
fine
split the workload idk
ill make a variable
or to be clear, 8,192102656000016e+19
You can only delay it if anything. World IO needs to be sync unless you are doing whacky stuff
16_080_400 actually something seems wrong on your end
calculator told me
honestly bukkits fault for creating copies Tbh
idk
jk
honestly
Minecraft is worse with it's BlockPos
just don't create millions or trillions of explosions AT THE SAME TIME
distanceSquared <= 10000 ezpz
runnable?
what the
Probably shouldn't make millions-trillions of explosions at all tbh
okay
first of all
why in the fucking hell
do you want to create
so much
explosions
fine ill just do like 50 radius and then make them all max explosion power
what
What the hell are you doing though 
is your goal
Blowing up the entire world?
making a random command
like random what
ooh i crashed log4j with too many thread dumps
"Editing Nuke.java" 
just create like 1 or 10 high power explosions idk
i'm not that much into how much tnt java can handle at the same time, but i'm pretty sure even 1k would be a pain in the ass for most modern servers
3.456e+17 high power explosion :D
thats the entire world btw
i wonder actually
It's Mojang so probably
uhhh
isnt even checking if block is air smh
if it is replacing air blocks with air blocks
wouldn't that be like
the biggest performance patch?
How do i set default world spawn point?
/setworldspawn
β€οΈ
lool
gonna get you banned
WTF
son of your mother...
that's not too nice lol
have you played minecraft they don't know how performance works
yes
fair
still getting 1.5k fps tho
@ancient plank can u edit my nick again
oh yes
what if i just summoned a ton of tnt entities at every point within like 700 block radius
int px = (Player) sender).getLocation().getBlockX();
int py = ((Player) sender).getLocation().getBlockY();
int pz = ((Player) sender).getLocation().getBlockZ();
for (int x = -100; x < 100; x++) {
for (int y = -100; y < 100; y++) {
for (int z = -100; z < 100; z++) {
if ((x * x + y * y + z * z) <= 100 * 100) {
((Player) sender).getWorld().createExplosion(new Location(((Player) sender).getWorld(), px + x, py + y, pz + z), 4, true, true, ((Player) sender));
}
}
}
}
Fully optimized code
not even checking if block is airsmh
your TPS will drop
thats literally what i have now
idc if its air
hard crash
drop?
go down
it'll be fiiiine
idk
AND NOT IN THE GOOD WAY
it's not as bad as my sphere code
Just throw the explosion particles + sounds in packets and emulate the explosions on the serverside at that point
what if i did ((Player) sender).getWorld().createExplosion(new Location(((Player) sender).getWorld(), px + x, py + y, pz + z), Integer.MAX_VALUE, true, true, ((Player) sender));
Oh I know how to fix the hard crash, just set the timeout-time in the spigot.yml to the max integer value and then it can never crash 
lol
then there will be an explosion
well
that works honeslty
looks like a good idea
it lasts about 10 seconds before hard crashing and the timeout is already like 5 minutes

lasting about 10 seconds? trying to supress another seks joke
this is good lag https://streamable.com/e6xlyg
looks cute
boom shakalaka
your mom looks cute
mod?
nvm im stupid
ik that mod
ik one that bans you from singleplayer
Adelemphii don't you play on like a TI-84
it straight up deletes the folder 
How do i disable weather for eternity?
hwat
?
Like your computer is a potato
no
Can't code and play mc at the same time
thats mc's fault
I'm limited by ram, but everything else on my computer is middle tier gaming pc
mc can't handle the simplest shit in the background
it's a "your pc sucks, but not in the good way" joke
Player player = (Player) sender;
int maxDistance = 100 * 100;
int px = player.getLocation().getBlockX();
int py = player.getLocation().getBlockY();
int pz = player.getLocation().getBlockZ();
for (int x = -100; x < 100; x++) {
for (int y = -100; y < 100; y++) {
for (int z = -100; z < 100; z++) {
if ((x * x + y * y + z * z) > maxDistance) continue;
player.getWorld().createExplosion(new Location(player.getWorld(), px + x, py + y, pz + z), 4, true, true, player);
}
}
}``` optimized even more ezpz
constants are inlined by Javac
you're not funny alex
do i look like i asked
stop that
I am cute and awesome, ask imajin
!false
intellij takes up 3GB of ram, minecraft takes up another 3GB and then I'm out of memory because the other 2GB is used up by misc programs/windows
or did you son of your mom change it again
i can use pattern variable instead of ((Player) sender) just to optimize it a tiny bit
Player player = (Player) sender;
World world = player.getWorld();
int maxDistance = 100 * 100;
int px = player.getLocation().getBlockX();
int py = player.getLocation().getBlockY();
int pz = player.getLocation().getBlockZ();
for (int x = -100; x < 100; x++) {
for (int y = -100; y < 100; y++) {
for (int z = -100; z < 100; z++) {
if ((x * x + y * y + z * z) > maxDistance) continue;
world.createExplosion(new Location(world, px + x, py + y, pz + z), 4, true, true, player);
}
}
}
if we are at it
my god..
insane
Meh, JIT should handle that
we r reaching peak nuke performance
i wonder if his server will literally burn after that
we can actually cache the Location too @quiet ice
instead of 3 player.getLocation calls
?jd-s
?paste
?whereami
this is quality code https://paste.md-5.net/fesonejari.cs
Player player = (Player) sender;
World world = player.getWorld();
int maxDistance = 100 * 100;
Location loc = player.getLocation();
int px = loc.getBlockX();
int py = loc.getBlockY();
int pz = loc.getBlockZ();
for (int x = -100; x < 100; x++) {
for (int y = -100; y < 100; y++) {
for (int z = -100; z < 100; z++) {
if ((x * x + y * y + z * z) > maxDistance) continue;
loc.setX(px + x);
loc.setY(py + y);
loc.setZ(pz + z);
world.createExplosion(loc, 4, true, true, player);
}
}
}
int r2
theres a word for that adele
its called diameter
All unnecessary allocations nuked
still hard crashes
send spark report with lower radius
could there be a way of optimizing it further by making it async or smth
never
I didn't make that code, I typed "// create a sphere" and github copilot did it for me
You CAN do it async, but it is in huge danger territory
you can tell because I have this comment still
java // for every block in the list check if the block under the block isn't air, and if so, change the block to snow/ice at random
Plus it is NMS only pretty much
why do people hate nms so much π₯²
Because I never used it so have litterally no experience with it?

everything I need in every project has an API in spigot
forgot what javap did for a second, nice
And it is undocumented territory with what's basically vendor lock-in
One day I will create the superior NMS experience - one day
just edit bukkit api to do everything nms can
@buoyant viper look at this class tho, 10/10 code right here https://github.com/Adelemphii/RandomEvents/blob/master/src/main/java/me/adelemphii/randomevents/corruption/CorruptionManager.java
yes
β€οΈ u java
I HATE THEM
best language
It also inlines GETSTATIC calls if the field is a static final of String/int/double/etc.
what if i did something stupid like delete the chukns and use a custom world generator to make new ones
java best lang
From time to time javac also uses constant dynamics but I have no idea when exactly it does it
It's actually more annoying than your think
while the player is in the chunks >:D
oh i know it is
The inlining that is
oh
php > java
sadly ive written in both atrocities you speak of
I have to admit, it was a joke
in the process of rewriting https://github.com/winnpixie/open-mc/ to not be as aids
Makes decompiled code unreadable and you can't change the constant pool of a single class to change all references to a field
just dont work with decompiled code ezpz
Bit hard to do if you are the only person in a modding scene
r u updating defunct mods?
Nah, modding an obscure game
F
so i did a thing, now the server is like crashed but entities are moving and stuff
idk wtf is happening
It's quite fun actually (especially being able to laugh at the failures/incompetence of newcompers), just gets a bit lonely
me?
nah, modding games
huh so whatever the fuck i did just kind of didn't happen at all
Not talking about mc there
still at 20 tps
old Trinket();
i just made it spam runnables to do each tnt on a different tick
super inefficient but idc
Hey guys im developing a custom ConfigurationSerializable class. How i can remove these lines?
you canot
why do you want to remove them
np
the issue is that it will not know how to deserialize the objects afterwards more or less
omg i lagged it so badly that it takes about a second per line of thread dump
was this a bad idea
the lag hit after
lol
huh only 1 thread dump?
strange
unless my console crashed
oh no i crashed all the other plugins but the server is still running lol
its stealing all the ram from other plugins
hehe
now Trinket();
/de_nuke
cs nerd
no u
CSGO more like
Csno
i think my plugin might actually be working
its crashing everything it touches but it hasnt killed the main thread yet
Lol
only 4 of the plugins on the server
make that 5
oh they are all differnet threads
why tf does worldedit get its own thread
new Thread();
because it created one
well ik but still
why do they need one
i wonder if my server will actually recover
i spammed /nuke like 12 times before the lag hit
im slowly killing threads one by one
it must be trying to process the explosions rn
taking almost as much as chrome
only 4 gb of ram?
i allocated 8
i managed to crash bstats twice
ok according to math this will take about 111 hours to finish loading
if it even loads
ok ill see you guys in 111 hours ig
wait what if i did something like skip blocks
what is the radius of an explosion with 4 power
Hey native speakers, which one is better?
The warp is currently disabled / deactivated ?
disabled
disabled
thank you!
not work
Videos on discord are bugging like hell for me somehow
images too
took forever for the world to render so i ended it
for some reason it didnt destroy any blocks, rendering is working
probably a random plugin being a piece of shit
and cancelling BlockExplodeEvent
too near to spawn?
i think thereβs a boolean parameter in world.createexplosion that changes block breaking
that was about 2 million blocks out
i enabled that
Can you do an example or i can just pick with protocollib the server sending information and modify them?
?jd-s
disabled
wtf
did you copy paste my msg from yersterday lmao
Im so confused too
I prefer my UnsafeValues suggestion. Work brilliantly
She responded to one of my question
she*
Fixed didnβt know
I literally gave the exact same answer yesterday lol
What i asked im doing a translation plugin the thing is i want pick the message sended by server for example plugin and translate them for the users
do you want to listen to messages sn
oh shit
hit return too early
do yo uwant to listen to messages sent by other plugins as well?
oh okay then you have 2 choices:
And resend them i think probably protocol lib can help
- inject your own logic into netty
- use protocollib to listen to outgoing "chat" packets
Probably protocol lib is better
And easier
this is one of the rare cases where I'd suggest you to use protocollib
- Use ASM and replace all strings in a plugin. Becaue nothing can go wrong
geol go to sleep π
I canβt do that lol i need to recode most plugin and even not custom and paid one
Hey, writing a maven resolver drives me insane
werent you the person who made the PR for my jar-string-replacer?
yes
thanks again, it works perfectly β€οΈ
on https://semver.org/, it says "Software using Semantic Versioning MUST declare a public API. This API could be declared in the code itself or exist strictly in documentation. However it is done, it SHOULD be precise and comprehensive." what exactly does this mean I need to do?
Bukkit for example has
Note: While the Bukkit API makes every effort to ensure stability, this is not guaranteed, especially across major versions. In particular the following is a (incomplete) list of things that are not API.
Implementing interfaces. The Bukkit API is designed to only be implemented by server software. Unless a class/interface is obviously designed for extension (eg BukkitRunnable), or explicitly marked as such, it should not be implemented by plugins. Although this can sometimes work, it is not guaranteed to do so and resulting bugs will be disregarded.
Constructing inbuilt events. Although backwards compatibility is attempted where possible, it is sometimes not possible to add new fields to events without breaking existing constructors. To ensure that the API continues to evolve, event constructors are therefore not plugin API.
Implementation classes. Concrete implementation classes packaged with Bukkit (eg those beginning with Simple) are not API. You should access them via their interfaces instead.
For this
and they ask you to use a proper versioning scheme
so by default does a plugin have an external api
no
ok
it only has it if you decide to do so
To be fair I have always ignored that paragaph of semver
Or really I have never been too fond of following semver to the letter
an API is basically just "there are the following method that everyone can use, and we wont change them randomly: A(), B(), etc
what does that mean?
yeah kinda
I prefer my
Maven's versioning scheme uses the following standards:
- MajorVersion
- MinorVersion
- IncrementalVersion
- BuildNumber
- Qualifier
For example:
- MajorVersion: 1.2.1
- MinorVersion: 2.0
- IncrementalVersion: 1.2-SNAPSHOT
- BuildNumber: 1.4.2-12
- Qualifier: 1.2-beta-2
mavens kinda wierd
hm no

