#help-development
1 messages · Page 1168 of 1
Yea, idk if people did cheap releases then upped it after traction or if I should just price it where I want it
ah yeah, I always take the grandfathered world generator as reference lol
It’s 20
generally people tend to just pick a price and stick with it
there's not much regulation on the market since there's not much of a high demand for premium plugins anyway
yea, looks like some plugins are constantly on sale
Wait until you see non-spigot marketplaces
what does benefactor mean
the OP of that post is one
I mean, they sell more than just premium plugins there
I'd like to assume custom resource packs are sold more than premium plugins even in those places lol
me on my way to sell negative spaces for $20
It’s flame cord
tbf configuring anticheats is hard lol
Wait
MarkElf has a good reputation regarding NCP configs
I assume they mean the #1 non-software resource
so what would you price a basic plugin. it essentially is a locker for multiple armors. (paginated and permission per row)
it's not anything super advanced but I found it cool on a server I played on for a bit a while back and wanted to recreate it.
5
300 robux, take it or leave
jokes aside, yeah I wouldn't pay more than 5 bucks for something like that
5 bucks already sounds like a expense for what would essentially be a limited backpack plugin
Fair, I plan to add features like having a primary slot where you can shift right click for example to change armor.
that's essentially what I have in mind for now
5
I'd place it at 7 just to see if people buy it as-is, then put it on sale at 5 afterwards
5
Yea, I plan to keep it open source too really
it has to be solid tho, otherwise reviews will kill you
it needs a purpose
like what kind of mode is it for
u can also just make it open source, and paid
eh, I wouldn't make it open source
why not
because it doesn't have any value outside of its code
people will just decompile it and piss me off if I don't
thast why u leak ur own plugins
so the price is more to keep it up todate
I mean, people who leak these kind of plugins weren't going to buy them anyway
what you offer is support
Essentially yea
and generally most server owner's wont have a clue on how to compile a plugin and I aint helping them
$0, lore is kinda ugly
the lore is just a placeholder xd
unrelated but to this day I still remember a plugin I used like once, however I always left good reviews on the updates since they listened to feedback really well
at some point they made the plugin premium but they still offered me copies whenever a release was made
I hate that kind of thing
people should be more opinionated smh
my way or the highway
haha, the only reason I got motivated to try this out is that I posted paypal link on my free resource and got a donation the day after because I just updated a tiny feature a guy asked for which was essentially to allow them to set a model which is one line 😛
blud is already on the pipeline
how do people update plugins frequently without creating bloatware?
they just create bloatware
there's no going back
jokes aside, for premium plugins, it mostly seems like they just make an abstract enough system and then offer resources separatedly
see Oraxen for example
so, instead of selling your plugin itself, you sell your highly customized configurations
or u just make everything MIT license cus free is awesome
make pay for support
plus open source
that model only really works for big plugins
well what i usually do is start free, build up a community, and then decide from there
but I want to make easy money!!!
does spigot pay a portion of ad revenue like modrinth does?
I use uBlock so I couldn't tell
yeah me too
thanks for the feedback guys! appreciate it
ok yeah i dont see any ads so there goes that idea
i guess they just run the website via sponsors and donations
honestly amazed it's been around for this long considering its revenue model
sponsorships
seeing the marketshare tipping towards paper, I would've assumed that mattered little in the grand scheme of things
but I guess if you buid a good infrastructure, maintaining it doesn't require a lot
only md could say
it changed a lot within the last 2 years
i feel
cause i swear i remember going to bstats
People still get plugins from spigot
Although hangar does exist now
hangar will never rise in popularity when modrinth exists
it just came way too late
maybe that will change when hardfork becomes a thing but eh, I don't see it
and modrinth pays you
even for free resources?
that's cool
i made $3 after like 3 months and 100 hours of work 🔥
it's a good way to encourage people to not use adblockers on your site
Noice
does it depend on the amount of resources you have or is it a flat rate
I think it depends on how many visitors and downloads on your resource
time to spam 1.8 performance mods on modrinth then
wow its so nice seeing that curseforge no longer lags for shit
and tells you to wait for 5 seconds
its based on how much ad revenue your mod or whatever generates
then you get 25%
so generally tied to page views
your money expired??
how do curseforge points work
they expired yea
idk tbh
all i remember is i uploaded a mod called JavaFX Dependency https://www.curseforge.com/minecraft/mc-mods/javafx-dependency and it got 2.2k downloads and i emailed CurseForge staff to make sure that doesnt gain points
Lmfao
And then this one got 16k downloads https://www.curseforge.com/minecraft/mc-mods/king-mammoth-ambience-patch and it was some BS mod i decompiled and patched up before uploading
You wanna define what t1 is or what
i dont know
i just wanna use it like they do in the tutorial
but i get an error and they dont
Read it
cannot resolve symbol
Look at your code and look at theres
ohhhh
that was a test u passed
For every so many downloads you get points which can be used in their store. One of the common things done was to have your account automatically use your points to pay for premium
I had curse premium for like 3 years because of holoapi getting several thousand downloads lmao
Shoutout to nexus mods in that regard
Once you get enough downloads you get infinite premium
Also with curse you can split points between devs of the project. Not sure if they still do this or not
chat what does all this class public static stuff mean
What
yo
words like "class" public static void
coming a bit late to the party, but pathetic could be of interest
https://github.com/patheloper/pathetic
W
even after the creator update?
idk what that is
ah so it isn't money like modrinth
you can exchange it for amazon gift cards
but never like actual currency
Walk in the parkour pathfinding Goal: Pathfind around Pregenerated minecraft terrain in an interesting way that makes the parkour “fun” and travel through the world, not staying in one area. Methodology: Recursively generate jumps into a list based on this process, given a list of all possi...
This is what i came up with
I dont need an optimized algorithm because its supposed to feel like its meandering
So i essentially picked random markers to pathfind to by finding the highest blocks in the region infront of the path and biasing towards that block recursively
nvm didnt scroll down low enough lmao
its at the top but ok
Soy un usuario que le gusta mucho la programación, quisiera ganar experiencia ayudando (gratuitamente) en servidores pequeños o en desarrollo
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
I'm using the EntityShootBowEvent.. but the force that's coming through for e.getForce() is 3 on a maxed out shot... Has anyone else messed with this and seen a shift in the force value here?
Ah. I guess the force is actually the speed of the projectile.. but it looks like dividing by 3 gives me roughly what I want anyway
okay just learnt about classes and main methods
hi everyone, the download for spigot is down.
can anyone check if this is not a Layer 8 issue?
what do you mean the download for spigot is down
spigot isn't downloadable per se
you use buildtools
I just tried ran build tools and it works fine
are you sure it isn't an issue on your end
Heh
Wdym build tools, i want to setup a spigot testserver and cant download the server jar.
You mean the server jar or wat
I said server-file or not
You build the server jar with build tools
Its illegal to distribute the jar ....
if you were downloading the jar directly from the internet, it is a third-party illegally distributing it
thats annoying
Your site probs got a cease and desist from Mojang
i saw the download after googling "spigot server download"
and it could possibly contain malware so you don't want to download it from these places anyway
what are you trying to say that it keeps getting deleted lmao
the page name that i found
after googling "spigot server download", google that and the first hit is xD
yeah, they got better SEO for this kind of thing, but as said
you don't want to download it from these places
i see
use buildtools
it's all good
Unfortunate but, it’s not legal to have a download on a webpage. The build tools is how spigot can legally follow mojangs terms or whatever. Build tools will also give you the latest patches so it’s the safe way to go
yeah got it done already, worked good with buildtools. Just took longer than i expected lol
It'll be faster after the first setup
Hello, I am creating an api for one of my plugins, (Custom events), this event works when used in the same plugin, but when I hook into the plugin in other project, this event doesn't fire (I have registered it) could someone help me?
I'm using repsy for the repo
This isn't firing (The other project)
do not shade your main plugin in yoru second
This is
I'm not shading it
I bet you are
Where do you fire the event
Do i send my pom?
answer Coll first
(The plugin.canUseVault is true)
?paste pom
you are shading
add a provided scope
:p
whats that other dependency i see
You see nothing!!!
who turned the lights off
Why, I think it’s PaperMC
What? Don't know what you are saying
Droppin some sick rhymes today
So if you don't define de scope it automatically shades the plugin?
pretty much
I see
default scope shades
Let me try, thanks
ooh
Yeah, that worked lol
Thanks
Why does it not work if it is shaded?
when its shaded its looking for its own copy of the event
Which is never fired
dam, i got edited on now my comment doesnt make sense
Because the code for firing it isn’t run inside the shaded jar, it’s only run in the other plugin
gonna jump infront of a stobart truck on the m25
Yeah, but when it isn't shaded why
the reason coll and elgarl said
Ooh
its trying to listen to event instances not just the event name
Okay okay, I understand
default scope is compile by the way, which is why it shades by default
You're lame
i was gonna say that but i couldnt remember if it was compile or something else
Yeah
With gradle, you'll instead spend 4 hours ripping your hair out, frantically Googling why the fuck your dependency won't shade despite telling shadow to fucking shade it
Maven
why my spigot no work i added it likee this
dependencies {
testCompileOnly("spimgot:1.20.4")
}
We have public repositories
no you don't
i think he meant what hygot uses
Doesn’t mean you use the same internally
Yes we do!
nuh-uh
probably
cant believe hypixel is 3 years older thanneon
?howold 1.7.10
Minecraft 1.7.10 is 10 years, 4 months old.
lmao, Discord formatted that 2008 as a list item
that's funny
Fun fact
That's what you think
File transfer via intestine
just gotta @blazing ocean
I saw this earlier
nuhuh
my bad
Guys, do you know why this happens when trying to upload the repository to repsy? On my laptop it works fine, but not on my pc
This is distributionManagement
did you add the user and password to global setings
Yeah
How to change the state of a CopperBulb and a lever (lit/powered)
I have the location of them and want to do a function like this
public static void turnOnLever(Location location) {
}
public static void turnOnCopperBulb(Location location) {
}
check the blockdata
Either ones of these dont seem to work for lever
Lever lever = (Lever) Bukkit.getWorld("plotworld").getBlockAt(-47, 36, 31);
lever.setPowered(true);
Switch test = (Switch) Bukkit.getWorld("plotworld").getBlockAt(-47, 36, 31).getState();
test.setPowered(true);
none of these call getBlockData()
isnt really giving me any function I would know how to use
you need to cast it to the correct class, one sec
cast the block data to Switch
Powerable is even better for your need
after you set powered set the block data back to the block
Powerable powerable = (Powerable) Bukkit.getWorld("plotworld").getBlockAt(-47, 36, 31).getBlockData();
powerable.setPowered(true);
Would this work?
it's like the item meta thing
now set the block data back to the block
altho powerable is no longer a block data
you might wanna use ((Powerable) blockData).setPowered(true);
so you can then do block.setBlockData(blockData);
Block block2 = Bukkit.getWorld("plotworld").getBlockAt(-47, 36, 31);
Powerable powerable = (Powerable) block2.getBlockData();
powerable.setPowered(true);
block2.setBlockData(powerable);
yup
noice
but does it work as is?
if it's powerable yeah
ye lever works
nice
i'm not sure, check if there are other block data
but i think Powerable is used for both
k
I think for copperBulb its Lightable although it also extends powerable, that results in an error
Currently checking if lightable works
nope
also wont work
so .setLit on CopperBulb should work?
rg.bukkit.craftbukkit.v1_21_R1.block.CraftBlock cannot be cast to class org.bukkit.block.data.type.CopperBulb
mhh
class org.bukkit.craftbukkit.v1_21_R1.block.data.CraftBlockData cannot be cast to class org.bukkit.block.data.type.CopperBulb
idk what ur talking about
thats what im doing ```java
Block block = location.getBlock();
CopperBulb bulb = (CopperBulb) block.getBlockData();
bulb.setLit(lit);
is the block a copper bulb?
it wasnt, i changed it, now it didnt throw and error, but after checking on it again its off again
Is it planned for ToolRule to get a constructor or builder? and possibly add a ToolRule to a ToolComponent via ToolComponent.addRule(new ToolRule(...))
so when openGUI method gets executed, also handleOpen() gets executed right?
im not getting why these 2 are different methods
is inventoryOpen listener necesary? if we make the player open the inventory in code anyway
if it would be possible to execute "openGUI()" and "onOpen()" and then just the "onOpen()" method i would understand but i dont
Maybe you can try blockData instanceof Powerable and set the power.
It will work with all blocks that can be "powered".
declaration: package: org.bukkit.block.data, interface: Powerable
this exists because sometimes you have a menu where you want to run some code when the menu actually opens. so its just abstraction to be able to do that easily.
still dont get why not in 1 method, do the things from "opengui" then from "onOpen"
as in a if check or what?
dont rlly know what u mean by this. u mean why not do handleOpen inside openGUI?
[02:35:27] [ForkJoinPool-2-worker-1/WARN]: Caused by: com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (4,739,923 > 65,535). You can change this value on the server by setting the 'max_allowed_packet' variable.
[02:35:27] [ForkJoinPool-2-worker-1/WARN]: at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:107)
[02:35:27] [ForkJoinPool-2-worker-1/WARN]: at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825)
[02:35:27] [ForkJoinPool-2-worker-1/WARN]: at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:446)
[02:35:27] [ForkJoinPool-2-worker-1/WARN]: at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:239)
[02:35:27] [ForkJoinPool-2-worker-1/WARN]: at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:188)
[02:35:27] [ForkJoinPool-2-worker-1/WARN]: at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:683)
[02:35:27] [ForkJoinPool-2-worker-1/WARN]: at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:230)
``` how
Just entered this conversation, could you tell me a little bit of what you're trying to achieve?
yes for example, i just mean to make these 2 methods a 1 method
cuz then it would not wait for the open event
sometimes u need to do specific stuff after that event
make a function to light a copperbulb without nms
Only copperbulb?
yes
okay thanks
Oh okay, have you achieved that?
well
kinda, now im making a function to save the block above the lamp, change that to a redstone block and change it back
Possibly a direct approach would be better
That would lead to more issues imo.
The code you sent above is not working?
The CopperBulb#setLit
no
wtf is wrong here?
cant be cast exception
class org.bukkit.craftbukkit.v1_21_R1.block.CraftBlock cannot be cast to class org.bukkit.block.data.type.CopperBulb
could you give me an example please?
You don't need the class for name line
wdym?
I don't use it and it still finds the jdbc path
what is DatabaseManagerImpl.java:19 ?
(it was tested without the newInstance)
hm
do you think this matters?
if you are on a recent version you no longer need Class.forName at all
what is DatabaseManager.java:150 ?
'
hi, how can I get Time played Statistic? i cant find the constant in Statistic class
declaration: package: org.bukkit, enum: Statistic
be certain they are not setting a max packet size in their connect string
yeah, I'll wait for them to reply
also, isn't that only possible when specifying properties?
your code is not sanitized so they could inject at the end of password if they wanted
new BukkitRunnable() {
double remainingRecoil = recoilAmount;
final float step = (float) (recoilAmount / 2);
@Override
public void run() {
if (remainingRecoil <= 0) {
this.cancel();
return;
}
player.setRotation(player.getLocation().getYaw(), player.getLocation().getPitch() - step);
remainingRecoil -= step;
}
}.runTaskTimer(plugin, 0L, 1L);
is there any way to make the yaw rotation of the camera be less janky while there are recoil steps going on?
thank you
how would you do it?
I'd do it no different, but you can;t trust a client to behave
if they have the user and password they can just as well extract these and drop all your tables with a mysql client
i think sanitization is not the problem here
Yeah its just odd that its teh getConnection which is throwing the over sized packet error. Also the error is showing an odd max packet size so they are doing somethign funky with their MySQL
I saw something similar (if my memory is correct). Setting the client packet size bigger than the servers setting
wrongly configured plugin is my guess, but you are askign in the wrong channel
i didnt notice but can you help
You need to ask in #help-server
ok ill just copy paste the msg
what's the best way to check if a container is non-vanilla? (so not a chest, player inventory, furnace etc)
no, containers created by any plugin
yeah, so far all I've got is checking if it has colours in it
I'm adding client sided tooltips to all items showing their worth for a shop plugin
but I don't want the tooltips added to gui items
maybe try to check if the item has certain item flags
for example all of my menu items have pretty much most item flags
like hide_additional_tooltip or whatever
im sure the client must have a way to find out those flags
to display it correctly
yeah that's a good idea
i need to make a list of itemstacks (i only need material and amount) in config, is this good waay?
items:
item1:
material: CARROT
amount: 3
item2:
material: APPLE
amount: 5
it would be good if you wouldnt have to name these items "item1" "item2" etc
but i think you cant do it like that
what is "map list"
List<Map<String, Object>
use getMapList on items
items:
- material: CARROT
amount: 3
- material: APPLE
amount: 5
``` would be map list
so this is
Map<Map<String, Object>> ???
sure
technically
sorry not this language
a Map<String, Map<String, Object>>
oh ..
I dont know
oh.. because i did something like Map<E>
Who uses lists
emm what
its a valid generic if you want
okay
yeah just use a MultiMap<Void, V> ez
real
a List could in fact be considered a Map<Integer,V> 🤓 ☝️
Considered our just is? Values need to be indexed somehow right?
It’s an array internally
the semantics are different so not quite. A list has different guaraantes such as contiguous indexing
well, that varies depending on the implementation
will this return correctly List<Player>???
yes
alr ty
why not just use Bukkit.getOnlinePlayers() tho
Do you really need to mutate it?
i need it for a manager
it's kinda hard for me to use a Collection<? extends Player>
Bro help
how ?
how what?
Bukkit.getOnlinePlayers already returns a copy
how is it hard to use a Collection<? extends Player>
ah but it returns it as Collection yeah
idk
i js prefer to use list
will it affect performance?
prob not much
it has to copy it twice now
instead of just once
what about for spigot dev?
i mastered java
and ux design
Yeah foe sure
It's uh spelled Tupac
as for your issue, how are you placing the sign?
Also take a look at this, this might be useful. https://github.com/mfnalex/CustomBlockData
these are signs, so it shouldn't be necessary
Hi, I have a plugin that allows changing crops in a WorldGuard region to another crop (only for the client, using Player::sendBlockChange()).
When the server loads, I store all the crops within the region in a HashSet<Chunk, Set<BlockData>>—this keeps track of all the crops in each chunk within the region.
This works fine, but I'm concerned that storing all the crops in this set may not be ideal for memory, since the size of the region and the number of crops can be quite large. I initially used this approach because looping through all the blocks in a newly loaded chunk to check which ones are crops eligible for replacement causes the plugin to lock the main thread and consume a lot of resources, as seen in the Spark profiler.
The reason I store blocks by chunk is to avoid looping through all blocks in the list each time a chunk is loaded and checking if the block belongs to that chunk using Block::getChunk(). The getChunk() method is resource-heavy.
I’m wondering if anyone has a better alternative that would use minimal resources without having to store all this data in a HashSet. I believe my current method works, but I’m not sure if storing large amounts of data this way will cause excessive memory consumption.
well, funnily enough, the CustomBlockData library linked above could be a possible solution
though I am unsure of whether it'd be any better performance-wise being completely honest, would have profile it somehow
I got to ask though, why is it client-sided?
Do you know gens server ?
that what im trying to do every player in the same region, same crops but if a player want to farm carrot instead of wheat he can change the crops only for him
Easier way is to make separate location for each crop
if memory is your worry, I'd specialize the stuff you store
i.e., instead of storing the whole block data, just store the crop type and stage
I don't see how loading crop data could block the main thread long enough for it to be an issue tho, how were you doing it before?
Does the Server.MAP_CHUNK packet, which is sent to a player when a chunk is loaded, contain data for each block in that chunk? I might be able to edit the packet as well.
that what i was doing before but this means that i need to use createBlockData for each crops in the chunk when the chunk load and that was using lot of resources but i can try again and do a spark profiler
u means loading crop data in the hashset when the server start ? actualy this have no issue, i was worried about the memory usage if the hashset is huge
yes it does, and honestly for this kind of thing it could be a good option however it is kind of annoying to handle I guess
yep but i think im able to do it
that said, it doesn't really solve the memory problem
it should turn into better performance since you aren't re-sending all the block datas but instead modifying what the player sees from the get-go, given you do everything right
but if you store it the way you're storing it now, it'll still be a memory hog
or well, could be, you got to measure how much memory it is actually taking
i don’t need to store anything if i editing in the packet directly
i got u wait 2min
how would you know which block it was if the server is restarted or the chunk is unloaded and loaded again
actualy i have this
[BetterHoeHarvester] Collected 1748 chunk and 440723 block states in the region BetterHoeHarvester | Approximate memory used by chunkBlockStates: 260139296 bytes | 248MB
anyway i don’t think that some server owner will have so much block
that is 590 bytes per crop, not too bad honestly
it could be lowered if you specialize the data structure as I said before
yep
so u think i can stay with that ? and not worry about the fact im storing all this data ?
will tryy
it could be better, but honestly I wouldn't worry about it right now
okok and as i said its was a very large region and server owner will never have this amount of block anyway its was a stresstest
then again, since it is a per-player thing, it could increase expotentially so there's that
im not storing that per player
yeah, that's the thing
it'd be better if you stored it per player, since you could get rid of a chunk of memory every time a player leaves
then again, I'm just saying there's lots of room to improve, but it sounds plenty good right now
i don’t realy understand why its need to be per player what the reason
well, since the crops are per-player, it means you can store it in a Map<UUID,Map<ChunkPosition,Map<BlockPosition,State>>>, and delete the chunk maps when the player leaves, load it when they join
that's a lot of maps, in reality it'd be done properly with classes to encapsulate the data lol
Hello, how can I set a limit on the protections placed on users in proteccionstone?
Might be easier to wrap the maps in a class btw so it's more digestible logic wise
gracias !
actualy im storing the selectedcrop of each player in a map already, so i have no reason to store all blockdata for each player, i will never update the blockdata hashset i populate it only on server start and that it
esa gente en mi server estan poniendo muchisimas protecciones los usuarios, tengo que reducir xd
habla en ingles bro, te van a a mutear xd
this is only if i want to store all blockdata for each player, but i don’t need that
that gringos are crazy haha
tt jaja
If there's a github project I'm forking, and that project updates, what's the usual way to include those changes without disregarding your own changes to the project?
Like spigot is a fork of the nms server, so how do they update their classes on every mc update without removing their own changes?
checkout this https://github.com/zml2008/gitpatcher
it just works like what Spigot's patcher scripts did
unfortunately no maven equivalent for it :/
so you might need to use Gradle for this
btw the patcher scripts just do these things: when patching, collect all patches stored before, reset the git repo to upstream's latest ver, apply patches using git am. resolve conflicts manually if any. when exporting patches just use git format-patch on the patched repo.
I already do
good, then you can checkout its readme
Everything else is just inferior
...I should really learn git
that's not difficult to learn common commands
Is it fine if I'm using Kotlin gradle?
Is there any place where I could get gradle basics as a maven user
that's fine! there is no actual resulting differences between different DSL
or just try it and see?
Well, I will when I'm back
No, java > kotlin and maven > gradle
see gradle official doc: https://docs.gradle.org/current/userguide/migrating_from_maven.html
bruh
that depends on people haha
Port plugin from gradle to maven, ez
there is no actual result differences between different build tools if configured them well
objectively Gradle scripting makes build more flexible
Gradle plugins and scripting are great
Convention plugins are amazing
I love being able to create functions and actual variables in my buildscript, not like Maven where you have some arbitrary shitty XML
ah, XML makes people complain
xD
it's nothing arbitrary, that's what the XML schema at the top is for
yeah, that's what I don't like about it
Maven has made big strides on making its build system more easily extendible with maven extensions
it's crazy
gradle plugins are also pretty easy
people aren't looking at it right now because everyone has moved ship to gradle already however they're both very competent build tools, and as far as simplicity of initial setup goes, maven wins there for me
why?
you only need a build.gradle.kts and slap your things in there
and gradle wrapper if you want it
because it's very uncomplicated and deterministic, people don't write their own funny magic on top of what should be a very simple build script for the most part
sometimes you do need a more complex buildscript
basically, I like how opinionated maven is in this regard
many don't, and maven has realized that recently and made big changes in order to support those people, so it actually competes with gradle
this doesn't just apply to jvm langs, here's something I had to deal with recently: https://github.com/rustdesk/rustdesk/blob/master/libs%2Fscrap%2Fbuild.rs
nowadays you have build cache extension, the maven wrapper, polyglot-maven if you don't like xml, and a bunch of other nice stuff that's nicely documented in their page
eh, that build.rs doesn't really look complex
it's annoying for sure
it is just setting up statically linked libraries, the x64 target and generating bindings
it's just horribly documented if anything
because I cannot find libvpx >:(
yeah it's a bit weird I have it installed but it can't find it
I tried installing it with vcpkg (💀) but to no avail
do you have your vcpkg_root env var set
yes
wait but they have binary downloads, why are you building it
I have the binaries kek
true I should switch to gentoo
unrelated but eza is really nice
facts
I really like not having to type whole paths lol
you mean zoxide then?
ls
ah, yeah I use that too
how can it die
never had that happen to me, but I mostly go to the same paths all the time
dunno
I remember when exa was still maintained 👴
the one thing I find annoying about eza is the shitty defaults
got to have this alias for it:
function go {
eza --level 1 --tree --icons=auto --sort=type $args
}
why go tho
go to folder
the alias name is still ls, that's just the function name to not confuse myself
otherwise the set alias command would be set-alias ls ls lol
why go to folder for an ls alternative
why set-alias
what do you mean why, it's powershell
I've grown to really like pwsh because its powerful scripting capabilities
even when I'm on linux, I use pwsh core
claude is also really good at making pwsh functions, so it is nice if I want any utility function
how can i cancel a Bukkit.getScheduler().runTaskTimer()??
get task object then cancel it
if you're using the Consumer overload, then you can cancel the task that's passed on the param
smth like task = Bukkit.getScheduler().runTaskTimer(plugin, ()-> task.cancel());?
declaration: package: org.bukkit.scheduler, interface: BukkitScheduler
Bukkit.getScheduler().runTaskTimer(plugin, task -> task.cancel(), 0, 10);
you made me remember
i gotta update spigot
I mean, both are the same
new BukkitRunnable()?
Yeah but
one is just more convenient than the other
Yeah
Why is it more convenient? i heard it is more convenient and started using it but idk why
Because it’s easier coding wise, like you have instantiate a bukkitrunnable and manually override the run task
You can use lambda for consumer
because you can do the cancellation on-site instead of saving the runnable to a variable then running the timer separatedly
yes you can
you were never required to use one anyways
you could if you wanted to just implemented bukkitrunnable in a class and then not have an anonymous inner class
Sound#valueOf() has recently started throwing these exceptions, how can i fix this?
surely sounds should always have a namespacedkey if Sound.valueOf() returns a value
doesnt seem to be very consistent either because it varies per server, despite all being on 1.21.3
varies per server
Are they all the same software ? (paper/spigot)
Are they the same /version ?
Do you use the same sounds when testing this ?
well its a bit weird and inconstent
the guy that reported the bug used paper
i used paper, no issue
i use spigot, issue appears
the sounds are always the same since its a default configuration
i saw that its possible to add or remove to the sounds enum, but that is not happening as far as im aware
ask them for the /version
if they're running on old tell them to update
they're running latest
i was actually running an older version
i ran latest version of spigot as well
add or remove enum
yeah that does not sound alright
thats what the helpchat documentation clarified
gonna assume they know more than I do then
Don't think they mean the java enum tho
probably not
but you can add or remove sounds from minecraft, i assume they meant that
but i doubt thats whats happening here
since its happening on a blank server
you can't add or remove from an enum but you can however change an enums value
in any case, has anyone else been having an issue similar to this
surely namespacedkeys for valid enum values should not be null
You wanna show us ur code and what ur passing?
What sound is it
Also you should be getting sounds via their namespaced key rather than name
oh i think i know
it passed a wrong string to it
i guess now it doesn't throw an exception when something wrong is passed to Sound.valueOf()
Inventory.removeItem(ItemStack... itemStacks);
Returns:
A HashMap containing items that couldn't be removed.
My code:
temStack item1 = new ItemStack(Material.DIRT, 2);
player.sendMessage(player.getInventory().removeItem(item1, item1) + "");
if player has 1 item (so 1 was removed) it returns
{0=ItemStack{DIRT x 1}, 1=ItemStack{DIRT x 1}
if player has 2 items it reuturns:
{1=ItemStack{DIRT x 2}
but in the first example it should return
{0=ItemStack{DIRT x 1}, 1=ItemStack{DIRT x 2}
i probably shouldnt remove the same itemstack but why is that
Because you're passing the same ItemStack instance twice. CraftBukkit actually mutates the amount of the ItemStack you pass in
Can I ask about ProtocolLib?
Because your items are the same instance, for your first example of only having 1 dirt
- Removes 1 dirt, sets the remainder of item1 to 1
- Tries to remove the second instance of item1 which only has 1 amount left
- Fails, sets item1 amount to 1
If you did player.getInventory().removeItem(item1, item1.clone()), you would see dirt x 1 and dirt x 2
Help Regarding Cancelling fall damage in Launch plugin using ProtocolLib -
public void onPacketReceiving(PacketEvent event) {
PacketContainer packet = event.getPacket();
int target = packet.getIntegers().read(0);
if (target == npcManager.getJeffId()) {
WrappedEnumEntityUseAction useAction = packet.getEnumEntityUseActions().read(0);
EnumWrappers.EntityUseAction action = useAction.getAction();
EnumWrappers.Hand hand = action == EnumWrappers.EntityUseAction.ATTACK
? EnumWrappers.Hand.MAIN_HAND
: useAction.getHand();
event.getPlayer().sendMessage("Hand: " + hand);
if (action == EnumWrappers.EntityUseAction.ATTACK || action == EnumWrappers.EntityUseAction.INTERACT_AT) {
PacketContainer explosion = new PacketContainer(PacketType.Play.Server.EXPLOSION);
explosion.getDoubles().write(0,event.getPlayer().getLocation().getX());
explosion.getDoubles().write(1,event.getPlayer().getLocation().getY());
explosion.getDoubles().write(2,event.getPlayer().getLocation().getZ());
explosion.getFloat().write(0,1.5F);
explosion.getFloat().write(1,0F);
explosion.getFloat().write(2,0.5F);
explosion.getFloat().write(3,0F);
explosion.getAttributeCollectionModifier().write(0,new ArrayList<>());
protocolManager.sendServerPacket(event.getPlayer(),explosion);
}
}
}
});```
It works , the launch part, but I don't know how to cancel the fall damage
you don't need packets to cancel fall damage
use entitydamageevent
and check the cause fall
and as far as i know, you don't need packets for explosions either
I just wanted to see if there was a way with NMS/Packets/ProtocolLib
Ooh I just randomly thought about launch thing and tried implementing in ProtocolLib , to learn
nms is just for listening incoming and outgoing, anything that changes the server state should be done via the spigot api
in that case it's alright
just keep in mind tho there are more easy ways to do it
it's like a line in spigot
player.getworld play explosion i think
Thank you for the help
no problem 😄
if it's short, i gotta go for a bit
So when creating NPC is it possible to create like a damageable npc , I tried using a Damage Event and other stuff but it gave error, most probably bcs the NPC isnt real just b/w the client and server
you can do it via packets, but it's a lot of work
the server does most of the work
so if you can spawn a human entity on the server it's even better
so what shld i do or explore ?
i think citizens has most of the answers on how to do it
So I research more on how to spawn human entity?
it's still a lot of work
you'll have to add it in the world, i'm just not sure how you can add a human entity to the world tho
sure I'll look it up thanks
np
what does "mutates" mean
Yes
oh
so it will only take normal dirt with no special meta or other things?
What? No. I'm just saying that the ItemStack you pass into removeItems() is going to have its amount changed, and that's why you're not seeing the results you expect
CraftBukkit probably shouldn't be changing the amount of that item stack, especially because that side-effect isn't documented, but it is what it is
oh yeah, i just asked another question not related to that
how do i make a plugin support velocity bungeecord and spigot at once? ik tehres something to do with modules or wahtever
do you know how to check if player has enough items? like check if the hashmap will be empty without removing the items
and then remove them if there are enough
There are two ways
- Implement your own method to do that, which isn't inherently difficult
- Copy the inventory, run removeItem() on that and check the result
I'd personally suggest the first one because the latter ends up copying a lot of items and performs two remove operations, but yeah
public static boolean hasEnough(Inventory inventory, ItemStack itemStack, int amount) {
int total = 0;
for (ItemStack slotItemStack : inventory) {
if (slotItemStack.isSimilar(itemStack)) {
total += slotItemStack.getAmount();
}
if (total >= amount) {
return true;
}
}
return false;
}
That would work fine
Optionally you could omit the "amount" parameter and use the amount of the itemStack you pass in, but that's up to you
Yeah that's fine. Edit however you'd like. That method should work fine though
how do i view a servers ram/cpu usage? with code
like implement that in my plugin
i dont want a command or whatever tahts why i specified
Java has a Runtime class you can poll information from, https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/Runtime.html
oh and ill make it a player not inventory arugment
is this an answer to my question?
Yes
thanks
or better a set
A Set probably isn't necessary. You likely only need an Iterable<ItemStack> because that's all you're doing is iterating
That way it can be any sort of iterable object, which includes any form of Collection
(and technically could also be an Inventory 👀 because it in-and-of itself is an Iterable<ItemStack>)
um
public static boolean hasEnough(Player player, Iterable<ItemStack> itemStacks) {
int total = 0;
for (ItemStack slotItemStack : player.getInventory()) {
for (ItemStack itemStack : itemStacks) {
if (slotItemStack.isSimilar(itemStack)) {
total += slotItemStack.getAmount();
break;
}
}
if (total >= amount) {
return true;
}
}
return false;
}
I guess that sums them all together which probably isn't ideal
inventory is iterable?
yes
since when?
idk
umm
i think thats not it
public static boolean hasEnough(Player player, Iterable<ItemStack> itemStacks) {
Map<ItemStack, Integer> remaining = new HashMap<>();
itemStacks.forEach(itemStack -> expected.put(itemStack, itemStack.getAmount());
for (ItemStack slotItemStack : player.getInventory()) {
for (ItemStack itemStack : itemStacks) {
if (slotItemStack.isSimilar(itemStack)) {
remaining.computeIfPresent(slotItemStack, amount -> {
Integer newAmount = amount - itemStack.getAmount();
return (newAmount > 0) ? newAmount : null;
});
}
}
if (remaining.isEmpty()) {
return true;
}
}
return false;
}
That might work the way you want
Or maybe smarter
public static boolean hasEnough(Player player, List<ItemStack> items) {
for (ItemStack item : items) {
int total = 0;
for (ItemStack slotItem : player.getInventory()) {
if (slotItem.isSimilar(item)) {
total += slotItem.getAmount();
}
if (total >= item.getAmount()) {
break;
}
}
if (total < item.getAmount()) return false;
}
return true;
}
i made this
That's actually probably way better and avoids the whole map shit I was doing lol
I'd still opt for an Iterable<ItemStack> over a List<ItemStack> though
You don't care about order. All you care about is that you can iterate over it. That's it
Hello. Can somebody say how to fix local host Ip
how to make show real peoples ip
im using paper mc on my pc
?whereami
stop crossposting and go to paper
rad why dont you have a discord
good question
why does this not work? Custom smithing inventory btw
wth it showed the gear on the armorstand
its actually so buggy
but when I shift click any of the materials:
I dont need it to be functional, I just need it to show they output normally (Like in the image above)
how would i make a discord to minecraft chat sync plugin? do i need to make a discord bot inside the plugin?
webhook
then a bot
thats impractical ngl shit plugin idea
it takes so much memory to run a discord plugin
i mean discord bot
so my plugin would take up so much memory and cause so much lag
what are you talking about
discord bot inside plugin
then dont have a discord chat 🤯
Or use discordsrv
i didnt wanna use an api
it doesn't take up much memory at all and as long as you do it outside the main thread you're fine
"do i need to make a discord bot inside the plugin?"
"yes"
"ngl shit plugin idea"
im not talking to you gtfo here
i dont need your observation
ik what i said
oh alr
that attitude sure makes everyone wanna help you
oh i remember you now
you were that guy who got muted for a week for being a bitch
youre not helping me lmao just laughing atm e
tendencies 😂
lmao your moms the bitch
arent you the guy that cried cause i said youre annoying
brto still remembers it after like 6 months
😭
cry some more
bros gonna call the staff and get me banned now
im considering it
even though hes the one that called me a bitch first 💀
weren't you the guy I tried to help who told me to stfu and gtfo :p
nah
ngl i see a lot of people saying that to you but i wasnt one of them
maybe youre the problem?
are you depressed, 11, trolling, or something else?
ok i don't need to waste more brain cells and energy on this bullshit 😂
"all of the above"
A. depressed
B. eleven
C. trolling
D. all of the above 💀
real
anyways, bump :3
bro has addicted to coding in his bio and is trynna clown me 💀
who tf is even talking to you
mate this is a help channel
@blazing ocean dyk anything? I cant find anything on forums :(
ghosted D: rip
i know the answer but maybe rad should help you since you dont like me so much ;(
You dont come off as very likable
do you have childhood traumas?
nah
sigh why is it so hard for people to be nice
according to rad, you acting like this isn't a one time case 🤔
can you suck it though?
"I don't have any counterargument to that so can you suck it though" ah response
what counter argument would i have to something that isnt even an argument
you were being rude to me first
ill quote you
maybe youre the problem?
yeah thats what i said to rad who tf are you 💀
guess you're short tempered then?
my temper is very good you just lack manners
I'm Pumkinhead 👋
and you got the same energy that you gave me
idk why youre crying
if you didnt want me to be rude you shouldnt ahve been rude to me
your responses so far are showing otherwise
Making you feel bad about yourself was never my intention
nothing you can say will make me feel bad about myself but maybe you should socialize a little and learn how to talk to strangers respectfully and i wont be rude anymore
i literally dont knwo you and youre making fun of my question for no reason wasnt even talking to you
obv im not gonna like it
whats that gotta do with my temper
Bukkit.createInventory
1.20.4
and player#openInventory
😭
Use my library open me it's archived because latest api replaces it
But it'll work for outdated
r u saying I should upgrade?
average miles self-shilling
yeah
alr ill do that rn
?howold 1.20.4
Minecraft 1.20.4 is 11 months, 1 days old.
Then you use MenuType
11 months is not old at all lol
not even 1 year lol
11 months too old for the new api
meh there's been a fuckton of changes
But I noone asked you ;)
XD
no one was talking to you ;)
why is it so hard for you to be nice
BRO
\
I LITERALLY
WASNT TALKING TO HIM
AND HE REPLIED TO ME
AND SAID NO ONE ASKED OYU
HOW IS IT MY FAULT
ARE YOU GENUIENLY STUPID
11 year old mindset go brr
goes for both of you
im 100% older than you
I 100% don't care
you dont even have basic manners to talk to a stranger
okay thats it enough arguing
respectfully
youre a little fatass kid
your skin is fuzed to your chair
probably havent seen grass in years
What is your goal here?
and it is now where i ping @young knoll
this is all you do lmao youre just rude to me and when i reply you try to back off
possibly @austere cove
possibly can you suck it?
what on earth
what did he do to you 😭
who?
ill pick you up tomorrow
pick deez up
I genuinely cant tell if hes trolling or not 😭
Anyways I hope I was of help
this isn't the first time they've acted like this
thanks for help chocolate
seems like not the last either 💀
I didn't need to update any code while upgrading? thats wild
