#help-development
1 messages · Page 731 of 1
Bunu denedim ve çalışıyordu kendim özel bir şey denedim logo kısmının sınırları vardı
So it's animated
I can only imagine yes
I was thinking it was just a loading screen texture
The avocado one seems static :P
Thank you very much, but can I logically turn a picture into fsh?
What if, I want a rotating banana as my loading screen?
Nope
No because textures aren't shaders. These two concepts are fundamentally different
I tried this and it was working I tried something special myself the logo part had limits*
Ajwokdkwkdi
inserts why isn't it possible meme
Yes
Fragment shaders? Is thst what they named pixel shaders or they're different?
Vertex and fragment shaders are part of the OpenGL shader pipeline
can someone help me, i need a staff member, idk where to put my message but its definetry not going in the help-server channel.
I think these guys are gods 😏
Are you trying to report someone or something?
lol this is creative https://paste.md-5.net/ufawexanur.glsl
wanna delete my own resource
Seems they made some sort of generator to convert their texture into a GLSL script
Then did this in the fragment shader which is honestly kinda funny https://paste.md-5.net/vazahuhure.glsl
Using import statements to copy/paste that if/else-if chain into the shader a little more cleanly
Use the Report button on your resource page and just say that you want it deleted and staff will get around to it.
ok
And the changed background script just changes the background colour
Detects red, changes it to green
Nothing too crazy complicated. You can download those packs and learn a lot
ya talking about changing the minecraft loading screen without optifine?? Im interested but idk how to use shaders in texture pack...
Unless you're trying to do something fancy like animate it, you don't need to do anything other than change the texture
well, i know that you can do this with optifine. But in vanilla minecraft🤨
im talking the mojang logo
You've been able to change that for a long time
i mean change the mojang logo to annother texture, not change the color. am i dumb or something, cause everywhere i looked, i just found shaders resource pack to change the logo and the texture based one required optifine
The logo itself is just a texture. You can replace that with any other image you want. Been that way for a while now.
If you want it to be animated, you'll have to mess with shaders.
ok
well thanks
hey, im trying to use https://non0reo.github.io/ImgToShader/ but i cant click on the upload logo or background image button, is this normal
Hey, is there any way I could use multiple spigot libraries at once?
Like inside pom.xml to have
1.19.2
1.18.2
1.16.5
etc.
Because at the moment I can only put 1.19.2 and 1.18.2
That's a multi-module project.
Best code I've ever seen in my life
Yea but am using nms for it
In that case yeah, you want a multi-module project
Does maven provide me with that or?
Outside of multi-module that is not truely possible anyways
Well basically you need to picture it as having many small maven projects come together as a big one (and of course you have the version-independent core at the center of it all)
I see, I'll look more into it but thanks for providing me with an idea 🙂
Multi-module builds are possible under any build system in one shape or form
Hi eclipse guy
Hey I use eclipse too
Hello there. You seem lost. What is your query?
So does @worldly ingot
There are literally dozens of us!
I should be in bed now. 12PM XD
I am afraid eclipse should really go to bed too - but one last line of code needs to be written today!
Good luck, I did write an MD like 2 hours long
XD
Heh, if my ConcurrentInt62Set was anything to go by my current project will take a few days even though it is a single class
You wrote MD5?
Yes
Recently?
Ye, I updated him
Ah okay
Glad to know he still has maintainers.
😂
Is there any negible difference between x << n and x * y if I happen to know that y is 1 << n but I do not know the exact value of n?
Basically I want to ask if it would be worth to do n = ln(y)/ln(2) and store it in a field
If you're writing something that performance sensitive you really should setup a benchmark
is PlayerInteractEvent literally just a right click
Yes
Or left
what circumstances is it left
i just want to detect right clicks
You can check that in the event
Then check if the action is right click block or right click air
:v action
getAction
yes
24
any exemple of this ?
joml has a bunch of rotate / rotateXYZ methods
please it's not that simple here, we are in minecraft math and joml concept are not that simple xD Been 6hours that i tried to rotate a display block around his center x'(
Minecraft math isn’t any different than regular 3d math
lol
BlockDisplay display = player.getWorld().spawn(player.getLocation(), BlockDisplay.class, blockDisplay -> {
BlockData blockData = Material.STONE.createBlockData();
blockDisplay.setBlock(blockData);
//blockDisplay.setRotation(player.getYaw(), player.getPitch());
blockDisplay.setInterpolationDelay(10);
blockDisplay.setInterpolationDuration(100);
blockDisplay.setTransformation(new Transformation(
new Vector3f(-0.5F, -0.5F, -0.5F),
new Quaternionf(0, 0, 0, 1),
new Vector3f(1, 1, 1),
new Quaternionf(0, 0, 0, 1)));
//blockDisplay.setTransformationMatrix(new Matrix4f(
// (float) (Math.cos(a) * Math.cos(b)), (float) -Math.sin(a), (float) (Math.cos(a) * Math.sin(b)), (float) 0,
// (float) (Math.sin(a) * Math.cos(b)), (float) Math.cos(a), (float) (Math.sin(a) * Math.sin(b)), (float) 0,
// (float) -Math.sin(b), 0, 0, 0,
// 0, 0, 0, 0));
});
Bukkit.getScheduler().runTaskLater(CECoreHUD.getINSTANCE(), () -> {
display.setTransformationMatrix(new Matrix4f(
(float) (Math.cos(a) * Math.cos(b)), (float) -Math.sin(a), (float) (Math.cos(a) * Math.sin(b)), (float) 0,
(float) (Math.sin(a) * Math.cos(b)), (float) Math.cos(a), (float) (Math.sin(a) * Math.sin(b)), (float) 0,
(float) -Math.sin(b), 0, 0, 0,
0, 0, 0, 0));
display.setTransformation(display.getTransformation());
//new BukkitRunnable() {
// float yaw = 4;
// @Override
// public void run() {
// display.setRotation(0, yaw);
// yaw += 4;
// //display.getTransformation().getLeftRotation().rotateAxis(12, 30, 0, 10);
// }
//}.runTaskTimerAsynchronously(CECoreHUD.getINSTANCE(), 0, 1L);
}, 10L);
nop
on a RightRotation ?
I normally make both rotations the same
Left is before transformation right is after
i cross the whole internet and nop (no one can rotate a display block around his center 😢 )
That’s very good to know
Could you change fog on a client with nms?
Fog distance specifically
It seems like people have at least removed it entirely with plugins before
Hi! Does anyone know how you would go about eliminating drag in minecraft? Im looking to get rid of the drag factor for snowballs and arrows. I saw a tutorial on MCreator (https://mcreator.net/forum/75655/tutorial-change-gravity-and-air-resistance), however I do not have the software to run the program, and am kind of in a rut. Thanks in advance!
How do you not have the software to run it
I don't think you even need to install a JDK
playerinteractevent isn't firing when i right click nothing with an empty hand
That's expected.
Either way you shouldn't use things like MCreator to make mods, they commonly produce bad or messy code and you, ironically, usually end up spending more time figuring out how to do things with code blocks that may or may not exist for what you want and make less sense than actual code
how do i detect all right clicks
Check if the action is right click air or right click block
Note the event doesn’t fire if you right click air with nothing in your hand
👁️
howwww
Because the client doesn’t send a packet for that
How would you suggest for me to do it? that would be the only thing i need to change really
In a mod or in a plugin?
hopefully a plugin as im running it in a minehut server
I'm trying to see if I can find how that's calculated
Ok
research says its applied every tick subtracting 2% from the vertical velocity. Also says it is applied in this order 1. velocity affects position 2. drag affects velocity 3. acceleration affects velocity
Seems like the only drag is from water
wdym
i mean wiki says drag is more significant in water but it is still present in air
there should be a table with all projectiles, their speed, acceleration and drag
does llama spitting not hurt player
ok i am spawning llama spit but it won't damage mobs
also i did setbounce but it won't bounce
how are you spawning it?
Imma be honest, I don't think doesBounce() does anything at all
Yeah use of that method dates back to 2011, 12 years ago, when arrows were able to either bounce off of players when hit or drop to the ground and inflict no damage
I don't know when that functionality was removed but doesBounce() isn't even called anywhere in CraftBukkit from what I can see. Probably worth deprecating that
Player#setPose() is saying no class defined error?
setPose() doesn't exist. You can't set a player's pose
Poses are recalculated every tick and based on certain factors so even if you could set the pose, it would just get reverted by the end of the tick anyways
Because it might be useful information to get. It's from Entity
lmao i thought it was in Player
You can call getLocale() as well but not setLocale() 😛
Some things only make sense to get
The only way I see setting the pose is through NMS
No because the client is going to disagree with you anyways
i see
fine ill use nms
So pose determination is client side?
It's both
Could he send a packet to set the pose every tick?
i wonder if protocol lib has that
Way to many LOL
@warped shell What pose are you trying to achieve?
If you just want to sit, spawn a display entity and set the player as a passenger
oh interesting
I use that for my sitting plugin
i hadnt thought of that
Crouch will make you stand, but I’m certain there’s an event you can cancel for that
Ok cool
cool ty for the idea
Yeah happy to help!
Also, just a guess, but you could use NMS to make a block above the player, which may force them to crawl. Preferably a barrier, as that’s invisible.
Im making a region system, is it worth making it so u can like add blocvks to regions instead of just having a min and max point?
Hello, best-practices question here. How do you guys think is best to handle a custom command feedback system? Currently I've got it so there's a messages.yml file, an enum and a manager to handle the file to enum stuff. However, I find it really unsatisfying that the manager has to use the plugin instance to locate the datafile. Like, ideally, I'd like the messages system of the plugin to work fully on its own but the closest I can get is having to either A: Make the plugin instance public and static or B: only create the mssage manager when the plugin is enabled and it's only really accessible through a plugin instance. Anyone got a better system?
Uhh let's see
I have a MessagesFile class responsible for sending messages from the config
and I just pass it on to my command manager in the constructor
something like this
Oh, so do you query the YAMLConfiguration when you need a feedback message?
works a charm btw
Somewhat
a FileConfiguration / ConfigurationSection is already a cached variant of the file
so I'm not doing any IO
Is there a way to detect if an arrow isn't flying anymore?
not being a dumbass might help
I was getting the updated arrow outside of the loop
How do I make chat appears different for different players? Say, we have 3 players, Player 1, Player 2, and Player 3.
Chat seen by Player 1
<Player 1> Hi guys!
<Player 2> Oh hey Player 1.
<Player 3> Welcome back Player 1!
Chat seen by Player 2
<Player 1> Hi guys!
<Player 2> Oh hey Player 1.
Message from a muted player..
Chat seen by Player 3
<Player 1> Hi guys!
Message from a muted player..
<Player 3> Welcome back Player 1!
Cancel event and call sendMessage
Change recipients collection from chatevent.
Or you can change chat system entirely but it will break plugins.
Alright thanks. Ill start from the recipients collection
Or listen to projectile hit event
For what purpose?
is there any detailed description on the plugin loading? especially the resource handling of the plugins? I want to know how I can easily load in resources from a different plugin where I have information about the relative path
i try create annotation command but this return System.out.println("error argument 41 line"); what mean subCommand not can find metod - https://paste.md-5.net/ecepajoyut.cs
In regards if its from a different plugin you can use the api to check if its loaded. Best to do this check from the server load event as that is ran after startup is complete
I discovered ServerLoadEvent recently
I usually just use a scheduler with a 1 tick delay
you mean in the handler of the server load event?
ye
We need the stacktrace and these classes to be on seperate pastes with imports and packages
i was check
now i dont undestand some reason command "/bot help" not found
exists "/bot goodbye" /"bot hello"
but first command not exists in metod
but when listener registred he exists
wth with maps
ok yeah my problem is accessing resources "next to it".
imagine this scenario:
I have /model/model.xml which references /images/bgmarker.png with @{../images/bgmarker.png}
the user of my library just provides the model.xml path which my library loads in
then I parse it and it finds a background image property which references the bgmarker
and my library should load it as well:
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.squidxtv.me/schema/frameui/v1/frameui.xsd"
id="test-frame"
width="5"
height="3"
background-image="@{../images/bgmarker.png}">
<div id="first-div" width="640" height="384" border-color="#FFFFFF" border-width="1"/>
</screen>
how do I get access to the whole resources of a plugin?
preferably without passing in the plugin itself, just the Path of the model.xml
I tried using nios Path like this:
Path.of(SpawnTestScreenCommand.class.getResource("/model/model.xml").toURI());
but I get some weird FileSystemNotFound exception by Path.of
I want to prevent that the user needs to load in all images himself and
passing it all to my plugin, that would be not that nice
.
.
some more context
and it should also work if the Path is a non resource path but an absolute path to something
URI documentLocation = URI.create(element.getOwnerDocument().getDocumentURI());
Path path = PathUtils.convert(Path.of(documentLocation), result);
/**
* The regular expression pattern for matching Windows-style paths.
*/
private static final Predicate<String> WINDOWS_PATH = Pattern.compile("^[A-Z]:\\\\.+$").asMatchPredicate();
/**
* The regular expression pattern for matching Unix-style paths.
*/
private static final Predicate<String> UNIX_PATH = Pattern.compile("^/.+$").asMatchPredicate();
/**
* The regular expression pattern for matching relative paths.
*/
private static final Predicate<String> RELATIVE_PATH = Pattern.compile("^@\\{.+}$").asMatchPredicate();
private PathUtils() {
throw new UnsupportedOperationException("Utils class, construction not supported.");
}
public static @NotNull Path convert(Path xml, String path) {
if (RELATIVE_PATH.test(path)) {
return xml.getParent().resolve(path.substring(2, path.length() - 1));
}
if (WINDOWS_PATH.test(path) || UNIX_PATH.test(path)) {
return Path.of(path);
}
throw new IllegalArgumentException("Invalid path format: " + path);
}
this is how I handle the custom path @{path}
which shows that its a relative path going out from the xml model file
thats why I would be interested in some more in depth view of how spigot handles the resources of the plugins
yeah, but essentially should support both
I mean the way I know one should do it is to just open a ZipFileSystem and read the resources from there
I think spigot prob goes through JarFile
does anyone know what the match tool does
I have 2 different rods and 5 different fish, 2 of them on the first rod and the remaining 3 fish will come out of the 2nd rod.
Is it possible to do something like this with the loot table
ty
anyway to detect left clicking on players without EntityDamageByEntityEvent?
why?
not being able to detect when hitting a player in creative mode
creative is it's own beast and difficult for a server to interact with
quick question, if i cancel a PlayerInteractEvent and i try to left click a block, will it still show the block fracture animation?
Code/System Design Question?
I've got 6 nms modules and I need to implement entities, I need to write a data watcher wrapper for flags for stuff like armorstand ect and wondering what the best way, if the best way is to make an INMSDataWatcherHandler and make some sort of wrapper for setting flags like DataWatcher.builder().setKey(1, 2) or whatever
or is there a better way since I believe data watchers have changed a lot from 1.20.1 back to 1.12 and 1.8
what do I take in from the user of my library?
InteractEvent, use raycasting from the players eye vector to see if they're looking at a player
I just saw the change log for 1.20.2 and it says: The positions that all entities ride on other entities have been adjusted to make more sense
Does anybody know the exact value they changed for riding armorstands?
Or where to look at it
.
For a brief second on the client its possible
im gonna try anwyays
try and see
Yes he is
do you know how?
Is it legal to distribute a mojang-mapped plugin jar? Lately there have been reports of Mojang-Mapped servers (not Spigot, but forks of Spigot) and I've received requests to make a plugin mojang-mapped-server compatible. Am I [a] allowed to make a mojang-mapped plugin jar for public use and [b] if I were allowed to do that, could I upload it to the Spigot forums?
yes, so long as it contains no Mojang code
So just to ensure my understanding is correct and I'm covering all bases:
- If a plugin was using NMS directly (e.g. import NMS classes), and then was compiled against a Mojang-mapped Spigot jar, then that's not okay?
- If a plugin was using NMS directly (e.g. import NMS classes), and then was remapped to Spigot so it didn't have any Mojang mappings in the code, then that's okay?
- If a plugin used reflection to access NMS and had something like
if mojangMapped then { access field "mojMappedField" } else { access field "spigotMappedField" }, then it is okay?
yes you are not including any Mojang code.
you are using mojmapped names which mojang provide.
So using mojmapped names counts as containing Mojang code?
doesn;t matter if you call .a or .connection you still include no mojang code
if you mean paper convertingto running mojmaps, im pretty sure the announcements said they were gonna auto remap
no Mojang provide teh names, its not code
Surely that's a grey area for distribution though? You end up distributing a jar with mojang mapped (compiled) code (and I thought that's not okay?)
it doesn;t matter if you use Mojang provided names or the encrypted ones, it's not code
probably works the same way paperclip distributes the obsfuscated code
paperclip is already a gray area
The reason I'm asking is because there's this one line in the mojang mappings legal text: You may copy and use the mappings for development purposes. My interpretation is that if you're using mojang mappings, then build a moj-mapped .jar file for distribution (e.g. upload to the Spigot forums), then it's no longer "for development purposes"
so long as you don't go packaging a Mojang class you are fine.
yeah paper will remap automatically when they start running it
Just to add mojang released these mappings for developers to use and include in their code it'd be highly contradictory to then pursue those devs in legal action for using the provided mappings
not offhand, sorry
you could always google it :p
it's a pretty common use case
hmm
this is incredibly vague, but would y'all have any thoughts on how to "organically" determine "land claims"?
"land claims" meaning they're not actual land claims but rather the server's understanding of where a player has set up shop
what
wait are you talking to me or someone else
"set up shop" is just
has setup shop means where they've settled
a colloquialism
yeah
these aren't actual shops
that's not it
lol
this is a design question, not an implementation one
basically "how would a bot determine if they're in an actual player's base"
bot-to-bot is easy, the server can just share their "claim" information
player-to-bot is also easy because players have brains
(usually)
bot-to-player on the other hand? that's the tough one
time spent in an area? persistence and variety of blocks placed by the same player? tileentity usage within an area?
i guess some combination of those could provide a rough estimate, since individually they all have flaws (e.g. someone just spamming blocks, or going afk in spawn, or raiding a base and repeatedly accessing chests/doors), but I'm not sure if there's a better way lmao
best i can do is piece together what the average player does in a base in terms of server events
i suppose a claimed bed would be a good one as well
Hello boys
@young knoll @eternal oxide @kind hatch @wraith apex @lost matrix
Sorry for the ping, I felt like updating you about the ClassNotFound from yesterday, seems like the issue truly came from uploading the plugin file while the server is running and then restart.
Since then I been actually stopping the server and then uploading the plugin file, and the server hasn't given the error of ClassNotFound 🤔
Hopefully this was the issue, since it was a easy fix 🤣
Can I give a custom loot table to my fishing rod with custom model data using the match tool
Hello guys, I'm back with another question.
I need to send a message to a group of player.
Here's is how I create the group (class: dropGroup)
if (plugin.droplog_list.contains(p.getUniqueId())) {
plugin.droplog_list.remove(p.getUniqueId());
p.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getString("prefix") + ChatColor.translateAlternateColorCodes('&', config.getString("dropsOff"))));
} else {
plugin.droplog_list.add(p.getUniqueId());
p.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getString("prefix") + ChatColor.translateAlternateColorCodes('&', config.getString("dropsOn"))));
}```
Now I want to send a message to this group in this event:
@EventHandler
public void PlayerDropItemEvent(PlayerDropItemEvent event) {
Player p = event.getPlayer();
if(!p.hasPermission("thelogger.bypass")) {
ItemStack item = event.getItemDrop().getItemStack();
p.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getString("dropEvent").replace("%eventplayer%", p.getDisplayName()).replace("%eventitem%", item.getType().name())));
}
}```
Now for the test is p.sendMessage(.....)
I want to make something like: droplog_list.sendMessage(....);
How can I do this?
I literally asked that ._.
is there a way to implement whitelist by a permission, so if player doesnt have permission hes not whitelisted?
You will get a ClassNotFoundException if you replace the plugin with a new build while the server is STILL ON because the JVM is freaking out that the original plugin has just disappeared. If the parts of the plugin still loaded in the JVM attempt to ask for a class that's not been loaded you will get this error. /reload or using a Plugin that facilitates a "reload" is also good way to get random bugs. You shut down the server before deploying a new build or you roll the dice for weird behaviour. Can also just kill the server if you don't care about the testing world getting corrupted chunks
yes
Though you wouldn't use the default whitelist system
you can just reject their connection and kick them if they don't have a permission as they're joining the server via PlayerJoinEvent
?
In summary you want to broadcast a message to a subset of players that are contained within the plugin.droplog_list whenever a player drops an item?
yes
the easier way would be use Bukkit.broadcast(message, permission), if you dont want to do that just loop the list and sendt he message
I don't know how to loop
aight
learn java then 😳
for(UUID uuid : plugin.droplog_list)
{
Player p = Bukkit.getPlayer(uuid);
p.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getString("dropEvent").replace("%eventplayer%", p.getDisplayName()).replace("%eventitem%", item.getType().name())));
}
not the netbeans format
bro, I try java one month ago for the first time
it is not the case to say sentences like then learn java
you wont learn by getting spoonfed
You're not helping either by complaining
I prefer to learn by doing because it makes me have more fun and programming should just be fun for me
only this
thanks for help @wraith apex
thanks
you asked if I was reloading, I never reloaded.
I also asked if you restart your server for a new build
Can I give a custom loot table to my fishing rod with custom model data using the match tool
i technically did, i never thought uploading while server was up was gonna do anything bad since i been doing that for years and plugins never did this problem.
the problem seems to have come up when you are "updating" a plugin every single time
possibly
yes, if you want it to be popular
Mojang stick with LTS versions of Java aka Long Term Support
11 + if you want popular
or 10
I forget which
it does but majority don;t use 1.20
if you build on 21 then the user/server owner has to update their java to 21
if you ONLY dev for 1.20 then 17
Aight might of not been clearer on my end then. But yeah it's hit or miss pretty much. Sometimes you can get away with it, sometimes not.
pls help 🙏
think this is the wrong place for that lol
That is a wrong statement. 50% of servers run on 1.20.1
The rest are small distributions to other modern versions that require at least Java 17
Actually 50.1%
Yeah. Actually didn't want to use that point. Saying "majority" with only .1% over 50% doesn't feel right to me though
My point stands, if he wants to appeal to teh majority of servers he can;t restrict to 1.20 only
Probably not. Java 17 would still be required for the most used versions
he needs to code for the lowest version he wants to support
Great idea. Omitting modern features of Java just to support some ancient version of Minecraft.
I personally would always start developing for the newest version of Minecraft and then continue with supporting new Minecraft versions while keeping support for every Minecraft version the plugin has ever supported.
Then you'll get 1 star reviews for no 1.8 support
I'll be honest the only thing I use from modern java is the instance of casting
That I can remember
That's usually the only thing I have to change when I downgrade versions
I'm more concerned about spigot methods that were added between server versions ngl
I mean, I'm just expressing my opinion. I think it's not smart to start developing a plugin with the idea in mind to support ancient versions of the game.
People who want to use my plugin, use my plugin. People who don't want to use my plugin, don't use my plugin. People who can't use my plugin should update to a modern version of the game.
support whatever versions contain the methods you are going to use
I am inclined to agree though, I don't write plugins to support shit like 1.7.10 and don't plan on it
that's LARGELY due to spigot limitations
I generally support back to 1.16.5. if I can
I'm not sure how far back support for my stuff goes, I generally don't use Spigot methods where I can help it
only to interface directly with the game
lol
says who
i don't write general utility plugins
i write gameplay overhauls and dumb shit
there is no in between
This, my plugins can all go back to 1.14 if I really wanted them to.
My beautiful fishing plugin ezpz 1.14
wish there was some kind of "added in version x" for spigot documentation
i didn't see any last time i checked the javadocs
also yeah that's why i brought up frequency of tileentity use, i figure people are gonna be interacting with them often in a base
is there any docs or guides for data watchers ?
I dont have a data watcher already and need to initiate and properly modify it and then wrap it back up to send to the clinet
I remember someone wanting to add that but not sure if they ever went through
do you recommend foundation library for gui's?
What version? It's an object list starting on 1.19
I mean
with the whole mark dirty shit
Im trying to write abstraction for cross version stuff and im kinda lost on how to implement it as I need to make abstraction for EntityDataAccessor and stuff
but im not really sure how I could do that cross ver
whats the best gui library right now?
idk if there even are any good gui libraries tbh
I've tried some out wasn't a big fan of any
most of my libraries are pretty light weight. all of the utils I need for everything only take up like 200kbs shaded
including nms 
Nms usage is the worst in terms of space taking
shame nms has two meanings
it doesn't
unless you're talking about the game no mans sky ig
but context should be obvious
network management service 😎
yeah i think context can explain what it means
ayeee
no more suffering
Not many signs
Being on spigot help dev channel might give the context you need
how can I go from an entity direction to a Quaterion4f for a display entity?
...is Quaternion4f from a library, or is it something you wrote?
It's in joml, bundled with spigot
that's new
it was added in 1.19.4
What even is a quarterion?
Oh
for block displayes
it's a method of storing rotations that's much cleaner than a matrix transform
or xyz and angle
That should be pretty simple, just change the angle
I don't know what to
i have the video of that
damn, I don't need to write my own maths library anymore, I can just use JOML
Well it's most likely in radians
you're converting from a forward vector to a rotation
Yes
do you know how to do that?
is JOML literally Just Another Math Library?
or rather
Nope
Pretty sure it starts at pi/2 and ends at 2pi
Java Object Math Library or smt
aight
Java OpenGL Math Library @wraith apex
so the problem with matrix rotations and direction vectors is that they don't necessarily refer to a single fixed rotation
It should have methods for rotatimg around a coord
fortunately since this is a game with a fixed orthographic rotation
we know the up and right vectors are always gonna be at right angles to the forward vector
You don't really want rolls
typically no
It would make my head spin
roll has its place but not in a first person controller outside of like...peeking corners, and that's not really something mc supports afaik
a common way of determining an orthographic rotation is uh
use an artificial "up" vector (0, 1, 0) and take the cross product of your forward vector and that up vector as your right vector, then cross forward with right for the actual up vector
and there are your three axes which you can use to compute a rotation matrix
joml probably has shit in it already to convert this stuff
This also makes my head spin
i work in graphics
this is like
graphics 101, unfortunately
i'm not particularly good at math
I guess it makes sense to you
believe me
barely
But i never worked with these so i don't have a feel for them
the people who originally discovered this shit are wizards
Haha
apparently I'm descended from the dude who invented logarithms, but like
I sure as hell didn't inherit the math gene
a lotta maths
I have no idea how their brain worked
OH YEAH
to this day i remember my introduction to vectors in high school
and it's because of this guy
cos I'm comitting crimes with both direction and magnitude!
I am just trying to get a rotation
of a slime
godspeed, soldier
yeah and I'm telling you that it's a pain in the ass
JOML might have a method to convert for you with some kind of assumption
Oh i remember him, the dude from minions
public static Vector rotateAroundAxisX(Vector v, double angle)
{
angle = Math.toRadians(angle);
double y, z, cos, sin;
cos = Math.cos(angle);
sin = Math.sin(angle);
y = v.getY() * cos - v.getZ() * sin;
z = v.getY() * sin + v.getZ() * cos;
y = Math.round(y);
z = Math.round(z);
return v.setY(y).setZ(z);
}
public static Vector rotateAroundAxisY(Vector v, double angle)
{
angle = -angle;
angle = Math.toRadians(angle);
double x, z, cos, sin;
cos = Math.cos(angle);
sin = Math.sin(angle);
x = v.getX() * cos + v.getZ() * sin;
z = v.getX() * -sin + v.getZ() * cos;
x = Math.round(x);
z = Math.round(z);
return v.setX(x).setZ(z);
}
public static Vector rotateAroundAxisZ(Vector v, double angle)
{
angle = Math.toRadians(angle);
double x, y, cos, sin;
cos = Math.cos(angle);
sin = Math.sin(angle);
x = v.getX() * cos - v.getY() * sin;
y = v.getX() * sin + v.getY() * cos;
x = Math.round(x);
y = Math.round(y);
return v.setX(x).setY(y);
}
I use these in my own library, but that's a few years old
eh, if it works it works
I just need to make a display entity face the same direction as the slime
yeah they still work lol
you don't need to do that then
you can just
set the direction of the entity
Not on display entities
even if you can't do it directly, you can create a temporary Location object
ensure the Location's direction is set
They don't inherit rotation from a location
then teleport the entity to that location
wait
what is a "display entity" exactly
is this some new thing in 1.20
lol
no actually
Display Entity?
no ticking, no processing way to display items/blocks/text
oh that is neat
huh. okay. so these are a lower overhead way of doing this stuff
instead of packet spoofing or armor stands
thank god
I should use these for my custom entity framework instead of armor stands
declaration: package: org.bukkit.entity, interface: Display
Only issue is they are completely fucked when using billboard
speaking of the display entities, has anyone else noticed interpolation being inconsistent or not working at all in spigot?
interpolation is weird
can't comment
you need to set the start at -1 and the time to like 0 first then set it again to the time
some random ass intern made this shit
wait what lol
why does this look like a huge pain in the ass
oh I see ok
anyways
thanks, am I good to dm you about it later? Ive been searching all over for interp fixes lol
ye ye
We banged our heads in against the wall at work
you're free to ask
We also found a bug
oh
jira link?
yep 1s
Now we have Vector and Vector3f
mojangis amazing
back to armour stands lol
we found a way to reverse the client interpolation just because of that
On the server
just don't worry abt it
wait, do you work for mojang lol
im gonna say he doesnt, its just a lot of people that have jobs in mc use normal work terms
when if irst read it i thought it was sem ver der
is it possible to interrupt plugin loading without throwing an exception?
yes
getPluginLoader().disablePlugin(this) or Bukkit.getPluginManager().disablePlugin(this)
so there is
TIL
im gonna say theres a high change it just calls one of those methods
all work
Yeah, for sure
different topic, if im storing per-player inventories, should i do so in one table globally or in one table per player?
I'm worried about high player counts slowing down access
table as in a db?
if so you arent gonna notice that until you have a LOT of players
does potentially a few thousand ones count
Cache or access database
But you can definitely hold all your player's inv in 1 table
No need to make one for each player
k
Is this a correct way to use HEX colors? The problem is that it just sets the minecraft default colors that are similar to the hex ones that I provided
public class HexUtils {
private static final Pattern pattern = Pattern.compile("#[a-fA-F0-9]{6}");
public static String hexFormat(String s) {
if(MinecraftVersionUtils.isVersionGreaterThan(1, 16, 0)) {
Matcher matcher = pattern.matcher(s);
StringBuilder result = new StringBuilder();
int lastAppendPosition = 0;
while (matcher.find()) {
String color = s.substring(matcher.start(), matcher.end());
ChatColor chatColor = ChatColor.of(color);
result.append(s, lastAppendPosition, matcher.start());
result.append(chatColor);
lastAppendPosition = matcher.end();
}
result.append(s.substring(lastAppendPosition));
return ChatColor.translateAlternateColorCodes('&', result.toString());
}
return ChatColor.translateAlternateColorCodes('&', s);
}
}
are you on a version lower than 1.16?
like that's exactly what the code does
convert it to default color codes if you're not on a version compatible with hex codes
no
it appears that my colors are set to red, because I'm using TextComponent, is there a way to fix that?
yeah, it doesn't work with textcomponent
Well, I got rid of something
at all
at the very least gravity is gone
darn
arrows fly forever now
the 0.99 is gone too
right
whatever that was actually doing
yeah, everything
There are a lot of lines that might be drag
drag isn't exactly calculated, more like just a static ??? thrown in at some point
Maybe it's just that 0.99
Because that same var is changed to the water intertia value if it's in water and gravity is -0.05000000074505806
If I'm right then removing gravity and the 0.99 (or 0.6 in water) then adding gravity back should get rid of drag
yeah I think that was it
it was
there's no drag in water now
Hi, has anyone here touched the miniaturepets plugin? I would really like to know its API, because I'm trying to find it and I can't find it anywhere
At least for arrows
bruh
throwable projectiles use a different variable for gravity and drag in water
is there a way i can read all key-values in a pdc container without having to specify a specific type? or instead is there a way to get the type of a pdc entry?
@full gull alright so I'm pretty sure I figured it out
projectile velocity minus gravity, divided by drag, then gravity added back
I'm not 100% sure that value that gets removed is actually drag, but it seems to work
Maff
In this scenario ideally your api should provide plugins a way to put stuff in your plugins directory not the other way around
This way your api only needs to be concerned with the directories where the jar is and allows you better organization in terms of providing customizations
hi, are devs allowed to use colors in console or is it a bad practice?
If you want to although the console should be for logging mostly
It is generally bad practice because it clutters the logs with color codes. The logs themself doesnt have colorized text.
Is there a way to fully delete a advancement, I have a plugin that creates advancements through a config but in order for my reload command to work I need it to fully delete all advancements then recreate them
my take is there should really be only 2 colors in console if any at all. Red and Whatever contrasts your background
Red means error otherwise just keep it normal
Nope, I work at a games company and we're making an MMORPG
anyone know what the index for EntityDataSerializers#getSerializer is? I am trying to get a serializer just from type
Oh, god, it's not a minecraft server, is it?
It is, we don't have the team or the infrastructure right now to support a full MMORPG outside mc
You mean via reflection?
What would reflection be useful for in spigot dev?
You can scan listener classes in your project and auto register it.
So, like discord bots in nodejs sometimes do with events and commands?
Thats not reflection
You’re referring to the 3rd party dependency reflections
vertical speed, right?
Why do you add gravity at the end?
Where would I start with making it so when I create a world it only uses whitelisted biomes, I have had a look at biome provider but it changes the biome but doesn't change the generation.
does the API have a method to render a particle to one player only?
hm the method exists but it doesnt say if its for that player only
oh nice thanks
Why would it be in the Player class otherwise
iirc theres something in the player class that does things globally, hell if i can remember what tho
also the api only saying 'Displays particle' doesnt help with the confusion
Hey uhhh is it intentional that the Spigot jar uses Spigot classnames, but mojmapped method names?
the spigot api isnt the most reliable thing
i just say 'Detect left click'
GOOD LUCK MATE
BRUH
Noticed the obfuscation in 1.20.2 was significantly different to 1.20.1, so I looked at a few class files and they're mojmap function names
So just wondering if it's intentional (and therefore won't be reverted, etc)
So you are suggesting that spigot is running in a deobf state?
i mean its happening on my server
spigot class names, obfuscated method names
and i made sure not to run remapped this time
Noice runtime mojmap
java -jar BuildTools.jar --rev 1.20.2 is what I ran just in case I've forgotten how to use BuildTools, freshly downloaded buildtools
Was just semi hoping md_5 could confirm whether it's a bug or intentional lol
But what if they’re pretty 🥺
Spigot uses obfuscated method names, you are probably running the wrong jar
I've been told that before but it only spits out one jar. I've recompiled with and without the remapped flag and this happened both times
maybe buildtools is broken somewhere
The jar was generated using the command I listed above, and I grabbed the spigot-1.20.2.jar file, ran it, then looked inside the \bundler\versions jar file
This was after I noticed reflection calls failing to obfuscated names
Is there something wrong with the command I ran / the jar I looked inside?
no and yes if its not obfuscated
I mean yeah there's obviously something wrong with the jar; but as far as I'm aware I ran buildtools correctly and everything. It was a new setup/download so there wasn't a previous cache or anything that could've messed it up
So it feels like BuildTools might have a bug that's leading to the wrong jars being created
post your bt log and the contents of Spigot/Spigot-Server/target/
isnt that too big for discord
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
try --rev 3890
is that 20.1 or 20.2 ?
am checking the outputted jars now
Yeah that revision is correct
obfuscated methods in spigot class names
thats probably a result of spigot mapping no longer having method names
3890 = good
3894 = bad
I think I see the issue, and yes probably windows only
can you explain what you think it is? I'm curious
https://github.com/agaricusb/SpecialSourceMP/commit/a359f3928ee85fe9cb508427be878343d2798aae wrong args in this commit
Ah cool, makes sense, thanks for fixing that
The day md_5 gets consistent with his whitespaces in parentheses, I'll finally be able to sleep in peace
I didnt write that code
why not
Do you pinky promise?
Time for Git Blame
System GC 💀
just buy more ram
Why gc twice
To be extra sure
probably from a stackoverflow post somewhere
It happens that in gui the state of an item may change. Starting from the lore and ending with the name, but because of this an unpleasant moment appears. How can you get rid of an extra key storing 2 lore state
I was too lazy to do that xD
I have no idea what you just said
item has states somewhere lore1 and somewhere lore2 but because of this you need to somehow write this 2 state into the config so that the config is not large
idk how do this
You want two settings without having two settings?
I have no idea what you're trying to say
i need somehow reduce their visibility so that the config seems small and beautiful
as an option yes, but there will be too much empty space for these items
Looks fine though idk why they're the same
Idk if someone try read this...
so this
be not small
cuse this gui
Most editors can hide different sections
them will have color
red end green
2 states
this is why
Both sections contain same exact information. So I cant see reason why you cant just remove one of them entirely. If you need separate between states then you can have dedicated section where you could define colors for instances when you have money and when you dont, and then insert that color into lore to indicate visually current state. That would simplify its looks without a need to duplicate same text twice.
now i change
I prefer having two different lore options
Gives the users more customizability
You can always make it optional, to define different lore for different state, if that doesn't exist then use default one for both states.
In my opinion shorter configurations give off the vibe of "I will hardcode this because I don't trust my users enough to configure it for themselves". Why limit them?
I don’t think they think so because it will be a copy of another plugin)
Superusers will be happy to configure their plugins to conform to their taste. If you think you should decrease the amount of customization, well, sure then, you do you
item has color state this all in plugin
"2 animations"
and by the way it turns out it’s not 2 but 4
red - red, red- green, green-red
green-green
omg
no i think this be big
there is a fine balance with this. Sometimes too many options can be bad
it may lead to be over whelming for the user
I've been trying to write an inventory to a json file using gson.
I keep getting this error tho:
java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.lang.Object java.util.Optional.value accessible: module java.base does not "opens java.util" to unnamed module @4e306d87
My code for now is
Gson gson = new GsonBuilder().setPrettyPrinting().create();
try {
gson.toJson(p.getInventory(), new FileWriter(ServerSystem.getPlugin().getDataFolder() + "/secretvaults/" + p.getUniqueId() + "/vault_0.json"));
} catch (IOException e) {
e.printStackTrace();
}
I'm kinda confused since I haven't worked with GSON (or any json in java) yet. Can someone help me out?
and sometimes for the developer especially if you have enough options that can cause some weird states XD
lol
You can't just gson random classes
ahhhhh wait i've tried with .getContents().
fsr it's missing there
You can use yaml and the config API or otherwise write your own Json serialiser
Where is there an optional in the inventory anyway
I reaaally hate yaml so that's why i'm trying to use json.
well ig then i'm gonna look into how to write that serializer
Not sure why this has to be Json vs yaml which is natively supported
JsonConfiguration when
also i didn't get yaml to work fsr, idk
how obaut add intarface for serisiation
There is, ConfigurationSerializable
ironically, json is valid yaml
That's what your Json serialiser needs to take
It's a pity not all classes have this interface
so they could just stuff the json into the yaml file XD
When you add it
I should have seen that coming
Well you can't just serialise random shit and itemstacks do have it
hmm okay ig i gotta wrap my head around that bc i have no idea how to even start there, lol
what if I want to serialize the entity
pretty sure you can o.O
and I'm too lazy to go through their features
It’s pretty easy to use the serialization api
if entity has Serilization intarface yes
ItemStack#serialize to go to a Map<String, Object>
And then ItemStack.deserialize to go from Map<String, Object> to itemstack
object can?
be serizible
oh no
The values of the map can be whatever
However they should usually be a primitive, or another ConfigurationSerializable object
I think json is nicer in this regard
No but their contents are
so you could serialize the contens, but you couldn't store the exact position in the inv then?
or wait no
you can create yor custom
it's null if the slot is empty, right
or air
yeah, that's the problem, i have no idea how
which.. is.. the same, no?
You can have literal air as an item?
it could be either bc bukkit
yes and no
._.
most methods wont work on an air item, but the stack can exist as air
makes sense
huh
if its air just make it null and save that as the content
wait air exists in game how item?
air is weird
so i would have to go through the array that inventory.getContents() gives me and then serialize it? And when deserializing i have to inventory.setContents()?
yeah
i think™️ that it should use null as the empty slot and that is fine to get and set back
huh, imma try something
So Im looking for a way to have a normal world but with the pre 1.18 tarrain. any ideas?
You could pregen in 1.17 and upgrade
im pretty sure mc will auto add the below bedrock
but then when you load new chunks it will update it
yes I ended up just looking throiugh the static fields and filtering with one for a type of what. i am looking for.
Is anyone able to give me an example on using data watchers like what methods to call according to wiki.vg's entity metadata
If all terrain is pregeneratted then only below 0 will be updated
The game doesn't magically replace the existing terrain
i just checked
everything updates
wot
it updates everything
so what do i do
Alright now I have to test this
Looks fine to me
- type : item
key : 1
amount : 1
weight : 10
is there any wrong can some1 know help me pls
ok thank
does anyone know how to create a hologram using th HolographicDisplays API?
Dont they have docs for that?
One sec
Create modern looking holograms in Minecraft. Contribute to filoghost/HolographicDisplays development by creating an account on GitHub.
Everything I found was either outdated or deprecated.
i love decent holograms
tysm
but these are loaded chunks
im talking about chunks that havent been loaded yet
can please somebody help with maven, please dm.
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
my maven is totally bugged
So you still have gravity
You remove it so that you can remove the weird drag calculation, then add gravity back
Well yeah those will be new
hence me saying
If all terrain is pregenerated then only below 0 will be updated
Also, I'm not sure if that's a typo in the wiki or not, but drag is the same in lava
Only water has different drag
Look, I checked it myself. Can you check it for a second just to see if you're right?
HolographicDisplaysAPI api = HolographicDisplaysAPI.get(plugin);
Location where = location.clone().add(0.5, 2.5, 0.5);
Hologram hologram = api.createHologram(plugin, where);
TextHologramLine textLine = hologram.getLines().appendText("Test hologram");
Cannot resolve method 'createHologram(org.bukkit.plugin.java.JavaPlugin, org.bukkit.Location)'
Does anyone know how to add effect to item and that effect still work if you have that item in inventory
@young knoll
So if I open a world in 1.17 and then play on it on 1.20 will the new chunks be new or old?
Do I understand correctly, that Bukkit.getOfflinePlayer(String name) accesses the minecraft api and looks up if a profile with the input name exists?
If so and if it then generates a UUID for said player upon not being in the api, can I somehow check if an OfflinePlayer exists and handle that? (I don't want to ban non-existent players)
Wait, is what I'm looking for offlinePlayer.hasPlayedBefore() by any chance?
hasPlayedBefore returns true if that player joined your server atleast once
That's good enough for that
annoyingly, it seems that interacting at max range with an entity (villager in my case) results in an interact event of LEFT_CLICK_AIR even though i'm right clicking. anyone know a workaround on that?
On right click, it fires once for each hand. You can check which hand it is can cancel for left click air.
?interactevent
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
based
How do I make durability infinite?
need some help, pls: #1156902127940153405
maybe it was ItemStack idk
anyway that didn't work
because in this case it doesnt matter the event got fired by both hands
if left/right clicking was done by a separate hand then yeah but in this case no
a left click air will not fire if you right click only
can someone help me make this work please?
hologram must have a name.
oh
how do I set the name for the hologram?
Pass name to constuctor.
Cannot resolve method 'setName' in 'Hologram'
HolographicDisplaysAPI api = HolographicDisplaysAPI.get(plugin);
Location where = location.clone().add(0.5, 2.5, 0.5);
Hologram hologram = api.createHologram(plugin, where);
hologram.setName("drtp_portal_hologram");
TextHologramLine textLine = hologram.getLines().appendText("A hologram line");
how can i do a search and replace that respects capitalization in intelliJ?
CTRL + F?
no
🤔
there’s a case sensitive button
in intelliJ’s ctrl f
thats just to find them
then ctrl r
its alt c but i see it
ctr shift r is to replace in all files
anyone? please 🥲
ye thats what im doing
someone fucked up their grammar
sent you a dm
there's no name concept in the HD API
createHologram takes just a position, so remove the plugin argument
I have a TextComponent in a String which for some reason is displayed as the object and not as the HyperLink. Why in the world is this happening?
TextComponent gitHubLinkText = new TextComponent("GitHub");
TextComponent gitHubLinkText = new TextComponent("GitHub");
gitHubLinkText.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/.../"));
sender.sendMessage(formatColors(ServerSystem.getPluginPrefix() + "The project is available on &1" + gitHubLinkText + "! You can reach me there."));
Yes because that's not how text components work :P If you toString() them you're going to get the JSON representation of the components
The whole message should be a component and you'll have to send it via a method that accepts a BaseComponent
BaseComponent[] message = new ComponentBuilder(ServerSystem.getPluginPrefix() + "The project is available on ")
.append("GitHub").color(ChatColor.DARK_BLUE).event(new ClickEvent(
ClickEvent.Action.OPEN_URL,
"https://github.com/.../"
))
.append("! You can reach me there.", FormatRetention.NONE);
.create();
player.spigot().sendMessage(message);```
That should work
Because it's part of spigot
yeah but can't you just player.sendMessage()?
You could, but we didn't
You would be able to if you're using Paper API
Though the Spigot API doesn't promote those, no
but i can tho what
if you're using Paper API
and i'm 100% using spigot
They for sure do not exist on Spigot :p
w h a t
There are Player#sendMessage() methods
The sendMessage in spigot only accepts a string
They just accept a String, not a BaseComponent
