#help-development
1 messages · Page 1063 of 1
how can I convert an mp3 to ogg with java
not easily
I tried every way
just use a website to convert before you package it
I broke and apis are too expensive
What? There are free websites you can use to convert them
and free software too
yes but I need them to be on my plugins
you convert BEFORE you package. You do not distribute mp3
?paste
Im making a music playing plugins that download a video and convert it to audio then convert it to ogg witch I cant do
ffmpeg
ffmpeg is bae
https://paste.md-5.net/butajoxura.java can someone give me a hint as to why sendFile is erroring with
Error: Unexpected end of form
at Multipart._final (C:\Users\~\Documents\Discord Bots\resourcepackservermanager\node_modules\busboy\lib\types\multipart.js:588:17)
at callFinal (node:internal/streams/writable:707:12)
at prefinish (node:internal/streams/writable:719:7)
at finishMaybe (node:internal/streams/writable:729:5)
at Writable.end (node:internal/streams/writable:641:5)
at onend (node:internal/streams/readable:713:10)
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
I know the problem is with the format I'm sending I just don't know what format it wants
sorry I mean uploadFile it's line 43
sendSHA1 works so does sendStillAlive
how do I fix that ?
- META-INF/LICENSE.txt
- META-INF/NOTICE.txt
ffmpeg-6.1.1-1.5.10.jar, javacpp-1.5.10.jar define 1 overlapping classes:
- META-INF.versions.9.module-info
maven-shade-plugin has detected that some class files are
present in two or more JARs. When this happens, only one
single version of the class is copied to the uber jar.
Usually this is not harmful and you can skip these warnings,
otherwise try to manually exclude artifacts based on
mvn dependency:tree -Ddetail=true and the above output.
See http://maven.apache.org/plugins/maven-shade-plugin/```
[22:32:05 INFO]: [STDOUT] Writer's Content: --190b328f8f0
Content-Disposition: form-data; name="file"; filename="ResourcePackManager_RSP.zip"
Content-Type: application/zip
Content-Transfer-Encoding: binary
--190b328f8f0--
am I being dumb? seems fine (don't have the inputstream in there, I guess that could be it?)
what is the codec of ogg?
vorbis
I shall never understand why libraries put their license files in META-INF or in the root of their jars.
Don't they understand that shading is common practice?
To come to the question: You can define the maven-shade-plugin to exclude those files, supressing the warning.
Though regardless chances are you'll be breaking some license unless you manually put a replacement license in there.
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
anyone knows why i cant use 1.21-R0.1-SNAPSHOT?
besides having jdk 21 in my project structure, what else should i check?
for context.... im trying to learn and im trying to update a plugin
try that
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
?paste
i feel so dumb, i tried that like 5 times and never noticed the maven reload project, i mean i know i had to reload the proejct but i didnt even try from the sidebar icon
thanks btw
in that how can I set the ogg so minecraft can play it
https://paste.md-5.net/owiyusexiy.java
you can't
you have to put it in a resource pack and have the client download it
it should also be single channel not stereo
no I forgot how to sendRessourcePack
setRessoucePack
also I got this error s.schild.jave.EncoderException: Exit code of ffmpeg encoding run is -13
[00:02:43 WARN]: at ws.schild.jave.Encoder.encode(Encoder.java:647)
[00:02:43 WARN]: at ws.schild.jave.Encoder.encode(Encoder.java:490)
[00:02:43 WARN]: at ws.schild.jave.Encoder.encode(Encoder.java:354)
[00:02:43 WARN]: at ws.schild.jave.Encoder.encode(Encoder.java:321)
[00:02:43 WARN]: at org.liam.liamplugins.PlayMusicCommand.downloadAndPlayMusic(PlayMusicCommand.java:126)
[00:02:43 WARN]: at org.liam.liamplugins.PlayMusicCommand.lambda$onCommand$0(PlayMusicCommand.java:42)
[00:02:43 WARN]: at java.base/java.lang.Thread.run(Thread.java:1583)
So I'm guessing it'll be the year 20,202,020 when something about an experimental thing for spigot for the server.jar stuff is done? I get it takes time and y'all do this in your free time, but I didn't know it takes an entire month and still not even close to finished.
it's opensource you can finish it yourself
"not even close to finished" is also obviously a statement
it should be fairly stable, just some plugin compatibility breaking (maybe, if so, open issue) regarding the enum -> interface conversion

how i get worldmap instance by world name
hello
can anyone explain how the hell this is made
https://cdn.discordapp.com/attachments/1072217309852213298/1262105512053313546/Lunar_Client_1.21_v2.16.1-2428_2024-07-14_13-54-19.mp4?ex=669562da&is=6694115a&hm=a87019cfcb339f77b7c97a7a06c179c8627e15b928cf8887bcea13173c275461&
(i believe this doesnt use a rp but i could be wrong)
Probably display entities
wouldnt the client explode trying to render all of that entities
invisible item frames with maps?
how can I use local database?
If you use text displays and some trickery it’s way less
I am pretty sure you can do this with a basic-ass model and an animated texture
how can I code a economy system in my plugin?
"only"
why returns 0? i copied the code from default renderer map of spigot api
i want see how the spigot get a instance. how i use "ctrl shift r " on github?
spigot isnt on github
its on stash
?stash
and anything Craft prefixed would be in craftbukkit
breakpoints can be done seperated from hotswapping but its similar give me a few min and ill write it out
17
spigot 1.20 the link only
does anyone know how to make a falling block bounce off of a wall
it would still be in craftbukkit
spigot shades and patches it
its also on stash
ok thx
i need see bukkit code when instancies this class
can you help me with this?
im not gonna search craftbukkit for you, craftbukkit is a giant project
if you want that run buildtools and open spigot in intellij and use searching features there
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
yes
To hotswap download jbr and hotswap agent put hotswap agent in jbr/lib/hotswap
modify server startup to be jbr/bin/java.exe -XX:+AllowEnhancedClassRedefinition -XX:+AllowRedefinitionToAddDeleteMethods -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -XX:HotswapAgent=fatjar -jar Spigot-whatever.jar
in intellij create a debug run configuration and set the adress to 127.0.0.1
start the server and run the debug configuration
then modify code and press the hotswap keybind, default is nothing so just search for it and add one
sure
yes
ok
thx
this is all because I don't know what WorldMap expects in the string when creating this object
Ive done It using ant is this better?
its much easier with jbr
LOLLLLLLL
doest adding method works?
should do
How to remove the asterisk?
I have a question and a problem that when I try to drag the stacked items, it simply doesn't let me stack more than 1. How can I change this?
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
if (event.isCancelled() || !(event.getWhoClicked() instanceof Player)) return;
Player player = (Player) event.getWhoClicked();
PlayerInventory inventory = player.getInventory();
ItemStack clickedItem = event.getCurrentItem();
InventoryType.SlotType slotType = event.getSlotType();
if (clickedItem == null || !isArmor(clickedItem) || clickedItem.getAmount() == 1) return;
if (slotType == InventoryType.SlotType.ARMOR) {
ItemStack cloneItem = clickedItem.clone();
cloneItem.setAmount(1);
switch (event.getSlot()) {
case 5:
if (inventory.getHelmet() == null || inventory.getHelmet().getType() == Material.AIR) {
inventory.setHelmet(cloneItem);
clickedItem.setAmount(clickedItem.getAmount() - 1);
event.setCancelled(true);
}
break;
case 6:
if (inventory.getChestplate() == null || inventory.getChestplate().getType() == Material.AIR) {
inventory.setChestplate(cloneItem);
clickedItem.setAmount(clickedItem.getAmount() - 1);
event.setCancelled(true);
}
break;
case 7:
if (inventory.getLeggings() == null || inventory.getLeggings().getType() == Material.AIR) {
inventory.setLeggings(cloneItem);
clickedItem.setAmount(clickedItem.getAmount() - 1);
event.setCancelled(true);
}
break;
case 8:
if (inventory.getBoots() == null || inventory.getBoots().getType() == Material.AIR) {
inventory.setBoots(cloneItem);
clickedItem.setAmount(clickedItem.getAmount() - 1);
event.setCancelled(true);
}
break;
}
}
}
oh god discord is starting to burn into my 4th monitor
saved, thanks random 9 hour long yt video for avoiding lcd burn-in
4 monitors is crazy
used to be 6
but then they started making much larger monitors
I hope it will be 1 monitor within the next 15 years, and I'll switch to vr goggles
what the fuck
why not swap to vr now
join the meta verse
because the tech isn't there yet
there's a really interesting headset coming out in a few months though
probably the most interesting in years
name?
that seems weirdly small
the dream is having them as large as normal sunglasses or so
im guessing its fully pc controlled
yo 6 monitors help my mans
yes
not even wireless
also requires controllers, they don't sell any, and lighthouses from valve
kekw
they're not for an avg consumer, really they basically made these just for me
just for you
they require a face scan because the face place it 3d printed for your face specifically
they require you to basically already own some generation of a previous valve vr headset which I do
it's stupid expensive, like nearly 3x more than what meta is doing
and it requires a beast of a pc to use
i dont think vr is at a point where it could replace my monitors comfortably
hurts my eyes after a few hours
there's two major problems, comfort and resolution
in the earlier vr generations the resolution just wasn't good enough to realistically replace a monitor, plus with the distortion it just made text hard to read in general
plus it is a heavy and hot thing you strap on your face which after even a single hour can already have you itching to take it off
yeah definitely
I'm not saying this solves it all, I don't think forcing using a cable is realistic plus the resolution is a huge leap from previous generations but still not what it needs to be for actual work imo (though I haven't tested it, on account that it isn't even out yet)
but it's the first vr headset that I feel I've seen actually tackle things with actual practical long-term use in mind
the vision pro was the complete opposite, they went out of their way to make it huge and used heavy materials just to get a premium look
yeah 127g is genuinely starting to get there
yeah the vision pro had the right idea but absolutely wrong execution
like it was to be expected from apple, but no third party xr support
is dumb
the heaviest standard sunglasses you can buy are at around 50g, for reference
just for normal sunglasses
I don't think the vision pro had a single good original idea tbh
more so the quality of how they did it
pass through is amazing
picture quality is great
sure, it's an extremely expensive execution of an ill-concieved concept
I wish I could try that headset
I'd be tempted to buy it if it feels good when in use but I don't feel like dropping that much cash just to try it
its good, but the novelty wares off after a few hours
then it's just an expensive movie watching device
ah
it's about $1400 here
you've tried vr before right
I'm yet to be compelled enough to use a vr headset for productivity
My project for the first half othis year was all vr related and i got really sick of the headset in the first 2 weeks of using it
there's only one thing I liked doing with it which was previewing 3d models I was working on with it but the htc vive is so insanely bulky it's not fun at all to try to keep putting it on and off as you're working on stuff
there was a strap concept that was really neat where you could just flip the headset up kinda like the night vision goggles of the army
I think if I was to use it consistently for actual work I'd probably want something like that
the vive is waayy to bulky for me to use often
same
quest 3 is pretty good, but still gets heavy after a while
I have every port of my gpu in use since I have 4 monitors so I extra don't feel like redoing wiring just to throw something vr-related on
but get me something with the bigscreen beyond format and weight, make it wireless and suddenly I will be very interested
you can also do what apple did to cheat battery life, I don't mind having a battery bank in my pocket
I'd rather have the battery in my pocket than on my face
get a second gpu for the purpose of more monitors
I used to do exactly that
but like I said monitors got bigger
there is no longer a point in me doing that
I'm sure you've seen pictures of my setup
I'm sure I don't care
nah
what, the chicken place is back from holiday?
been back for a month
did you go there on day 1 to eat a month's worth of chicken
no
yeah right
What’s the issue with chicken?
speaking of, smoothie time
how do i flip a vector offset from a direction to another direction? so if the vector is facing west and the values were (1, 1, 1) i say make it east it'll return (-1, -1, -1)
idk if that made sense
multiply by -1
if it's normalised, it should work
it's really precise so i cant really normalize it
No need to normalize, just multiply by -1
Have you done some basic algebra?
as i said thats only for west to east
if you just want to flip the cardinality you need to get the identity then multiply by -1
i know i can multiply it by -1 to flip it
https://gyazo.com/ff2805b4cf45a567f3ae7260ddee204c
rolyn look at this wild thing I accidently made lol
i need to flip it in 3 directions not 1 tho
multiplying by -1 makes north south, south north, east west, west east
And now you can make immersive portals congrats! (https://www.curseforge.com/minecraft/mc-mods/immersive-portals-mod)
I'm having an issue like this right now actually
ok
flipping implies it's binary
If what you want is get the opposite direction of a given vector by keeping its magnitude, multiply by -1 is enough. If this is not what you mean please be precise
I mean, it's not very pretty but per messing up geol's suggestion I created that weird 3d visualization thing
i want the opposite direction and north and south
That's why display entity would have been much easier ! Just apply size transformation and then you just have to teleport the entity to place it
so you just want to rotate it 90deg
kek yeah as opposed to doing this magic line stuff
correct?
if tahts the case just apply a rotation matrix
wait Vector comes with a built in rotate around method
Anyway got the schematic pasting into the correct location now, though I'm still having issues with the visual overlay dependent on players current view (direction), there are cases in the west/north direction where the visual overlay is placed closer to the player than it should be ie:
https://gyazo.com/3e669edde61ab5e72b446f351b617c95
As opposed to what it should look like:
Depending on the players current view direction, I either need to add / subtract from my x/z values to display this correctly right?
What you could do is just specify target location, and direction vector.
add the direction vector to the location to draw the line going further, and take the orthogonal vector to go to the right.
The direction vector should not be the one of the player, but the axis vector the closer to the one of the player (cosine similarity between (1, 0, 0), (0, 0, 1), (-1, 0, 0) and (0, 0, -1))
How to get the orthogonal: just rotate the direction 90d around Y
Or maybe more -90d if minecraft uses trigo rotations
Ok I'll play around rq
Recap:
- Get the closest axis vector with the player direction. Let's refer to it as
V - Rotate
V90 (or -90d) aroundY(0, 1, 0), referred asO - Start at the target location and get the lines to draw by adding
VandOto it. Just think it as a path to follow (firstV, thenO. restart from start loc +O, thenV. Then do the same with the start loc +Y) - Don't forget to multiply
VandOby width andYby height
Alrighty got it working!
Damn I am being a good math student today
Rolyn you're awesome thank you
Oops new bug
https://gyazo.com/58ad78d9e3608422f4e4eb459175d891
Only when facing north, all other paste locations are correct lol
So what's wrong when facing north?
Uh it seems like the paste location is rotated compared to the visual overlay
Rather vice versa tbf
Can I see the paste code ?
public void placeStructure(Player player, String schematicFileName, Location targetLocation, Location oppositeCorner) {
File schematicFile = new File(plugin.getDataFolder(), "StructureItems/" + schematicFileName + ".schem");
ClipboardFormat format = ClipboardFormats.findByFile(schematicFile);
if (format != null) {
try (FileInputStream fis = new FileInputStream(schematicFile)) {
Clipboard clipboard = format.getReader(fis).read();
World world = BukkitAdapter.adapt(player.getWorld());
BlockVector3 pasteLocation = BlockVector3.at(
Math.min(targetLocation.getBlockX(), oppositeCorner.getBlockX()) + 4,
Math.min(targetLocation.getBlockY(), oppositeCorner.getBlockY()) + 3,
Math.min(targetLocation.getBlockZ(), oppositeCorner.getBlockZ()) + 2
);
try (EditSession editSession = WorldEdit.getInstance().newEditSession(world)) {
Operation operation = new ClipboardHolder(clipboard)
.createPaste(editSession)
.to(pasteLocation)
.ignoreAirBlocks(true)
.build();
Operations.complete(operation);
}
} catch (IOException | WorldEditException e) {
e.printStackTrace();
}
} else {
player.sendMessage("Invalid schematic file: " + schematicFileName);
}
}```
Lmk if you want this in a paste
nah that's fine
Those little offsets on the vector3 might be the issue too
Though I need them, otherwise the paste location is off
Yeah what are those offsets lmao ?
So prior to not having them, it would paste in at the location (obv) but was off by those offset amounts
Simplest thing i thought was just add those to the paste location
You don't need them
You just forgot to clone the eye location when adding the direction * 5
Oh breh
Location targetLocation = eyeLocation.clone().add(closestAxis.clone().multiply(5));
So just this, and remove the offsets?
I think so
.
The paste location is still relative to the visual outline, it's just kinda bugging out
Yeah actually the issue might come from:
- you are manipulating the targetLocation often so somewhere you might unintentionnaly change it (since location are passed by and edited by ref)
- you need to rotate the schematic when pasting
It's just odd that it does the weird rotated paste only when viewing north
What you should do:
clean a lil your code, and try to make it easier
pass the locations by cloning them, and not directly giving them to methods
Also try to do some basic debugging to check the target location, the closest axis vector
I could pass cloned locations as well as return cloned ones couldn't I?
Btw you can get the closest vector by normalizing the direction vector and flooring x z and setting y to 0
Yeah, but I mean you do lots of manipulations of the location in between
Do you mean flooring in the way I already am with x/z? (any y technically yeah)
it's hard to evaluate if there is a mistake somewhere
N is the normalised direction vector.
The closest axis has coordinates (round(N.x), 0, round(N.z))
not flooring, mb
Ok gotcha
Yeah issues with deriving a region from a schem file then doing all this stuff kek
btw @agile anvil how similar would my structure be given I switched to text displays? I only ever put time into learning them in one project but that was a while ago, so I'm not sure if I still need to do the outline magic
You can remove all the drawLines, all the corner computations etc. You just have to spawn a blockdisplay or another display type and apply a transformation to it
Nice !
Handwriting is truly awful, but it’s really helped writing down structures of systems here
Why not use a proper mind map tool or something? 🥲
Hey man maybe I just appreciate writing and paper
One day that's not going to exist anymore and everything will be virtual
😦
doesnt sound normal, you sure normal man consented to all of this?
Writing on paper sheet is the best tool I have
^
Writing isn't normal????
NOT TO THAT
Man I have a stronger photographic memory than anything so writing things down helps a lot
This can be interpreted two very different ways lol
oops let me fix this
does everyone here just hate paper or something
No I was just joking about it
Paper people are cool
But we cooler (i wish at least)
Do you also remember things better when you write them down?
I do have visual memory indeed
Probably the only reason I even bother tbf
But what I like about paper is that there is nothing to block my thoughts
computer is taking more time and harder to transcribe all my thoughs. But if I need to organize things clearly I'll also do some other representations using computers
So dou ever draw/sketch code then? As a means to remember ur code?
I've my little pocket notebook for when I'm out and about and have (what I think to be) a great idea
lol okay
Wait you handwrite code?
It's rather pseudo
Yeah more or less
Idk where my pocket book went, but thats where I have my little pseudo code things
I take it with me everywhere I go incase I randomly have (what I think to be anyway) a great idea
damn, like I’d only use sheet of paper to draw uml class relations, solve algorithmic problems or math problems but thats that
I still do this
But I use printer paper
I design the structure in my (regular) notebook, and keep ideas in the pocket book
Solve math on this paper
I've always thought people who have whiteboards in their homes to be teachers
Maybe not a fridge whiteboard
But there's been a couple people with like full classroom whiteboards in their office room kek
Anyone know easy ways to make my plugin size smaller?
its currently 14mb which is huge, so i think im shading things wrong or something
Using Maven and IntelliJ
yea I mean u could use the libraries feature
To make the server download dependencies of urs at runtime
14mb dear god
and i am getting GIANT shade warnings too
teacher or just studied intensive maths.... But I prefer writing on print paper and overwriting changing color each time. Looks like hard scientific stuff
I dont know how to fix it though
Ru shading all of spigot or what lol
Theres a chance idk tho

Show us your pom
Yea no biggie problably
It's funny I asked for help with essentials one time, and got absolutely shit on there for using spigot kek
Yea they hate spigot
mine is 50mb
brother what
He like to make malware
dependencies {
implementation("org.apache.commons:commons-lang3:3.0")
implementation("dev.s7a:base64-itemstack:1.0.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
implementation("com.noxcrew.interfaces:interfaces:1.2.0-SNAPSHOT") {
exclude("io.papermc.paper", "paper-api")
}
implementation("com.noxcrew.noxesium:api:1.2.0")
implementation("net.radstevee:radlib:1.0-SNAPSHOT")
implementation(platform("io.github.jan-tennert.supabase:bom:2.4.2"))
implementation("io.github.jan-tennert.supabase:postgrest-kt")
implementation("io.github.jan-tennert.supabase:realtime-kt")
implementation("io.github.jan-tennert.supabase:storage-kt")
implementation("io.ktor:ktor-client-apache:2.3.11")
implementation("org.incendo:cloud-paper:2.0.0-beta.7")
implementation("org.incendo:cloud-kotlin-extensions:2.0.0-rc.1")
implementation("org.incendo:cloud-kotlin-coroutines:2.0.0-rc.1")
implementation("net.radstevee.packed:packed-core:0.3.1")
implementation("net.radstevee.packed:packed-negative-spaces:0.3.1")
implementation("com.github.sya-ri:kgit:1.0.6")
implementation("io.javalin:javalin:6.1.3")
compileOnly("com.viaversion:viaversion-api:5.0.0-SNAPSHOT")
paperweight.devBundle("net.mire.palm", "1.20.6-R0.1-SNAPSHOT")
}
``` big
What is your plugin even doing
dw about it
and he can't code in console
Hey at least I made a cool 3d representation of a cube in minecraft
yea that is pretty cool
brother discovered placing blocks
how far into java should i learn to start making plugins?
like should i learn basics on classes and how to make programs or is there more advanced stuff i should know?
No not really, fundamentals of Java and OOP is most important
OOP concepts like polymorphism, inheritance, objects, classes and encapsulation
Im taking a course and so far its tought me variables, classes and methods.
Java stuff like local/instance/static variables, classes, instance/static methods, primitive types and class types, new-keyword, understanding the structure of a class, class constructors etc
love how the new keyword is on there
i genuinely haven't used it in a year
Buddy is not keen on reinventing the wheel apparently
Why create new objects when you can just use provided ones?
never said i wasn't creating them
Does kotlin have new?
nope
oh no wonder
Do you use kotlin?
Ha
and i love it
I don't like kotlin tho
beat ya
my phone is slow
Non apple user smh
And that's why I beat you to the kotlin gif :p
Android uses kotlin
Rad's busy making the next hypixel right now
no not the next hypixel™
Radpixel?
loudly crying face emoji
are you talking about this
fun registerEventFonts(vararg offsets: Double): Map<Double, UIFont> = buildMap {
offsets.forEach {
val offset = 19 + it
val backgroundOffset = -10 - it
put(it, object : UIFont {
override val packedFont = pack.addFont {
key = Key("mire", "beaver_offset_$it")
ttf {
key = Key("mire", "beaver_upper.ttf")
shift = listOf(0.0, offset)
size = 16.0
oversample = 17.0
}
bitmap {
key = Key("mire", "gui/overlay/background/notification.png")
ascent = backgroundOffset
height = 13.0
chars = listOf("\uE000")
}
}
override val glyphWidths = Fonts.BEAVER_UPPER.glyphWidths
override val registeredSprites = listOf<RegisteredSprite>()
})
}
}
i should make the shift a pair instead
which bit of the syntax
What even is "it"
it's the default variable from a lambda
like, map, forEach, etc
you can rename it
it is pretty cool once you pair it with the stdlib
val glyphWidths = fontGlyphs.associate { it.char to it.width }.toMutableMap().apply {
set(' ', values.first())
}.filterKeys { it.code > 0 }.toMap()
Reason i like java is because of how verbose it is
kotlin can be verbose
It's easy to jump in and figure what's going on
if you want it to
intellij always shows you what it is
i have an even more confusing snippet
override fun run(remainingArgs: List<String>) {
val fontName = remainingArgs.firstOrNull() ?: run {
log("No font provided!", LogType.ERROR)
return
}
val dir = File("fonts", fontName.replace("_bold", ""))
val jsonFile = File(dir, "$fontName.json")
val json = jsonFile.readText()
val font = Json.decodeFromString<FontMetadata>(json)
val fontGlyphs = font.glyphs
val glyphWidths = fontGlyphs.associate { it.char to it.width }.toMutableMap().apply {
set(' ', values.first())
}.filterKeys { it.code > 0 }.toMap()
log("Found ${glyphWidths.size} glyphs for font $fontName", LogType.INFORMATION)
log("Glyph widths for $fontName: $glyphWidths", LogType.INFORMATION)
log("Generating kotlin map code...", LogType.INFORMATION)
println("buildMap {")
println(
glyphWidths.toList().split(4).joinToString(
separator = "\n ",
prefix = " "
) { entries -> entries.joinToString(separator = "; ") {
"put('${if(it.first in listOf('\'', '\\')) "\\${it.first}" else it.first}', ${it.second})"
} })
println("}")
}
How does one even choose Kotlin vs Java?
thank god this is just a script in our scripts repo and not something to our main repo 🙏
a friend introduced me to kotlin
so i converted our codebase to kotlin
loved it
damn
imagine code reviewing this
I'll just give my demission letter
lmao
I usually stick with what works without complicating stuff
do you happen to be familiar with httpurlconnection
I'm about to give up on this thing and just go use some actual library for this
familiar with what exactly?
HttpUrlConnection, specifically to send large files
i mean whats the issue exactly
?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!
get ?ask'd haha
I already asked earlier, it's still the same issue as here #help-development message
aaaand the apache httpclient doesn't seem to like my java version
well then
either that or the shader doesn't hmm
oh it is the shader, man I don't remember how pom works after so much time working with gradle
Lol
i have problems with my code
import org.bukkit.Color;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.projectiles.ProjectileSource;
public class ArcherClassEffect implements Listener {
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
public void onPlayerDamageByArrow(EntityDamageByEntityEvent event) {
Entity damager = event.getDamager();
Entity victim = event.getEntity();
if (damager instanceof Arrow && victim instanceof Player) {
Arrow arrow = (Arrow) damager;
ProjectileSource source = arrow.getShooter();
if (source instanceof Player) {
Player shooter = (Player) source;
Player damaged = (Player) victim;
if (shooter.getInventory().getHelmet() != null &&
shooter.getInventory().getChestplate() != null &&
shooter.getInventory().getLeggings() != null &&
shooter.getInventory().getBoots() != null) {
LeatherArmorMeta helmetMeta = (LeatherArmorMeta) shooter.getInventory().getHelmet().getItemMeta();
LeatherArmorMeta chestplateMeta = (LeatherArmorMeta) shooter.getInventory().getChestplate().getItemMeta();
LeatherArmorMeta leggingsMeta = (LeatherArmorMeta) shooter.getInventory().getLeggings().getItemMeta();
LeatherArmorMeta bootsMeta = (LeatherArmorMeta) shooter.getInventory().getBoots().getItemMeta();
if (helmetMeta != null && chestplateMeta != null && leggingsMeta != null && bootsMeta != null) {
if (helmetMeta.getColor().equals(Color.GREEN) &&
chestplateMeta.getColor().equals(Color.GREEN) &&
leggingsMeta.getColor().equals(Color.GREEN) &&
bootsMeta.getColor().equals(Color.GREEN)) {
damaged.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 600, 1));
}
}
}
}
}
}
}```
the potion effect isst working
?paste
bruh its not that long
it is on mobile
you have like 7 nested if statements
do a print and see if the if is executing
ok fourteen buddy
when you use your phone, the first thing you think is lets help spigot kids?
genuine question
i'm bored wtf do you want
||go find them girls||
ok
Wasn't rad gay?
Well, who doesn't enjoy some boob physics
wha
?paste
lol
https://paste.md-5.net/niyawecugo.xml did I drink stupid juice today or something, why am I getting unsupported class file major version 66
anyways, back to my disassembler
server running old java?
no it fails to compile
how can i do it?
how can you do a print?
specifically the build part fails
Bukkit.broadcastMessage
Maybe incompatible java-maven/Gradle combination?
figured it out but I'm still getting the same unexpected end of form this is weird
@odd gulch My bounty, Skript, was removed, but it was 100% made by us. And it got huge downloads.
oh heck
I finally did it
cool
we got the, number one victory royale, yeah fornite we about to get down
I haven't played with terrain generator since 1.15 so I guess there might be some changes. Is it possible to edit the vanilla world generator easily in 1.21 or is it still a pain that requires so many injections?
ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(this, "diamond_sword"), new ItemStack(Material.DIAMOND_SWORD));
recipe.shape(
" D ",
" D ",
" D ");
recipe.setIngredient('D', Material.DIAMOND);
Bukkit.addRecipe(recipe);
``` why it wont let me craft diamond sword with 3 diamonds in middle
tutorial guy did same code and it worked for him
show the entire class
other then it having the underscore in the shape, it looks fine to me
could maybe be the key's name??
that was misclicked while copying
i tried it by adding gold block istead of space keys before and after diamond and it was working
empty ones dont work
according to a post in 2015 "It will only work if there is not already a recipe for that type of item. Since you can already craft golden apples, it doesn't allow it."
which doesn't sound right
that's old
things changed
how's tutorial guy's recipe working then
he didnt use any extra code to remove previous recipe
what do you have so far?
and why do you need httpurlconnection?
hi
someone can help me why the armorstand dont moving? ```java
private void CsulaKardInteract(Player player) {
Location eyeLocation = player.getEyeLocation();
Vector direction = eyeLocation.getDirection();
Location spawnLocation = eyeLocation.add(direction.multiply(1.5));
ArmorStand armorStand = (ArmorStand) player.getWorld().spawnEntity(spawnLocation, EntityType.ARMOR_STAND);
armorStand.setInvisible(true);
armorStand.setSmall(true);
armorStand.setGravity(false);
armorStand.setInvulnerable(true);
ItemStack slimeBlock = new ItemStack(Material.SLIME_BLOCK);
armorStand.setHelmet(slimeBlock);
new BukkitRunnable() {
@Override
public void run() {
if (armorStand.isDead() || !armorStand.isValid()) {
this.cancel();
return;
}
Location location = armorStand.getLocation();
if (!location.getBlock().getType().isAir()) {
armorStand.remove();
this.cancel();
return;
}
for (Entity entity : armorStand.getNearbyEntities(0.5, 0.5, 0.5)) {
if (entity instanceof LivingEntity && !entity.equals(player)) {
LivingEntity target = (LivingEntity) entity;
target.damage(20);
target.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 100, 1));
armorStand.remove();
target.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, target.getLocation(), 1);
this.cancel();
return;
}
}
armorStand.setVelocity(direction.clone().multiply(1.0));
player.getWorld().spawnParticle(Particle.SLIME, armorStand.getLocation(), 5);
}
}.runTaskTimer(this, 0, 1);
armorStand.setMetadata("csula_kard_projectile", new FixedMetadataValue(this, true));
}```
is the runnable executing?
It's fine I resolved it with apache
yes its executing
up to the setVelocity line right
ironically I would have probably recommended using apache
test it like this its okay? player.sendMessage("asd");
armorStand.setVelocity(direction.clone().multiply(1.0));
player.getWorld().spawnParticle(Particle.SLIME, armorStand.getLocation(), 5);
yeah thats fine
if (entity instanceof LivingEntity && !entity.equals(player)) {
LivingEntity target = (LivingEntity) entity;
target.damage(20);
target.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 100, 1));
armorStand.remove();
target.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, target.getLocation(), 1);
this.cancel();
return;
}```
this return is intended right?
?
yes its executing too
oh its because it has no gravity
okay i test it
Can i somehow disable that player needs permision to see some messages? Like not global but from sending message by command
can you elaborate?
your question doesn't really make sense
yes its working thanks+
there is a way to apply velocity on an entity with no gravity but it requires nms iirc
I figured that's how it was going to pan out and that I just had to stop being lazy
anyone got a list of all the predicates that can be used in resource packs for items? like custom_model_data and time
to do with item properties maybe
ah there you go thanks
Like player need permision to see chat
so you want to disable chat for a player if they don't have a perm?
does somebody code with intellij?
I just set up a new Spigot project and added a server file so i can test and debug the plugin faster. This worked well, there is just one big problem if i try to make inputs in "Run" which is the console, like testing commands or op someone, nothing happens. I cant do any inputs in the console with intellij. But if i start the server itself without Intellij, and the normal console starts, everything works fine.
Does someone know how to solve this issue?
90% of people here yes
run is output, not input afaik
How did you setup the run ?
Can you share a screenshot
this pretty sure
just run it in your terminal
Hello
Guys im trying to find a good Knockback settings for 1.8
Anyone can help me?
then that means that you're trying to enter a premium server
ANYONE KNOW HOSTING FOR TLAUNCHER MINECRAFT MULTIPLAY
don't ask that here, wrong channel
i'd recommend buying mc as it will probably be more worth than paying for a hosting service...
how do i run it in the terminal?
it's... beautiful
well this works wonderfully, I love that for me
how can I get the IP of the server the plugin is running in?
ah just bukkit#getip
Pretty sure that can be fucky in containers
What you using the ip forv
I might just get it from the server, that's what has the data anyway
for the autohoster for the rspm
Cant just host from localhost?
no
Like its chat for admins and players cant see the messages that admins seens
Listen to AsyncPlayerChat event and change the recipients
Or re send it just to players with the perm
Thanks
hm fun question is there a way to get the port a server is running from
hmmm
or i can just do purely random uuids
that probably makes marginally more sense
yeah that way I'm really not storing any data
The exposed port? I dont think reliably
Unless you use some outside server
Bukkit.getIp().toString() maybe?
yeah way less bothersome if I just randomly assign a uuid when a server connects to my remote
and send that back to the server for it to know
The bukkit port can be different to the outside port
So bukkit methods are only useful locally
that way I don't have to worry about containers, ports or vps' or anything like that
YeH
pretty sure normal uuids make for valid http links right
no character breaking stuff in there
Yep
So you’re gonna have a remote dl server?
yeah
buddy
why can't I just tell people to merge their own resource packs
and host their own resource packs
and make their own animation software for models
That’s completely different
and make their own boss plugin
and make their own base voxel game that people can then modify
and make their own programming language that is definitely not fix for a voxel game
and make their own cpus from silicone they find at a beach
why do anything at all
Just give them a pile of rocks atp
give them? they can walk
Im just worried for ur server lmao
this is just one of the features, if it becomes to expensive I will gate it behind a paywall, if people are going out of their way to try to exploit it I'll just close it and everyone gets another fun lesson about the tragedy of the commons
I'm already designing it according to the appropriate EU directives that came to replace the safe harbor laws in europe
besides I'm pretty sure if it picks up any steam some vps provider will show up and tank the cost for a deal
it's not that demanding
How i can set the recipients i only see method getRecipents
Ur so nice to your end user
I would absolutely just make them host the dl server themselves
You can cancel the event and send each player individually
I want the installation experience of models to be you put the file in your server, reload the plugin and everyone immediately gets the pack with all things already accounted for
preferably including bedrock clients though some limitations will apply
But can i use event with command in the same file?
Admin uses command to send message for admins
you should make use of the chat channels
there is a conversation api that can facilitate this
then you don't have to worry about recipients and instead just add the people to the channel instead
sending a post request to a server every minute should be a basically entirely negligeable operation right
I don't like how frequent that sounds but on the flip side the problem is if I'm using uuids which I am I'm basically going to get a new rsp every time a server using this restarts
and I don't want to have a spare 3000 rsps just because a bunch of servers have been restarting
depends on the payload, but assuming it’s just a ping, yeah
largely depends on how large the request is
but in your cause its like a few bytes at most
so if we assume 1000 requests a minute, that is only 1mb at most
if the requests are just 1 byte or whatever, not that they are that small
so negligable yes but as long as the request size is small to begin with 🙂
Helppp! Some commanda even for ops doesn't work
Plugin commands
My plugins
/spawn /sethome doesn't work!
At how does that relate to the topic of this channel?
help, I've fallen and I can't get up!
can you make a plugin for me that will fix this
Litsrally novody in rifht chanel helps
and what makes you think the wrong channel is gonna help? 🤔
Oops, I don't make plugins
wow
does anyone know how to reduce plugin size? i'm new to coding and for some reason my plugin is 2mb when it has only like 2 commands in it
Don't shade dependencies that should not be shaded
well since this is only for development and you can't develop a fix I guess I'm doomed to just stay stranded on the floor forever
how do i know what should be shaded or not and how can i unshade?
So under maven use scope = provided where it makes sense and avoid api or implementation under gradle
Don't use the maven-shade-plugin or gradle's shade plugin
the documentation of what you're using should say it, and in doubt just don't shade it in
you'll get an error telling you the class is missing in case you guessed wrong
As a rule of thumb, if it’s not in your plugins folder, and not in spigot runtime, shade it
do i just delete the <plugin></plugin> to remove?
i get an internal error in game if i do that ^
Use <scope>provided</scope>
Yes
ohh
package it.mjicio.chunkutils;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.UUID;
import java.util.stream.Collectors;
public class ChunkUtils extends JavaPlugin implements Listener {
private WorldGuardPlugin worldGuard;
@Override
public void onEnable() {
// Verifica se WorldGuard è installato
if (getServer().getPluginManager().getPlugin("WorldGuard") == null) {
getLogger().warning("WorldGuard non trovato! Disabilito il plugin.");
getServer().getPluginManager().disablePlugin(this);
return;
}
// Ottieni il riferimento al plugin WorldGuard
worldGuard = WorldGuardPlugin.inst();
// Registra gli eventi
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onRegionEnter(RegionEnterEvent event) {
Player player = event.getPlayer();
ProtectedRegion region = event.getRegion();
// Controlla se il nome della regione contiene "plot"
if (region.getId().toLowerCase().contains("plot")) {
String owner = getOwnerOfRegion(region);
// Invia il messaggio nella action bar
sendActionBar(player, ChatColor.GREEN + "Sei entrato nel plot di " + owner);
}
}
RegionEnterEvent doesn't exist but Idk how to do this event in other ways.
is it okay that the plugin is that file size then? (with mongodb shaded in)
You can always use a runtime dependency
In your plugin config
okay :D and another question, is the plugin file size really matter or?
Imo not really
But depends who you ask tbh
Md would argue that it takes too much space on the spigot server tho
if you're developing more than two plugin you can shade all the stuff in one jar and can use it as a depend
and there is should be a option for minimizing it which is removes the classes which you didn't use
This is just a bad way of implementing runtime dependencies
what's the proper way
well there is the library loader
yes how would i like, instead of having to shade mongo 2 (or more) times, how can i do it 1 time for the next plugins i'll create?
Using spigot library loader
is there a guide for it?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Read the “libraries” appendix
that's cool, i was coding in 1.8 so i believe it doesn't exists at all 😄
do i put the library in every plugin i will be making?
Another reason not to use 1.8
So you put that library in your plugins.yml on every plugin that needs it then depend on it in a provided scope
So now your server will download the dependency ONCE for the whole server
Rather than having to shade the exact same dependency 5 times into 5 separate plugins
i dont think i can not shade mongodb
You can
The plugin.yml loads it into your servers runtime
The point of the library loader is to avoid shading jars
im making a plugin who uses the clasic Archer Class from HCF but if the leather armour is dyed like green color it gives poison to the victim, but the code isnt working, can i ger help with this?
how would i get like this: com.squareup.okhttp3:okhttp:4.9.0
(thats from the guide)
Show your code
Groupid:artifactid:version
?pastecode
?paste
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
<version>3.11.3</version>
<scope>provided</scope>
</dependency>
``` so that would be `org.mongodb:mongodb-driver-sync:3.11.3` ?
I asked you before, did you try the print statement
Correct
i printed in other code, but it isnt bradcasting
Then your if statement isnt correct
Or your listener isnt registered
is registered on the main class
If you figure out which if statement isnt being fulfilled, you find your issue
tysm!!
You also have way too many nested if statements
ok
2nd argument is amount, yes
but really, yes, you can pull the 1.8 Javadocs from the Maven repo if you'd like, or compile them with BuildTools' --generate-docs arg
choco supporting 1.8???
he is a dev at hypixel
He knows the codebase of 1.8 better than mojang employees (maybe because they haven't worked with it for 10 years but who cares)
came across this 5 minutes ago on accident xd
Dual personality choco
I wonder how mych of hypixels api resembles spigot now
I'd hope little to none 
I doubt their api resembles spigots since they started from 1.7 and basically everything at this point is custom
wdym hypixel uses 100% command blocks
HELPP
What? No! They use admins who run all the commands on demand when it's needed
datapacks only 
WHY THE MAP NOT IS RED??
fuck, I have been exposed as a fraud
Why can't I get an instance of my Core plugin from my QOL plugin? ```java
public final class Qol extends JavaPlugin {
private Core m_core;
@Override
public void onEnable() {
// Plugin startup logic
m_core = (Core) getServer().getPluginManager().getPlugin("Core");
registerEvent(new HungerListener());
registerEvent(new JoinListener(m_core.getMapService()));
}
this is my code, but I get this error[14:39:48 ERROR]: Error occurred while enabling Qol v1.0.0 (Is it up to date?)
java.lang.ClassCastException: class world.ntdi.core.Core cannot be cast to class world.ntdi.core.Core (world.ntdi.core.Core is in unnamed module of loader 'Core-1.0.0.jar' @58a9a581; world.ntdi.core.Core is in unnamed module of loader 'Qol-1.0.0.jar' @cbd2947)
at Qol-1.0.0.jar/world.ntdi.qol.Qol.onEnable(Qol.java:16) ~[Qol-1.0.0.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288)```
you add core on soft-depend on qol plugin?
idk then
Ur shading it
hi. I want to create a stats system based on mode and stats. so, I created a map, but now I don't have any ideas how to put and load it from the database. for this I'm using ORM Lite.
@DatabaseField
private HashMap<ModeType, HashMap<StatType, Long>> playerStatsMap;```
In ormlite you can't use these advanced data types like hashmaps, you have to use ForeignCollections
everything is made out of tables
I've read the ORM lite docs. they have something like SERIALIZABLE. however, it doesn't load directly
well yes you can serialize a class
But your data looks very, complex, you may want to consider a nosql approah?
what do you mean?
Well you're storing a hashmap, that has a hashmap as the value, This could very well either be simplified two ways, with json/nosql or by making it a record with three fields that are enums and longs
then storing the records in a foreign collection will be much simpler
making a record would not be good for the server performance since every player has its own stats and the stats have different variations which uses more ram due to java objects.
then maybe you want to reconsider how you are structuring your data
I COPIED THE BUKKIT API AND NO WORKSSSSSSSSSS
wouldn't a table for each player that has all its values and stats be perfectly fine?
Load the stats when a player joins and unload them on quit
hi does anyone know about thirdparty yggdrasil?
Piracy is not supported here
not privacy
imagine server had 100 players. would it be okay if you had 100 tables as well?
no no no no
just 1 table, with 100 rows
and how many columns?
however many you need for storing all your data 🙂
im developing clientside anticheat which requires some tech from it for better security
Let me show you an example of what one of my plugin does
@topaz kestrel This is how I store all my player's talents or wtv
just a bunch of simple booleans
NOBODY KNOWS HOW TO SOLVE THE PROBLEM?
this can be integers, or anything else you want
what problem
that is what i was thinking about lol
I don't see why you need to mess with the auth system for that. Just send your own packet identifier
cuz im developing in pure c++ and my anticheat is a java agent
You can still send the packet?
NOBODY KNOWS HOW TO SOLVE THE PROBLEM?
its just about changing how youre storing data to match sql standards
if i dont do some workaround with the auth sys then the heckers might be able to bypass it by opening 2 clients. anticheat challenges will be done on the vanilla one
?
I don't see why two clients would break anything
All you need to do is grab the network connection that the client has and send a packet through it
they can still code a mod to mock anticheat's behavior
Is it possible (and safe) to switch to the main thread without the 0-1 tick delay BukkitSchedule#runTask gives. If it is, how?
That will always be the case with client code
NOBODY USES 1.8?
IS 1.20
No I wouldn't say so. If you're forcibly jumping back in to the main thread you don't know at what step it is and what it's currently doing
It will be quite unreliable
BUT IT'S THE SAME SHIT
bro chill the fuck out
chill?t
alright thanks, then I will just take the 1 tick delay L
the api is a shit
fds
po ikrkl
gringo fdpta
mamame as bolas
i love you gringo ❤️
sane reaction
voce e oq entao
They never were
yea
A benefit to the community for sure 
Hi I was just wondering what would be the best way to prevent players from breaking a specific structure for a minigame I'm making, while still allowing them to break/place blocks that they have placed.
fds

Well, depends on the structure
So two ways;
Track the blocks belonging to the structure
Or track the blocks being placed
Yeaa
You can do a combination of the two if you want 
fair
What might be the best way to track the blocks belonging to the structure? Right now I have it looping through the loaded chunks on a seperate thread (so the main thread doesn't get tied up) and added the blocks to an ArrayList which when someone tries to break it will check the list and allow/prevent depending on the location. Only issue is trying to get all blocks in a short period of time (so people can't break one right away and keep it) and if any entities spawns during the check it gives an async error since it's on another thread.
"The best way" depends on the exact use case and structure
Can't you use the blockbreakevent and check if the location of the block is in the list? Why do you have to loop through the loaded chunks
Also looping the world blocks sounds terribly inefficient
This ^
How would I get all the blocks in the structure in the first place to then prevent it? Manually adding in every single block location in my code seems less efficient then looping through the loaded chunks (at the beginning), adding all the blocks to a list, then when someone breaks a block, check the list if it exists.
Currently getting the existing blocks of the structure is the main issue
It depends, are players not allowed to break any block of the map at the beginning state or only certain parts
I currently have it that when the map loads it checks all the blocks in the map and saves them to a list, throughout the game they can break/place any block a player had placed, just not the ones the map spawned with
having it like this allows me to do multiple random maps with it being automatically detected on protected blocks, the only issue is getting the structure's blocks in a quick manner to prevent wait times
It seems like 1.21 broke a lot of plugins and datapacks
If it's possible to make the players only use blocks that aren't in the map, like wool it would be very simple. Or you could save the list to a database and get the blocks from the database in the future but that might be slower idk
but you said random maps so the second solution probably won't work
I guess the best method would be to just track the blocks the player had placed and add it to a list, and when they break a block, if it's not in the list, to not break it
as Olivo mentioned the two ways
Is there an entity teleport packet?
What makes the HashSet better for performance than a ArrayList?
also I am already using a HashSet, thought I did an ArrayList lol
HashSet on average uses the same amount of operations regardless of object
when might a HashSet be a better choice?
arraylist has to resize and shift its backing array a lot more internally depending on what u’re doing
ah
For small stuff
It doesn’t matter too much
Also arraylist is ordered by index (not to be confused with sorted)
hashset is not
And no duplicates if u didnt troll ur hashCode() and equals() implementation
But yea basically the hashset takes the hashcode from a given element, and finds the canonical remainder in modulo of the length of the backing array,
index = hash % arr.length
and this operation is constant nicely enough
(Obv you get collisions, but eh, its too occasional to care too much about)
I'm a good boy and make my hashcode return a random int between 1 and 1 billion
to modify the chat we have to use an event ?

im bad boy and return the added hashcode of all the stored objects
The hash set is just a hashmap with a constant value
That too
https://minidigger.github.io/MiniMappingViewer/#/spigot/server/1.16.5/AbstractDragonPhaseInstance I can't figure out anything, is this class in 1.16.5 or not?
but I can't access it.
Well well well
Could not connect to a default or fallback server. Incorrectly configured address/port/firewall? io.netty.channel.ConnectTimeoutException
because mojmaps arent used in spigot yet
use the spigot mapping
how? at the moment, I just have the spigot core built from buildtools included in the project.
on that site it has multiple different names for the cl ass
How can I check is the block is the player at is a block of a custom recipe?
AbstractDragonPhaseInstance is the mojangh mapping as shown before it
if you look down it has spigot which would be AbstractDragonController
where can I get bukkit source code
?stash
Is it possible to gather input from command block?
Is your server configured correctly? Verify it.
thanks
I've done it a lot of time, and I've done it that way itself this time too.
Is the firewall correctly configured?
Also use #help-server
no
only blocks with TileEntities have a PDC
you have to store in the chunk for normal blocks
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
Hey, is there a common reason why BukkitRunnables would generate NoClassDefFoundErrors at runtime only sometimes?
No
worth a shot...
The most common is updating yoru jar with the server still running
I thought of that, but I restart the server everytime I make an update. It works for hours sometimes without issue, but occasionally (like 1% of the time) it'll crash and give me that error
restart or reload?
i'm waiting for it to happen again so I can send it
Could just look in the server logs
ok, I pasted it into the link you sent
If it looks weird, I used a try/catch statement, but I still print the stacktrace
No way to tell from that
okey, the data will be stores also when the server reload?
thats pretty much unreadable. use a normal stacktrace
Ya i know sorry, i'm working on it
alright I found an old one. Strangely enough this one has nothing to do with a BukkitRunnable
https://paste.md-5.net/uwopafaceh.cs
But it's the same error I believe
Yeah, stop replacing teh jar live
when you replace teh jar with the server running and call reload it really messes up the class loader.
you end up with old and new classes referenced
I understand how that would cause the error, once in a blue moon I must've forgotten to restart the server after making a change (I output the jar directly into the plugins folder)
I heard there's a way to make an update folder? I wasn't sure if that would help though
shut down server, build and replace jar, restart, contemplate life for ~10 seconds, spam join
easiest way
idk mine won't even let me replace the jar if the server is running
maybe a gradle thing?
idk how it works on maven
me neither tbh, I followed guides, and the guide used maven
I now know, I do not like maven
then like you said just make sure the server isn't running when you're changing shit
alright thanks!
btw, I heard something about making an update folder and compiling the jar there? does that automatically work or do I need to make my own script to make that work?
yes update folder works
great, thanks again!
many plugins are written so bad they corrupt on a reload
I personally reset my plugins on disable
static references and class paths
releasing static reference is not easy for a reload
or better said, easy to mess up
Does it throw away all registered services? (The interface)
I have no idea how I missed that, thanks
there is a PlayerInventory but is there maybe a PlayerHand
Player#getItemInHand
thats deprecated
PlayerInventory#getItemInMainHand/OffHand
^^
thanks emily
fun toNMS(c: CustomPhase): AbstractDragonController {
return object : AbstractDragonController(this) {
override fun getControllerPhase(): DragonControllerPhase<out IDragonController?> {
try {
val create: Method = DragonControllerPhase::class.java.getDeclaredMethod("a")
create.setAccessible(true)
return create.invoke(null, this.javaClass, c.getKey().key) as DragonControllerPhase<out IDragonController?>
} catch (ignored: java.lang.Exception) {
}
return DragonControllerPhase.HOVER
}
override fun d() {
c.start()
}
override fun e() {
c.stop()
}
override fun a(): Boolean {
return c.isSitting
}
override fun b() {
c.clientTick()
}
override fun c() {
c.serverTick()
}
override fun g(): Vec3D {
return Vec3D(-509.0, 9.0, 1173.0)
}
override fun f(): Float {
return c.flyingSpeed
}
}
}
fun setCustomPhase(c: CustomPhase) {
val nmsPhase = toNMS(c)
try {
DragonControllerManager(this).setControllerPhase(nmsPhase.controllerPhase)
} catch (ignored: IndexOutOfBoundsException) {
}
}
fun spawn(): Entity {
val entity: Entity = this.bukkitEntity
val craftDragon: EntityEnderDragon = this
health = 80.0f
yaw = -90.0f
MobWars.entities[bukkitEntity.entityId] = bukkitEntity
setCustomPhase(CustomPhase(entity as EnderDragon, NamespacedKey(MobWars.instance, "dragon")))``` what else should I do to finally get the dragon to fly to the right coordinates?
Hello, I want a code for no damage item in hand and armour player.
any helping??
any helping??
You know java?
yes but he not working
package me.m3zof.hybloodpvp.System;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerItemDamageEvent;
import org.bukkit.inventory.ItemStack;
public class ItemDamageListener implements Listener {
@EventHandler
public void onPlayerItemDamage(PlayerItemDamageEvent event) {
ItemStack item = event.getItem();
if (item != null && item.getType() != Material.AIR) {
// Check if the item is in the player's hand or armor
if (isInPlayerHandOrArmor(event.getPlayer().getInventory(), item)) {
event.setCancelled(true);
}
}
}
private boolean isInPlayerHandOrArmor(org.bukkit.inventory.PlayerInventory inventory, ItemStack item) {
// Check main hand (1.9 and later) or hand (1.8.9)
if (inventory.getItemInHand().equals(item)) {
return true;
}
// Check armor slots
for (ItemStack armorItem : inventory.getArmorContents()) {
if (armorItem != null && armorItem.equals(item)) {
return true;
}
}
return false;
}
}```
why not just give it the unbreakable tag
what version btw?
yes
spigot
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta
i use 1.8.9
spigot
1.8.9 doesnt exist as a spigot version
1.8.8*
because 1.8.9 is a client only version