#help-development
1 messages · Page 558 of 1
Hey server owners are
people writing 200k lines of code so you can solve your problem in 5 lines of code
Not smart
I literally wrote a registration system for the modules at work because people kept making circular dependencies
They’ll forever put tabs in yaml files and then complain it doesn’t work
If I was to write a "perfect" (larger) plugin (or anything code-related) I'd never be done. You always learn new stuff on the way or notice flaws.
Isn't rare that I change something and a month later I feel like "eeh, the other way was better" - and change it back
ehh
you get used to it
it's called
tech debt
I love how my pc almost crashes every time I run gradlew build
Its why first thing my team has done is just build some libraries and call it a day. That way, we can have paralell projects using the current library, and then maybe have like 1 team member constantly looking for additions and improvements. So they dont negatively impact the current project
discord's rendering at a solid 2fp
yay tech debt
As long as you have versions for that library that's a common way to approach things, yes
This code is for creating a particle at a random location on the tree.
yeah, git workflow best practices ftw ❤️
All hail the dev branch
Spigot has 12 years of tech debt
Dear Father who art in heaven, "actual code reviews in big multi dev plugins" be thy name
Sometime you look at old spigot code and wonder what was going on when it was written
In like 2013
Bro i was looking at code written in 2023 and thinking that lol
Well that too
is there a spigot resource api
For what
im trying to make a plugin that automatically updates other plugins when updates are detected
or the xf api
Auto updaters are evil and will break your server
you would need to figure out its id iirc
public static List<WorldCoord> toWorldCoord(LightChunkArea area) {
final List<WorldCoord> coords = new ArrayList<>();
for (LightChunk chunk : area.getChunks()) {
final Chunk bukkitChunk = chunk.toChunk();
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
final Location absoluteLocation = bukkitChunk.getBlock(x, 0, z).getLocation();
coords.add(new WorldCoord(absoluteLocation.getWorld().getName(), absoluteLocation.getBlockX(), absoluteLocation.getBlockZ()));
}
}
}
return coords;
}``` nested loops go brrrrrrr
What are you even using this for?
converting internal chunk map of a zone into towny world cordinates
How do townyh world coords work/
could flatten that loop and do some math to get the actual coordinates
*this is exastly why i asked ^
Towny has Static Coord and WorldCord helper methods
default is 16
but you can specify a non standard size, always indexed on 0,0 though
Iirc towny was the annoying one when implementing protection checks
It doesn’t have a good way to query protection on an entire area at once
Towny API seems annoying I literally have to work with internal methods to do what I need
So, when an upgrade slate is dropped onto an item, it does say in the chat that the item was upgraded, but the upgrade slate would still be held in the cursor, and the attributes haven't changed.
well, I'm trying to make capture points, but the protection is weird and their is no directly exposed API within towny to make protection without a town etc around a certain zone afaik
areas belong to towns
so I made an internal town called gaia or whatever to calim everything
thats why it's called Towny
well the area will belong to a town, but they need to capture it first, its default state is owned by no one, but you can't destroy blocks their
wdym
there are area flags for owner, friend, outsider etc
so you can allow/disallow actions
There is also a built in method for fighting over towns
flag war
its been a few years since I looked at any of that code though
Client wants a specific type of conflict not supported by towny though, so its rough impl
thanks for your help though
Is the server lagging
No
Make sure your if statements pass
If a player already has the same potion effect and you apply it again it won't refresh it if I remember correctly. I stumbled over that a while ago
You have to clear and set it again
That's incorrect in the newer versions
^^
alright didn't know that was changed
whats the method for 1.7/1.8 to make armor stands uncollidable
Probably isn’t one in the api
¯_(ツ)_/¯
Scoreboard teams might work
Granted idk if those had collision settings in 1.8 either
any other ways to make holograms other then armor stands
Not in 1.8
Not that I remember anyway
Did armorstands have the marker setting back then
Because that makes them have no hitbox
I think they do actually
I am coding a minigame for the first time. A sequence while playing the game
and this order will change constantly, how can I apply a design pattern for it?
can anyone help me i redownloaded intellij after long time and now it fulls of errors
what are the errors?
you need to verify
i did
your name would be blue if you did.
any idea on how to deploy in jitpack a library which depends of a jar file which i has in local but it is not in the git repository because it's a paid plugin?
you would need to put it on a cred only repo with github secrets and a workflow
Guys. I have a self-written plugin for the prey system by clicking on the trees. In the configuration, they write a tool, extraction with a click. There is a particle on the tree. It is necessary to make sure that when hitting the particle, it multiplys the extraction of the tool by x2 each blow
google translate
is there any way to find out that the item that is on players hand is renamed or not?
i tried checking if displayName is null but it is always true
hasDisplayName
oh right thanks
?pdc
Phases
please
Here's how I write mine
I need to find a way for:
-> Function which you input coordinates of block, Max. Radius of blocks
-> Returns coordinates of all connected blocks of the same type within said radius in an array.
Any ideas other than looping through each connected one?
looping is your best bet.
So, there's ways to play just normal sounds but...
Is there a way to play music to a player? IE if i want to play menu music to a player is this possible?
You can with a resource pack
Yeah that's what I'm doing right now is just overwriting the sounds with my own (IE I replaced menu1.ogg with my own ogg file)
And, it'll work for playing automatically, I wanted to like manually control the when the sounds play
Add a custom sound and use playNamedSound
Add a custom sound you can do a what now im sorry is this some new witchcraft or something
interesting
It’s fairly old
It has existed for a while yeah
This method right, only one that allows supplying strings so I assume it is
oops
screenshotted wrong one
yeah ignore me on that one mb lmao javadocs said it
Any idea what the issue is here?
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
generateIsland(event.getPlayer());
}
Required type:
Player
Provided:
org.bukkit.entity.Player
player is player
like cmon man
wrong import, or you shaded the whole of Spigot into your plugin
probably the second
shaded?
do you use maven?
ya
spigot needs a provided scope entry in the pom
meaning...?
<scope>provided</scope>
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
seems to be there
then you manually added a jar to your project
Havent touched anything
IntelliJ
are you using artifacts to build
I do not agree to the EULA.
ok
Do you agree to the EULA?
depends which one
you have to to play the game
ok good for you
mojang doesnt rlly care
look at hypixel
booster cookies go brrt
Booster cookies are fine
p2w
they give you craaaazy buffs, then on top of it you also get the ooportunity to sell them to other players for in game currency
Then on top of it, you also have the player profile buffs, which you can skip the timer for upgrades by buying gems
It's tecnically non competitive
Idk what that means but sounds like p2w to me
Mojang changed their EULA so p2w is allowed on non competitive servers
Which is why skyblock removed PVP
hypixel isn't competitive?
oh
ohhh
but wouldnt the leaderboards they have be considered competitive then?
or only if said leaderboards give prizes of some sort?
you'd think
I mean the EULA does say leaderboards may make it competitive
Which is very vague thanks Mojang
so they just mainly consider pvp the competitive part then
how is a leaderboard anything but competitive lol
But I assume if anyone was going to get nuked for violating the EULA hypixel would be first, so I imagine they have some contact with Mojang
yeah i very highly doubt mojang really cares about p2w servers
few others companies have policies like that that everyone breaks but they dont do anything about
Look at youtube and theyre advertising policies lmao
Did the path of the spigot change from 1.19?
for nms or just normal spigotapi
nms, I used to have this https://oss.sonatype.org/content/groups/public but its not there anymore
?maven
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
oh it did change sweet thx
nms has never been uploaded anywhere
i always always found it here https://oss.sonatype.org/content/groups/public before, werid.
did you ever run buildtools?
Nope
it has literally never been there
that is not from spigot
I will contact sonatype as to how someone got that uploaded
Md is going to hunt them down
@EventHandler
public static void onEndermiteTarget(EntityTargetEvent event){
if(event.getEntity() instanceof Endermite endermite) {
Player player = (Player) endermite.getTarget();
if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals(ChatColor.BOLD + " " + ChatColor.DARK_PURPLE + "Endermite Sword")) {
event.setCancelled(true);
}
}
}
Why would the endermites still be coming after me?
why is the method static
all of my events are static.
why
Don't make them static
because they are, if they arent i cant access the config.
oh. well my events work, and so does everything else, so im not realling gunna complain.
Not the right mentality
Possibly a mirror
Nah
Mirrors are one thing
A project called "spigot-1.8.9" with completely irrelevant code is another
wdym?
absolutely amazing

horrible
Video never gets old

oh dear i fucked up the playnext feature very badly tho
3 songs playing at once lets go
but does it play async
i mean yes actually it could but meh
except then you'll discover packet flushing is done when the main thread ticks
ashsujsjdkkkdk
pain
i wrote some really messed up patch to get around that lol
meh not like it really needs to be async anyways
client handles most of it you just need to tell it when to play a song at x time
?paste
https://paste.md-5.net/soselipazi.java
Little messy rn cause im cleaning it up, but its overall pretty lightweight
Only thing im likely gonna change is using a global BukkitTask timer instead of a bunch of smaller runLaters but dunno works really nicely as is right now
For some reason, bedrock players on my server can't craft anything related to wool. I think it's because of my custom recipe that lets people craft 1 wool into 4 string, but I can't figure out how to fix it
ItemStack outputstring = new ItemStack(Material.STRING, 4);
ShapelessRecipe stringtowool = new ShapelessRecipe(new NamespacedKey(this, "wts"), outputstring);
stringtowool.addIngredient(new RecipeChoice.MaterialChoice(Tag.WOOL));
Bukkit.addRecipe(stringtowool);```
in onEnable()
spigot doesnt support bedrock
Forgot to say I'm using this with waterfall
right and what server is this
Slight issues
Im like 99% sure this is client side but
Is it possible to stop the vanilla Minecraft music sounds from playing? Or would best bet just changing all vanilla music to empty files
Hey guys, can't find a tutorial on this anywhere, or a video, etc. I would like to shade each chunk in a map, so that it looks like an overlay. I'm happy to do it block-by-block if necessary; Is there a way to take a map AS IT IS EXPLORED and change the pixels that are being updated base don the blocks they represent?
I think once a sound starts playing it keeps playing until it ends. At least that's how it used to be.
There’s methods to stop it
they can be stopped
im wanting to stop it from triggering to play though
i guess i could just stop every music sound
As for vanilla music I think all you can do is replace it or turn music off in settings
well im playing music through music channel rn hence why i wanted to try to see if a method/event exists for when music starts playing
Off to replacing hundreds of music files i go 
fawwwwk
Anyone know about editing maps as they are explored?
While they are explored not sure
Checked javadocs and i did find this (From MapView)
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/map/MapRenderer.html
seems you can use https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/map/MapCanvas.html to actually draw on the map
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/server/MapInitializeEvent.html
Theres also this event for when a maps like first created
I'm somewhat familiar with MapCanvas, I've used it before to make custom wallpapers in-game.
For the map init event, is there a way to change the underlying image? Could do something with that maybe. Fake an init event, get the underlying image, draw my edits over it based on pixel colors and location/block/pixel correlation, and then let them explore it... all if I can change the underlying image without "exploring" the whole thing instantly.
Idm complex, been there/done that
You can check if a maps being filled out with this method + the move event
and check the color from last event to this event
see if it changed then change said pixel how you need
honestly not that badly complex
Ayyy looks like what I need, I'll dig into some docs, tyvm
that methods from MapCanvas, theres a getter from it from MapView -> MapRenderer -> Map Canvas
huh you can supply images
interesting
god this music is badass
Alexander Nakarada ftw
Hello. Is it possible to cancel BlockPistonExtendEvent?
Should be in the BlockGrowEvent tree of events
Same with cobblestone and whatnot
Are you having issues doing it?
Cant remember if that is one of those whacky ones
oh wait it doesnt implement cancellable huh
nah it does
Yeah should be cancellable
just read "you should be cancellable"
tbh everyone is cancellable in this discord
try me
You can easily cancel anyone by killing them
god cipher - i could send that to a christian woman and have you cancelled on twitter for pretending to be god
i will try you
with pleasure
it doesn't work
@EventHandler
public void onPistonExtend(BlockPistonExtendEvent event) {
event.setCancelled(true);
}
the arguments i would have would make me finally happy
you should see the rust (the game) discord then, arguments in there go crazy
its 100% registered?
lemme guess, kids that got raided while in school
Yes, I checked if it is being called
private void registerEvents() {
getServer().getPluginManager().registerEvents(new BlocksListener(this), this);
}
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/BlockPistonEvent.html
Maybe try cancelling this one?
declaration: package: org.bukkit.event.block, class: BlockPistonEvent
oh
i remember this being an issue a few months back where someone couldnt cancel the extend/retract events
?jira
:p
no i remember they fixed it somehow, i just cant remember what they did exactly and i cant ctrl + f it in discord to find when it happened
It doesn't include #getBlocks()
I need to get the blocks that the piston will move
I mean afaik those events cancel fine
If you can narrow down and confirm this is a spigot issue, and you are on the latest build
?jira is the place
What is the proper apiVersion we need to put for 1.20?
I tried "1.20", but told me it does not support 1.2
api-version: '1.20'
This would make a good drinking game
Did not work
org.bukkit.plugin.InvalidPluginException: Unsupported API version '1.20'
your server is not running 1.20
how many users was face the 1.2 support "issue"? xd
I always use 1.13
I had this issue before
I made an abstract listener
The idea was to listen to the implementation inside constructor
api-version: 1.13
Didn't work
🤷🏻
I think I fixed it because I still had to track the listener so whenever I added it to the map, the class that held the map would instantly register it.
That was super weird
I was thinking why I getting erors on inventory click then I seen getClickedInventory() is null. Having the option to close on background click seems little odd
Don't know if SpigotMC meant to do that
But I never seen a plugin that does this before I started this dev
Ok so the scale of the map determines what chunks will be shown inside; this should be able to be determined via a modulus operator.
PixelsPerChunk is determined by the scale
ChunksPerMap = 128/pixelsPerChunk
roundup(locationX/16) % chunksPerMap = maps away from spawn
Pixels?
Nullable
Thinking out loud sry
Inventory is always null if you click it while outside
Imean
If you click outside the inventory
I know, that is what I talking about
its always been nullable as far back as I can remember
How are you able to paste an image into chat like that?
Verified moment
Ah... yeah that's not an option for me anymore.
Had a verified account, then it got deleted and now I can't re-verify.
I can paste links to screenshots though, I suppose?
Wait I'm about to blow your mind...
I am able to draw onto the map fairly easily, but as you can see in the screenshot, the unexplored area also is drawn in.
Like I said, already had a verified Discord account, and it was deleted. My spigot account remains as it was.
@tall furnace Yes, I heard its only for verified accounts. But be careful with links, they can get you banned if not careful. Must servers just ban urls/link. But I recommend imgur, one of the safe image hosting
I cannot verify a new Discord account onto a previously-verified spigot account.
ty for that
What is the account
Blue BukkitDev
https://www.spigotmc.org/members/bluebukkitdev.62643/
!verify
Usage: !verify <forums username>
!verify BlueBukkitDev
This account is already verified!
Don't do this but I seen links that gets IP addresses. That might be why they ban them
"This account is already verified!"
are 1.20 servers more strict with player movement? my plugin involves shooting players in the air at a high speed and in 1.20 it keeps spamming the player moved too fast message
!verify BlueBukkitDev
A private message has been sent to your SpigotMC.org account for verification!
@devout canyon shouldn't be, make sure you are up to date
MD is a 🐐
tysm <3
I thought he was a 
wasnt there also a software called bluebukkit
or am i totally wrong now
that was like blueprint just for spigot
Wait, 1.20 got released?
Face palm
1.20 got released 4 days ago
I just started updating my plugin a little bit ago, I included the spigot maven repo with the 1.20-R0.1-SNAPSHOT version, I'm not sure what else I should check. I could test to see if it behaves differently on spigot vs paper
Make sure the spigot jar on your server is up to date
yeah I just downloaded the latest paper version
Staying on 1.19.3 for right now to give forge and all that time to update
?whereami
1.19.3
yeah I wasn't sure if this was a paper thing or vanilla mc thing
third option, a spigot thing
I know there is 1.19.4 but the mods I use don't work such as my minimap. I made a GPS Compass but still, like to have the minimap
I have a picture but not here at home, it's MD_5's true form
It's at the office, I won't have it until tomorrow
But if I can remember, I will share it with you
!verify MrnateGeek
A private message has been sent to your SpigotMC.org account for verification!
I got the map rendering o.o If you want to know if a pixel is explored, check the base alpha. If the alpha == 0, it is unexplored.
yall ever just randmly wanna cry while working on a big gamemode.
I keep spare onions in case my eyes run out of tears
somehow somewhere if i try to dmg a user who has 4 hearts instead of the dmg dmging them it heals them
and i have zero clue where tf it is
oof
and im sitting hegre like wtf
I just start commenting out huge chunks, starting in the listener classes
Once the problem stops, I backtrack
Hello, i have to use ProtocolLib to listen for specific events.. but i don't know if the plugin's size is 5MB is that bad? i know this a famous one but is that will be bad for the server?
Did you shade it?
no using the api as it is
Then what’s the issue?
map rendering is icky at best
so it's okay? cuz i want to put ProtocolLib in every spigot instance
That’s fine
nice.. thanks dude
dont think u need to shade the api
since protocollib is on there as a plugin
maaaan this shit is addicting even as background music 
Getting the hang of it though
Hi, im making a weekly shop and im using ScheduledExecutorService, but something doesn't work i tried for weeks to make it work but it doesn't, no errors nothing i checked the logs and nothing, the function alone works just fine seems the scheduler is not called but is called in the Main Class.
Code: https://sourceb.in/KkPyo8E08U
Debug Information:
Time until this tuesday (1058 minutes)
Time of TimeUnit of 1 day in minutes 10080
can someone link me to the enchat glint doc
Add one enchant for example durability then add itemflag hideenchants
im trying to set command aliases through my config.yml but it doesnt seem to be working https://pastebin.com/GDUJGkPP
How can i make a system that when a daily task runned and none is online, makes it wait like in a List and then when a players join makes it happens?
List<String> waitTask = new ArrayList<>();
//Task
waitTask.add("waitPlayerJOIN")
@EventHandler
public void onJoin(PlayerJoinEvent event) {
if(waitTask.contains("waitPlayerJOIN") {
//Makes the task happens again
}
}
This up here is a concept i made in discord
Update: Works just fine the concept lol, why i written in here in the first place
Really trying to make my own plugin but every video does something different and this is so hard does anyone know a good tutorial to watch or even does anyone wanna hop in a call an chat an help me out? I'd really appreciate it
Start by the wiki it helps really well and search on google things you want like “how can i make an event” etc, start by here and in the side you can find many tutorials made by the community https://www.spigotmc.org/wiki/creating-a-plugin-with-maven-using-intellij-idea/
I started from the wiki with little knowledge of java and now i know more java then before and i can make custom plugin
Adding on to this, you should
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
That’s was like its obv you need to learn java to write code, minecraft is based on java lol
For me its obv but for him probably wasn’t
Telling someone to learn the language they need, adding onto a message about how they should do things, is mean and unnecessary?
You best believe I'll bet on you being an avid twitter user
I've currently got a spawner-changing system, and for each spawner I've created a recipe
craftPandaSpawner.shape("EEE","ESE","EEE");
craftPandaSpawner.setIngredient('E', Material.PANDA_SPAWN_EGG);
craftPandaSpawner.setIngredient('S', Material.SPAWNER);
Bukkit.getServer().addRecipe(craftPandaSpawner);```
Problem is I'll have this for a bunch of spawners, and this is a hassle to update for each minecraft version update. Does anyone have any ideas on how to simplify this?
@desert jacinth I watched this guy when I first started and I've made quite of plugins since that I'm happy with: https://www.youtube.com/@KodySimpson/videos
I love coding and the process of learning new things. On this channel, I share my knowledge with you and we learn new things together. My favorite language is Java, what is yours?
Join our Discord Community: https://discord.gg/cortexdev
no point debating. ike was only trying to help
You could get all spawn eggs from the Material enum and then run your recipe code within a loop for each egg
Could anyone help me a bit? How can I make a hologram disapear for a player when he is far a way from it
What version are you using ?
If 1.19.4+ then use Display Entities and set the view_distance
I use 1.19.4, thanks
completablefuture
i assume
guys, what to do if the particles move in different directions. How can I remove it so that they are only in one place?
First off please paste code in the future with
?paste
Secondly, what do you mean move
they move away and dont stay at the spot
add 4 0's behind the 1
those are the offsets and extra
on the video you can see that the particle is not in one place, but moves in different directions
the video is 1s
and yet i understood
for only a few lines I'd prefer a
// code block
``` actually.
For more the paste site is fine
Ye, but instead of screenshot that no one can read xD
idk why discord would render them like this anyway
thanks
thats some interesting constructor
when you dont have SneakyThrows :(
and whats protected in here
There’s probably a public function alr named exec
Also sneaky throw there is arguably not very nice in terms of design choice (just use SQLException and let the function explode knowingly
🌚
bruh github has this now?
Discord is going to have it soon as well.
my discord already had it?
It's being slowly rolled out, I don't think I have it yet
poor world
yeah it's custom
im atheist 🥲
same 💀
how so
stop this conversation before this spreads too far
Look how much trouble religion caused and is still causing.
Wars, holocaust, discrimination.
Also you don't need a church to pray if you feel bad (which is one of the few pro-religion things)
But dovidas is right and this ain't a topic for #help-development
so use registerEvents
But the paramter autocorrects
why is it always the most cursed stuff being sent in here
use Bukkit.getPluginManager().registerEvents(new ClassName(), this)
you have comma at the start of the parameter list
and a sad smiley at the start aswell 
you still have a comma at the start
and you are still using registerEvent
getServer().getPluginManager().registerEvents(this, plugin)
Im on spigot
no, the 1st param is the listener class
okay??
bruh
you still need to use registerEvents, not registerEvent
So still do it
soz havent used the api for a while
reigsterEvent is for making custom events
you can use registerEvent() but you need some kind of wrapper class to register it properly
just use registerEvents()
its in spigot (bukkit api)
dang it
lmao
you are using registerEvent unless you are making a CUSTOM event use registerEventS
Like 5 people told you, that you are missing an S after registerEvent
registerEvent used to be useful for listening to literally everything
Also aClass and Listener are just the argument names
now you gotta be hacky
how tf did you make this so big
test
add a space
F
your mom gae
this is so good for trolling
i wrote my college notes in markdown 💀
Don't
or to tell people that they are an idiot
Hehe, I do too if I am not forced to use word or latex
i hate word
had to use it for my exam and it thought lets just move the images here and there
Just use TeX
my uni forbids the use other than ms word
💀
what are you studying? the 19th century?
This is why you set your images wordwrapping
TeX can be a little bit annoying for quick stuff
i gave them a .odp last time and i havent received complaints yet
But it is great for larger docs
school says
use word, google docs or libreoffice
I just use google docs because fuck cracking word
even though the teachers hand out usb drives with all sorts of cracks
never had it crash, it only looks trash
just use Latex. It gets the job done and you can do everything you want
we use a cracked version of windows server 2012 with a key that's embedded in the powerpoints
It left a pretty bad impression if you wrote your bachelor thesis with word as a CS student where I studied
nano
helix 🥰
I literally made all the website pictures for my final project on photoshop
Lol?
My German teacher prjnted out the .odp version instead of the .pdf version of a handout so all the bullet points were messed up (how is it still an issue in 2023?)
in my defense it's pretty realistic
technology
Looks nice
yes
tech
just a blurred image with a bunch of roundy squares
nexa font
logo I made on ms-paint
they can launch a rocket but cant even make formatting consistent 🥺
who says I can launch a rocket
Building it is the hard part
Rocket science is not music theory! it is easy!
That is why I use OOO sometimes at least it works 24/7
Open office outfits?
everything's too big
libreoffice draw is good tbh
anyone using google docs?
i dont know any better alternatives
that could do graphs so good
i've literally made my CV document via libreoffice draw
i have made a 50 pages networking summary and it looks trash with libreoffice 💀
Google docs isn’t bad
cant really convert it now lol
I wonder if google consumes all your text tho
wouldn't really be surprising
I could bet money that they do
They shove it into bard
I mean even github did
Always use LaTeX for docs or Academia
should always assume that a for profit company uses everything you provide it
Bard is hungry and must consume
I'm even more hungry and will consume bard
Recaptcha was a pretty smart move of google
My parents are really not feeding me enough at times (at other times I get too much though)
now they use it for AI detection or something
yup. Free pretty much unlimited AI training data.
should tell them to feed you more
They just toss like 3 images they're sure it's wrong, 1 image that they're uncertain and 2 images they're certain it's right
and based on the community feedback on that 1 uncertain image they train
Yup pretty smart decision actually
get rid?
are you sayign you want to unregister it as you no longer need it?
Ye the YT video Im watching he does some keyboard shorcut to rid of the paramter
Idk what it is
Sorry prolly a dumb qquestion whats a constructor
?basics
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
all Classes have a constructor, even if you don;t add one
If you don;t add one, no code runs
you can add a constructor which runs code when you create an instance of that class
or you can use it to require arguments passed to the class when it's instanced
Ahhh found it!
Destructor when
when choco adds it
Rip
They suggest you use Cleaner instead, https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/lang/ref/Cleaner.html
Interesting
got it fixed ty
feels like im in hell already
I just updated my plugin to spigot 1.20 but the server doesn't seem to find/run it in the plugins folder
check your log. You'll probably have the "1.2" error
Yeah surround 1.20 with "" in your plugin.yml
in which case you have to set the api-version to '1.20' instead of 1.20
Do “‘s work?
Ok thank you
yes, yaml supports both. " does support linebreaks while ' does not
Cool
Not sure why but # doesn't work on the config.yml file, it doesn't appear
You mean comments?
Yeah
They only work in modern versions
Guys, maybe I don't understand something, but why does the event 'AsyncPlayerPreLoginEvent' always return ALLOWED? Shouldn't it return KICK_WHITELIST when whitelist is on or KICK_BANNED when player is banned...?
if you're on an old version they will get remove if you update the config
Im on 1.19.4
This event firess before teh player has logged in. It's to allow plugins to prevent the login or bypass things like whitelist
Show how you're adding the comments
Put the comments above the value
Why don't the first comments work then
In-line comments should be fine too
Show us how you're updating the config
you can above or inline, but if you use set on a section you have to reapply the comment
hm
Ah, I see. So there's no reason in using this event to load data? After all, a player can be banned or whitelist can be enabled...
You cna use the event to pre load data for when they may join.
Although there is no guarantee a join will happen
best for fetching data from SQL
you can also delay the async event for a short while preventing them from joining
a few seconds, no more
okay, thanks
Thats the problem?
copyDefaults will not copy comments
very first line shoudl be saveDefaultConfig();
replace copyDefaults?
You can keep[ that in the next line
saveDefaultConfig will only create the config on disc if it doesn't yet exist
copyDefaults line will copy any new entries from the in jar config into your in memory config.
Thanks
or any default you set via code
Yeah works now, thanks again!
I need to find a way to find all conjoined blocked that make up a surface.
e.g.,
X X X X X X X Y X X
X X X X X X Y Y Y X
X X X X X X X X X X
If I clicked on the face you are seeing, it would identify all X Blocks, (not Y) and give me their coordinates
not too hard
How would I do it?
a limited range?
blimey 200 is a long way, but ok
well it can be changed
If you ever played hypixel skyblock and used the builder's wand. that's basically what i'm trying to make lol
you need to start by creating a few values. MaxX, MinX, MaxZ and MinZ
that will be your current X/Z Plus/minus your max range
k
what in the blazes
it will only be one block deep, so it won't go past surface
"Right click a block face, and extend all connected block faces of the same type"
Its probably easier if I show you some sample code. I wrote for finding connected chunks (claimed areas)
Yeah just don't want to be spoon-fed xD
you'll have to rewrite it all as it's not using blocks
Alr
Alr
however, you have to check teh Max/Min X/Z to make sure it is also in range
so it's basically just looping through
all blocks
I'll try write something up, thanks
Alr
I'll try it, thanks!
jsut treat plots in my code as your Blocks
I forgot the getPlotCardinal method you also need https://paste.md-5.net/kefonuloja.java
Alr, thanks
+= 1 😢
still better than nothing
atleast you can savely assume that null isn't your fault. Unless you alter something of the plugin
I need to load a config to my main class, when i do it the same way i do it to other classes something breaks
private static final MAINCLASS plugin = MAINCLASS.getPlugin(MAINCLASS.class); that wouldnt work right
Why don't you just use "this"?
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
?
when you are in your main class and you need your main class instance
Then why not just use "this"?
obviously not in a static context
Although you can have a static variable. You would have to assign it in your onEnable().
public static Class INSTANCE;
private Class() {
super();
INSTANCE = this;
}
I found this in a few plugins xd.
I mean it works. It is static abuse though
and the super() is implicit
a circle of what?
falling blocks despawn
tracing a circle is very simple.
a for r loop for radians 0 to 2Pi
x = cos(r)
z = sin(r)
then multiply each by your required radius
Something to ask about jython, is possible to use events and how its possible to load them like plugins, so in this way i can make a sort of Addons system in python
was the easiest i found people just don't want to learn java to make addons and im adding a system like this into my api so its easy to people and even for me adding this
Java addons are pretty basic though
foreign stuff always causes a massive overhead
you have an example or something similar to make a loader or something?
tell those people to learn java instead lol
I may have some residual code at home, I'm at work atm. I used Spigot for inspiration and had an addons/plugins folder and just initialized anything there from within my main process.
thanks, if it is possible i will try remake it in my way so i can have a better understanding
addons as in separate jars?
yes
spigot attempts to load the main class and then hooks into the classloader
dunno that much about it, should look into stash
this is not how you do it
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
seems like i was too fast
you were slow
im sorry
someone else already gave them that link
but I was scrolled up so I didn't see that there was responses already XD
when I replied
thanks for the help
Personally, I like to see curly braces and proper sectioning. I don't want to see loops and functions written in a single line.
me at times
oof
Guys please help me what to do in this situation.
good eyes
still left
Id not ID
yo ElgarL, i'm still a bit confused on what to do. I've looked through your code multiple times and I just can't get my head around it.
I would have to go through each block that's connected and then repeat the process by going each way from that block to see if it's connected... just seems like there would be an easier way, any ideas?
the small method gets all blocks next to the origin and returns them to the main method
So you have two classes
how to fix this
one which finds out all blocks connected, and returns it?
In teh code I showed you it adds the returned collection to the List to check
well, it makes sense to separate code out of the main class as to keep it organized
reload maven
Hmmm
plz post your maven pom
your version of getPlotCardinal would get the blocks N,E,S,W if they are the same material
told you
public static List<Block> getBlockCardinal(Block block) {```
I opened with my phone and it say this error on line 59 at column 22: Opening and ending tag mismatch: url line 58 and repository 🤔
Ok, lemme try something
Those links are no longer there.
no closing url
ur urls aren't complete for the repo
Hi, is there anyone who knows if is it possible to create new Armor Trim with a plugin and a Texture Pack in 1.20 ?
This is what i did
But i have an error
[16:44:49 ERROR]: Failed to handle packet net.minecraft.network.protocol.game.PacketPlayInSetCreativeSlot@3ecbc7fd, suppressing error java.lang.IllegalArgumentException: pattern must not be null
i know pattern is a tag for recipes but did you mess up the texturepack?
This error is in the console so if i messed up the texturepack it should not be here
mhye facts
Does anyone know about this error? "No key layers in MapLike[{}]"
Whenever I generate world with world creater, Bukkit throws this error
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
Does anyone know about this error? "No key layers in MapLike[{}]"
Whenever I generate world with world creater, Bukkit throws this error
This is my code: https://paste.md-5.net/rofazeyoda.java
uhm Spigot Code Async == Almost always a bad idea read it wrong at first
though
can you send the full error in a paste
stacktraces will give specific lines
?paste
Forgive me for being late 🫡
java.util.MissingFormatArgumentException: Format specifier '%s'
at me.rukon0621.guardians.listeners.ChatEventListener.formatMessage(ChatEventListener.java:219) ~[Guardians-1.0-SNAPSHOT.jar:?]
at me.rukon0621.guardians.listeners.ChatEventListener.onPluginMessageReceived(ChatEventListener.java:212) ~[Guardians-1.0-SNAPSHOT.jar:?]
Oh sorry
this is different error
This is the only error line I got "No key layers in MapLike[{}]"
now post the code that causes the error
you can not generate worlds async
ok
try setting world type to DEFAULT instead of FLAT
oh ther eis no default
try normal to test
I know but
generator settigns are only used in flat worlds, so generating using normal will eliminate that as a cause
then we'll know its your generator settings
is this an already existing world?
No I created new world with new name
to test generate with NORMAL instead of FLAT
Ok
it should only affect FLAT worlds
Furthermore I got more serious error this time
but the world should generate fine
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
Is there any huge difference between paper and spigot?
yes
replicate it on Spigot and we can look
How do I detect and modify things in a mob spawner?
yes it is a fork, but that doesn't make either one the same. It means the underlying code does use what spigot has, but they are free to change anything
who wants to try to guess what this is? HINT: It is used commonly
oh I see thank you
node
dynmap
wrong
something on the internet
systemctl restart discord
linux hater
I'm trying to learn how to do file IO propely in java. Is bufferedreader the best filereader to use?
Code
import java.io.*;
public class Main {
public static void main(String[] args) {
System.out.println("Reading file...");
File file = new File("test.txt");
try {
if(file.createNewFile()) {
System.out.println("Created test.txt!");
}
else {
System.out.println("The file already exists. My bad.");
}
}catch(IOException exception) {
exception.printStackTrace();
}
System.out.println("Writing...");
write(file);
System.out.println("Written. The output is: "+read(file));
}
static void write(File file) {
BufferedWriter bufferedWriter = null;
try
{
bufferedWriter = new BufferedWriter(new FileWriter(file));
bufferedWriter.write("I'm writing this text to a file!");
bufferedWriter.close();
}catch (IOException exception) {
exception.printStackTrace();
}
}
static String read(File file) {
BufferedReader bufferedReader;
String text = "";
try {
bufferedReader = new BufferedReader(new FileReader(file));
text = bufferedReader.readLine();
}catch (IOException exception) {
exception.printStackTrace();
}
return text;
}
}
I would have never guessed such things since I don't use web panels
make sure you are properly closing the BufferedReader and BufferedWriter
at least not web panels that just inherently suck it seems
OOh i forgot to close the reader mb
if you use try with resources it will do it for you
but its not super bad that you didn't explicitly do that since the OS will take care of it anyways
and the JVM
still good habit/practice to do it anyways
what you mean resources?
so the difference between a try statement and try with resources is this
try(resource or resources as you can specify more then one) {
code here
} catch () {
}
so anything in the parenthesis will close out automatically at the end of the code block
So the variables get "deleted" after the scope ends? (which means the file would be automatically closed and I would get what i want from it)
Yeah when I put it on the try () parameters it tells me closing is redundant
Learnt something new today. Thank you!
probably want to take a look at the java.nio.Files api (especially Files.newBufferedReader)
I hate the format for try-with-resources when you have more than one resource
It looks so weird
well technically anything in a code block variable wise gets deleted at the end unless declared outside of it
what it does is performs the closing of the resource
IE, the api method actually does in fact call a OS system call
to state its not using it anymore
im wondering how many memory leaks ive already created today
so if your code is appropriate instead of manually doing it, you can instead use try with resources and not worry about. There is still some niche scenarios where try with resources is not ideal
Not closing the reader would give a memory leak right?
Thank you 🙂
in the best case?
I'm now going to practise creating gson type adapters.
as long as you show you are trying and stick around long enough, there is plenty we can teach over time 😉
I learn more here in a hour than at school in 3 lessons.
yeah, fortunately some of us here are actually experts 😛
when adding a dependencies into the pom file, it has to be exactly the same as the other plugin right? for instance, my plugin overhaul systems controls a mana and health system, im trying to import the plugin into my project so I can use it as an API.
<dependency>
<groupId>toast.pine</groupId>
<artifactId>Overhaul-Systems</artifactId>
<version>1.0.1-a</version>
<scope>compile</scope>
</dependency>
I add this to the pom file of the plugin i want to use OverhaulSystems API in, correct? the groupId, artifactId, and version, are all copied from the overhaulSystems pom file, they are exactly the same, but for all of those I get this error.
Dependency 'toast.pine:Overhaul-Systems:1.0.1-a' not found
am I doing something wrong?
Do you have the correct repository on it aswell?
