#help-development
1 messages Β· Page 1083 of 1
you do whatever works π
alr
just remember its in Radians
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
i always wanted to do something like this, but i didn't see the point
The authentication servers are down
that means?
This is a Mojang/Microsoft problem not much you can do
Just wait for them to fix it
what happens to the Player instance when a player goes offline?
ehh
In short, when an object loses every reference to it, it (eventually) gets garbage collected
ig you hold on to it, not much
The reference goes stale. ie its no longer referenced by Minecraft so you holding it is pointless
Now, references to objects are held when you're for example, storing an object on a list or using it in a method
When you're holding a reference to an object for longer than the object's lifetime we say you're having a memory leak
As that object is being (pointlessly) kept in memory when it shouldn't
So you need to make sure you remove every reference when the object gets invalidated, by for example, removing player instances from all sorts of collections and cancelling any tasks that have the player as a runnable
This will leak:
public void startTask(Player player) {
Bukkit.getScheduler().runTaskTimer(plugin, () -> {
Location playerLoc = player.getLocation();
if(playerLoc.getWorld().getName().equalsIgnoreCase("spawn")) {
plugin.getLogger().info(player.getName() + " is at spawn!");
}
}, 20L, 20L);
}
Hey there. Is there a way (besides storing entity UUID values in a Config file and then retrieving them each time) to recognize if an entity has been made by a specific plug-in?
Oh, thank you
Simple example:
- Have an "entity template" system that applies components to a given entity (let's say that when left-clicked sends a message)
- When applying a template to an entity, save the template id in a list in PDC
- When the entity is loaded, check the template list and re-apply the templates
p much how I achieved permanent components on the custom entities at work
you won't find this thread on google since it got old
?pdc
what, memory leaks exists in java?
They do
no, they exist in your code
Memory leaks exist in every language
i mean they don't exist in java as they exist in C, but it just means your code is ass
C stands for "your Code is ass"
C stands for ass
Even in human language!
... those moments you are looking for a word, but your memory has leaked π€‘
java stands for both but has an L in the middle
but thing is, does the Player instance becomes valid again if a player logs on once again
no
and what will happen if i call methods inside a Player instance where the player has gone offline
will it throw error or will it do nothing
Depends on the method
β¨ mystery
how do i make a display entity (that is riding a player) always be infront of the player
you don't really wanna find out either lmao
teleport method or sendMessage method
why not
just don;t hold invalid references
nothing is gonna work
Mem leaks
but whether it no-ops or throws an error is unspecified
WeakReference woo
WeakHashMap if using a map data struct
I've actually had crazy overhead by using entity.getLocation().distance
or a weakhashset using Collection convert to set
Instead of creating a vector using getXYZ methods which are paper only :( and doing distance directly
Solid 2/3rds of the performance was going to creating new world references and doing world equality check
getDirection and apply to Translation
PRs are open
who no why i cant download
[--nogui, --rev, 1.20.4, --output-dir, F:\server\1.20.4]
Loading BuildTools version: git-BuildTools-5411f5b-186 (#186)
Java Version: Java 21
Current Path: C:\Users\KroAzi\AppData\Local\Temp\66978217-acad-40c4-bc9a-aec9642956b7_archive.zip.6b7\archive\target
*** Could not find PortableGit installation, downloading. ***
Starting download of https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.1/PortableGit-2.45.2-64-bit.7z.exe
It's always been here without downloading
try again with the jar
this is BuildToolsJar
that looks like the UI version
tray exe to
My Arch Linux is crashing sometimes and there's nothing I can do... does anyone know what could happen?~
yes ui
?paste the full log
I can't find a jar that doesn't build with a gui
?bt
this log is all
- this is spigot help-dev
- if you have no idea how to use linux stop using arch
- you should know how to debug stuff yourself if you're using arch
just use ubuntu or pop_os, lol
this is exe is BuildToolGUI
they wanted the "fastest for coding", somebody said arch, they immediately started installing it kek
lol

cant this is 404
gotta get that real arch experience
arch >>>>
shut up pls
(i somewhat know what i'm doing)
If the operating system crashes out of nowhere, it's not the user's fault but the system's fault lol
Even my mother understands more than you, brother
damn bro i'm sorry
After downloading, Run is still a GUI build tool
then why are you asking help here?
run command line
isnt this a spigot help server?
java -jar BuildTools.jar --rev VERSION
java -jar ...
it sure is
java?
oh lol
Funny person doesn't understand Arch Linux then π€‘
wym?
F:\server\1.20.4>java -jar "BuildTools (2).jar"
[]
Loading BuildTools version: git-BuildTools-3591c95-170 (#170)
Java Version: Java 21
Current Path: F:\server\1.20.4.
*** Could not find PortableGit installation, downloading. ***
Starting download of https://github.com/git-for-windows/git/releases/download/v2.30.0.windows.1/PortableGit-2.30.0-64-bit.7z.exe
Still stuck in the download PortableGit-2.30.0-64-bit.7z.exe
If you choose Arch Linux, you basically sign the small print that says "possible system instability, due to bleeding edge updates"
i use arch its usually windows fault still i dont even know fucking how lol
true lol
?paste the log
in teory if you open https://github.com/git-for-windows/git/releases/download/v2.30.0.windows.1/PortableGit-2.30.0-64-bit.7z.exe you get something?
I can download PortableGit-2.30.0-64-bit.7z.exe on github, but not with BuildTools
C stands for Carbs, the only long term relationship you'll truly be able to maintain
what error?
is ProtocolLib maven dependency for 1.21 out??
I can't find the 5.20 for some reason
ALL log
you need to save and post the link here
I dont know ,log.txt is null
download a exe
How do I post pictures
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
I may not have described it very well
Screenshot
read bot message
The other person not having a brain doesn't mean I know everything about an operating system lol
where
this?
yea
and from what I saw it's a problem with archlinux and not with my settings or an installation problem~
!verify
Usage: !verify <forums username>
several people report the same problem
they're just saying its not the right server to ask in
you using arch with no idea how to use it is the issue
!verify θζ΄Ύ
Could not find your SpigotMC.org account!
my archlinux works fine, thank you very much
its not a problem with arch
same
it'll be a problem with however u installed it
I don't use arch atm, but if I was, it would be running fine too (I guess) xP
^^^
that is not to say that your issue is unique to you and there aren't others who suffer from it
u just gotta trial and error tbh
also u gotta make sure u installed the right one from the right place
archinstall moment
This is the third time you're being rude and dismissive of people trying to help you.
!verify xuyan
Could not find your SpigotMC.org account!
so 99% of users install it on the wrong side
oh not just the third time buddy
???
@sharp storm go to #bot-commands
way way more
love myself some archinstall
!verify kroazi
A private message has been sent to your SpigotMC.org account for verification!
wym wrong side?
what kek
If you don't want help go to another server
ok
i wanto help but i cant post img
just click on the link in this message
then you're verified
This wasn't meant to you lol, it was meant to another person
You're fine
yeh u chill
I didn't judge that people were needy because of the people they block. Do you want affection, baby?
β¨ romance β¨
?
bro doesn't understand that this is not the right place to ask
go ask for help in the archlinux discord
he's not even making sense
yeah he loves me I need to look at him the same way
?
i really don't
btw guys is 1.19.4 a good version for development?
use 1.20.6, it's the latest stable
sorry thats a rly badly phrased question
no
You don't need to be ashamed to show your feelings in public
just use 1.20.6 or 1.21
is it difficult to transfer 1.19.4 code to 1.20.6?
has much changed
?
really depends what things are you using
i might be gay but please shut the fuck up π
good point
if you just use the api, there are a couple things you might have to change
if you use nms, haha good luck
that xd
mostly maths, particles, and custom item ability stuff
ok
hahahaha
ohhh shit lol
like items have components now
internals, net.minecraft.server
Unsupported Gradle JVM.
Your build is currently configured to use Java 22.0.2 and Gradle 8.5.
Possible solutions:
- Use Java 21 as Gradle JVM: Open Gradle settings
- Upgrade to Gradle 8.5 and re-sync
any idea
not api
e.g. the /give command has changed
im using java 22 and gradle 8.5
He's been like this all the time, how to solve it
bc ik resource pack stuff has changed quite a bit
custom model data is api, so idk why you'd use nbt for that
oh yeh my mistake
Everyone that needs/wants help create a thread for your issue
actually i dont use too much nbt
how many time is in that step?
ideally you would not use nbt at all
Use /thread name:something
i think i used it but it shouldnt be too hard to remove.
whats the biggest change?
nbt no longer exists in ItemStacks
from 1.19.4 to 1.20.6
basically
BuildTools stuck in downloading git portable for windows
It's been a long time
it looks to be starting the download. did you wait for it to finish?
but you shouldn't need to use NBT as there is api for pretty much all you need?
is that because not much itemstacks use nbt?
yeh good point
Please quote me when you reply to me, I don't know English, I don't know who you're talking to
im pretty sure eveyrthing can be done with the api now regarding items
δ»δΈδΌδΈθ½½
ohhh nice
but like
any server side/client side switch arounds?
He won't download it
ah k
I waited for half an hour
what if you try to download that from your browser?
https://imgur.com/a/pUhk3zs the crash reason was request timed out?
that stack trace says it's from a separate thread
you gotta look for the Server Thread
normally you'd just make a table to store your list
depends on how your data is structured
you sure you don't mean two tables instead of two databases?
two tables then
table for games, table for players, which store a game id
when you fetch a game and players, fetch from the game table and fetch all players with that game id
and an index! :paperuwu:
just use mongodb if you think this sucks
but mongodb sucks even more
well
just create two tables at this point
the sql approach?
then have a third table 
Game table
Player table
Table that stores mappings for player to game
π€·ββοΈ
^^
what how
that's what the 3rd table is for
the mappings table is a list on its own
it stores all links of games to players
playerid, gameid and maybe some extra data
nope
game id and player id would be unique combined
you can have multiple players per game:
- player: 1, game: 1
- player: 2, game 1
also multiple games per player
that will just be another entry
or neither
i mean yes
but they would both make a composite unique key
well, you can't
unique key != primary key
its just a composite primary key or whatever its called in english
you can have several unique columns, but only one primary column
uhh
nahh
could still use an index
well primary keys already have an index on them
also assuming youre not gonna hold millions of players
dbs are pretty darn fast if you set it up right
"if"
and you could also use something like redis if you need that extra boost
i mean yeah if you have a dogshit structure you're doomed lmao
uhh ye, dunno what youd need the index for in game players
Is this for BungeeCord?
Or are you only dealing with one server?
PRIMARY KEY(game_id, player_id) hmm?
so if I understand correctly health scaling is a custom spigot feature; it is not in minecraft's source code by default?
yes
org.bukkit.craftbukkit.v1_20_R3 is 1.20.6?
Is there any way to reduce the cost of setType?
purpur
im sry but thats spark from my friend
the server is doing nothing for 86% of the time lol
and most of the rest of the time is spent just ticking entities
its just a test server
is there a code to support hex color messages? Like &#ffffffHello
sure but the setType is only spending 0.1% of the tick time (including sleeping until the next tick, not of the mspt)
you could pass false as the update param, but, y'know, you're passing false to the update param, idk if you're interested in that
ok thanks
there is nothing to worry about, i'd worry if it was actually causing lag
/pastebin
?paste
?paste
How can i send a message with a built-in font that minecraft has? for example SMALLCAPS
or sα΄α΄ΚΚ α΄α΄α΄s
https://paste.md-5.net/joleperuse.java https://imgur.com/a/a5dCXy2 Why don't I see the armorstand?
what do you mean builtin fonts?
smallcaps is in the default font
by built-in fonts i mean fonts that are in the default game itself like SMALL CAPS or BOLD or so so
https://paste.md-5.net/joleperuse.java https://imgur.com/a/a5dCXy2 Why don't I see the armorstand?
small caps and bold text is in the default font
no need to repodt after TWO messages
https://paste.md-5.net/joleperuse.java https://imgur.com/a/a5dCXy2 Why don't I see the armorstand?
answer the question that is good nothing
thx
https://paste.md-5.net/joleperuse.java https://imgur.com/a/a5dCXy2 Why don't I see the armorstand?
https://paste.md-5.net/joleperuse.java https://imgur.com/a/a5dCXy2 Why don't I see the armorstand?
i know but how can i send a message with that message?
https://paste.md-5.net/joleperuse.java https://imgur.com/a/a5dCXy2 Why don't I see the armorstand?
so i cant do smth like json components?
no
you can
yo @ivory sleet it is the kid you banned before
i mean it has always been obvious but that's just so dumb lmfao
third alt btw
like, it's just regular text, just write the message text using those characters, no need for fancy fonts or anything
there's probably some "text to small caps" result on google you could use
proofs?
your screenshot
yea there is
accusing without proof is a sin
π
citation needed
getting banned and then having two alts to bypass it also ain't good buddy
doesnt seem like i can read the future can i?
the player is writing the message
or i can say Papi is
so they aren't plugin messages you send, you want to convert a player message to small caps?
oh boy just waiting for the next "Why can't I see the armor stand"
i'm not sure what you mean ngl
i already did it with custom resourcepack fonts
but i cant seem to do it with built-in minecraft fonts
but it boils down to having a Map, Pattern or switch expression that converts the String chars to their small caps unicode codepoint
replaceAll or whatever suits you
why tf is your debug line in portuguese
it's not mine ok
it's that gongas kid whose third alt just got banned
he was reposting the message after like 2 messages so yea
I Wanted to use maps but dont seem to underestand it properly
resells premium plugins for half the price
small caps is uh
not really a thing
ppl use custom fonts or weird unicode for that
π what do you mean π
...it is
What are you trying to achieve?
i mean yea
CustomFonts Expansion Remake :troll_face:
rip
i've already achieved most of it
but seem to be stuck in making built-in fonts work with it too
private static final Map<String, String> builtInFonts = new HashMap<>();
static {
builtInFonts.put("mini", "α΄Κα΄α΄
α΄κ°Ι’ΚΙͺα΄α΄Κα΄Ι΄α΄α΄κ―Κκ±α΄α΄α΄ α΄‘xΚα΄’");
}
Is this even correct? π
am i doing it right?
well now im stuck again π
String finalFont;
if (builtInFonts.containsKey(fontName)) {
finalFont = builtInFonts.get(fontName);
} else {
finalFont = fontName;
}
meh π
mans tryna play with fonts cant even play with basic java
i got till here just by looking at spigot forums π
i dont even know how java works π
i prefer registering my fonts to my resourcepack at server boot and then i just have those for setting it on components
okay i lied i do know a bit of java
works great
but not enough
well the problem is, this is gonna be a public resourcepack π
why did i say resourcepack
i mean plugin
I cannot understand why the config file is not created within the plugin folder. I used saveDefaultConfig() and the file is inside the plugin (viewed with winrar). however, I cannot find it
how can i create a plugin for bungeecord and spigot all in one?
I tried to make all those animated videos about rail roads and jumps of the minecarts to be true, but something went wrong
It works literally "like in those animated videos".. With slowmotion in the end
ah i thought that was default mc behaviour
That is default mc behaviour
@quaint mantle I now know how to change the .jar output file to any folder of my choice. Through the maven-jar-plugin or artifact builds. But how do i set it up through FTP and to my external laptop in my living room which will be hosting the minecraft server in a few days.
Anyone else feel free to drop suggestions and solutions
hey guys, i want to try optimise my server minecraft 1.21 and i want use all threads on my ryzen 9 3900x do you have idea and i have 16Go of ram, it's my personnal server
my server turn on spigot !!!
do you have a better idea to optimize my server ???
no need to crosspost
Well idk how to fix this slowmo fall
Maybe setVelocity to the down when minecart start to fall?
how sad to spoil you but minecraft is effectively singlethreaded
so using all threads wont be happening
in 1.21 not turning on multi threads ???
i have no clue about 1.21
oh ok
but you have idea to optimize server on spigot, i have change settings on Spigot.yml ?
There are quite a few factors that go into server performance
things like decreasing mob spawn rates and such
yes i know
Why BuildTools builds 1.20.1 spigot and craftbukkit if I requested 1.20?
if you really have a big server and wanna use all the threads, could look at folia
I've already done it
Thereβs a reason and thatβs how itβs supposed to be, I just canβt remember
folia is optimized ???
i mean it uses regionized ticking, which implies it also uses more ram
Java Version: Java 21
git version 2.43.0
openjdk version "21.0.3" 2024-04-16
Attempting to build version: '1.20' use --rev <version> to override
Attempting to build Minecraft with details: VersionInfo(minecraftVersion=1.20.1, accessTransforms=bukkit-1.20.1.at, classMappings=bukkit-1.20.1-cl.csrg,```
and not nexessarily optimized, more in the sense of "lemme use all the threads available"
Yes, normal
so if someone build a lag machine, only one region of the server lags
i thinks 16go of ram for 30 player it's good
doubt
So how to import org.bukkit.craftbukkit.v1_20_R1? I should compile 1.20.1 or what?
How would I go about updating a 1.15.2 plugin to a newer version? Also, what would you guys recommend to be the newest version that would run with plugins most smoothly?
if you only have 30 players i see no need to optimize
if it uses nms, get screwed
to be sure that the server is not laggy
but for the latest version id either use 1.20.6 (stable) or 1.21
is it laggy?
It seems that for the version you select itβll go ahead and compile the latest βstableβ version in relation to the option picked so just try to one before 1.20
i prefer optimize because i don't want lag if you prefer
well if theres no lag and it doesnt uses relatively big amounts of ram i dont see a reason to opitmize
sry for my english i'm french and i don't have all vocabulary
i understand you well enough
just wanted to say that magic word
ok good π
How would I tell if the plugin uses that net.minecraft.server thing?
just look at the code
Was made by some korean dude a couple years ago, he fell off the face of the world after making it
having an HDD that runs the server and burns or not ???
hdds are slow
or it's better ssd
but its mor about ram
but chunk loading might be relatively slow if it loads from a hard disk, idk
ok so I should go to 32 go ?
again, if you dont have performance issues, why bother optimizing
Or even the pom right? Just look and see if the spigot depend is βspigotβ and not βspigot-apiβ?
mmh
This is an example of the imports of one of the files: import org.bukkit.Particle;
import org.bukkit.entity.Projectile;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;
i thinks i try to put ssd nvme in my computer server
I donβt see any NMs there
Cool, so its not impossible to upgrade it?
well you can just search for net.minecraft in the repo
because I want to anticipate
Not seeing it anywhere
Can you not just do this @blazing ocean ?
well then it doesn't use nms
yea ig so
but it gives you more than NM
I thought you had to depend on all of spigot for NMs
Right right
So to go about upgrading it to a newer version, I just need to update the stuff that has to do with the Spigot/bukkit API? Or is there other stuff I have to change
Its going from 1.15.2 to prob whatever latest is
Whatever is marked as deprecated really
Are you using IntelliJ
It should just tell you depending on the version of spigotapi youβre using
How I can compile org.bukkit.craftbukkit.v1_20_R1 for 1.20 with BuildTools? (specified [--nogui, --rev, 1.20, --remapped, --compile, SPIGOT,CRAFTBUKKIT, --output-dir] still gets 1.20.1 snapshot by some reason)
aren't 1.20 and 1.20.1 effectively the exact same thing anyway?
It is, but Intellij says org.bukkit.craftbukkit.v1_20_R1 is not found, and I have craftbukkit-1.20.1.jar
Maybe I should try to rename it?
Well 20.1 is probably the βstableβ build so Iβd just use it
bump
I'm getting old and jaded, I just got a bunch of plans from someone for a thing and after 5 minutes I already know for a fact they're not going to make it in life
not just for these projects, just in general
your problem is somewhere else then, 1.20.1 also uses v1_20_R1
make sure you are properly importing nms with the maven plugin
I found it, thank you
My command is not tab completing. Does anyone have an example I could look at?
All in the main class or a tab complete class?
I have a class implementing TabExecutor separate from main class
TabCompleteClass tc = new TabCompleteClass();
this.getCommand("yourcommand").setTabCompleter(tc);
```Main Class in onEnable
I have
getCommand("wink").setExecutor(new WinkCommand());
public class MyCommand implements TabExecutor {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args.length < 2) return false; // Not enough args
sender.sendMessage("Hi!" + args[0] + ", " + args[1])
return true
}
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
if (args.length == 1) { // first arg
return StringUtil.copyPartialMatches(args[0], List.of("this", "is", "an", "arg"), new ArrayList<>())
}
// other args
}
}
@Override
public List<String> onTabComplete(CommandSender commandSender, Command command, String string, String[] strings) {
List<String> list = new ArrayList<>();
if (strings.length == 1) {
list.add("tab");
return list;
}
return list;
}
```your other class that implements TabCompleter
that is very pointless
you sholdnt have to check command name as each command gets its own executor
idk cuz mine works and theirs doesnt.
and it doesnt really matter if you send tab complete to console
I can't see anything wrong x-x can I show you guys my code?
Try this
looks correct, in game does it show the values for the 1st arg
it does show everything. but it doesn't let me tab complete
use StringUtil.copyPartialMatches
I press space and the list shows up but typing the first character doesn't do anything
for the first arg it would be return StringUtil.copyPartialMatches(args[0], Arrays.asList("mention", "pm", "tpa"), new ArrayList<>());
the first args[0] is passing in what the user has so far, the 2nd paramater is the arguments you want and then the last paramater is the return list so most of the time just a new array list
overcomplicating it
how
im explaning what it does so they learn instead of just spoonfeeding it
or telling them to use something completely different instead of a built in bukkit method
np
the one i gave is a lot easier to read and handle with further down the line needs. and why are you making a array then converting it to a list, just use the list
i used the code they had
Fair but... id recommend otherwise. Its faster to use list.add(""); and be able to use such thing for adding/removing tab completes faster in cases where you need to list off entities, players, and remove unused enteries as you type a word
the issue is resolved guys π just saying
I think I did something...
sorry to distract you, but your plugins work on version 1.16.5 and on Hosting-Minecraft
now make santas sleigh!!
Is that a question?
yes
Sounds like a statement
There are thousands of plugins out there. Some of them work on 1.8, some on 1.16.5 and some only on 1.21.
You would have to go to the plugins page and check for which version it works. Generally speaking spigot is upwards compatible, so there
is a good chance that a 1.12 plugin will still run all the way to 1.21
that's prettyy cool
Now do a loop-de-loop
π
can anyone help me with this? Please?
show code
I smell some singleton pattern
Check yoru startup to ensure there is no error/exception during onEnable
no error
i've checked
then you either do NOT have a config.yml in the root of your jar or you did not update the jar on your test server
there is config.yml
?paste your latest.log
do you init your database in onEnable?
yep
I did say you had an error in onEnable
[18:28:26] [Server thread/ERROR]: Error occurred while enabling Lifesteal v1.0.0 (Is it up to date?)
you didn't catch the sql init error so the exception caused your onEnable to fail
fix your database setup, also wrap it in a try/catch
someone can help me pls, why doesn't it detect the bungee api?
Hi everyone, I am currently upgrading my plugin from 1.20.1 to 1.21. Does anyone know what happened to the ItemMeta#setPlaceableKeys method?
don't (manually) depend on jars
You should use maven or gradle
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
It got removed because of compatibility issues
Pretty sure you can do it through reflect
Allright, thank you!
Does anyone know how I can make particle effects that circle a middle point? I'm not to great with Vectors or Math, so any resources I could get would be great.
thanks!
u probably wna learn about parameterization of curves (esp circles)
yeah, do you have any resources for that?
not in particular but some keyword u looking for is ofc
- circle equation in 3d (R^3)
- parameter equations
- ig basic vector operations like add and subtract
what kind of lock ru using
alright, thanks!
u can probably reentrant after the resource declaration in the try-with-resources statement
also skinny u may wna have a save operation where it only saves if it isnt already saving
optimistically that is yk
if (lock.tryLock()) {
try {
} finally {
lock.unlock();
}
}
yea sure, but the issue is that if someone invokes the save method 10 times, its gonna try to save 10 times, even if those invocations happen relatively subsequent one after another
I was today years old when I realized ByteArrayInputStream and ByteArrayOutputStream close do nothing
I should have been much younger than that before realizing
I mean yeah it's just a fancy byte[] wrapper lol
It's just genrally good practice to call close() on a stream though
Especially if you don't know that the type is a byte array stream
private static byte[] writeNBTCompoundToBytes(NBTTagCompound base) {
try {
final ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
final DataOutputStream dataStream = new DataOutputStream(byteOutputStream);
NBTCompressedStreamTools.writeCompressed(base, dataStream);
return byteOutputStream.toByteArray();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
probably fine in this case
aaa no try-with-resources aaaaaa
I did before but I realized close doesn't do anything on either of these streams lol
for the DataOutputStream it really just closes the byteOutputStream
but ByteArrayOutputStreams don't need to be closed
Yes but you see you are saving an extra line of code
im trying to create a spigot plugin with a commando to send a player in another server via bungeecord.
What i have to use in the code?
so true
Is anyone familiar with DFU I'm trying to figure out if an ItemStack is always guarenteed to return an NBTCompoundTag the save method returns NBTBase instead
Pretty sure it is
Itβs impossible to represent an item in anything other than a compound
mmmk I'll just assume it does πͺ I'll just serialize air in my test and see if it breaks things kekw
I was thinking air might not be a compound
What will it be then? NBTVoid?
yes it is always guaranteed to return such things because there is nbt it must always have
for example, it must have an id, if the id is missing it is treated as air and is thus removed
all items can have Attribute Modifiers as well
I think at base an itemstack only needs the id
But I donβt think itβll ever just return a string tag in that case
in which case it'd still be serialized as a compound probably just in case
it will workβ’οΈ
Plus I think the deserialize method only accepts a compound
kinda
the compressed deserialization method only does
however there are methods that accept NBTBase instead
I think its safe to assume anything the serialization API touches though will be NBTCompoundTag so its okay to just yolo on the readCompressed?
I wasn't compressing before π
I just found those methods like 30 minutes ago
well, not totally true tbh
I knew of them I just thuoght that's dangerous it makes me assume NBTTagCompound
just gonna blind cast 
I mean, LWJGL 3 has ZSTD bindings
This is an amazing explanation, thank you so much!
It probably should be noted that if its a circle you only need 1/4 and can just multiply and inverse for the rest.
Since the rest of the circle is just a mirror image
Quick question tho, does the method make the particles spin or is it stationary?
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
?nms
Am I coding right? I am just not sure if I am even doing the right thing,
on enable: @Override public void onEnable() { new ConfigHandler(this).initializeDefaultConfig(); }
https://pst.innomi.net/paste/7c5n7scrycofobr34e7csjfg
Seems fine
Though you can just call saveDefaultConfig in onEnable
It should handle all the rest for you
i know its more for custom configs
i want a stress free way of doing it in the future, just wanted to know if it was in the right direction
Yeah seems fine
Though currently all of that is stateless so you could technically make it static
how the hell do you run the golem swing animation??
I used ProtocolLib and the api

We have EntityEffect#IRON_GOLEN_ATTACK. You can play it with Entity#playEffect(EntityEffect) on the iron golem entity
Also, God damn it, who fucked up the name of that constant :(
Is there any way to set overflow items in CrafterCraftEvent?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/CrafterCraftEvent.html
it was @young knoll https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/commits/27ae46dcd29c7a8e576f3e21f38a542f9b719ada#src%2Fmain%2Fjava%2Forg%2Fbukkit%2FEntityEffect.java. Putting git blame to work π€£
and ofc it was merged, so can blame md_5 too
Where can i see stuff and learn how to make modules run on commands and like open inventories and then open new ones based off buttons you press there
Like a documentation basically
?gui
how do i fix $1: unbound variable with applyPatches.sh
i've added a configuration variable inside IntelliJ's editor, but when i put the fill path $1="/Users/xxx/Desktop/Test Server/BuildTools/work/decompile-3e3bd0ca"
i get a [file path above ^] not found
yall this is scary anyone know some videos that help me get into the minecraft part of this. Like ive watched videos explaining java coding but is there like videos that will lead me into implementing that into minecraft
ignore what you are trying to make. look up a video of making a plugin, which includes compiling in the end
you should watch several videos of the same thing to learn the concept
and youre sure the path does exist
no
you've quoted it
yes, cuz when i cd path it works
#!/bin/bash
set -euo pipefail
if [ -z "$1" ]
then
echo "Please run this script again with the clean decompile sources as an argument. In most cases this will be ../work/decompile-XXXX"
exit
fi
# https://stackoverflow.com/a/38595160
# https://stackoverflow.com/a/800644
if sed --version >/dev/null 2>&1; then
strip_cr() {
sed -i -- "s/\r//" "$@"
}
else
strip_cr () {
sed -i "" "s/$(printf '\r')//" "$@"
}
fi
nms=$1
cb=src/main/java
#clean up and rebuild
rm -rf $cb/net
for file in $(find nms-patches -type f -printf '%P\n')
do
patchFile="$file"
file="$(echo $file | cut -d. -f1).java"
echo "Patching $file < $patchFile"
strip_cr "$nms/$file" > /dev/null
mkdir -p $(dirname $cb/$file)
cp "$nms/$file" "$cb/$file"
patch -d src/main/java -p 1 < "nms-patches/$patchFile"
done
where did you get this from
so your saying almost just watch people code
and try to understand that
these are how you apply patches when contributing to CB
this is a hard thing to teach because so many tutorials explain it differently
and some dont explain it well at all
thanks
you have to pass in some sort of path to NMS in CLI
$1 is first arg
No im saying no one is going to teach you start to finish, each tutorial may teach you a little piece. Based on what you said you need help with (getting the code into minecraft) means you should watch a random basic tutorial on making a plugin which in the end of the video you can skip to, will show compiling.
This is assuming you already have gotten down creating the plugin without errors in the editor
Again there, dont worry about what you are trying to make yet. just use one main class to make a join event that sends a message. once that works then you know how to export
Alright it is my fault for explaining this poorly ive saw how to put the plugin into my server but i dont understand how to make events run based on commands. I mainly learned like what the stuff is in java but idk how to apply it
Well, feel free to show us what you do have and maybe assistance can be given π
watch a youtube video on how to make a join message plugin.
#!/bin/bash
set -euo pipefail
#if [ -z "$1" ]
#then
# echo "Please run this script again with the clean decompile sources as an argument. In most cases this will be ../work/decompile-XXXX"
# exit
#fi
# https://stackoverflow.com/a/38595160
# https://stackoverflow.com/a/800644
if sed --version >/dev/null 2>&1; then
strip_cr() {
sed -i -- "s/\r//" "$@"
}
else
strip_cr () {
sed -i "" "s/$(printf '\r')//" "$@"
}
fi
nms="[path to decompile]"
cb=src/main/java
#clean up and rebuild
rm -rf $cb/net
for file in $(find nms-patches -type f -printf '%P\n')
do
patchFile="$file"
file="$(echo $file | cut -d. -f1).java"
echo "Patching $file < $patchFile"
strip_cr "$nms/$file" > /dev/null
mkdir -p $(dirname $cb/$file)
cp "$nms/$file" "$cb/$file"
patch -d src/main/java -p 1 < "nms-patches/$patchFile"
done
``
error:
zsh: "[path to file]" not found
ik it seems quite obvious what the error is, but i promise you the path is there
under "Edit Configurations", i put in $1="path"
that would not work
you can't do number=
and $k=v is invalid
since that's running $(k)=v
try the 3 dot
there may be a text box
would not work
$n is not an environment variable like normal
its special like $@
no idea
I've never fucked with NMS
you need to find a way to pass in the path
need some help working out how to fix the 'class not found errors' here
made for 1.20.2 btw
what is this supposed to do
π I choose to shift blame to @remote swallow
||My bad||
change the skin of a player for a certain group of players
there is a much better way to do that
ok
idk how to im just looking back at past code i made last year
how would it be done?
oh wait I didn't read too closely
NMS is harder
do you have to use NMS?
Plib|Pevents would make this a lot easier
and compatible
protocollib
packetevents
packetevents is newer
but protocollib is very well known and is fine
ok, ngl idk how it would work with these
Just a different way to say it but it's abtracted
you get their game profile, change it
and update it for those players
this is lengthy but it lays a lot of the groundwork https://gist.github.com/nathanfranke/2d02ceec740ad0599d4c2a19883ed42e
use readSafely(0) instead of read(0) though
and yes it is kotlin
refresh() is a good starting point.
ok thanks
so im following the ?gui and im trying to do the @subcommand but its not working
its showing as @Subcommand doesnt exist
im trying to do it in the final class that extends javaplugin
Show us your code, at least a pic or so
the term for that is "main class"
import org.bukkit.plugin.java.JavaPlugin;
public final class MopoGamemodeSwitcher extends JavaPlugin {
@Subcommand("open piano")
@Override
public void onEnable() {
// Plugin startup logic
System.out.println("Starting up Mopo's Gamemode Switcher");
}
@Override
public void onDisable() {
// Plugin shutdown logic
System.out.println("Shutting Down Mopo's Gamemode Switcher");
}
}
the @subcommand is red
im not sure where you saw this but thats not how commands are made. Find a new video or ask chatGPT
this is what i was following
why ask chatgpt
chatgpt only knows outdated shit that doesn't work or exist
depends on what you prompt it, it knows todays info, 1.21 api. But, the reason id tell someone to do such thing is that it is great at thorough explanations and can definitely point out things you oversee
try again π
and it really doesn't point out oversights, instead oversees things
no why would i
because you likely gave it a dumb question, or skipped actual details. its your fault for getting the wrong response. as of its latest version it can directly quote from the web, which is part of why it is capable of helping through 1.21
or.. just don't use ai lol
I do know how to code but some late nights when I just dont see my mistake I paste the code and describe what im doing, rarely have i gotten a wrong answer and when I do I tell it to rewrite it a different way
I think its not something you should rely on 100% at all, no way. but i think its a great side opinion
i've never found ai to be useful for coding, not even boilerplate as it just copies the wrong thing over and over again
because you dont know how to use it.
i mean, i don't need to learn how to write the perfect prompts to some random number generator
My ide is setup to automate most of the boilerplate stuff
I even have some templates for it too
copy pasting and adjusting is the way to go
Basically
it's just a huge waste of time where i could be working on a new feature
I even have an archive of snippets too that i keep around
- you usually need several prompts because it won't give you something working
just a waste if time
Which most devs should be doing. When you find some piece of code you like or interesting or whatever. Just save it to a snippet library
Some day it might be useful lmao
I think you dont know how it works. you are teaching it while it teaches you. so you need to be smart enough to use it. you need to know common terms. "rewrite what you just sent but this time only a snippet and without nms"
I honestly forget to do that lmao
yeah they're usually just in the repo ready to copy
I actually should finish that one project for snippets
it was just
name
desc
lang
snippet
Lol
and you could filter for that
regardless it's a waste of time
I just forgot to make it save π
i just use those nvim snippets, they're great
to you. dont use it. but to others who have the knowledge to handle such tools, it can save a lot of time in many topics. ive taught it a example piece of a config and had it write thousands of lines next repeating for a shop.
I see this being time consuming. In the time it would take you to train it you probably could complete several projects
your training is just properly telling it what you need.
Ok. But why do that when i can setup a template to be what i need?
And it always be correct 100% of the time
you're just sounding like the average twitter chatgpt tech bro rn
Chat chat just use gpt for book finding or stuff
it doesnt have to be used for programming. im simply saying that if you know how to use it then it would be of use
it's really good at that
I guess if you like ai do it, but unfortunately this isnt convincing to me to use or being worth using
I use it to tell me dates of stuff
I dont like ai, really hate that it was brought to the world. but i can say that chatgpt in occasions has helped me a lot.
Nothing works for everyone
you really are sounding like a chatgpt shill tho
no im against saying its useless. but if you dont know how to give it proper info then sure it may be
it comes down to your own knowledge
I am aware of this but do know if competing with the best is what you want, they dont use AI. I am perfectly fine with more subpar programmers because of AI because that means less competition for me
π
honestly I've actually found a really good use for AI: Telling me the names of things I forget, not just books.
"what was that one formula that looked like X" oh you're talking about XYZ? then you look it up and it's that, treat them like what they are: search engines
Yeah it is handy for that lmao
and don't take their output for granted tbh
yeah
Really good at that
Until you start asking it for spigot methods...
Sudden hallucinations
exactly
always begin with "I am using spigot api 1.21. ..."
man its not funny when it uses the proper methods
Player.explode was one it gave me once xD
lmfao
antioch
I asked it how to make a player break a block
it figured out that raycasting for a block, simulating a block break event then breaking it if it isn't cancelled would be best
to get the target block π
but look at how silly your brain is "how to make a player break a block" no one could help you with that.
Ig to find the block the player is looking at xD
public class BreakBlockCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player player = (Player) sender;
Block targetBlock = getTargetBlock(player, 5); // Get the block within 5 blocks in front of the player
if (targetBlock != null && targetBlock.getType() != Material.AIR) {
// Call the block break event
BlockBreakEvent breakEvent = new BlockBreakEvent(targetBlock, player);
getServer().getPluginManager().callEvent(breakEvent);
if (!breakEvent.isCancelled()) {
targetBlock.breakNaturally(); // Break the block if the event is not cancelled
player.sendMessage("Block broken successfully!");
} else {
player.sendMessage("Block break event was cancelled.");
}
} else {
player.sendMessage("No block in front of you to break.");
}
return true;
} else {
sender.sendMessage("Only players can use this command.");
return false;
}
}
private Block getTargetBlock(Player player, int range) {
BlockIterator iter = new BlockIterator(player, range);
Block lastBlock = null;
while (iter.hasNext()) {
lastBlock = iter.next();
if (lastBlock.getType() != Material.AIR) {
break;
}
}
return lastBlock;
}
}
??
people here would be able to help you no problem
^
"I love chatgpt"
LMAO THAT WAS MY SAME THOUGHT
chat should I procrastinate and work on my search engine
It would be helpful to just throw shit at it and it organizes itself
I'm NOT organized π
That is a pretty shit code structure there you sent and I dont doubt it did generate such thing, but... still comes down to what you gave as a prompt. I do truly wish ai was not integrated in everything nowadays, but unfortunately it is.
stop procrastinating
It's more like procrastiworking
being productive at something else
yeaaa
ew
You just reminded me I'm procrastinating on working on config by working on inventories and I now want to work on my search engine
I can't keep focus on one thing π
neither, my adhd does NOT allow my ass to work on one thing
π I am going to be checked for that soon actually
Remember, pick the quickest thing you can complete and put all your effort into that. Its better to complete something than to have ten open projects
^
yea i have like 25 at least
I am handling the entire backend, frontend and external services of an hosting service ALONE, I have roughly 700 items in my todo list AND IT'S NOT EVEN DONE
10 is like nothin
I js realized I'm talking abt myself again carry on chat π
if you put all your effort into something you wouldnt end up with the endless amount of incomplete projects
my adhd just simply does not allow me to put in all my effort into one thing
i just cannot
m8 I get a feeling of vomit when I open some projects too early it's not effort that's lacking π
get high and you will
π
ill tell you which ai sucks at responding regardless, the one they added in google results XD. but anyways, gpt isnt for everyone, i agree it could give unwanted answers but it could also give great answers, just have to give it a try when in doubt. i may ask it if it has any solutions for rad's adhd cuz man you gotta get some projects done
bam
is there a way to make it so that when a BaseComponent gets clicked, a function runs
yea i saw that
but it seems like there's no way
and i have to make a dummy command
Correct
No
that fixed the majority of the issues, but how do i get about errors regarding libraries that aren't imported? is there a specific way to import all the libraries that are needed for this project? is that documented somewhere?
joml is a dependency of bukkit, I don't see how your IDE can not import it unless you didn't import it as a maven project: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/pom.xml#48-53
This is the way to go. I wrote an abstract layer which lets me generate a cryptic command with a Consumer<Player> callback.
This makes it possible to have arbitrary dynamic actions on text clicks.
well i'm working on craftbukkit not bukkit
right, there's in there with Bukkit in my local machine
but when i go to my CB project,
Try running BT at least once
i'll restart and invalidate caches to see if that works
Or also include the bukkit project within the workspace if you are using eclipse - if you are using IJ jump off a bridge.
I have no idea what you really need to do - you should just ensure that it publishes the bukkit artifact to the local maven repository
i'm not fully sure what's wrong here. Bukkit has joml dependency in it's pom.xml, but CB doesn't
Transitive dependencies
But cb has bukkit
okay, just had Maven reload the project and everything seems to be fine now
And henceforth you need to compile bukkit before compiling craftbukkit (except for eclipse - eclipse is smart enough to not require that step)
yeah, i had already done that beforehand
i guess it just needed a reload
Hey i someone fimiliar with CKnownPacks ?
?
so the problem is that i get io.netty.handler.codec.DecoderException: Not enough bytes in buffer, expected 109, but got 18 when trying to send an Default 1.21 pack
like this
self.send_packet(CKnownPacks::new(
1,
&[KnownPack {
namespace: "minecraft".to_string(),
id: "core".to_string(),
version: "1.21".to_string(),
}],
));
But not sure why
what do i do about things like this?
Wrong JDK? What even is the error?
could be, let me try
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/MatchException.html MatchException exists since J21 - but in theory your IDE should be already selecting the correct version
yep that seemed to work π€·ββοΈ
what am i being blamed for
kekw
haha @young knoll has to write commodore
sir that is rust
yes
so i already fixed the error nvm
but now i have another one Caused by: aa: Non [a-z0-9/._-] character in path of location: minecraft:\u0018min
it has to do with Registry Data packet
nskey ?
mhh
i do not use resource location often
i already checked everything in my registery
well something has the key minecraft:\0018min which is not ok
i have no idea wtf cknownpacks is anyway and that certainly isn't spigot related as it's rust so glhf
Haven't like 50 people done that in the past already
Soo, reinventing the wheel once again?
π―
the most of the projects are abonded or frameworks like valence
this one will be different
graphite actually has a cool brig api
