#help-development
1 messages ยท Page 895 of 1
How the fuck do I publish a maven library to local gradle
I ran mvn install, it's in my .m2
But my gradle project does not recognize it
It's not in .gradle\caches\modules-2\files-2.1
And it probably should be
How though lmao
why would maven install into gradle?
its not like the maven install command is used for anything else but maven
Kinda hoped they would try to be at least a little compatible with eachother
add mavenLocal() to dep block
Well now I see that it does not work that way
gradle can use maven local dependencies
Uhh I'm pretty sure that some other I could successfully import some other local deps
But I'll try
check its added and ensure that spelling + case is identical
I copypasted every detail meticulously
on github?
No, it's a local project
I copypasted groupid, artifactid and versionid into the gradle striong
To be sure
?paste the build.gradle
ah kek
Ty
got to be a fast typer sometimes ๐
otherwise how else you going to shave them coding times?
I am probably 90 wpm on average and my best is like 110
slavery AI copilots
Yeah I wish lmao
just get one of them small keyboards like they use in court rooms
stenography or smth
stenographer
stenography is also correct too I suppose
I am actually surprised you knew that though
I mean my keyboard is a bit weird during winters
i spent like half an hour watching stuff on it
It has like a metal case and when I get up and sit back down and touch it, it occasionally shocks me and stops fucking responding until I replug it
uh, why?
i was bored
Thankfully the wire can be reattached from the front
Well like
so it has like exposed wires or something?
ah, ok. I assume you have carpet?
Yeah
and you wear socks everywhere?
Wrong wording again fuck
I have a big mousepad lmao
For some reason that came to my mind when you said carpet
is this a static moment
Zbll
Yeah most liekly
I am all ears
yes its a static shock, but I was just trying to figure how exactly how they were building up static charge
Well it's really easy during cold winter lol
Please instruct me what to do with this
just make yourself a grounding rod and put it near your desk. Before you touch your keyboard, just touch the grounding rod first
Good idea actually
however, your keyboard is flawed itself too
because for some reason it isn't grounded properly
Yeah it's irritating
being grounded properly doesn't mean you wouldn't have that static shock, but it shouldn't actually cause the keyboard to do anything
I wonder if maybe if something in your keyboard is stripped ๐ค
the only metal keyboards I know of are mechanicals
It's a good keyboard, this flaw is rly annoying though
my bat file worked before until i switched to java 17 and downgraded back to java 8
Learn englidh?
I know plenty but my brain is melted today
ok so I did some research
apparently the case of the keyboard is not grounded to the USB like it is supposed to be and is a known flawn with that keyboard of yours
so what you can do is add a ground wire to the keyboard case and run it to the USB ground wire
and it should stop causing your keyboard to do funny things
also, from my limited research the static electricity is known to kill that keyboard as well
Oh wow
yeah, so whats happening is the static shock is going through the keyboard board
Frankly I've been planning to get a new keyboard since this one has been with me for a decent while and I have an addiction to buying things
But wow you really did your research holy cow
Yeah that is def not supposed to happen
Like it's just the case, shouldn't be going through
I see
but you were able to get the one you have now?
lol
I do not think I can be considering anything above 80$
Yeah it was like 75$ when I bought it
And I just got my biggest commission
So I decided I'd reward myself
Huh
select red for the switch type
โ Preisvergleich fรผr Roccat Vulcan TKL Pro, schwarz, LEDs RGB, Titan Optical Linear, USB, DE โ Bewertungen โ Produktinfo โ Layout: DE โข Typ: mechanisch-optisch โข Switch-Bezeichnung: Roccat Titan Switch Optical Linear โข Beleuchtuโฆ โ Tastaturen โ Testberichte โ Gรผnstig kaufen
red for whatever reason is the cheapest
I am about to buy this keyboard
and you need your keyboard in korean?
Either way I cannot be ordering from there because they are 100% not delivering to Russia, and on the electronics website that I use to buy, well, electronics and stuff, this keyboard is ~105$
Nah that was a misclick
lol that is what made it more expensive ๐
they just don't like the EU it seems then
Most likely lmao
If you have any other recommendations I'll actually be happy to see them because I have not yet decided on what I'd be buying. Like just ping me and I'll see it when I get online lol
I gtg now
cya later
Cya
have fun building that ground wire
๐
why this error sends when i try create fake player nms
You exceeded the write limit
@wet breach got it all figured out
No Index limit
nicely done
what do you mean
Imagine having an array with 4 elements and you wre editing the 8 one
did you by chance test out the server perms and know if they still work? lol
it uses PDC to store a sha256 hash of the password into the player
let me try
and what is the source
nick?
or smth else
but you are suppose to be magical don't you know?
Side note: you probably want to also logout the user when they unregister
you're right
I assume you don't do that rn because atm they can move freely after unregistering
yeah i don't
it should be easy enough because it's constantly checked on move events which are cancelled if the player is logged out
Yup
Seems like PlayerInteractEntityEvent doesnt work with BlockDisplays.
Is there any other event for that?
@wet breach bukkit.commands.whatever still works - but i'm on paper
don't think that makes a difference but oh well
NVM doesn't
@rotund ravine they still work
i spoke too soon
๐ฎ you lied
i thought they did for a sec xD
it might be because they ditched their own implementations in 1.8 to use the vanilla ones under the minecraft: namespace
dunno how it's done now
I will have to this weekend load up a server and see
i was thinking of also making a plugin to restore skins on warez servers
warez servers?
would that need some extra tinkering like nms or could it just be done from spigot api?
offline-mode=true server :P
you should be able to do it with the api
declaration: package: org.bukkit.profile, interface: PlayerTextures
nice
i have to study how that texture server shenanigan works
maybe an api request with a uuid to get it?
oooo capes can be set too
https://sessionserver.mojang.com/session/minecraft/profile/UUID
which returns a properties list where the first element properties[0] contains a value field which has some base64 encoded json, which decodes to some more json that has a textures.SKIN.url field which finally points you to the correct textures.minecraft.net link
yep
Alright
discord is dying fr
hey does anyone how to register a loot table so i can use it in commands, mobs and chests?
Datapacks
no other way?
interesting
is sth like this possible in java too?
Not sure what that does
how to checkif item has different name than default one?
hasDisplayName
On the meta
that means this class has a function "path(MapArgumentPathBuilder.() -> Unit) " if its generic type is MapCommandContext, otherwise not
well you can make an util method that takes that generic type and functional interface
the fact it's an extension function kinda shows it has to be not a function "of" the type
but with a normal util class it'd only have access to visible members while like this it can also see private members, isn't that correct?
not if it's in the class itself
static methods in the class can access its private members when given an instance
?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!
ty, used that method but didnt work, and realized the issue was in another place lol
i have a spawn with the multiverse core plugin but how do i make it that they cant break blocks?
cause now they can just grief spawn
Use worldguard or smth
Would that not just be a static utility method that has the specific generic type?
public static void doSomething(TheObject<SpecificGenericType> object, ... the args ...)
That's all extension methods are is static methods that accept the object as the first arg, so if the first arg has a specific generic, then you can't use it for any other generic type
that's basically what it compiles to
i already have it installed, how do i add protection?
Or if you want to further scope it, give the method a generic type and extends something, public static <T extends Whatever> void doSomething(TheObject<T>
Not what itโs used as though ๐คช
Ask worldguard or #help-server
it won't be static though I think, since it's a member of that class in alex's case
I guess
It is static in the jvms view from alexโs example
It's a Kotlin extension method. They compile to static utility methods because you can't add a member method to an existing type
you can still access properties of the enclosing class within an extension as a member
Sure. You can do that if the static method is within the class as well
Kotlin is special
i asked it can u answer it if u know
in help-server
public class MyObject {
private int privateMember = 1;
public static void example(MyObject object) {
System.out.println(object.privateMember);
}
}```
Just as an example :p
I'll make an example of what I mean
Yeah, that's just how Kotlin works :p
Itโs compiled to a static method
but Kotlin doesn't exist. It's still JVM bytecode at the end of the day
It has to be supported by the JVM
kotlin doesn't exist is my favourite sentence ever
but how would this work in java? wouldn't both static methods have the same signature?
no? they're different classes and the methods exist in different classes
Think he meant on use Emily
One of two likely options. Either named something differently with a generated name at runtime, or generates a new class for each extension method
Compile then decompile
maybe but it isn't virtual dispatching that's for sure
the type needs to be statically accessible
Iโm wondering which extension itโll go for. Cause u can extend clases to use an extension
All I'm saying is that Kotlin is black magic, and back in the day we used to burn people at the stake for that kind of thing
Maybe we should take the hint ๐
true

Well, a lot of things happened to other people too back in the day.
yowza
there is some weird black magic shit in there tho lol
would be boring if it'd be the same as java lol
Fake news my jdgui decompiler canโt decompile half my kotlin classes and it can decompile all my java classes /s
It's JVM bytecode so ๐
If you think about it, it is java
I rememeber someon saying in here there was a better decompiler GUI out their than JDGui I am extremely skeptical cuz I forgot the name of it :P
Still compiles to a static method
Just not used as one in kotlin
that's so cursed wtf
it works even if the property is private
Yes
enigma is nice
I weirdly haven't seen any auth plugins do that and they instead use an external database file for storing passwords which is overcomplicated
the only thing I can think of is security since the sha256 password hash of someone is visible when you /data get them
but /data can only be used by ops and it's a hash either way
sure? The same is the case with static methods in java
you know that
is Location1.equals(Location2) not true if they yaw/pitch are different?
what I wanted to say is that the extension method doesn't end up as static in that example
better than jdgui in your opinion?? I've found the UI of JDGUI a bit clunky sometimes
I don't really deal much with UI based decompilers ๐ ยฏ_(ใ)_/ยฏ
its certainly usable tho
so just โจ give it a try โจ
looks nice :P
gui based decompilres are very important to me
how else am I supposed to decompile CMarcos plugins easily
It does
my condolences
All extension methods are static
Yeah but im looping this thing multiple times
it does not, you can check on compiler explorer
it is still empty
hmm I haven't read the context but what about fernflower in intellij?
empty set will never contain user
Ok wait ill write the other lines, maybe it'll understand
you've created users set but never added anything to it
so it will of course never contain any user
ok it fixed itself but how come its unnecessary? I dont want the set to have multiple values
it will go away when you write the rest if the code
wtf is wrong with my IJ
huh?
Invalidate Caches didnt help
its a hashset
Can those not have duel values?
no
Ok I see thanks
that is the whole point of a set
Kotlin documentation literally says extension methods are static methods from the java side / jvm side
I thought set = no order
Ok thanks I see
what's wrong with my IJ ๐ฟ already invalidated caches 3 times
It died
Not sure how to fix.
Could remove project without deleting it
Restart ij and reimport it
auto formatting turns it into this nasty mess
I already rewrote the whole class - as you can see in an earlier screenshot, it already complains when I just do class MyClass<T: Something> ()
Is that supposed to be kotlin? The file extension is .java
Oh
duuude
thanks
Ahaha
that also explains why it compiled
Np lol
because it ignored the file lol
I only checked if it was empty not if it was java
damn why is Java Class still at the top of IJ's menu even in src/main/kotlin kek
hey how do i create a mining fatigue (entity effect) packet with protocollib?
I've been trying to write to the integer/byte fields from the wiki.vg
But i keep getting index out of range errors when i write to the fields
effectAdd.getIntegers().write(0, player.getEntityId());
effectAdd.getIntegers().write(1, 4);
effectAdd.getBytes().write(0, (byte) (255));
effectAdd.getIntegers().write(2, 1);
effectAdd.getBytes().write(1, (byte) (1));
https://wiki.vg/index.php?title=Protocol&oldid=18256#Entity_Effect
im tired so it might be stupid
will never be as good as JDGui lol I don't want to pop out intellij to crack open a .jar
I bound a separate keybind for creating kotlin files with java i use ctrl+shift+z with kotling I use ctrl+shift+k
it finally works! and it can even infer the type from down there to the context<..> part o0
not always: https://i.imgur.com/mxD26I4.png
Interesting
You should use the new api for that :p
ah
Is there a simple way to compare if two locations are the same? .equals wont work if the yaw/pitch are different (or will they)?
is it possible to do it my way?
probably
i'm just unsure as to what i've done wrong, in the documentation it says there are 3 varint fields and then when i add them, it tells me index out of bounds
Hmm how would I check if a hashmap which key is Location containsKey Location but ignoring the yaw/pitch
Make your own class to use as the key
And make sure to implement hashcode and equals
is it possible to assure the data and metadata class are the same
from a method like this
setMetadata(Class<?> metadataClass, Object data)
cause using generics doesn't assure it
Donโt use metadata
I mean, metadataClass.isInstance(data)
you won't get further than <T> method(Class<T> metadataClass, T data)
alr
if you want a specific class you can add more data to that too e.g. extends or super
well it depends what you want to do
e.g. are we constricting data to a single class?
if so you should add a generic to the greater class
the data has to be the same class as the param metadataclass
even if I have Class<? super T> metadataClass it's the same
ykw im prob wasting my time with this lmao
ima just add the 1 singular condition
Hello, I tried using my plugin for 1.2.5 CraftBukkit server that sends a webhook message when player joins or leaves but I keep getting error 403, what could be the cause of this? Yes, the url is correct
1.2.5?
yes
You're lucky that your problem isn't related to the Bukkit version
403 means forbidden, try to add a user agent
Not really sure how to do that since I dont know how to code in java and the plugin wasn't made by me
Then the next best thing you can do is to disable the Cloudflare proxy, if you use one. Apart from that, you'll likely not have much luck. It's very much possible that the old Java version that you use isn't even able to connect with your web server
If it does, you'd have to update the code
add user agent like this? connection.setRequestProperty("User-Agent", "Mozilla/5.0");
Yes, something like that
ok will try that
There are better ones on the internet if that doesn't work
adding user agent worked, thank you so much for suggesting that!
is HashMap.containsKey faster than looping through all of the keys?
Yes, significantly
Ok
best and average case yea
generally you'll find any hashmap operation will be faster once you eclipse 10 or so entries otherwise an ArrayList usually edges out a Hashmap. In most cases though I'd advice using the API methods given to you
an unsigned int is usually 32 bits on x86-64 implementations of C right?
I would imagine so?
Yes but this is compiler dependent
always use sizeof if you need to know.
or use uint32_t
its a queston on my test study guide, but its poorly worded so I just guessed for x86-64 lol
I knew I wasn't crazy and it is system dependent
0/10 arson the school
I used a C compiler where a char was 32 bits.
The new UTF-32 format
Yeah, that is poorly worded. I assume it meant stdint.h but yes, the size of types like unsigned int are never gauranteed
You should bring it up with whoever made it.
its for an embedded systems class though
so I'm guessing it could be 8bits
it could be any bits
luckily this isn't graded, but I'll bring it up if something like this is on the test
the real answer is sizeof
the real answer is whatever the assembly instructions for sizeof are xD
since its implementation dependent and while most embeds are 32b, cant be sure.
Use godbolt and find out
Or just disassemble it yourself
well on my arduino its 8 bits because our registers are only 8 bits
but on my x86-64 processor its 32
yep.
likewise on x86-32 it'd be 16
A TMS320C3x/C4x Byte Is 32 Bits
The ANSI [C] definition specifies that the sizeof operator yields the number of bytes required to store an object. ANSI further stipulates that when the sizeof operator is applied to type char, the result is one. Since the TMS320C3x/C4x char is 32 bits (to make it separately addressable), a byte is also 32 bits. This yields results that you may not expect; for example,
sizeof (int) == 1(not 4). TMS320C3x/C4x bytes and words are equivalent (32 bits).
Get out K&R and look up sizeof.
Anyone have a good tutorial /pseudo code/ guide for the best practice to having multiple config files? I know I can use a simple read/write to get it to work, but I'm sure if there was a better way to handle it. I've been using the built in config management in the JavaPlugin class.
Found on Stack Overflow: "in the context of the ANSI C standard, a 'byte' is actually defined to be the smallest unit of storage that can store a char."
?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!
Can you post the error?
What is the stacktrace?
do you use maven?
How do you know you have an error
because it says Task exited with error code 1
And nothing else?
nah
there should be the stacktrace above it
Are you compiling spigot
a what
yea
text describing the error
ok I hit copy log
can I just dm you the log
?paste
Send it here in a paste
You can dm me the log but I cost 20 dollars per minute to dm
So it adds up pretty quick
my rates are very competitive
How long it takes you to reply?
"may we see them?"
...no
20 a minute ur dm is on my screen plus 5 dollar a minute thenotifaction is on my screen if its outside work hours
So thaaaaaatโs what the wakatime discord plugin is for
This code throws a ConcurrentModification Error. Is there any way for me to make it so that it doesn't?
Im just replying to it cuz i dont feel like transfering the code to a new md5 page
Stacktrace please?
Give me a sec
@rotund ravine
i think i modified it slightly from the thing i replied to
If u remove this line
plugin.getClaimedChunks().remove(claims.getKey(), kingdom);
Does it work
(yes)
Smh spoonfeeder /s
the problem is that it doesnt save the data to the config.yml (ie remove it) when i reload the server or anything even if theres more than one kingdom
Well letโs see ur save method
public void saveClaims() {
for (Map.Entry<String, String> claimedChunks : claimedChunks.entrySet()) {
this.getConfig().set("claimedChunks." + claimedChunks.getKey(), claimedChunks.getValue());
}
this.saveConfig();
}```
savePluginData calls that?
amongst other save things, but yes
they all have the same format
i guess i would make a separate method that would nullify the values? i cant think of a way to do it properly
thing is you are iterating over the existing values
so the values in the config that were removed from the map stay there
you could set the whole claimedChunks to null and then fill in the values
how would i do that?
this.getConfig().set(claimedChunks, null)``` or sum?
yeah
With โโ ofc
Would this work both if the player is offline and the player is online?
data.set(new NamespacedKey(plugin, "UUID"), PersistentDataType.STRING, Bukkit.getOfflinePlayer(playerName).getUniqueId().toString());
trying to store the UUID inside of a player head from a playerName string
yes
ty
what is the best way to fix this?
Your CommandSenderFactoryRegistry#get() is going to need to return an actual generically typed object
is there any good double jump plugin?
If your generic types are ?, it's going to want ?
so you suggest that it returns my own CommandSender (not the bukkit one)?
No, I just mean
// This:
CommandSenderFactory<?, ?> factory = CommandSenderFactoryRegistry.INSTANCE.get(sender.getClass());
// Needs to be:
CommandSenderFactory<CommandSender, YourCommandSender> factory = CommandSenderFactoryRegistry.INSTANCE.get(sender.getClass());
i tried that ig
only with the 1st ?
same error
i even tried to use the bukkitSenderClass.cast but it did not work either
why aren't my packages being shaded?? https://paste.md-5.net/onuqilifoq.bash I'm running ./gradlew clean build
do you have build depending on shadow jar
theres the issue
is there any way to filter minimization to not minimize certain packages with gradle?
how we can leash player ?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/LivingEntity.html#setLeashHolder(org.bukkit.entity.Entity)
i did invincible zombie thing between 2 player but it will teleport leashed player only.
declaration: package: org.bukkit.entity, interface: LivingEntity
I believe you can add excludes
actually no clue about minimize
yeah but that takes in a "ResolvedDependency" or "Dependency"
minimze and excluding is weirdly like annoying
not sure how I could get those from my strings
i guess i know the solution
kinky
yeah kinda
hmm, what would be the best way to make a serializer for an sqlite database?
Currently making an API which i need to serialize types of objects somehow
and i honestly dont know that to serialize to, string, byte array ๐คทโโ๏ธ
json just defeats the purpose of sqlite so
hi Does somebody have a GitHub repository with a multi-module project for NMS supporting multiple versions, as an example for me? (with gradle)
did you try JDBC ?
You have another option to use orm, but this is generally not recommended for spigot.
does JDBC have serialization?
i mean, my current system is just using a string but its inefficient imo
also more storage being used
I have find this tutorial but it's on maven, and i can't find how to do it with gradle :/ https://www.spigotmc.org/threads/maven-nms-tutorial.347254/
well i gotta serialize 1 object, since im making an annotation based system
@Table
data class Test(
@PrimaryKey val id: Int,
@Column val name: String,
@Column val age: Int,
@Column val list: List<String> // Which needs to have a defined custom serializer
)```
as of rn
could serialize into a byte array
yeah, that's what i was thinking
wtf just announced : https://www.youtube.com/watch?v=q2MFE3DVkH0
#Java 22 brings multi source-file execution to the platform. It allows us to run programs consisting of multiple source files and even dependencies with just a simple java command. For experienced developers, this will make exploration and experimentation simpler but it's a real game changer for people just learning Java or even just to progra...
why not have it serialize a variable by default instead of having to do @Column for each one
then have it transient if not serialized
They have announced it before tho
However build tools are guaranteed to stay alive - especially for loom and co
i just saw
when is set a scoreboard's objective to a completely different one, will it change the scoreboards appearence?
why do we make private fields with public getters and setters which is same as making the field public?
its not
why not
you can have buffers on those getters and setters
its called encapsulation
whereas the variable being public, it can be editted without any monitoring
public class Test{
private int x = 0;
public void setX(int val){
if(val < 0) return;
x = val;
}
}```
if that variable was x then I could set it to less than 0, obviously a simple example but you can get why it's important
yes but we use setters and getters even if its like```java
private int x;
public int getX(){return x;}
public void setX(int x){this.x = x;}
still good practice
use lombok anyway
makes life easier
@Getter @Setter
private int x;
ok ty
Is there a way to get the drops of a block break event? I can only see a way to get the drops of the block that was broken in isolation, not what drops actually occurred as a result of that specific event
This is because I want to modify these drops based on what they were
Block.getDrops(item used)
declaration: package: org.bukkit.event.block, class: BlockDropItemEvent
that aswell
Is that in isolation or does it actually report what happened? E.g. if they mined a gravel, and it dropped a flint, will that function return a flint dropped? Or does it reroll the calculation
This looks good
Didn't know about this
Ok, despite the locations being equal, why is the HashSet.containsKey not being true?
for (int y = minY; y <= maxY; y++) {
for (int z = minZ; z <= maxZ; z++) {
Location blockLocation = new Location(l.getWorld(), x, y, z);
for(Location i : homes.keySet()) {
System.out.println("dakey "+i);
}
System.out.println("lookin4dis "+blockLocation);
if(homes.containsKey(blockLocation)) {
System.out.println("foundit");
HomeLocation h = homes.get(blockLocation);
String user = Bukkit.getOfflinePlayer(h.getUUID()).getName();
users.add(user);
}
}
}
}```
I did some research, Location.equals(Location2) will return true if x y z and world are the same, it does not care about the yaw or pitch
check if location follows hashset contract
hashset doesn't use equals also
it does not?
ah mb
it does afaik
It properly computes the hash & equals
uses pitch and yaw for hash
ok, whats the best way to store the location as a hashset key, and be able to check if containsKey
vector if you dont care about world and rot
Ok so vector is just location without world or rotation?
im making a homesnear command, shows which players have homes in a radius of 20 blocks
and im doing that by loading the homes into a HashMap<Location, Home> and looping through blocks in a radius of 20, and checking if the hashmap contains the key
You could either make a subclass of Location and override the equals (and hashcode) method to ignore yaw and pitch or you just set it to 0 in order to compare
so MyClass extends Location and then make new equals and hashcode?
yes
if only java had implicit cast overriding :/
You can make it more futureproof when setting yaw and pitch to 0, then calling super.equals or hashcode and then setting it back
Although I doubt Location will get adjustments to those methods in the near future
that sounds kind of eh
ok how would you do it then
you'd probably be faster to check every damn home location with a distanceSquared
like
a cube of 20 blocks in width would be 8000 contains checks
well
i feel theres a threshold
you could also store homes per chunk
would be interesting to see what is more efficient
and then just get nearby chunks and access them that way
yea ^
probably a better call
sub-section them somewhat
tbf, could even do it by region (so 32x32 chunk block)
nah, a region is 1024 blocks sq ig
just get all ebtween those extremeties
bruh I thought this would be a simple command id get done in 20 minutes and its turned into this
Ah
so you only iterate over like "potential ones"
but yea, tbf, storing them by chunk key is probably good enough
and a lot faster given you can adress chunks in int keys
but 8000 contains checks against a map sounds pretty terrible and well
scales horribly
you could even pack the chunk coords into a long, and then do a Long2ObjectHashMap
dont think you can with a single int key
Well yea, you'd pack into long ^
since chunk coords are 2 ints (4) bytes, they fit perfectly into 1 long (8 bytes)
granted you should be using a DB of some sort instead of a hash map but you know
Or use relative chunk coords. Those could be stored in an int.
But long and absolute makes more sense.
But honestly for a command this is completely fine. Its not like he is iterating the map every tick.
And even 8k locations with a distanceSq check are just a few arithmetic operations. Probably still <1ms
ill just .setYaw and pitch to 0 in the map and when comparing
I mean yeah but it is faster, and honestly making performant plugins is just better
Didnt read the rest. What is faster than iterating over the locations?
There's almost always room for improvement of some sort. Commands don't have to be that optimized since they usually don't run often.
i.e. you'd have chunk to homes in that chunk, and you can just get the nearby chunks and call a map 8 times instead of ~8k, so yes it is faster by the nature of doing less
is a new Location without specified yaw and pitch always have those as 0?
yes
Ah grouping locations in chunks. Sounds overkill to me unless the server has to scale for several thousand players.
I'd rather make fast code if it was easy enough tbh
or just have an if statement
if total homes < blocks in radius lol
seems easier to make homes per chunk
yeah per chunk is probs best
Orrr use my RegionatedIntIntToObjectMap lol
that doesnt sound real
I'm trying to involve myself more with developers and get active in voice calls so that I can learn with others, are there any communities or people interested in this please let me know I am somewhat new to Java and Spigot so I know we all get lonely sometimes and enjoy others company while coding๐ฅน
There are some voice sessions from time to time. You can just hop into the general or verified voice chat and wait for company. Right now it's probably too early and most of us are still at work/school
Are you an experienced developer?
if you want we could go in the verified vc, im currently lonely as well :(
Im in General 2 I don't know if i have access
i could use a little drawing for that lol
This is synchronized, should probably make a separate thread-safe class
Though this I love
Help, how can I make 1.8.8 plugins in intellij, there are only versions till 1.13, also I can't find a good tutorial on YouTube for 1.8.8 plugin programming
nice, but couldnโt that be somewhat non deterministic when you access the array elements outside of the mutex?
Change the version in your pom
And if you don't know Java yet, you should start with that
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programmingโgreat for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! ๐
new learn message
i made a server using spiggot/paper, but when i do /pl on my paper server it shows as bukkit, is there an explaination for that?
ask paper
It doesn't support async writes, yeah. But even for a sync-only impl it is fine
With fine I mean stupidly fast
But eh, that class was written when I was much younger than I am at this point in time so errors are to be expected
anyone know how to make fancy tab completion and argument handling
coloring an integer value green and having those <---[HERE] error messages, etc, like the vanilla commands do
could I theoretically directly use brigadier or sth similar? is this possible without external libs?
You can def. use brigadier (I've done it)
But there might be a problem with command permissions.
I have a thing that does this https://github.com/steve6472/Brigit
(My plugin also has some support for reloading)
But if there are API ways to do this, you should probably go with those.
Also, different command libraries exist.
Ah fair enough, nice nice ๐
not quite sure if this is what you are trying to achieve but you could use treemap inside an treemap
treemap<int(x), treemap(int(y), object)>
is treemap hashmap with order?
would be smth like this
I forgor, ive never used it before
Has anyone played with packets in 1.20.4 yet? If so how do you send out the PacketPlayInBlockBreakAnimation or what did it update to?
I have this but it does the flashing animation. If anyone can help please @ me when replying
player.sendBlockDamage(location, (float) (damage));
no that's LinkedHashMap
TreeMap is like a binary tree
Are you trying to change the block the player is breaking
it's sorted, and does not use hashes
You need to give the player mining fatigue to stop them from breaking the block client side
You can even do client side mining fatigue
i am trying to send the animation of the "cracking"
they have mining fatigue and it works fine it just has a visual flashing where it switches between client damage and server damage to the block. I ran into this problem in 1.12 and using packets fixed it but now i cant seem to find the proper way of doing the packets.
so the answer is yes?
Disclaimer: This is not my upload in the attachment
https://imgur.com/X8LHUrU
this is the same issue im having but the forum post i got it from is a little outdated
and Olivo yes
i think the third block broken in the attachment is the best example of what im having
I don't see how packets would change anything
The method literally just sends a packet
I think the API can do exactly what you want without the flickering
im not 100% sure why it fixes it but in 1.12 thats how i fixed it and it worked perfectly
Try using https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Player.html#sendBlockDamage(org.bukkit.Location,float,int)
pass some random integer
The one with no entity parameter uses the player as the one breaking which might be confusing the client
this isn't what I want, re-read the question
thx! looks cool
WOW that simple changed fixed it. Thanks to everyone that was helping
completely unrelated off topic question that doesnt belong here but...anyone know how to stop intellij from freezing when it autosaves? Ive already increased ram
Does anyone know to make a fastbridge plugin like mcplayhd has
what exactly is fastbridge ?
Well, it's kind of a minigame where you have to bridge from one island, to another island, and between the islands is void, where if you fall off, you teleport to the starting island.
That sounds possible with a single command in a repeating commandblock lol
Ok but how can I learn it to do? Is there some kind of documentation?
logic for the plugin would be:
if player in area -> teleport, give items
do you know basic java?
Ye, classes, generics, packages ye
- Setup a maven project: https://blog.jeff-media.com/how-to-create-your-first-minecraft-plugin-using-the-spigot-api-and-maven/
- Check out the basic tutorials in the forums, e.g.
a. Listen to Events: https://www.spigotmc.org/wiki/using-the-event-api/
b. Creating a command: https://www.spigotmc.org/wiki/create-a-simple-command/
The rest is in the javadocs: https://hub.spigotmc.org/javadocs/bukkit/index.html
Well I want to make a 1.8.9 server, where the server is based off of that minigame, similar to McPlayHD's server.
That's what I want lol
My plan is, there will be a command where the player can join an island, for example: /fb join short,
Where the short argument is the mode of the minigame, and the gap between two islands is, as per the name, short.
But if the player does /fb join long, it would teleport to the long mode.
I have seen some worldedit schematic manipulation docs. But none of them have met my requirements, including the 'coding the plugin in 1.8.8 spigot'.
And whenever they execute the command, manipulating multiverse core, it would send the player to the island.
Oh?
I've never heard of that
Also is there a way where the player islands are parallel to eachother, in the sense that when they are bridging, they can also see their friends islands?
Like spawning the islands next to eachother in a specific gap
Is there a way to increment scoreboard critera like NMS does it with API?
CriterionTriggers.USED_TOTEM.trigger(entityplayer, itemstack); this is the NMS stufv
No you cannot trigger specific criterion
boo
Some of them are just statistics though so, bumping the statistic should work fine
lemme give a look
I think most of them are
this one is an advancement
but I think I can award that manually?
yes
Yeah, AdvancementProgress
I don't think that would work though because you're only able to award the advancement criterion, not increment its progress
So if you have like "mine 64 cobblestone", you can't +1 it
You can only give the whole criterion
๐
Ho Hello, I'm searching help for a bug of minecraft i've founded on the life bar of the player. Someone can help me ?
?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!
you rascal!
I'm checking to change the damage of an EntitydamageEvent but, i've made a mistake and my player is in the situation of constantly dying without health bar, and I want to change it (stop dying indefinitely and make my health bar reappeared).
1.8
It's not the code apparently, i've just set the damage to NaN, and the game didn't block it. It's beacause of this problem, i'm in trouble.
so u can just disable ur plugin and ur fine no?
Ok, I will try it
this one is old
I would go with this one instead
https://github.com/tryashtar/nbt-studio
in 1.20 for get an inventory title it'snt event.getView().getTitle().equals("Name")
because i'm doing it but nothing appen
?gui
XD and how can i do sry?
well read this
anyone got some next level cooding idea?
write an os
nah plugin themed for spigot or bungee
there is nothing next level about coding a plugin
unless ur making a /levelup command 
drop one
danggg thats craazy
but whats like the focus of that team like custom orders or what
tks
wow those are some varied fields of development
well thats not that top secret anymore now
and also not exactly an esteemed position
I mean I'll be very interested to see a bytecode obfuscator made from scratch with no libraries
ยฏ_(ใ)_/ยฏ
What would be the best solution for reducing the amount of networking while processing thousands of client side blocks. Everyone's ping goes bye bye when I set lots of blocks
I'm just doing player.sendMultiBlockChange()
how many blocks are you sending
and how often
cuz if you're sending like a couple thousand blocks every tick like yeah would make sense
can i change an interfaces methods access modifier?
no
well you can have private static methods but that's about it
why :(
because that'd be an abuse of what a Interface is
private methods have no place in design with interfaces
oh true, after thinking about this i might wanna have an abstract class
boooo ๐
why an interface is not made for my problem ?
well you have your reason
and this required 300k spoofed blocks for what reason?
okay, but why does the client needs to see 300k blocks?
So dont use packet blocks then? Lol
NO that's not the issue
i think you should try and reduce the amount of blocks
don't spoof 300k blocks at once lmfao
you should only spoof the immediate area around the player eye sight which would be at max a couple hundred or so
maybe if they're really getting in there a couple thousand
300,000 screams YOLO fuck you guys 
Oh yeah for sure
I'm just saying overall I'm setting 300K blocks and ik that's terrible lol
I'll prob just split it into multiple tasks for the client to process
You can send multiple block changes as one packet
And I am doing that
By doing player.sendMultiBlockChange(Map) although it still has to process all of them
Which is still sending 1 packet just its hella long prob
Oh gosh
Lmfao
Okay but that's not the multi block change packet
And I am doing that
By doing player.sendMultiBlockChange(Map) although it still has to process all of them
I'd guess it's still somewhat close to that unless there is some crazy optimization in size compression
I think either way you can't argue spoofing 300,000 blocks isnt completely ridiculous and needs to be revisited
Well, you save all the extra 4 byte length values + 4 byte packetIDs
Best here tbh is to spoof in the players pov so you'll have to do some raytracing and such
But it'll save you the burden of DDOSing your players
Alr
I'll do that
Or just dont use packets ig, not the end of the world but I'd much rather do it
๐
Ty
Mutli block change is apparently now Update_Section_Blocks
Yes
sendBlockChanges() will send more than one packet. I had it break up into multiple packets if the states span multiple chunks
sendMultiBlockChange() is Paper API btw, we have sendBlockChanges()
idk why. BlockState is just a BlockData with a position
But then I have to call getState!
chunk packet
Muh cpu cycles
Isn't HumanEntity a thing just because nms stuff?
Pretty much
mojank
Where EntityPlayer
ServerPlayer extends it, and it's what matches Player
Presumably there is also a client version on the client
You can create state objects now
BlockData#createBlockState()
Actually that state isn't bound to a location so it's not relevant nor useable lol
And there is no way to bind it
๐ฉ
At least we can add virtual entities to the world now
Yeah I still have to depend on Paper for what I need
Can't create my own block states
Custom biome api when :c
PR when?
Can't
I don't think MD would approve of
public static void unfreezeRegistry(Registry<?> registry) {
try {
Field intrusiveHolderCache = getField(MappedRegistry.class, Map.class, 5);
intrusiveHolderCache.set(registry, new HashMap<>());
Field frozen = getField(MappedRegistry.class, boolean.class, 0);
frozen.set(registry, false);
} catch (ReflectiveOperationException e) {
e.printStackTrace();
}
}
Lifecycle API, Bootstrap phase. ๐
If it's stupid and it works it's not stupid!
Yeah rewriting the plugin loader without breaking old plugins is... not easy
Sure we can just move plugin loading to be super early... but then plugins would explode if we init their main class that early
That's why then new plugins has a different loading conept. .)
You cannot depend on other plugins in the early stages. xD That' done onEnable
I mean I guess that could kinda work
But what if you want to do registry stuff based off another plugins registry stuff
Hmm, stuff that won't be supported.
What is the xy for that?
Devs like to do stupid things.
Basics has the best plugin loader
I'll load you
I s2g I go and check out if tis does anything interesting
a kotlins syntax wants me to purge my eyes out
This is readable ๐ฅฒ
please add a CommandSender.sendMessage(Message) extension instead of message.sendToSender(sender)
the urge to clone it and do some cleanup
It's readable bro
๐ฏ

Nah I don't like that syntax so I just don't use it lol
Do you do
var classLoader: ClassLoader? = null
try {
classLoader = ModuleJarClassLoader(file, javaClass.classLoader)
} catch (e: Exception) {
throw InvalidModuleException(...)
}
classLoader!!
Because if you do then you might reconsider the whole using kotlin thing lol
You can actually do Val with non null since the throw guarantees a return
Fair enough, still kinda eh
So you never need to check nullability
I don't think not liking one but of syntax should be a consideration on the entire language also
Nah I'm just comically exaggerating
There are things I like and don't like about Java likewise with killing
Ofc it's a preference thing but I'm powered by sarcasm and 4 hours of sleep
real kotlin fans do runCatching { ModuleJarClassLoader(file, javaClass.classLoader) }.getOrElse { e -> throw Exception("dead", e) } /s
This is ehat I do
It's really effective
๐ช๐ฏ๐
yeah it is but nothing wrong with using the try-catch either
I like that
make it lateinit
then it doesnt need to be nullable
Ask Paper
who tf is paper
The people who're developing Velocity
Join their discord and ask for help
I see, we have a new wave of people asking for help in a place that has nothing to do with the thing they are wanting help with >>
Do read the documentation first :p
ok
both will work
ok
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programmingโgreat for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! ๐
I recommend following more than one
how long do they take
As long as it takes.
probably didn't offer enough
or the idea is impossible to implement for 1 dev
wsg6uvfystgvusghsyssvysvsyt
or just impossible to begin with or just dumb XD
i am dumb
ok, that is fine, fortunately I guess you can acknowledge you are I suppose, the rules state others can't fix dumb but it says nothing about you fixing it yourself
so I guess there is hope yet
e
does any1 know why changing durability of an item would cause the texture to go all purple black blocky?
using this:
public static void damageItemInHand(Player player) {
ItemStack hand = player.getItemInHand();
int durability = hand.getDurability() + 1;
hand.setDurability((short) durability);
}
odd thing is, it only happens with items ive given the player, when i give myself an item using minecraft:give, this does not happen
not sure why you are using statics
guess we are back in the trend of people using statics everywhere >>
its a util method?
would you have me type this method out everywhere i wish to use it
looks a bit clumsy
but yea, suppose it might be of utility, tho I would rather call it a static helper method
I said I wasn't sure why, second static isn't the only way to access something from anywhere else
FileConfiguration regionsData = RPJobs.getPlugin().getRegionsData();
ConfigurationSection trashmanSection = regionsData.getConfigurationSection("trashman");
if (trashmanSection == null) {
regionsData.createSection("trashman");
}
List<String> regionIds = trashmanSection.getStringList("regions");
regionIds is null, how do i add stuff to the trashman section as a list
however, you are not the only one here lately that has issues with code, and ironically using a method that is static
i feel like this case is perfectly fine to use static
I didn't say it wasn't ๐
well ur kind of implying that with this right.
sure take it however you want, a trend is a trend whether you agree with it or not
lately there has been quite a bit of people who have issues with their code and it being static
yet im very sure it being static is not my issue
what i dont know is why it does happen
can someone help with this
haha yea, do u remember when I used to be like that?
No unfoturnately or maybe its fortunate that I haven't?
setList forgot you just use set
if ur trashmansection is null it creates the section but that does not set your trashmanSection variable
that is still null
ig
hmm well it was like 3 years ago frosty





