#help-development
1 messages ยท Page 1216 of 1
is there anything bukkit/spigot provides that uniquely identifies a server, persisted through restarts and is not modifiable
no
also makes no sense
The best you can do is use the main worlds UUID ig
uid.dat in shambles
Hi i have a problem. When i use launchProjectile() it trigers the LaunchProjectileEvent which launches even more projectiles because of a specific method. And when i spawn the projectile and set its Velocity it hits the entity thats suposed to "lauch" it. Does anyone have any idea how to fix this problem?
Should't normaly spigot methods not triger any other events?
Well, it's still happening on the server
afaik, everything that triggers a certain action still calls the corresponding event
Are you launching projectiles in the launch projectile event
yes
One hacky way you can get a round it is to just keep a boolean that you toggle
event:
if myEvent
myEvent false
else
myEvent = true
launchProjectiles
i will try thanks
what the skript
If i use the setShooter void on the projectile will it still hit the shooter when fired?
try it and see
didnt work
then there's your answer
how can i go about using flags in my commands in ACF?
like for example
/kick player -s true would make the kick silent (gimme a variable named silent to work with)
and /kick player would just be normal
or just -s instead of -s true would work too
what to do when people spawn in the wrong world
like i want them to spawn in a second world when they join
if thats all you want, and not making a custom plugin is an option then just use EssentialsSpawn or some other spawn setting plugin
hey, looking for some advice, i have no clue how to use SpecialSource, I wasn't able to find any documentation on it, the only thing i was able to find was some old forum post referencing some old Shopkeepers module files where it uses SpecialSource but i can't figure out how to use it, any help?
this is what im trying to do
?nms
i've already folowed this tutorial
the issue im facing is that i dont have a mojang remapped jar
then you didn;t follow the tutorial
uh, maybe i skipped something, not sure, im going to read it again
at the very top it tells you to run buildtools with a specific arg
pretty sure build tools cannot do mojang mapped for version before it supported it
i specifically said 1.16.5, the remapped option doesnt give the remapped jar because 1.16.5 didnt come with mojang mappings
yeah but there should be a way, right?
i used a tool to convert the mojang mappings (txt) into a tsrg file, can i use that? somehow?
i'll see what i can do with that page, thanks
how would i do that?
i got the essentials spawn
what command do i run to set the spawn?
.
?paste
ok so, i was able to get the obfuscated mappings, this is my build.gradle https://paste.md-5.net/irelezikan.cs
and it also fails to find the special source main class
oh god not someone trying to use mojmaps on gradle
current: https://paste.md-5.net/tasurokodu.cs
whats wrong with it?
it's just a huge pain, especially without wanting to go through the mess of SS
what would SS be
specialsource
well, im looking to use it but i dont know how, im not even sure if what im doing is correct
do you have any reference for this? or a repo i could take a look at
Just use Patrick Chloe remapper
well if you look at the build.gradle paste i sent above i am using it
i have so much little clue that i commented out the line that sets the main class and it built the jar just fine ๐, it prob wont work though
this still stands
bros got glorious curly hair
Wtf
drop ur routine thx
i cut it recently ๐ญ
just shampoo
๐ญ๐ญ๐ญ
sometimes a foamy thing to make it nice and curly
Real
im pretty sure 2/3 messages here are not even related to spigot, and i love it
average help development conversation
well when you put a lot of cs nerds together, they are definitely gonna talk since its the first human interaction theyve had all week
true
Hey, I have a question. I created a new project with the IntelliJ minecraft project wizard. I am currently trying to add this to my project: https://github.com/sya-ri/minecraft-server-gradle-plugin
I will send the build.gradle in a sec
So I added the id and version to the plugins block. I noticed the things in the example didnt work because I think they are using a kotlin build script and mine is a groovy one?
tasks.register('launchMinecraftServer', LaunchMinecraftServerTask) {
dependsOn("build")
jarUrl.set(LaunchMinecraftServerTask.JarUrl.Paper("1.21.2"))
agreeEula.set(true)
}
So I tried to recreate it using what I am using, now when I try to run gradle I get the following output:
A problem occurred configuring root project 'growable-rebalance'.
> Could not create task ':launchMinecraftServer'.
> No signature of method: static dev.s7a.gradle.minecraft.server.tasks.LaunchMinecraftServerTask$JarUrl.Paper() is applicable for argument types: (String) values: [1.21.2]
Possible solutions: Paper(java.lang.String), grep(), tap(groovy.lang.Closure), wait(), every(), any()
So the thing I put into the JarUrl.Paper is a string in the config as you can see above
But I don't get whats wrong here
you probably wanna be using https://github.com/jpenilla/run-task
Thank you, I will give this a shot
Oh wow that just worked out of the box. Thank you very much
this might sound pedantic but is there a way to make intellij add spacing between different package imports?
It's sort of possible
far from ideal though
Settings:
Editor > Code Style > Java > Imports > Import Layout
Manually add every import group and a space between them
its good to have when you read code from git repo
how do you call this bar in UI that's in windows file explorer baked in
tracker bar?
details bar?
footer?
Yeah, either a footer or a status bar probably
Choco is correct, it is a status bar ๐
try priority = EventPriority.LOWEST
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/EventPriority.html
declaration: package: org.bukkit.event, enum: EventPriority
because another plugin maybe canceled event
What exactly do you need to get in the end?
I wanted to know what kind of plugin you want to make.
But try EntityDamageByEntityEvent
xd
Funny idea
How is pvp disabled? Some kind of plugin?
If you're worried about it being cancelled you should set ignored cancelled instead
does anyone know why cancelling the InventoryClickEvent doesn't stop people picking up items anymore? It's setting the item back, but the item duplicates onto the cursor? This is a debugging thing and every inventory interaction is cancelled.
you wouldn't happen to be in creative mode would you?
in this case yeah, does that break it?
Indeed
oh yeah that's strange, is there a way to fix that?
There should be a creative inventory interact event or something iirc
ah, thanks! I'll have a little look for it
?jd-s
declaration: package: org.bukkit.event.inventory, class: InventoryCreativeEvent
thank u
its not spigot
its an implementation thing from mojang
Creative has long been known to not work the same way as typical play usage
Oh a mojank even better
this goes back to like almost the first versions
believe it was around 1.5-1.7 though where it was more noticable since more features being made available through the api
i feel insulted
Is there any documentation on how to use specialsource or do i have to inspect the source code?
using it for what?
using it for what it does, probably?
"Anyone know how to use a lawn mower"
"using it for what"
i want to use nms on 1.16.5, i have read the patrick remapper tutorial multiple times and have used that for all versions past 1.16.5 but since build tools doesnt have mojang mappings for versions pre 1.17 im forced to do all kinds of weird stuff
well it can be usedi n many different ways
oh yeah
spigot doesnt support mojang mappings back then
so you just use the normal spigot dep with no mojang mappins
and dont need to worry about any deps
not deps, remapping
what if i made the remappings myself
your gonna have a really really fun time dealing with it all
its much easier to either not support 1.16.5 or you just have to use the obf jar
how hard is it on a scale from 1 to 10
more effort than its worth
mh
Does anyone know of an api/plugin I could use to see what the server would normally send to the player?
Just joining a fake player
packetevents?
I'n just trying to parse the visuals a player (even if there's no player on the server) would see after an entity spawn from commands
But I'll try a different way probably
is there an event to tell when a player hits an entity which no health value? (eg: tnt)
Interact with block?
Probably PlayerInteractEvent check for action LEFT_CLICK_BLOCK
Could you explain what you're trying to achieve? I can probably answer it better.
hello, I've been learning Spigot for just about 2 months now, so apologies if I make any mistakes here or misunderstand anything.
right now in my plugin I have a title and sub title text being sent to players on my server that just shows a few minus and equal signs "[-=-=-=-]" changing color as a sort of "loading animation" a few times per second. I would like this "animation" to continue playing at a constant rate, even when the server's main thread has slowed or briefly freezes, however I have been having trouble doing this.
so far I've set up this code within a class extending BukkitRunnable and am running this task asynchronously, using title packets to send display the title message on players screens. the target players are referenced off a HashSet which has been given the needed set of players ahead of time before starting the runnable.
this has been "functioning" as expected, correctly displaying the title text "animation" on players screens, however during testing I've observed that it seems to stay exactly in sync with the server still. by that I mean it slows down / freezes when the main thread also slows/freezes. this happens even after changing this from a synchronous task to an asynchronously with packets and no Bukkit API calls. this slowdown occurs even when my computer resources aren't being fully utilized, and other applications on my computer, as well as my Minecraft game client, are running at their full independent speed just fine from what I can tell. I'm aware that features such as game chat and such still seem to function just fine and do not experience the same slowdown, implying to me that that also uses the type of async usage I am looking for.
_ _
_ _
is it possible to make the rate of my packet sending NOT tied to the server's tick rate, so I can keep this visual text updates continuing at a constant rate? perhaps I'm misunderstanding how something works here as well. been researching this topic but have been unable to find an answer. if anyone knows, any tips or suggestions would be appreciated. thank you.
I just realized I forgot to mention. I am using specifically this method "runTaskTimerAsynchronously" on my bukkit runnable extending class
you are overloading yrou server
packets are placed in an async queue to be sent, they have no real limitations
if yoru main thread is slowing down AND your async tasks are lagging then your whole server is lagging
I see. so basically this is a server issue and not a plugin issue, correct?
hardware limitation, or you are saturating your network
hm not sure if it's a network thing since I am running the server and the game client I'm testing on the same device
I'm still a bit curious as to what might be causing this, as like I stated in my message, my computer usage isn't that high and all other software including my Minecraft game client is running at the normal speed
all of the slowdown is contained just within the server. I would like to know what I may be able to do to look further into this
run a spark profile and see what is putting the most load on yrou server
you may have made a mistake somewhere and you are hammering packets out unknowingly
that sort of tool isn't something I've ever worked with before but I could look into it
also as previously mentioned, during this sort of "slowdown", not just other software, and my gameclient continue at a consistent speed noninterrupted, but so does the server chat itself. I can see both in my console and in game the chat continueing to update immediately when I write test messages
yes, that is what I'm trying to set up here with my title packets
I'm trying to replicate that sort of behavior
run it in your own thread (scheduled executor)
that is what I am doing
oh I see. thanks for informing me. what method(s) should I use or look into instead?
that makes a lot of sense why I see no performancechange here then in my plugin
this is actully not a good example as they schedule a new task for every number
you just want one task from what I understand
oh okay so this is non Bukkit it's just Java? as mentioned previously I am quite new to learning a lot of this stuff. from what I've read and what others have informed me, using asynch runnables outside of Spigot or Bukkit api is "not a good idea"
but ScheduledExecutor is what you want
so I wasn't sure if it was okay to use that sort of thing
got it. thank you so much. I'll definitely look into that. I see why my runnable solution didn't work now that you've explained it
any good data storage libs? i dont feel like doing the whole mysql/sqlite integration setup manually for the millionth time
combine with Jackson and you are good to go (u can use it with the integrated json tho)
I advise this one for small to medium plugins ; if you are going to make a big data plugin stay with a database ^^
because of the performances and storage space in game server side
i plan on sticking to a database
i was wondering if theres any libs for easy integration
Exposed?
for kt exposed's nice yeah
something like this ? https://github.com/Huskehhh/MySQL
But building a service for your database doesn't take too much time :/
yeah well i wasnt home so i was wondering if theres any good simple ones
but now that i am on my pc im thinking why not just make my own handler
i think im gonna just
copy my old code from my plugin, refactor it, and turn it into a package
hello, im looking for a way of obtaining spigot jars programmatically, preferibly from a url; I've tried using buildtools but when i do so it takes a long time and i need it to not take that long
Buildtools is the only legal method of obtaining the server jar
i was thinking of building each jar manually and putting them in a repository, is that ok?
if its private and only for you, yes. If its public, no.
mh
what im doing is im working on a testing platform for github actions to run tests for my plugin on spigot, which obviously requires the server jar, there doesnt seem to be a nice way to go about it, though...
I assume you're not talking about the package declaration in a class
so what package are you looking to make
Github actions can run BuildTools and keep the server jar in the cache
ohh how would that work?
i wish to make a simple mysql handler, to avoid having to write the same code in every goddamn plugin i make
but i have never made a package before (that people can import and stuff yk from their pom or gradle)
beautiful, thanks
is there any utility method in java that allows to resize the fixed size array
ik i can use System.arraycopy but im wondering whether there's one liner function for this instead
i would love to have something like js :[...foo, 'bar'], but java afaik doesnt have something like this
Guava is shaded right?
On spigot
the only place in 2-3 years where i use & operator in generics
public static <T extends Observable & Collection<V>, V> Button selectAll(final EventHandler<? super MouseEvent> handler, final T tracked, final T selected) {
return GenericButton.selectAll(handler, GenericBinding.deselected(tracked, selected));
}
hmm yes
mhm yes hmm
ive had IntelliJ open for an hour and a half and all ive done is delete a thing i made yesterday because i realised it cant work
hold on whats this & doing here
every time i think i understand generics i stg
Basically defines multiple generic constraints
For example that my event must be a subtype of both PlayerEvent and Cancellable
So you can do stuff like getPlayer, check -> setCancelled
classes can only extend one thing tho. i take it this merges implements into it too?
You can implement multiple interfaces
But yeah it does
the T extends Whatever applies to interfaces too
you can just treat it as a "T inherits Whatever"
there's also T super whatever but it isn't as popular
is it the same meaning as extends?
They are slightly different
javafx... why?
why not this instead:
public static <T extends Observable & Collection<?>> IntegerBinding size(final T observable) {
return new IntegerBinding() {
{
super.bind(observable);
}
@Override
public void dispose() {
super.unbind(observable);
}
@Override
protected int computeValue() {
return observable.size();
}
@Override
public ObservableList<?> getDependencies() {
return FXCollections.singletonObservableList(observable);
}
};
}
i literally copy pasted the implementation from javafx internal static method and applied generics
it works perfectly fine
and allows for any observe any collection size
there's no point either way to listen for size of observable array
its not fixed size
so what's the big deal really
........ aaaaand how?
extends doesnt allow inputting super class as a parameter List<FooBase>, while using super does it
if you have
List<? extends Player> as a parameter, you cant pass List<Player> it will error out
List<? super Player> will also take List<Player>
noted
well its not like that really, ? super Player is better since then you can downcast list to lets say List<Object> and it will still take it as a parameter:
public void foo(List<? super Player> list) {
final String name = player.getName(); // error! Even if we know that object provided has any of the superclasses, but we dont know that if it has Player class on the object
}
public void bar(List<? extends Player> list) {...}
...
List<Object> objects = players;
this.foo(objects) // this would still compile and but you lose access to methods of Player
this.bar(objects) // with ? extends, compiler be like wtf you're passing List<Object> to List<? extends Player> parameter method??
you usually use ? super for consuming values a.k.a parameters, because compiler can infer the type even if was downcasted, meanwhile ? extends you would use for producer return types
basically you need those wildcards because java doesnt implictly downcast generic values if you have function:
public void foo(List<Object> list) {
...
}
you cant pass anything higher in terms of inheritance:
foo(List.of((Object)0)) // works because List.of((Object)0) evaluates to List<Object>
foo(List.of(0)) // doesnt work because List.of(0) evaluates to List<Integer>
so if you want to control what kind of downcasting or upcasting checks can compiler do when you provide an argument you use ? super Foo to provide for the compiler that it can take generic parameters which are lower or equal inheritance related to Foo class and ? extends Foo to enforce that provided object should at least have access to Foo methods
what would be the best way to store a list of players in a mysql column?
like
CREATE TABLE IF NOT EXISTS playerGroups (groupId integer PRIMARY KEY, playerList {SOMETHING});
that's very deep topic really
it depends if you want normalized data or not
i simply wish to store a list of player UUIDs in the column
order does not matter
(and then get them back easily)
if you want flexibility with filtering data, etc. you would store it in normalized form by creating new row for each user
if you prefer performance over flexibility, you store the list in encoded format like json inside varchar or some other data type
json it is then
i need no flexibility, it is just a pile of UUIDs
nothing less nothing more
well if its only uuids i guess
normalized tables are not that expensive either nowadays, if you would need to expand your code later i would just use new row for each user so that i can add more columns
but if you're only storing it just for the sake of storage well it doesnt matter much
thats the first thought i had, but there is literally nothing to store or will be there to store
i have a seperate table for player data already, this is just telling each team object that "hey mate, these players are part of you" "aight bro thanks"
convenient
Do note the implementation difference of JSON between MySQL and MariaDB
I do recommend keeping the database normalized instead of using JSON
uuid[] type?
or does mysql not have tat
uuid array?
wtf why do people still use mysql its so shit
i just read it doesnt even have arrays
like wheres the advantage over postgres other than less features
more widely supported
You're supposed to normalize your database
instead of having an array directly in a column
sometimes normalizing it just doesnt make sense
by normalize you mean 'reduce to primitive types all databases support'?
i think he means that youre supposed to have only 1 value per table cell
so you eliminate arrays by making groupId just an index and have multiple rows with the same groupId
that way you can get all members of a group by filtering groupId and reading all rows returned
^ Part of first normal form
but what if you tread the array as 1 value
not the contents of the array which would be multiple but just the array which would be 1
Least interesting discussion to date
databases support custom types nowadays, they arent one value either
do whatever the fuck you want with your SQL, if it works for you, life is good. If it doesn't, run a DB migration
you could argue that an integer is multiple values too: 4 bytes
It represents a single value
now that I think about it, the entire DB is a single value
its all just a big byte blob
the array represents a single value, the "members of a group" is one value
cause its a list
and a list is one value
I'm just saying that storing a JSON string as an array in a column is a bad idea, but if you want to do so I can't stop you
if i cant update parts of that value (for example by storing it as JSON) then its one value
and json in that case is simply less efficient than a native array
So you are saying that arrays are not one value 
given you can update parts of it
they could be seen as such
But tbh, members of a group in an array does sound complete ass. Unless pg has some mystical in-array indexing
well if i wanted to then yeah, i would normalize the table, but if i just want to store an array and never modify parts of it then i would store it as an array type
maybe he has another table going from uuid->groupId xd
Yea and at that point one should be banned from database design
xd
why java doesnt have function scope static variables
i see it kinda useful for encapsulation of reusable constants which are being used exclusively within that static method
What.. would be the use of that exactly?
public static void display() {
final static Alert ALERT = new Alert(...);
...
this::display.ALERT.show()
}
something like this would be pretty cool
Okay now explain why this isn't possible with static fields
it is, but you cant do hide it primarily into function scope
C style static pretty much but in a language that doesn't need it?
How is this any better
well i can move function without carrying the dangling static field outside
and now explain how that is needed in java
So basically you designed something poorly and need to cope so hard you need a language feature nah I get you tho
that's for utility functions only
what if i use that variable only within one function, what's the point of exposing the field outside the functions scope
"OOP" reusability fields alll the fun stiff that comes with it
I think you're looking for something like Haskell you can find that out by the dumpster outside
muh OOP. if java was truly oop we would've never got lambdas
what's the point of lambdas
I'm not having this argument you need help
hah
gotcha
i mean its not neccessary and stuff, but it would be pretty cool feature to have
now what the fuck
fucking autocorrect + my inability to type
Java allows for multiple paradigms
Kind of not really you can't go purely functional in Java
It gives you the choice to do some functional programming but it's nowhere near thr capabilities of any competent functional language
iirc static methods anyways are not living on top of the class implementation, they're stored outside of the class in bytecode level so having function scoped static fields are not something that's deal breaking in terms of compatibility
Java at heart is based in OOP and it's fairly opinionated about it I mean see the language design
The exception would be enum and static methods but these are fairly sensible additions
Go for Kotlin @mortal hare
It fit perfect for you ithink
kotlin my beloved
hey that's mine
stop copying my shitposts
smh
this channel really is 90% shitpost huh
correct
only noticed now?
More like a pointer
Map returns references due to generic parameters not wannabe primitives
unless you use fastutil maps
Only primitives are pass by value
if i have a value that is a custom class
and i grab the value and use a setter of the class
will the map now have the updated class
yes
so ive been paranoid for nothing
(for now, soon(tm))
good.
all java is pass by value though
now thats what had me confused
if all java is pass by value
then is the map thing reference or nah
that's like saying c is pass by value because pointers are copied
ok so but the value will update automatically tho
so im good right
i dont have to put the updated class instance back in the map
if you put the object in a map and you mutate the object somehow via its setters externally then yes
If you modify something inside of the object you got in the map then yes it's updated in the map
yeah the class has setters for all its internal stuff
It's not copied
ok ok ok good
the only things in java that are copied are primitives
but you cant pass those directly into map
(yet)
the reference to an object is copied, but not the underlying data of the object
you need to box int -> Integer, boolean -> Boolean object types
"reference to" here is key
hm.. mhm
IdentityHashMap: am i joke to you
does anyone know how to make copy of a world and paste it?
World temp = Bukkit.getWorld("template");
lets say I got a world named "template"
and how do I create a new world thats name gonna be "duels" and it will look 1:1 to world "template"
cus I want to make copys of world for duels so when someone duels another player it creates this world and delets after.
i want to run a task to save all data when the plugin is being disabled
but spigot wont let me access any of the api once shutdown has started
are there any workarounds?
do it IN onDisable not in a task. The scheduler is not available at that time
so it has to all be done on the main thread
once onDisable fires yes
yes but why do you even want the plugin to save all data?
just in case the server owner wants the data to not dissapear ๐
like when you disable your server or reload it or restart it it automaticly saves itself
why the hell would i do the server's job
but oh well
@misty ingot could u help me real quick?
with what
?
with this
like how do I create a new world that is copy of an existing world
in my plugin
???
if the arena is small you should use schematics
copy the folder, rename it to the desired name, then create the world gg
otherwise copying the whole world directory is the only way (^)
I cant
I just want new worlds to avoid any glitches
then copy paste the whole world directory
give the directory a unique id-ed name
delete it after
I dedicated my yt channel to bug finding Im mod on berry for finding glitches and found a lot of vespa glitches
I know how the duel mechanics should work
and Im trying to prevent every glitch from the start
also make sure to clear it up when the server starts, in case theres any leftover dirs from a crash
just how do I do it with java...
void createNewWorld(World world){
File worldDir = world.getWorldFolder();
String newName = world.getName() + "_temp";
FileUtils.copyDirectory(worldDir, new File(worldDir.getParent(), newName));
WorldCreator creator = newWorldCrator(newName);
World newWorld = Bukkit.createWorld(creator);
}
for giving it a unique id, literally like make an iterator variable
well you might want to find out why it doesnt work
and it just doesnt lett me use it
uh no clue why even...
time for a
well i have told you the basic outline
its time for a google search
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! ๐
ah, so thats what the command was
learnjava
anyway, good luck
๐
if someone can help pls join vc general-1
Are skull textures loaded by doing an io request to some api with the image of the skin?
yes and no
So they wouldn't load offline?
first the cache is checked for said player texture otherwise it then does a request to mojang servers for it
Okay
im actually doing .setOwningPlayer on a skull to an offlineplayer and it doesnt seem to work if they are actually offline
Are there any special measures you can take
To extract just the head or just left leg for example
left leg? For skull?
From a normal texture as in
I have a player named Shadow
I want to give the player head the texture of just the left leg
don't think that would work without cutting off some of the leg
I would reformat it
@misty ingot could you tell me how are you able to use FileUtils?
the way texture png works is there is a predefined area of the png and size for each of the parts
omg
Can you somehow generate custom textures on the spot?
and t hen the game basically does origami folding of said png to make the 3d of it
sure
the textures just need to be in the right positions in the data of the textures
?help
I forget how far in the png format where data would be expected to start and end for each section but I am sure you could probably find some wiki on it
#bot-commands
I will time you out
probably should listen to the staff
I mean like: I want to generate a custom skull based on dynamic parameters
ok?
I've always wanted to do skin splicing in minecraft
I already state it is possible to generate dynamic textures on the fly, not sure how asking the same question but in a different way would change that response
it shouldn't be too hard since skins are a set format
Ah sorry
there is a format to the textures
where each body part starts and begins
so think of 2d format, and then the game takes that 2d and folds the image to form the 3d model
FileUtils.copyDirectory(new File(Bukkit.getWorldContainer(), "hello"), new File(Bukkit.getWorldContainer(), "new_world"));
is it possible to use some alternative for FileUtils?
as long as you know the areas for these body parts in the png format, you can just feed the data directly into the method
instead of feeding a file. Since the file just gets read in as bytes, you could just give the bytes instead
I suggest loading pmcskin3d on planetminecraft and looking at where edited points go to see the zoning for each limb texture
might be dumb question, but is there any hack to return two distinct values which i can reference in java without creating an object for them to be stored? Arrays and lists are not an option here, nor wrappers. im thinking whether there's some kind of hacky way to do this
something like c++ references passed via arg or smth
what kind of values?
reference values
object references
void foo(bar& bar, baz& baz); looking smth like this from c++
probs there's no such thing, even it was i would need to probably wrap the object somehow
I assume you just don't want to create objects just for references?
yeah
you could just use a static for that
i want a helper static function
i guess
static can store object references fyi
yea
even classes
which is handy when you want to create a dynamic loading of classes depending on certain parameters IE versions ๐
since there will be only one instance of it
user dialog?
yeah its java fx thing, that i've made its a form for editing user
maybe bad wording here
if there will only ever be one instance of it, then you could just use singleton pattern where you have a static method that grabs the current instance or makes one if it doesn't exist. Then you just use this everywhere
that is how you would use a static method that gets current instance or makes one for singleton pattern ๐
there is other ways, such as lazy loading etc
i am not using fileutils
you asked a question and gave you an answer
i have never even touched worlds related stuff, and dont plan to for a while
uhhh idk why vault isn't working
Could not determine the dependencies of task ':shadowJar'.
> Could not resolve all dependencies for configuration ':runtimeClasspath'.
> Could not find org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT.
Searched in the following locations:
- https://repo.codemc.io/repository/maven-releases/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/maven-metadata.xml
- https://repo.codemc.io/repository/maven-releases/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-SNAPSHOT.pom
- https://repo.codemc.io/repository/maven-snapshots/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/maven-metadata.xml
- https://repo.codemc.io/repository/maven-snapshots/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-SNAPSHOT.pom
- https://repo.extendedclip.com/releases/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/maven-metadata.xml
- https://repo.extendedclip.com/releases/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-SNAPSHOT.pom
- https://jitpack.io/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/maven-metadata.xml
- https://jitpack.io/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-SNAPSHOT.pom
- https://repo.maven.apache.org/maven2/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/maven-metadata.xml
- https://repo.maven.apache.org/maven2/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-SNAPSHOT.pom
- https://repo1.maven.org/maven2/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/maven-metadata.xml
- https://repo1.maven.org/maven2/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-SNAPSHOT.pom
Required by:
root project : > com.github.MilkBowl:VaultAPI:1.7
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
i litteraly got everything:
repositories {
maven {
name 'papermc'
url 'https://repo.papermc.io/repository/maven-public/'
content {
includeModule("io.papermc.paper", "paper-api")
includeModule("io.papermc", "paperlib")
includeModule("net.md-5", "bungeecord-chat")
}
}
maven {
name 'minecraft'
url 'https://libraries.minecraft.net'
content {
includeModule("com.mojang", "brigadier")
}
}
// PacketEvents repositories
maven { url = uri("https://repo.codemc.io/repository/maven-releases/") }
maven { url = uri("https://repo.codemc.io/repository/maven-snapshots/") }
// PlaceholderAPI repository
maven {url = 'https://repo.extendedclip.com/releases/'}
// Vault repository
maven { url 'https://jitpack.io' }
// Additional repositories
maven { url = 'https://repo.maven.apache.org/maven2' }
maven { url = 'https://repo1.maven.org/maven2' }
mavenCentral()
}
dependencies {
compileOnly 'io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT'
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.8.6'
implementation 'io.papermc:paperlib:1.0.8'
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.13.0'
testCompileOnly 'com.github.spotbugs:spotbugs-annotations:4.8.6'
testImplementation 'io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.4'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.4'
// PacketEvents dependencies
compileOnly("com.github.retrooper:packetevents-spigot:2.7.0")
// PlaceholderAPI
compileOnly 'me.clip:placeholderapi:2.11.6'
// Vault
implementation "com.github.MilkBowl:VaultAPI:1.7"
}
is vault repository is down or?
you are limiting the paper repo to paper artefacts
when that is where the bukkit dep comes from
come again?
maven {
name 'papermc'
url 'https://repo.papermc.io/repository/maven-public/'
content {
includeModule("io.papermc.paper", "paper-api")
includeModule("io.papermc", "paperlib")
includeModule("net.md-5", "bungeecord-chat")
}
}
the bukkit dependency is not hosted on jitpack
it is pulled in from spigot or paper repos
but you are marking the paper repo to only be used for resolving the above 3 modules ^
so add includeModule("org.bukkit", "bukkit")
A template for building PaperMC Minecraft server plugins - CrimsonWarpedcraft/plugin-template
oh
ummmm idk if it made it worse or better
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT.
Required by:
root project :
> Module 'io.papermc.paper:paper-api' has been rejected:
Cannot select module with conflict on capability 'org.bukkit:bukkit:1.21.4-R0.1-SNAPSHOT' also provided by [org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT(compile)]
> Could not resolve org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT.
Required by:
root project : > com.github.MilkBowl:VaultAPI:1.7
> Module 'org.bukkit:bukkit' has been rejected:
Cannot select module with conflict on capability 'org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT' also provided by [io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT(apiElements)]
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.12/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 1s
1 actionable task: 1 executed
ig maybe vault api doesn't support it
i'll create my own currency system or smt
It's caused by vault having a transitive dep of bukkit
If you exclude bukkit from the vault api dep it should work
just move vault down in your dependency list
I used .equals() instead of equalsIgnoreCase() in checking database type and spent 15 minutes figuring out why the disbanded guilds wouldnt get deleted ๐
i love java
hey what a problem
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_METADATA);
WrappedDataWatcher dataWatcher = new WrappedDataWatcher(entity.getBukkitEntity());
WrappedDataWatcher.Serializer chatSerializer = WrappedDataWatcher.Registry.getChatComponentSerializer(true);
WrappedDataWatcher.WrappedDataWatcherObject watcherObject = new WrappedDataWatcher.WrappedDataWatcherObject(2, chatSerializer);
Optional<Object> optional = Optional.of(WrappedChatComponent.fromChatMessage(entity.getBukkitEntity().getCustomName())[0].getHandle());
dataWatcher.setObject(watcherObject, optional);
dataWatcher.setObject(3, true);
packet.getIntegers().write(0, entity.getBukkitEntity().getEntityId());
packet.getWatchableCollectionModifier().write(0, dataWatcher.getWatchableObjects());
NMSPacketWrapper.sendPacket(packet, packetData);
[17:10:17 ERROR]: Error sending packet clientbound/minecraft:set_entity_data (skippable? false)
io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:set_entity_data'
Format changed around 1.19
a okey thanks hah
i use 1.21.3
lots of new developments and I'm still getting lost
do ya actually havev a list like that somewhere or did you just write that down from memory?
^
I write these guides when I feel like it and reference back to them often enough
some are pinned, some are not
ah
i just tag my messages in another server with a not so random string of letters
helps me find em again
havent written anything noteworthy here yet tho ๐
thx works
Okay so I got a question
Doesn''t the "textures" nbt contain the url to the servers?
Only thing I found is that it needs go be some kind of url, can even local
But, well, as you can imagine, it wouldn't work for me to have the url point locally
the client refuses urls that are not a certain domain
you could exploit that and use the education minecraft thing to get a texture URL under that but they fixed it
So how can I go about creating custom head textures dynamically
Ideally without uploading anything anywhere
is there a way to get the skull of a player who is offline? (i have their UUID)
mineskin
its easy and theres a webapi and plugin
Mineskin will upload the skins for you
Hello, i've been using this serializer for ItemStack to sync inventories accross servers https://gist.github.com/graywolf336/8153678, but recently i've encountered an issue where i cannot deserialize ItemStack from newer version of minecraft to older version of minecraft, is there any possible solution to this?
yeah thats simply because the ood server does not have the new item definition so it doesnt know how to load things it never saw
That's tough, yeah just wondering if anyone has solution to this, this thing never occurred to me only after working on this specific features for weeks lmao.
is there a way to get the commandsender as an argument in the command completion processing in ACF?
basically i wanna have a commandcompletion where it shows the options depending some factors related to the player
also how can i use flags like -s in my commands in ACF
nvm i think i got the first one, but still wondering about flags
I have a question if it is possible to do sectors on po via protocollib and would it be efficient?
Is there any event that detects both right click equips and inventory click equips on armors
thanks
can i query FOV
no
don't
Is there a way to generate an update folder on bungee like spigot it already has?
I wanna write an auto updater for my plugin so the user doenst have to do it manual every time
how can i use command flags like -s in ACF
and how can i set custom messages for things like command not found
if getItemInHand is deprecated what i should use?
It should tell you in the deprecation note
That's the context menu
oh sry then how can i open the deprecation note?
You can see the deprecation note when hovering over the method if Javadocs are downloaded
otherwise you can check the javadoc in your browser
?jd-s
this one https://imgur.com/a/zIlOvBB ?
i'm using spigot i created this project like 5 min ago
ik but i clicked on spigot on the creation xd
fixed ๐
how can i dowload the javadocs? it's like a plugin that i need to add?
No
okay thanks a lot for that last question and sorry for disturbing, now everytime i want the docs i have to dowload it or i directly have it in any my new project?
Just new projects or when you update Spigot version
thanks a lot for your time and sorry for disturbing you
lil typo
You can use file:// as the url and just create a file in memory of the data. File doesnt actually have to exist locally with that url type
Sorry for late reply. Went to bed lol. Now am at work
However you could skip the url part if i am not mistaken. You only need that api portion to fetch the texture but if you already have it you dont need to use that
The client won't accept random urls nor can you create the texture file in memory without modifying or having access to the client
Oh right for sending to the client. In that case i am sure there is solutions to that. Lol
There is only one solution which is to upload the skin to mojang servers. Mineskin will help you do that
The other solution i can think of is swapping the player out for a display entity
Then you can give them whatever texture you want without the constraints of the player model
Yeah actually that would also be possible
Load the texture with a resource pack and then have a model for the entity
WTF is wrong with oracle's way of writing SQL
who tf writes comma at the beginning
unique people
this is just cursed
*DISTINCT people
badum tss.
theres also people who write the opening bracket on the NEXT LINE in cs or cpp or java and stuff and i hate all of them
if () {
they do
if ()
{
The gnu style is worse
its called allman
that is gnu?
Oh wait isn't gnu when its:
if ()
{
..
}
APL is what's truly cursed:
primes โ {โต/โจโตโโจ(2=+/โ.=โจ)ยจโต}
Lol that's something
Fite me
i hate everyone who doesnt follow the same coding conventions as me
its time to bring racism to programming
btw any way to get the player head item for a player who is currently offline?
Hi, I have again some coding practice question. Is this rly bad usage of exception? I kinda want to give acurate message what went wrong. I probably can do it for each method to return some boolean only, whould that be better or this is oke? (There is more requirements I cut them just to showcase code)
private List<Requirement> loadRequirements(YamlConfiguration yamlConfiguration) throws Exception {
List<Requirement> requirements = new ArrayList<>();
if (isToolTypeRequirementSet(yamlConfiguration)) {
if (validateToolTypeRequirement(yamlConfiguration)) {
ToolTypeRequirement req = loadToolTypeRequirement(yamlConfiguration);
requirements.add(req);
}
}
return requirements;
}
private boolean isToolTypeRequirementSet(YamlConfiguration yamlConfiguration) {
return yamlConfiguration.isSet("tool-settings.tool-type");
}
private ToolTypeRequirement loadToolTypeRequirement(YamlConfiguration yamlConfiguration) {
System.out.println("Load tool type req");
List<String> materialStrings = yamlConfiguration.getStringList("tool-settings.tool-type");
String message = yamlConfiguration.getString("messages.wrong-tool-type");
return new ToolTypeRequirement(materialStrings.stream().map(ToolType::valueOf).toList(), message);
}
private void load(YamlConfiguration yamlFile) {
String name = yamlFile.getString("name");
Material material = Material.valueOf(yamlFile.getString("material"));
ConfigurationSection locationSection = yamlFile.getConfigurationSection("location");
World world = Bukkit.getWorld(locationSection.getString("world"));
int x = locationSection.getInt("x");
int y = locationSection.getInt("y");
int z = locationSection.getInt("z");
double maxHp = yamlFile.getDouble("max-hp");
Location location = new Location(world, x, y, z);
ConfigurationSection respawnSection = yamlFile.getConfigurationSection("respawn-settings");
Material respawnMaterial = Material.valueOf(respawnSection.getString("material"));
int respawnTime = respawnSection.getInt("time");
List<Requirement> requirements;
try {
requirements = loadRequirements(yamlFile);
}catch (Exception e) {
System.out.println(yamlFile.getName() + " is not loaded because of: " + e.getMessage());
return;
}
this.meteors.put(location, new Meteor(this.getPlugin(), name, material, location, maxHp, respawnMaterial, respawnTime, requirements));
}
first of all
?paste
for code snippets this long
also thats literally what exceptions are for
to tell what exactly went wrong
but you should probably make your own exception classes if you wanna use em like that
Does a change in the item slot call InventoryClickEvent?
Thanks
How can I make sure that an item in a specific slot cannot be changed in a player's inventory?
Changed how
hi i need help ๐ anyone good with php , larvel ?
no images or js work why?
i have everything there i checked permissions
Im sorry I forget about this.
nothing rly went wrong I was just asking if isnt it bad for performance or some other reason. I saw most of plugins just no handle that witch will crash enteire plugin, but I dont want that bcs of user erorr in file. I just discover I can carry the Exception with message true multiple methods I was shodek (idk why lol), I was about make some custom class for that (not exception). So thats all what I need to know. Just trying to be good and have good practices. Thanks a lot.
Your website doesn't work because php
?whereami
it works but no js or images loads (say error 404 not found .)
๐ฅฒ always good
love hitting the intellij error cap
that's how I know I'm having fun
At least thereโs only 1 warning!
I love reinventing the wheel
love having to rewrite a command system
especially love doing that 3x
also it seems like I sort of forgot to go to bed
I think I've been up for 25h?
The programmers curse. Just another 5 minutes and I'll be done...
well
just kinda got it to do what i wanted it to do
think I'll just go to bed and clean it up tomorrow
qq, how do i delete a chunk via code
like clear all the blocks and entities or delete the data from the world completely
2nd
i can just set all blocks to air and remove entities but im unsure how to clear it from the mca
you could in theory just never save the data when it unloads
see thing is thats server side
well i can check the event thing
depends if a chunk's base state is saved or not when it generates
so what exactly do you want to do then?
prevent elytra trails from fucking up disc space
sure
Maybe use the ChunkUnloadEvent and if the player who last loaded it is on elytra then dont save it
setSaveChunk(false) method
ah. good point, i can just keep track of the flying state
if no player ever leaves said state in said chunk, and doesn't enter it otherwise, its safe to discard
though i worry about the PlayerMoveEvent causing lag
Maybe
or override inside the chunk load and unload events to the player move event but idk how that works
yeah that makes no sense in hindsight
Theres no method to get the player that loaded the chunk
or maybe
Hello everyone !
I'd like to know if you guys know a way to change the time required to eat some food ๐ค
I mean, like extending the eating time
I know I can't do that using events because it sounds like it's handled client-side, but I'm wondering if I can fake it somehow using packets with ProtocolLib or else
Theres new attributes for that
ah ?
Very interesting thank you !
So I guess it's not possible using Spigot but it is using NMS ๐ค
its in the latest versions tho
https://www.youtube.com/watch?v=w-ZVFJlNev4 a lot of stuff surrounding that is in here
In this video I will show you how to make every item edible in minecraft 1.21!
If you liked this video, please be sure to hit the like button and let me know in the comments why you liked it! If you really love my content, please consider subscribing!
With the new command sys...
Thank you !
This video is outdated
Please refer to the wiki link I sent
@smoky oak i have an idea for you
it might be a dead end but idk
if you get the world then get all the players
then you can constantly check if each player has the chunk loaded and is wearing an elytra
and if they unload a chunk and that chunk is unloaded at the same time
that sounds like sloppy code but it could work
maybe
how do i fix this.. i am trying
error: invalid target release: 19
SDK openjdk-19 is not compatible with the module jobs language level 19 in chosen run configuration jobs [package].
Change the version of JRE in the Maven Run Configuration
Well you change the jre version in the maven run configuration of course
is there a way to run a specific method like
String abc = "one";
lang.get{abc}();
String def = "two";
lang.get{def}();
basically the method thats being run is changed if the string has a diff value
You could do a simple if else
this is java?
Ternary otherwise if I had to guess
intended to be
i have a list of enums
depending on the enum
i run a diff method
lets say like 15 enums
So then couldnโt you just differentiate based on the enum itself?
Doesnโt sound too bad
But also 15 what the fuck
well the string thing was an example
the thing im trying to do is not have to write a seperate statement for each enum
the method names are the same except the part with the enum's name
Gotta work now sorry mate
understandable
what are you trying to do?
basically
i have a list of enums, each enum is meant to refer to a specific cosmetic effect
for each cosmetic effect i have to grab the name and description of said effect from the lang.yml file
i am using configlib so instead of that its a get method in a class to grab the name, and description, seperately
and what do i change it to
since theres quite a lot of cosmetic effects i wanna know if theres a way to do this without having a match case or a tower of ifs
because readability, and also maintaining
what you need is a map
am i dumb
hm i do indeed need a map
try setting Everything to java 21
whats everything ๐ญ
go into your pom.xml
and also your build configuration if you are using intellij (idk for eclipse)
change all the java version stuff to 21
and install the jdk
then try
this?
what i there is no 21
then download it
i have to download
correct
thankss
after this also change it in your pom
i changed
archetypal question. What is the best strategy for storing player role properties
for future expansion
Well what are these properties? Very vague
What do they do? How are you representing them?
like properties for use in event listener etc
usable properties
i can use imp classes or map<String,Object>
but idk
That doesn't really explain anything
ok for example effects
potion effects
custom effects
check type and use effects what role has
the roles are very different in properties
hard coding ๐
not just 1 role with all options
ECS 
Hey, anyone here able to fork the Factions plugin by MassiveCraft and able to edit it a bit ? ๐ค
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
hello, how do i add custommodelData if minecraft 1.21.4 is using strings now cuz i see the setCustomModelData(int)
think I've done it before
Use the model data component
Not sure if spigot has an API for it but the one who shall not be named does
declaration: package: org.bukkit.inventory.meta.components, interface: CustomModelDataComponent
so i use this? void setStrings(List<String> strings) Sets a list of the custom strings.
declaration: package: org.bukkit.inventory.meta.components, interface: CustomModelDataComponent
Yeah
alrighty, thanksss
i want to make a snowball launcher
Snowball ball = p.getWorld().spawn(p.getEyeLocation(), Snowball.class); ball.setShooter(p); ball.setCustomName("diamond"); ball.setVelocity(p.getLocation().getDirection().multiply(4.5));
and everything work fine but the problem is that when i call the ProjectileLaunchEvent it say null for the shooter and null cof the custom anme
Probably because the event fires before setShooter
and how i can make the opposit way?
There's a spawn method that takes a consumer
You can modify the entity in that consumer and it'll do whatever
Pretty sure that'll work
worst case scenario you just use launchProjectile instead
can u explain it for a stupid guy?
no
okay
Pass a lambda as the consumer and modify the snowball there
That will ensure it's modified before being spawned
TIL ProtocolLib has an auto wrapper thing
where you can make your own lil class and it'll wrap
nvm it crashed my client
๐ I think I found a fucked bug
might be a minecraft bug
ooo
how can i check if a projectile has no velocity
what the fuckkkk
excuse me waht the ufck
zero clue how to fix as well
I'll just add 10k to every entity id I got
thing is I'm using atomic ints so this should never happen
also whats the most efficient way to grab every projectile entity in the player's world which was fired by the player
this soulds like a commission
it is not
unfortunately
i figured out the velocity part
but whats the fastest method to grab em all (iterate over all of them)
getEntities in the world or something?
then filter by projectile source and do whatev
oh ok
im already doing that
was wondering if i was skipping over some faster method
bruh
skill issue
using protocollib for this
they lack wrappers for hella things and metadata is broken for <1.19.3
because their data watcher just fires some error
just use packetevents smh
smh nah
oh rght because working with something that actually does the job is unfavorable
cba using it ngl
this works
just need to do raycasting and I can finally move on from this proj
https://github.com/lukalt/PacketWrapper has wrappers for 1.20
Packet wrapper classes for ProtocolLib. Contribute to lukalt/PacketWrapper development by creating an account on GitHub.
I actually cba now that it's done
how would i go about making it so the particles my plugin makes are only shown to certain players
wouldnt it be a bit slow to loop through all these projectiles and also have a nested loop through a list of players and spawn them for each individually
im saving that one too
hey i see when using head in an inventory (with offline player), the head is a steve /alex head (or a basic skin), but when i update the inventory like 10 tick later, the heads has texture. Can i check if a head has a model ans is not a basic skin (also the head already has a owner)
#isBush #isStone #isGrass ...
so im not the worst at this huh
????
how can i fix the problem that when i try to type in a plugin that i dowloaded it says FIle is read only?
Why are you modifying a dependency?
i think hes trying to modify plugin source code
Dovias *
Very suspicious to ask that
He might have far future plan making it dynamic ๐
i've commited previous changes
its not mine
im actually replacing bunch of this shit
with my ECS
// TODO: Experimental
final me.dovias.battlecity.scene.Scene gameScene = Game.scene();
final Transform transform = Transform.of(0, 0, 48, 48, Direction.UP);
final Entity entity = gameScene.components().entities().attach(
transform,
Sprite.resource("/assets/bush.png", transform)
);
for (final Sprite sprite : gameScene.components().type(Sprite.class)) {
final IntVector2D position = sprite.transform().size();
final IntVector2D size = sprite.transform().size();
final Rectangle rectangle = new Rectangle(position.component1(), position.component1(), size.component1(), size.component2());
rectangle.setFill(new ImagePattern(new Image(sprite.stream())));
root.getChildren().add(rectangle);
}
finally my ECS api works as i've intended it and i can attach multiple renderer pipelines through it (javafx, native opengl)
i've had plans for native opengl renderer but it took way too much time and im already rushing this
Does somebody have a way to manipulate Sign-Content in 1.21.4?
I wanted the user to enter a number at a specific position on a written sign.
So I tried the following to set a sign:
- sendBlockChange Packet
- actually setting a sign near the player
In combination with either of the following to open the sign:
- player.openSign(sign)
- Open Sign Editor Packet
With sendSignChange or BlockChange or Tile Entity Data update Packet to the server/player.
Without and with delay.
Since there is no ProtocolLib build for 1.21.4 - and the last patchs plugin not working - I assume I did make a mistake which I dont see.
The farthest Ive archived this is setting a sign with content (on both sides), but as soon as I open the sign in any way, the Sign GUI is completely empty.
Hello, what is a good way to register a command with reflection easily in Spigot?
I can't find much information on the topic online.
how do you break out of a BukkitTask loop from within the BukkitTask?
The latest dev build of ProtocolLib should work fine on 1.21.4
PacketEvents is also an alternative
?scheduling
you can probably dig up NMS and register your command through brigadier
using datapackRegistry object iirc
@bronze laurel
Do you have a version number for their ci? There is no listed support up there
I want to keep it simple and register my commandExecutor command at runtime.
my bad, i thought you meant native commands, but i guess you want to have compatibility with bukkit api
brigadier commands arent friendly to bukkit api as bukkit command api impl that's present in Spigot and Paper is a big hack on top of brigadier
I can convert that into a "registerCommand(command, name, String... aliases)
Thank you.
I mean it already registers to the command map but sure
hm? What version number are you looking for?
https://ci.dmulloy2.net/job/ProtocolLib/739/
Something like this
Build nr*
Yeah I know what a version number is
I'm just asking about what version number you want
and why
Since on spigot nor on their CI there is a listed version that supports 1.21.4
As I mentioned the latest one (739) will work
Basically any build after this was merged https://github.com/dmulloy2/ProtocolLib/pull/3319
try {
Field field = Bukkit.getServer().getClass().getDeclaredField("commandMap");
field.setAccessible(true);
CommandMap map = (CommandMap) field.get(Bukkit.getServer());
map.register(name, command);
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
}```