#help-development
1 messages · Page 2197 of 1
np
funny I was looking for that 15 minutes ago but I was browsing via intellij itself...
😄 yeah I only found out about the vcs.xml too when I once broke something
yeah for sure the kind of thing you only really learn about once something has gone wrong for you personally
exactly lol
there will be so many of them in the open world. I just said that going through all the possible mobs in the world is not the fastest option. And I sincerely believe that there is a faster solution.
btw have you seen the hilarious process of installing gradle so you can build a gradle project from command line on windows?
I had to manually add environment variables, it was great
yeah... I really dislike gradle for this and other reasons
also not worth it, conversion broke more things than it resolved
I mean it's indeed faster in building but that doesn't justify all the downsides it comes with
ended up doing it manually regardless
the speed is really important to me but boy setting a project up is like getting your teeth pulled out
one can also extremely speed up maven by telling it to use more than one thread
mvn clean package -T8
for example
and you will never find any documentation for importing in a gradle format, it's always maven and the rest is left as an exercise to the reader
yeah I have to admit I also always only provide maven information
you bastard
but tbh if someone decides to use gradle they are probably also capable of "translating" it
see I don't provide either so I am helping
I mean all you need is the repo, group id, artifact id and version
oh wait I just realize
no it's not lol
my repository manager shows gradle information
there's plenty of exceptions when adding repos that result in really bad hacks that you have to do
hell even just shading something in is ugly
good
IIRC gradle can't even shade on its own
nope
it requires a plugin that isnt even made by the gradle team
yep
shadowJar
that's part of why adding maven stuff can be tricky, you need to manually relocate everything you want to shade so it's easy to forget
I'll be stuck with maven for the rest of my life because I know how it works and I like how it works. gradle is probably totally fine too but I don't see any reason in switching over and relearning everything
I'm a sucker for that 3< second compile time
I switched when I started hitting 40s with maven
have you tried the -T switch?
also I like streaming while I work on stuff and it would straight up freeze my stream every time lol, so adding more cores would just make it worse
hmmm
well BetterFood is now updated
poggers
automatically eat food in your inventory, now we are gaming in 2022
one core: 41 seconds
yikes
yeah that's trash
so the improvement is not really huge
idk it's my library that I use in all of my plugins. final jar is 258kb
so exclude that
but I want the javadocs to be generated?! 😄
well maven was slow years ago for me, I'd guess it's worse now though after upgrading my cpu idk
isnt once enough
what if the docs change
not your problem
I like writing javadocs
yeah that'll fix our issues
sometimes when I'm bored I just open a project and write docs
wanna do that for me?
if you pay me? we could make a fixed price like "1 beer per class"
or "1 döner per package"
sure I'll do that mfnalex
how do i check if the args contain a player usernae
please ignore the sound of me typing right now, I am not writing a script which bundles all of my classes into one class right now
alright so it's 62593 lines for 1 beer, what a great deal I did today
which player?
in germany we would say wucher
a massive wucher
in germany we don't use german on this discord because optic fusion is very quick in kicking people for this lol
oliver was kicked only a few days ago
loop over the args array, then check if Bukkit.getPlayer(currentArg) is null or not
they player in the args
true lol
the*
^
args is java not english watch out you'll get banned for language
ok
oh crap !!!11
what if my code is in german
BANNED
if you posted code that's a ban, if you posted german code we will send the FBI to raid you
i hate how in css u have to use color not colour
public void istMfnAlexEinWucher() {
return true;
}
the fbi are on their way
obv. i need help with this guys
lots of people are gonna get banned today
high quality code
verbosity = good
I hear you like long names
ugh
it gets obfuscated away anway lol
in the final jar it will probably be called "if" or "goto" or sth like that
aha, leaked
sure it gets obfuscated anyway but I still don't write entire bible verses as variables because it gets to a point where the autosuggestions get clogged
what does the update checker do if u use a version that isnt on spigot with a higher version number?
it considers you to be up2date if your running version is higher than the "update check source" version
ok
it uses something like Maven's "ArtifactVersion" class to compare versions
it's linked above lol
is it done with the spigot api?
I made my own checker for things other than plugin version
you can decide that
you can use Spigot API, Spiget API, Github releases, or provide a custom link
otherwise checking if the plugin is up-to-date is pretty easy
for now i always used my own with a version file
spigot provides a page for that
I know that oraxen uses my CustomBlockData but no idea about any other plugins
the higher the better
I think I always upload 256x256
they don't really recommend any size
looping 10k and removing is probably the fastest way unless you set the difficulty to peaceful for a tick, which probably does the same thing backend im not sure tho
the "rendered" size is 48x48 on all pages
I mean sure but they do get displayed in a specific size
spigot itself sizes it to 96x96 but they always display it for 48 only
as you can see I am a professional icon maker
get your premium quality icons here, only $99,99
that is so cheap
pls create an icon for my newest plugin
upgrade "maven-shade-plugin" to 3.3.0 or higher
I also offer enterprise-grade icons for $999,99
that will be $999,99
ah I see we have a loser who doesn't understand that you need to spend money to make money
hfbp
if you want to use it, I guess so
you can try to use minimizeJar in the shade plugin's configuration
to reduce the file size
but it probably won't help much
damn
if you're on 1.16+ and the lib is on maven central, you can also use the library feature in plugin.yml
You can also just fork it and remove all the code you don't need
true but tbh - noone cares if a plugin is 1mb or 400kb
The xml parsing should be taking a lot of space iirc
that's why my plugins are 3tb
never heard of the library feature, what's that?
my newest plugin is 600kb and angelchest is even almost 2 mb, noone has complained yet
is the lib you use on maven central?
"IF is in the Central Repository, so you don't have to specify a repository."
I guess that's a yes
aah
ok
then you can do the following:
- set the scope to provided and do NOT shade it
- in plugin.yml, add the following:
libraries:
- com.squareup.okhttp3:okhttp:4.9.0
obviously replace okhttp with inventoryframework
so groupid:artifactid:version
alright I'll try that
spigot will then download it when the server starts. but as said, this only works in recent versions of 1.16.5 and later
send the error msg
also why do you check the command's name?
that's useless
Why are you casting everywhere
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
like why do you cast null to Object?
Ah right you're the one who doesn't know Java
Trust me this is going to be easier if you just take some time and go through the java basics
I still don't understand why you refuse to do so
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<artifactId>IF</artifactId>
<version>0.10.5</version>
<scope>provided</scope>
</dependency>
libraries:
- com.squareup.com.github.stefvanschie.inventoryframework:IF:0.10.5```
Is this correct?
looks good
it will take even longer if you don't even try to learn it
Yeah maybe. If you're in a hurry to get your plugin done hire someone
wait
the artifact isn't called "IF" is it?
send the link to the maven information pls
oh no ;/
800kb isnt much
guess that's what I'll do
as said some of my plugins are almost 2mb and noone ever compained
Where do you sell your plugins btw? @tender shard
If you're goal is to learn something then you have no reason not to start with learning Java
peope be like "why my code not working" lol
only on spigot. and commissions through my discord server
lmfao
ahh okay
I tried polymart once
but I only got one buyer
so I decided it's not worth it
I sold angelchest on spigot like 700 times and on polymart exactly once lol
?learnjava Get started with a few of these links
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Damn you making bank
Well, you would be more broke if you didn't sell your plugins I guess
Nice, still making something on the side with plugins then
Is there a way to prevent this?
I inspected in JD-gui and one class is there twice, one being named name.class and the other one name$1.class
in name$1.class there's only an import and the package lol
the better question is "why is the preprocessor accepting the fact that theres no return statement"
🤔
and what has getting the single values off a map object to do with serialization
How would I structure this database for my plugin:
I have a plug-in where there are spawners and the player that kills mobs spawned gets rewards tho he can do x kills per day, and there are many types of spawner, I was thinking about making a table for each spawner in the config and saving the uuid and kill count but that seems trashy, do you guys have any idea?
So like 3 pigs per day 10 zombies per day
database as in sql?
that is how ConfigurationSerializable works
declaration: package: org.bukkit.configuration.serialization, interface: ConfigurationSerializable
well to be fair ive never looked into the bukkit wrapper for the java serializer
just used it because my non bukkit related serializer broke the objects
it turns an object into a map or turns a map into the object
but tbh ConfigurationSerializable is shit
always causes errors
it sucks so hard
usually I just do a toMap method and a constructor that takes a map. that at least works all the time
i mean as a kid i thought "wow bukkit is god stuff how can someone even write this"
now im like
meh
another bug
xD
i have to work around
cough
RecipeChoice.ExactChoice
i still cant get over it that exactchoice isnt applied properly on shapeless recipes
feel free to PR then 😛
the good thing about open source is that you can always tell people to fix it themselves 😛
because the code used to be looking differently
a null check on a double is pointless
it throws an NPE right when you assign it
because of auto unboxing
i also dont understand why ppl say "dont check instances for null"
its unsafe
i mean hell no its not
if u dont screw it up
wdym?
i always just get the object i want and then null check it to see if its existing like for itemstacks
like
PrepareCraftEvent
ItemStack is = event.getInventory().getResult()
if (is != null)...
or something like that
yeah but that will never be null IIRC
it is
it'd return an ItemStack of AIR with amount 0
it returns null
somehow
others return null
Material.Air
gets cast to null
🤔
even worse
if u say u want to get material.air itll always fail
but if u set the IS to null
it says cant be set to null
🤣🤣🤣
like to see if an item slot is empty u must check for null
but if u want to remove/delete it
u must set it to air
xD
that fails
needs to be itemstack of air with amount of 1
idk why its kinda weird
right because primitives get assigned right away..
Yes
well first off id prob store the data of how many mobs someone killed in the sql database
and the limit for each mob type per day in a json, ini or whatever config file
u know front and backend programming
anyways ull have to ask someone else about the sql part
and dont forget to track the date somehow
as for updating dates/daily/kill ratio limit, probably only when someone logs in
How can I make movable ship?
Ik I should loop thru list of blocks and move them
but then it comes to "rotated" movement
Any ideas? Maybe WE?
you could use worldedit's api to rotate stuff if you don't wanna do the math yourself
okk
But wont that result in some micro waiting times between rotating/moving?
From my experience with WE it always took few moments before filling/rotating blocks
well worldedit (not those async forks) does it on the main thread
ok thats nice
anyone here works with protocollib? it seems like entity id is unique, if i randomly use values, would it cause issues?
It can cause issues yes
then what should i do to get an id that won't conflict with existing ids?
is it actually safe (or even "possible") to cast like this?
Player target = (Player) Bukkit.getOfflinePlayer(UUID.fromString(args[0]));
no
OfflinePlayer has a getPlayer method, which will return null if they are not online
spigot be like
@EventHandler
public void onBlockPhysicsEvent(BlockPhysicsEvent e){
if(e.getChangedType().equals(Material.CROPS)){
e.setCancelled(true);
}
}```
Someone knows why it doesnt grow anymore?
My only goal is to let it not break automaticly if it is on top of another block. Because i want to grow it on podzol
because you always cancel the event
wut
only cancel the event if the new material is different from the old material
target.toString().toString().toString().toString();
best
But how can i check that? Because getblock and getchangedtype is the same block i figured
yes exactly. only cancel the event if the old type and the changedtype are DIFFERENT
if both are, lets say Material.POTATO than it's just a crop growing
you don't wanna cancel that
But if it breaks it goes to air so i dont get why its not working
Why do you use .toString() do much? 1 time is enough
it was a joke bruh lol
Oh
@EventHandler
public void onBlockPhysicsEvent(BlockPhysicsEvent e){
if(e.getBlock().getType().equals(Material.CROPS) && e.getChangedType().equals(Material.AIR)){
e.setCancelled(true);
}
}```
I dont get why this is still breaking the seed tho
print out the old and the new type
@EventHandler
public void onBlockPhysicsEvent(BlockPhysicsEvent e){
System.out.println("Old: " + e.getBlock());
System.out.println("New: " + e.getChangedType());
}```
Like this?
How can I tell gson to not serialise a specific member? @Expose doesn't work
system.out.println 😳
it's just debug lol
?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/
there is no player in BlocksPhysicsEvent though
ah yeah
[11:45:25 INFO]: New: CROPS```
Bruh it does air as old block, thats why it didnt work 😂
that is weird lol
Yep.. but now lets see if it works haha
good luck 😄
Thanks! :D
[12:01:24 INFO]: New: CROPS```
It also breaks because it does crops as old and crops as new
But i cant cancel that because then it doesnt grow again
i think u might be getting the player but im not sure
World Edit paste doesn't seem to work
public ShipLoader loader = new ShipLoader();
public void loadSloop(Location loc){
File file = new File(Pirates.getPlugin.getDataFolder().getParentFile() + File.separator + "/WorldEdit/schematics/sloop.schem");
try {
Clipboard cl = loader.loadSchematic(file);
loader.pasteAt(loc,cl);
} catch (IOException | WorldEditException e) {
e.printStackTrace();
}
}
yes
dont worry about that, is just because i want make a procedual locations algorithm
i just want make the armor stand head pose, rotate like the player head
why are you using NMS for it
but doesnt that manipulate your head position?
and since you mulitplicate it, to the future like you can see in the video?
And Euler angle too
No?
I Just want know why the armor stand yaw is not right
i think not manipulate
let me try just the vector from the player direction then..
myListener = new YourListener()
i'm trying to save entity to config but it gives Craft-SomeEntity
Entities are not serializable
sadge i could do that with location
what is the right way to do it?
what should I do to check if a PlayerMoveEvent is about position movement and not yaw/pitch movement?
the uuid of entities is persistent
you can save it
trying to store entity for respawn later
what do you mean with store?
yes
stuff like armor, PDC?
not sure if there is a built in way to do it
pretty sure you have to do it yourself
only thing that comes to my mind is using nbtapi to get the nbtcompound of the entity and saving that, then creating the entity from the compound
not sure if you can do that either
Idk if im just dumb or what, first time making custom entity in NMS, i can't summon it ingame and can't find a tutorial as to why? Class seems to work and it has the correct constructor but the game just doesn't recognise it i guess?
like minecraft:?? is not a thing
final EntityAreaEffectCloud areaNMS = new EntityAreaEffectCloud(craftWorld.getHandle(), centerLocation.getX(), centerLocation.getY() + lineOffset, centerLocation.getZ());
areaNMS.a(0f); // setRadius
areaNMS.a(new ParticleParamBlock(Particles.c, // Block Particle Param
Block.a(0))); // AIR block data / setParticles
areaNMS.b(999999999); // setDuration
areaNMS.d(true); // setSilent
areaNMS.a(IChatBaseComponent.a(line)); // setCustomName
areaNMS.n(true); // setCustomNameVisible
lines.put(areaNMS, line);
for(Player viewer : viewers)
{
((CraftPlayer) viewer).getHandle().b.a(new PacketPlayOutSpawnEntity(areaNMS));
System.out.println(viewer.getName() + " has been notified of a new line.");
}```
I have a little issue with this code... The entity is spawned
But the properties are not taken in count
So, the raidus, the particles, and the custom name, aren't changed :/
I don't really understand why
Should I use Datawatcher instead of the the builtin methods?
you need to send a metadata packet
@minor garnet are you trying to build something like this ?
Before or after I spawn the entity?
after
Can I get the modified metadata from the entity? Or I have to make one
yess !
ah lemme get the spoon
the constructor of the packet takes in the entity id, the datawatcher and a boolean which im not sure what it does
oh ok, so I have to manipulate datawatchers 😭
public static EulerAngle directionToEuler(final Vector dir) {
final double xzLength = Math.sqrt(dir.getX() * dir.getX() + dir.getZ() * dir.getZ());
final double pitch = Math.atan2(xzLength, dir.getY()) - Math.PI / 2;
final double yaw = -Math.atan2(dir.getX(), dir.getZ());
return new EulerAngle(pitch, yaw, 0);
}
based on some random math exchange post
...
i'm pretty sure the methods from entities modify the datawatcher of the entity
so you don't have to make your own
but my problem
Oh, that would be nice, I hate dealing with them directly x), gonna look for the method name to get the datawatcher then
don't get the data watcher if you can
use the methods on the entity itself that internally mutate the data watcher
why isn't my yaw spinning with my head
.
i think the player yaw is 360 some think like that
What is MinecraftKey & EntityTypes supposed to be now? I have NMS but I can't import specifically those and I can't find what its meant to be
in 1.17.1 it's called getDataWatcher and it's in the Entity class
I remember something like that, I had to convert the player's yaw
why notch had developed yaw different from normal vectors
I just don't remember where I saw this on a forum...
nice, remember to send the packet each time you update something
Yup, done that with my little lib 😄
MiniMappingViewer
If someone need to get the official map
That helps a lot when working with nms ^^
So far, AreaEffectClouds to make holograms looks way better than using armor stands 😮
.
Can I save entity data by saving NBT data?
You cant get anything by saving something.
Define what entity data refers to. All entity related data is already saved as NBT data.
So an entire entity? Including attributes, location, world, persistentdatacontainer etc
Yeah everything
You need NMS for that. Create a new NBTCompound, call the save(NBTCompound) from Entity and then serialize the compund to a base64 String.
Its quite the hustle.
how can I make a custom item not show its name in a item frame?
Oof sounds like it
i suggest using nbtapi if there's the option to get the compound from and entity and vice-versa
Both sounds great thank you
I'm not a professional developer
Spigot and java coding is just a hobby for me
I'm not advanced
I think thats quite hard to achieve... You need to either add the nbt tag that hides the name through nms or modify packets.
is there a tag that hides it?
Anyone experienced with InventoryFramework?
Whats your concern?
I'm trying to put some "Last page" and "Next page" buttons, the last page button only appears when there is a last page, next page button only when there is a next page, however let's say I'm on page 1 and go to page 2, the "last page" button is not appearing. Also their name is noch changing to like "Return to page " + getPage() - 1)
Are you using paginated panes?
?paste
That's what I have rn https://paste.md-5.net/vevozorifo.cs
some1 know?
Looks horrible. I would suggest using another gui library like Triumph.
Hasn't someone sent a resource about it already?
https://www.spigotmc.org/threads/no-item-frame-display-name.412389/
I'm having a look at it rn
Do you use Triumph?
Yes i currently (have to) use it
I'll give it a try
@iron glade skullMeta.setOwningPlayer(Bukkit.getOfflinePlayer(all.getName()));
Just pass player since player extends offlineplayer
Use their ItemBuilder. It has good support for skulls too.
How do I fix this? When I use /reload after restarting, it works, though that's not rly going to help
https://hastebin.de/atepimafes.properties
The world exists
Can we see game class?
You have a location stored somewhere. After reloading you need to re-ininitalise the Location because it only holds a weak reference
to the world.
Oh I see thx
You can circumvent this by using another object that stores the UUID of the world + a Vector.
let's call this object "Hector"
Are you still struggling with this?
Honestly if you would just go ahead and read up on the math you would have created a whole library for this by now.
i'm trying to make the armor's head rotate according to the player's head position, the pitch is all right, now or yaw no, I noticed that I split this value works a little better
Probably just an atan2 problem.
and seriously do i really need math for this? Is there a very simple way to solve this? ...
Does mojang use radians or degress for yaw and pitch?
You always need math for everything in programming.
Especially if you are working with dimensions, orientations and vectors.
didn't I already provide some code ? what did not work for you with it
So it is in radians
ye ?
see this video
Why bother with degrees then and just do the math in radians
It's not my problem lol
how do I check if an inventory is a crafting table?
He sent this
Check they type, it's an enum
who?
Wrong reply xD
U
Can we see ur direction to euler method?
private static EulerAngle convertVectorToEulerAngle(Vector vec) {
double x = vec.getX();
double y = vec.getY();
double z = vec.getZ();
double xz = Math.sqrt(x*x + z*z);
double eulX;
if(x < 0) {
if(y == 0) {
eulX = Math.PI*0.5;
} else {
eulX = Math.atan(xz/y)+Math.PI;
}
} else {
eulX = Math.atan(y/xz)+Math.PI*0.5;
}
double eulY;
if(x == 0) {
if(z > 0) {
eulY = Math.PI;
} else {
eulY = 0;
}
} else {
eulY = Math.atan(z/x)+Math.PI*0.5;
}
return new EulerAngle(eulX, eulY, 0);
}
@minor garnet from forums
Test it
dude
?
this code literally do this
I'm pretty sire it doesn't but I'm gonna test it
yea they produce different results
Can someone tell me how I can let a Mob (or specifically a horse) run to a certain location?
@minor garnet
it's different
2.313476202573401,2.860360451671498,0.0
-0.7426798757785043,-0.2812322019182953,0.0
those are reuslts from the same vector
nms pathfinding id assume
do you have a snippet for me?
yes i know
but the code your send, the vector to euler maths is diferrent
but do the same thing
do you have a sec? I'm kinda confused with triumph
huh????????
- It does not do the same thing
- Yes it is different
try the method i sent instead of urs
@thorny dawn
i dont want use euler angles
just try the method and see if it works
then u can try to figure out what you're doing wrong
Sure. What is it
Can I DM you?
WorldEditAPI:
How to adapt world and location?
Im using worldedit-core dependency
BukkitAdapter doesn't exist
if bukkitadapter doesnt exist, then youre missing the proper dependency for bukkit
When i use Bukkit
(screen will be sent soon)
yep
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.2.5</version>
<scope>provided</scope>
</dependency>```
this is enough
I guess you need to figure out where they grab bstats from
or just exclude it from the dependency
did you add bstats yourself to the pom?
nope
First of all set the scope to provided
but 7.2.5 is working now
*so far
Downloading of dependecies is still going
Yep no errors
imma try that BukkitAdapter
yep thx
works
do I need to create a MapRenderer for each Image? or can I make one MapRenderer for each player, which got a list of images?
you can use the same renderer everytime
I currently have this:
public class ImageRenderer extends MapRenderer{
private final Player player;
private final BufferedImage image;
private boolean done;
public ImageRenderer(Player player, BufferedImage image) {
super();
this.player = player;
this.image = image;
}
@Override
public void render(@NotNull MapView mapView, @NotNull MapCanvas mapCanvas,
@NotNull Player player) {
if (done)
return;
mapCanvas.drawImage(0, 0, image);
mapView.setTrackingPosition(false);
this.done = true;
}
}
if I can use one instance of this class for each map, how does it know which BufferedImage to render on which map
well in this case if you need different images, obviously you have to use different instances
I thought you wanted to render the same image to all players or sth like that
so yeah use one renderer per image
ok thanks
gif it
should I make some Cache thing? bc there is a chance that some people get the same image
is there a way to check if two BufferedImage are the same? equals method works?
check the pixels
equals is the same as == for BufferedImages
hm ok that doesnt work then
you could check the size first. if that doesnt equal thats an easy false
then check the pixels yea
where do you get the image from?
the size is always 128x128
for example if it's by file name, you could just do a map that maps the file name to the bufferedimage
if you have the images hardcoded you can easily compare them by ==
since it will always be the same instance for the same image
ok so let me explain what Im doing and what I try to do
if you load it from somewhere you will need to check the pixels
it's probably a crack cocaine simulator
lmao
a mirror for the lines
lol
heey, how do i get the damage value of an itemstack

cast the ItemMeta to damageable
then do getDamage
with Packets:
- I create a wall of 5x3 itemframes
- then I load an Image of size 640x384
- I split this BufferedImage to small 128x128 parts
- render each part to its correct itemframe, so I create a big image
- this wall should be clickable and change on click etc // not implemented
and where do you obtain the images from?
from a .png file
i'd then just cache them by their file name
Map<String,MapRenderer> or sth
where the string is the file name
but I draw stuff on the BufferedImage, which depends on the player and what he is currently doing
oh ok then you have to use a new maprenderer everytime
i meant like damage like stone sword deals 5 damage, and iron sword deals 6
👍
oh ok. probably you can use the attributes on item meta for that
can I edit an Image of a Map which got send by packets? can I edit it by using the same EntityID?
Guys sorry for the dumb question, but how do boss bars work in 1.18? Last time I used them was years ago and iirc back then it was very complicated
Bukkit.createBossBar
fr?
but is it right that it was not that easy in like < 1.13?
I think it was added in 1.13 but not sure
that method wont let you do per player boss bars tho iirc
you can just create one bossbar per player
you can decide what players get shown which bossbar
Well glad it's that easy now
how?
just create a bossbar and then you can use addPlayer or sth like that on it
when you create a new bar, noone is added to it anyway
I always just cache all bossbars in a map and create one per player
public BossBar getBossBar(Player player) {
BossBar bar = bossbars.computeIfAbsent(player.getUniqueId(), __ -> {
NamespacedKey key = main.getKey("bossbar/" + player.getUniqueId());
BossBar existing = Bukkit.getBossBar(key);
if (existing != null) {
Bukkit.removeBossBar(key);
};
return Bukkit.createBossBar(key, null, currentContest.getBossbarColor(), BarStyle.SOLID);
});
if (!bar.getPlayers().contains(player)) {
bar.addPlayer(player);
}
return bar;
}
Good to know, thanks
it was added in 1.9
how I can change placed block in BlockPlaceEvent?
maybe good idea how do this?
get the block, and err place it?
but in Bukkit scheduler?
what is err?
me speaking
just do it in the event
you shouldnt need to delay it as far as i know
@EventHandler
private void fixPlaceEvent(BlockPlaceEvent e) {
e.setCancelled(true);
e.getBlock().setType(org.bukkit.Material.STONE);
}``` Like this?
sure, but you might cause a stack overflow
idk if setting the type will cause a BlockPlaceEvent
should work then
this don't working
placed block miss and don't change to stone
did you register the listener?
only then can it look strange
does anyone have any idea how to get the direction of the player's body or armor stand, getDirection returns a vector based on the player's pitch and yaw, not the exact direction of the body
you want his head direction?
what ru trying to accomplish
well ya cant
the body is entirely client controlled
as far as i know
Use runTask not runTaskLater
wow
Is there any way to make the boss not that "dark" or behind the inventory?
thats actually such a cool idea for bossbar
finally got it working like this
and no
OH that bossbar idea is cool
well u can
I'm stealing that
close the inventory xD
ur free to do so <3
Make sure to store the players bossbar and set it back when ur done
So whatever other plugin is doing bossbar stuff can have its bossbar back
yo guys got a plugin idea?
although there is still a strange effect ;/
a tax authority plugins that makes you pay taxes, have to file your income tax declaration every other minecraft day and if you forget it, you'll get fined and jailed
lol np 😄
real life is the best inspiration xD
so whats ur channel
i need to sub to this man of culture
um fr?
i demand answers too. if you actually do the tax plugin, I wanna see it lol
will do
not yet
i syuck at edituing so it takes an eternity
public static String[] ideas = {
//TODO: Will do later
"Minecraft but it tweets whenever you complete a advancement.",
"Minecraft but everytime you break a block, a villager spawns and says Sun Tzu quotes near you",
"Minecraft but touching grass kills you.",
"Minecraft but taking damage gives you [SURPRISE]",
"Minecraft but taking damage gets you a random item. [GC]",
"Minecraft but you cant mine or craft",
"Minecraft but you can mix water to make wet water",
//TODO: In the video
"Minecraft but theres no Minecraft",
//TODO: Will do later
"Minecraft but if you look at baby villagers, they gang up and kick you in the balls",
//TODO: Will do later
"Minecraft but every mob teleports like an Enderman",
//TODO: Will do later
"Minecraft but Signs can run code",
//TODO: In the video
"Minecraft but to defeat the ender dragon, You have to rap battle with it",
//TODO: Will do later
"Minecraft but a chicken controls your movement",
//TODO: Will do later
"Minecraft but you have friends",
//TODO: Will do later
"Minecraft but cows create Lava",
//TODO: Will do later
"Minecraft but only cats",
//TODO: Will do later
"Minecraft but you can only eat raw meat [GC]",
//TODO: Will do later
"Minecraft but when you stare a sheep, it starts glowing & levitates with the _jeb effect"
};
the ones i have rn
lmao
https://www.youtube.com/watch?v=dQw4w9WgXcQ is this one of your vids? dude has the same name as you lol
[GC] is github copilot
yea
nice that u found my vid tho
lol nice one, liked!
just black screen
the same as !dry water
duh
Yea
id add thsi in the yt vid "Not as wet as ur mum after seein me tho"
or is it too much
yea i aint
hmm
🧢
I think you can use it nonetheless
Just use it
ok nice
you get more comments because of it I bet
xd
there are people out there talking trash in like every video for all of the video xd so it should be fine
yea
Hello, the JavaDocs are down ?
no
yeah they are
403 Forbidden
nginx
Then it's a matter of wait
simplest way to check for nighttime?
yep, refreshed, 403
the whole hub is down


💣 
Kaboom
Hello, when will spigot updated to 1.19?
Never!
Hope it is joke.
Yes it is
as said: july 7th
Thank you
Everyone just keeps asking for an ETA
just tell them it's july 7th until everyone believes it
it gets funnier the more people participate
because when someone asks "when" and everyone answers "july 7th" then they'll think that it's actually true lol
Ill just tell them august 2021
uhm guys, is there a way u can get a player's ip by plugins. It does log the ip on player join so?
:)
ips are logged in console on log-in
yea
i want to get them through code i wonder how
does Player have a method for that?
or does this require nms?
the AsyncPlayerPreLogin event has a method to get a player ip address
Player#getAddress
i think there might be some difference between them, but im not sure what
idk, maybe theyre the same
Anyone else who can't fetch the spigot-api from Maven?
"authorization failed for https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.12.2-R0.1-SNAPSHOT/spigot-api-1.12.2-R0.1-SNAPSHOT.pom, status: 403 Forbidden"
it appears to be down
Yeah, hub is down.
how would I wait for 3 seconds before doing something else?
?scheduling
Just add Thread.sleep
oh yea thats a greaaat idea
is bungee for 1.19 out yet or is this still under work.
https://www.spigotmc.org/ as you can see on the front page
it appears to be out
Hello i need help with compiling spigot 1.19 anyone help? https://pastebin.com/iZGdEB5E
INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project spigot: Could not resolve dependencies for project org.spigotmc
jar:1.19-R0.1-SNAPSHOT: Failure to find org.spigotmc:minecraft-server:jar:1.19-R0.1-SNAPSHOT in https://libraries.minecraft.net/ was cached in the local repository, resolution will not be reattempted until the update interval of minecraft-libraries has elapsed or updates are forced -> [Help 1]
Hey Guys! How Can I set ItemStack on config
depends. do you want to preserve all data about the item?
I wanna make Kit Plugin When Player write /createkit kitname get Player Inventory and set on config
Just Items is enough
There isnt one
1.19 released today (or will)
Spigot needs weeks making the jar for 1.19
So wait
It's already out
ya it is released
the spigot jar released as well?
Yes
They've been working on the snapshots
1.18 to 1.19 not a lot of changes under the hood
if ur using yml u could do
FileConfiguration conf = ...;
conf.set("item", yourItem);
but personally i like it better to write my own serialization.
hub is also down so can be that
Ohh I see When I get this ItemStacks I should getConfig.getItemStack ?
Oh what is your suggestion?
nice! not a single change needed in any of my code. just switching from 1.18 to 1.19 mappings is enough :3
uhh well json is another easy option but the best would probably be a database
Im using VPS to build spigot. It is okay? 😄
Oh Actually I'm new on spigot.. (like 1 months) Is it okey use database on this level
uh i would first get familiar with files if youve never done either
and data storage doesnt have much to do with spigot
thats more general java knowledge
I'm working on config like 1-2 weeks soo I dont know its enough for me
But I can use json and maybe later I can use database.
yea i guess indeed.
thanks
👍
it is okay, but why
Idk why this is false when I click in a crafting table, any ideas?
event.getClickedInventory().getType() == InventoryType.CRAFTING
Try checking if it’s instanceof CraftInventory or CraftingInventory idk
how can I delete worlds folder?
and how can I siables spawn chunk from loading? I have custom populators and when that chunk is made I can't modify them
damn my pom is getting longer and longer every day https://paste.md-5.net/ejayumedof.xml
fr
oof
?
unload the world, then simply delete the folder
the folder is named exactly as the world is
not working, already tried that
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
do Listeners need to be public, or can they be package-private?
it just doesn't work, what you suggested, and I asked question about how to delete it
they have to be public
they do ?
just to clarify, I am asking about the class itself, not the methods
public void destroyWorld() {
try {
Bukkit.unloadWorld(world, false);
world.getWorldFolder().delete();
} catch (Exception e) {
Bukkit.getLogger().log(Level.SEVERE, e.getMessage());
if(plugin.getConfig().getBoolean("debug"))
e.printStackTrace();
}
}
``` this is what I'm using and it doesn't work
Well, a public one would be better for you (especially on paper servers) as invokation of your listener methods is easier
you need to init the class in javaplugin class so they have to
that does not mean they cannot be package private 
you cannot simply delete folders
you have to recursively delete the contents too
could just be in the same package as your java plugin child
or use a nexisting method like FileUtils.removeDirectory or however it's called
I can register them in another class, as long as I have the instance of the plugin
You can not unload default worlds
sorry, didn't see that
? the world I'm getting is not default
did you read what I said about deleting folders?
why o0
Then you have to wait for the world to be unloaded. Also you can;t delete folders with files in them
so it can be package-private?
yes
technically yes, again I would not recommend that
I am only listening to spigot events
Does anyone know why when add this compileOnly("net.froze.lib:bukkit:1.0") as a dependency to my gradle project and try to pull it from my local maven repo it doesn't give me an error but it doesn't work at the same time (cant reference it in my project)
https://i.gyazo.com/thumb/1200/a81a2571d6a751eff9f4d88470f81d40-png.jpg
just make them public
this method doesn't exist, I'll trz deleting them in for loop
the method is from apache commons io. and as said maybe it's called differently, like FileUtils.deleteFolder or sth
but it definitely exists 😄
what's their dependancy on maven?
then I'm only getting FileUtil with copy function and no other
good idea
it doesn't recognize my build tools 😐
it's definitely included in recent versions of spigot
wdym?
Could not find artifact org.spigotmc
pom:1.8-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
but I have them downloaded
wow
you have to shade commons io yourself then
this again
thanks
you also have to add the maven-shade-plugin if you haven't already done so
and then set the <scope> of all dependencies you do NOT want to shade to "provided"
I have that already
just use current versions 💀
please stop with this bulls**t
should I delete before or after unloading the world?
after ofc
okay
thx
[19:38:55 ERROR]: Unable to delete file: .\game\region\r.0.0.mca
[19:38:55 WARN]: java.io.IOException: Unable to delete file: .\game\region\r.0.0.mca
bruh
You have to wait. Unloading is not instant
?
what about that do you not understand?
what that has to do with fileutils not being able to delete folder?
because its not fully unloaded the world yet
Hey Guys! Can anyone help me? How can I make color gradients in chat messages (player#sendMessage)? I can't find any point in the docs
what?, it first has to unload it, then it can only start deleting it, what are you saying has nothing to do with my problem, the world should be fully unloaded if there isnßt any issue
ChatColor.translateAlternateColorCodes('&', text);
"should be"? How long are you waiting after telling it to unload?
No, not normal color codes
hex?
yes! for example
Example: https://prnt.sc/yV_DrLZSZqU0
what? i dont use runnable to unload it
Bukkit.unloadWorld(world, false);
FileUtils.deleteDirectory(world.getWorldFolder());
I use this in a single core plugin
and as I said, it does NOT unload the instant you tell it to. The world is still loaded when your delete runs
how so, and how can I make it unload before deleting it?
Guys Are there any downsides to using the API?
try saving the chunks
You are also telling it to unload the world, while holding a reference to the World.
You tell it to unload, wait a few seconds, then loop while testing if you can delete.
it sounds counterintuitive but maybe if u try unloading without saving it may just remove the world from memory and deal with closing file streams after?
now sure how bukkit does it
in 1.8
Do not hold a reference to the unloading world, just get a File reference
like this?
File worldFile = world.getWorldFolder();
String worldName = world.getName();
world = null;
Bukkit.unloadWorld(Bukkit.getWorld(worldName), true);
FileUtils.deleteDirectory(worldFile);
close but no
you still have to delay deleting the world and test if it fails so you can repeat x number of times.
i thought world loading and unloading happened sync in 1.8 tho?
Not as far as I remember
ah ok
well u probably have to schedule a repeating task to delete the world until the folder no longer exists
Do custom items as an exact choice break the crafting book?
pretty sure it will not start to attempt to unload until the next tick
It's saying I can't craft this even though I have the exact items it's looking for and I can craft it manually by dropping everything in
are any of your items damaged?
no, they can't even be damaged
It's three brown stained glass with the luck enchantment for the glow and a custom name
and a netherite ingot with a custom name and luck
File worldFile = world.getWorldFolder();
String worldName = world.getName();
world = null;
Bukkit.unloadWorld(Bukkit.getWorld(worldName), true);
int task = Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
try {
FileUtils.deleteDirectory(worldFile);
} catch (IOException e) {
Bukkit.getLogger().log(Level.SEVERE, e.getMessage());
if(plugin.getConfig().getBoolean("debug"))
e.printStackTrace();
}
}, 20);
Bukkit.getScheduler().cancelTask(task);
``` @eternal oxide like this? sorry for late response
the recipe for the brown stained glass works in the recipe book and it's glass plus eight renamed and enchanted soul sand
No, you cancel the task straight after creating it. You also need to try again if the delete fails, so a repeating task and cancel it from inside when it is finished or takes too long
Can anyone tell me how to use hex colors? And maybe how to use color gradients?
you could use the adventure framework
https://docs.adventure.kyori.net/minimessage/format.html read about it here
I take a look
how would I got about it?
Does anyone know a good way to set nearby ground on fire and then remove it aftre 5 seconds? Like 10 blocks in x and z from the clicked block to fire
Current code
int r = 10; // Loop through all blocks within the radius (cube, not sphere) for(int x = (r * -1); x <= r; x++) { for(int y = (r * -1); y <= r; y++) { for(int z = (r * -1); z <= r; z++) { // Grab the current block Block b = (Block) loc.getWorld().getBlockAt(loc.getBlockX() + x, loc.getBlockY() + y, loc.getBlockZ() + z).getRelative(BlockFace.UP);
?scheduling
this wont work very well either
this method requires the land to be completely flat
(r * -1) -> -r
I have a library for that but it's not really very good
?paste
Something like this. Not tested but it will give you the idea. https://paste.md-5.net/zipaqatiku.java
can you execute code when a world has finished generating?
A world is never finished generating
worldloadevent?
or chunkloadevent
loading*
Would u know how to make it so it works on all surfaces? But that it only affects blocks that have air above?
is that called when the world has finished loading?
private void lightOnFireInRadius(Location origin, int radius) {
for (int x = (origin.getBlockX() - radius); x <= (origin.getBlockX() + radius); x++) {
for (int z = (origin.getBlockZ() - radius); z <= (origin.getBlockZ() + radius); z++) {
Block fire = origin.getWorld().getHighestBlockAt(x,z);
if (fire != null)
{
fire.setType(Material.FIRE);
}
}
}
}
i think this should work.
dont go gethighestblockat
Thanks man
why not?
you might need to go 1 more block
if theyre in a building it wont work
get all blocks in the radius, if it's air check if it has a block below
and set it on fire
a solid block*
ya what if the terrain goes up next to you
