#help-development
1 messages · Page 792 of 1
Spigot API
inb4 legacy version
how do i turn this method to the PlayerProfile thing?
public ItemStack getCustomTextureHead(String value) {
ItemStack head = new ItemStack(Material.SKULL_ITEM, 1, (short)3);
SkullMeta meta = (SkullMeta) head.getItemMeta();
GameProfile profile = new GameProfile(UUID.randomUUID(), "");
profile.getProperties().put("textures", new Property("textures", value));
Field profileField = null;
try {
profileField = meta.getClass().getDeclaredField("profile");
profileField.setAccessible(true);
profileField.set(meta, profile);
} catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e) {
e.printStackTrace();
}
head.setItemMeta(meta);
return head;
}```
ok
You will get a shitton of warnings in console if u do that
`[15:23:39 WARN]: Found inconsistent skull meta, this should normally not happen and is not a Bukkit / Sp igot issue, but one from a plugin you are using. Bukkit will attempt to fix it this time for you, but may not be able to do this every time.
If you see this message after typing a command from a plugin, please report this to the plugin developer they should use the api instead of relying on refl ection (and doing it the wrong way).`
Oh hey that's the new message
and what is URL skinUrl = ...;?
new URL(...
Yeah i stole it from someone else
the mincraft skin url
how do i get that?
it is, but it's just an example
there is a method there to pull the url
private String getURLFromBase64(String base64) {
how did the other way of spawning entities with Consumer Interface look like?
so i need to use the public ItemStack getHeadByProfile(UUID id, String name, String base64Texture) method?
Yep
so what is UUID id again?
any random id unless you are using an actual player
@storm crystal link me the method in javadoc and i’ll tell u
wdym exactly
I think I asked the question wrong
Someone mentioned there that there is another way of spawning a custom entity
as in with custom name, armor etc.
instead of spawning it and then editing it
like the other way around
UUID.random
ohh isee now
or something close
and what is the String name argument?
the name that will show on the skull
yes
how do i get that from a namemc profile?
Cry
lol
lol
easiest way for you to learn, run that texture through the private method in that code and sysout the result
Ur welcome
That’ll be 25$ for my time
Elgar took longer and answered more questions, so he’ll take 85$
lol
missing a few digits there 🙂
Sh
Hey so I builded system which tracks blocks which are placed by player for older version under 1.16 because they don't have PDC
so for each chunk I got file which stores locations of placed block but only specific ones like Ores
I track them so player can place it again and mine it to get rewards and abuse natural generate block rewars system
I am currently saving on chunk unloadevent
and load chung load event
is that ok
Sure
or shuld I save data on shutdown
and load on chunk load
or what I said up is good enought for preformance
How can I modify the behavior of a dispenser firing a specific item
BlockDispenseEvent?
If you want to shoot a different item, cancel it and shoot your own using the BlockProjectileSource from the dispenser
Why does the onBlockBreak event sometimes trigger multiple times for the same block?
?
broke a block once and the event triggered 2-7 times
some other plugin maybe calling that event
Seems sketchy
like remove other stuff you got and then test
Logs?
That’s unrelated
can someone help me, I made a plugin on IntelliJ Idea and build it into a .jar file and it worked, but then out of no where it start failing and crashing the server, I didn't even do any change to the code. I even tried to creating a new project and transffering the code to the new project but it still crashes the server.
?stacktrace
We cannot help without the full stacktrace; Please paste it here: https://paste.md-5.net
https://paste.md-5.net/eleqizefor.cs @young knoll
@ivory sleet did u die :(
how do i test to see if an itemstack is a certain item?
ItemStack#getType??? or maybe ItemStack#isSimilar
depends on what you mean by certain item
type
ItemStack#getType
is isSimilar for NBT and stuff?
Yes
Material
does it compare the itemtype also or jsut the data
srry I've been spending too much time with registry Pr :L
both
It compares anything but amount
?jd-s
thanks
Can anyone help please> https://paste.md-5.net/eleqizefor.cs
I made a plugin and it keeps crashing the server even tho it was working just fine a few hours ago, I didn't even made any changes into it.
Exclude dependencies that are signed
How would i know
Then what do you mean by excluding dependencies that are signed? I don't see anything about it in the crash report. I'm just confused
where can i find my plugin after building?
you have to exclude their META-INF
you would see it in your build logs
Put essentials as provided
sorry you mean in repository?
In the pom
how can i disable beacon effects for all players?
Oh, I just deleted the whole META-INF file and it works now.
hey, has anyone an idea on how to change a players nametag (above the head) to a color gradient? I've seen other servers do this, but i dont know how they do it :(
M8
Set essentials to scope provided haha
shading essentials ftw
Sorry but I'm new in all this, I have no idea what you mean by that. XD
You see how all your other dependencies
Has a line that says provided?
In the pom
Essentials wants that one too
So be a good daddy
oh xd
How do you call those integration things for websites?
Like the youtube player that can be added to a website.
embed?
Not sure; I'm looking for something like that for Blockbench. Cause I want a user to be able to upload a file and then display it.
iframe ?
how is mysql implementation in java called?
you mean driver ?
the thingy that lets you do mysql stuff inside java right away
I want to find its documentation
Google it
yeah the thing is that I dont know name and describing it didnt really work
hibernate and jpa ?
your description here also isn't working lol
the driver? the part of Java itself that deals with SQL, like PreparedStatement and so on?
Could you please elaborate or point me into the right direction? That would be amazing.
Do you know how I can exclude the files ending with (.DSA, .RSA, .SF) in the META-INF? I figured that it was those file what was crashing the server, but everytime that I updated the plugin those files com back again.
i mean, iframe is literally html element, let you embedd one page into other
idk if that is thing u want
maybe, thanks
np
Wait is blockbench availible on the web?
seems like good question for google
Show pom
yeah
Show pom @quaint mantle
I cant right now, I'm going to work. But its the same one from the last time just that this time I includee the provided that you told me
Then it shouldn’t include anything that is signed
I cleaned the project and rebuild it with the provided added. But when I go into the META-INF the files are still there.
I tried cleaning it first and the rebuild it, it didnt work. Then I just tried to rebuild it and it didnt work, then building it like normal and it didnt work.
Would need to know the tasks you ran as well as pom when ur back
I may have the pom, I remember that I made a repository
That is my current pom
Ye shouldn’t be shading anything anymore
Would love to see the insides of the jar file when u got time
I'll probably be looking if there is any way to exclude the files from appearing inside the meta inf.
I've looked online and this appear. Would this work? : <configuration>
<filters>
<filter>
<artifact>:</artifact>
<excludes>
<exclude>META-INF/.SF</exclude>
<exclude>META-INF/.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
What is the right way to spawn a armor stand display entity?
Which one
how would I want to cache this kind of data where player has different datatypes under each statistic?
an armor stand or a display entity?
Display Entity
Item, Block, or Text?
Okay armor stands and display entities are completely different things
Which one do you want
nvm I guess im wrong then. I thought you could spawn an armor stand display entity
I see. Thanks!
Although it would be nice, hey @Mojang hit me up and i'll code it for you
HashMap<UUID, ArrayList<HashMap<DataType, DataType2>>> ?
im kinda confused on how to handle the fact that there are integers, strings etc. in values
like key : value where key would be like deaths etc.
HashMap<UUID, MyDataObject>
what is MyDataObject
Where MyDataObject has fields + getters for all the different values
isnt there really a table to store different data types
I mean sure
like in python I could just do x = [1, "d"]
But that is messy
?pojo
Make a class so you have concrete types
what is this class supposed to do
Hold values
A method to get the value from a field
Does anyone know if of a plugin that forces users to use optifine?
I saw one of the newer optifine versions made this easy, but I was wondering if this exists for 1.20
https://github.com/sp614x/optifine/issues/1631
public class MyDataObject {
private String nickname;
private int level;
public MyDataObject(String nickname, int level) {
this.nickname = nickname;
this.level = level;
}
public String getNickname() {
return this.nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public int getLevel() {
return this.level;
}
public void setLevel(int level) {
this.level = level;
}
}
Have an example
okay but I am supposed to make separate class for each column?
like deaths level rank etc.?
No, just a seperate field
and how do I put it into map
map.put(key, value)
Map<UUID, MyDataObject>
so I make it static?
Map<UUID, MyDataObject> map = ...
MyDataObject value = new MyDataObject(...);
map.put(someUUID, value);
why do I make new instance for every single value
isnt that too much
cant I make like 1 instance per player
or just 1 instance
Hey,
The entity I've spawned stops rendering at 5 chunks distance, even though my view distance is 6.
This caused the player to not see the entity when they are too far away of it I'm the y-axis. Is there anyway I could fix this?
I've tried:
Setting high view distance of the entity display. (Spigot)
Setting higher simulation distance (server.properties)
Setting high shouldrenderatsqrtdistance (net.minecraft)
Setting high entity-broadcast-range-percentage (server.properties)
Setting high entity-tracking-range (Spigot.yml)
Am I missing a Setting that could help me render an entity on a higher y-axis distance between the player and the entity?
You do make one instance per player..
but that just gets one value and puts that value to map
what
you get value form MyDataObject and you put it to map for that UUID
but you gotta do it as many times as there are columns
You create a new MyDataObject with the data of all the columns
And put that in the map for the uuid
okay but how do I make it more scalable to return as many values as I want
like so that I dont have to hardcode 3 getters
for instance
why is it problem to add 3 getters
its not scalable
you define your model once, there is nothing to scale...
well Id have several different databases and what if I decide to make like 2 more columns in player database
you add two more getters
adding 2 more columns isn't something you gonna do every day
Have you looked into saving your data to files?
If you havent, then you should def consider it instead of using a database.
yall literally just told me that its a fucking bad idea to do it in config files 😭 😭 😭
what the fuck
I dont know at this point
Just came here. Saving data to files is a totally valid approach.
And again: Different people can have different opinions. I dont understand why this shocks you every other day.
because by the moment I am 1/3rd in finishing something someone told me to do
someone else tells me to do the other thing
I think you're too reliant on advice here tbh if it changes the direction of your entire project
There are formats which are more viable for data storage, like json.
Yml is also fine, but i would def consider it a configuration format.
I want to make database (OR WHATEVER) to store player stats, enemies to spawn, weapon data etc.
This exact thing has been said multiple times yet we keep having this convo for some reason
just store everything as binary blobs in a file
alternatively, do the Wynncraft and store things in a chest at a specific position in the world
Is this project meant to run on multiple server instances at once?
what?
Do you plan on having multiple spigot instances running in parallel?
I dont know
I dont know if what I want to do will need it or not
Matters if he has more than a few k unique players really.
But also something to keep in mind
If i expect <1k players then i just sacrifice 50MB ram and dump everything into memory 
muh Memory NOOOOo
tbh if you don't know what you want, stick with something simple like json/yaml and files
if you don't know if you need a DB, you probably don't
Keep your logic abstract enough to switch down the line
I want to make database for:
- players: custom base attack, armor, resistances, deaths, money, etc.
- lootboxes: items, item datas, odds
- weapons: custom statistics, special things like PDCs
- enemies: health, armor, attack, drops, level scaling etc.
thats just it
Honestly, i think you will be fine with files for all of those.
Databases add a layer of complexity and might not benefit you here.
Pretty much everyone started with saving their data to files, i still do it for
some projects, and i recommend you doing the same.
and people told me here that its an awful idea to have stats that would change constantly be saved into files
and I already bothered to download xampp and start rewriting my plugin
The frequency at which data is changed for only online players is pretty much irrelevant for your choice of persistence.
It only matters if you take the accessibility of your data into account.
For example top lists, or computing statistics, etc (Or scaling way beyond what the average mc server needs)
It's not
I just save it async at world save event
And it works just fine
Just remember to have the file write synchronized
well fuck this shit ill do it in mysql just to be left alone at last and make it work
why would it be public
hi guys how to make it so the minecart doesnt stop when the player stands on the rails?
it should keep its velocity
alr so i already asked this earlier but id like to know if anyone else has input on this, what would be a good way to know if a player broke a block with PlayerInteractEvent
What are you trying to do?
im cancelling an interact event when left clicking a block bc i have some custom beheavior when a noteblock is punched (beheavior that conflicts with vanilla beheavior)
but i still want the noteblocks to be breakable
I mean at the time InteractEvent is fired you don’t know if the block will be broken since the player can just stop before
yeah well thats my issue
because blockbreakevent wont fire if interact is cancelled
https://www.spigotmc.org/threads/how-to-sqlite.56847/ I found this post about using SQLite as database, from what I understand it makes database (.db files) in server files and requires no external database working in background
Could use shift click to differentiate
could this also be useful to what I want to do?
yeah well i dont want to force players to break them by shift clicking lol
well using this SQLite method + caching it to not lose any data
If you don’t plan on using that data from multiple servers simultaneously yes
when would I want to use several servers at once?
I mean
how big of a project would it have to be?
If you have a network and need multiple servers to access the data
I just want to make a rather smaller mmo rpg styled server
not anything super huge
What exactly is your custom action?
SQLite is fine for that, you can still pretty easily migrate to MySQL later if you need to
okay thats pog
would you still recommend caching data even if it was locally in server files under .db files?
Depends on query complexity, caching is always a good solution if you have very heavy queries or data you use frequently
id use data pretty much all the time
And consider handling your queries asynchronous
to spawn mobs, get weapon statistics and such
You can cancel the NotePlayEvent if it is getting called during the same tick as the interact event (World#getFullTime())
But don’t forget that any thread will lock the file until it has finished its operation
do you have any resources on setting actions async?
Any Java Multithreading explanation should help you out with the basics
well i removed the feature from noteblocks to change notes when clicked
so i manually play the notes using some block pdc
okay
cancelling noteplayevent does not cancel note increments
Thank
Of course they don't. In that case cancel the right click within the interact event. But you have been asking for left click
You should never, ever do any IO on the main thread
Also: Always throw away (and close) your connections. Get a new connection for every single request.
(Except startup and shutdown :>, then it can be fine)
Yes, mr clube is right
mr smiley is just as right :)
Try with resources best
@sterile axle I'm curious about something why does my char array need to be 5 here to capture the entirety of the word exit shouldn't that take up 4 positions within a char array
0: e, 1: x, 2:i, 3:t
char input[5];
while (strcmp("exit", input) != 0) {
printf("command: ");
fgets(input, 5, stdin);
printf("%s\n", input);
}
However, if I use only 4 the array gets cut off and the output looks like
command: exit
exi
command: t
when expanding to 5 the array works as expected
command: exit
exit
command:
its pure C
Your strings are terminated by a null character
strings are terminated by \0
Its like a memory address which signals that the string ends here. '\0'
Strings in C are terminated with it so you can have a pointer to the start of your character array, without
having to know its length. You simply traverse the memory block until you hit the null character, which terminates the string.
I need some help about a school project which i have some doughts about its designing. At momment i have done the next things basic things for it https://paste.md-5.net/yuhoqajile.java. I would be really thankfull if you can take a look at it. Its somethign really simple and without much effort hehe
Java strings are also null terminated but it handles it transparently and you never have to worry about it
but C does not do that for you
it's how it can tell that the string is over
Reminds me of gameboy assembly
strlen for example goes char by char and increments a number for each char it sees, infinitely, until it finds \0
Lots of terminator characters there
if it doesn't ever find \0, that loop won't stop until it reads memory it doesn't own
ahhh okay
then you segfault and program crashes
I forgot strings are just char arrays for some reason
printf("%s", stringhere) will print char by char until it finds \0. if it doesn't find one it'll keep printing each memory address forever until it reads and tries to print memory it doesn't own then your program crashes
Doesnt look too bad at first glance
strings in any language are arrays of chars, it's just an abstraction around that. you either have a char array and a length to know how long the array is, or the array is null terminated so you can tell the array is over
c just doesn't do anything for you
you do it yourself
In the original Pokémon games your inventory was terminated by a special byte
Im missed up between the return null from the obtain user method, not really sure how doing it that part. Could you giveme a small hand. And thanks for reviewing my code
pascal strings best
mc protocl also uses length-prefixed strings which is interesting
<length>char,char,char,char,char,char,...
Wait i got a meme saved somewhere for that. let me see
char,char,binks
anyway @river oracle this isn't just strings, you will also find this pattern any time you want to have an array of something you don't necessarily know the length of, you just put your shit in the array and then add a \0 at the end, and when looping you'd do something like ```
while (*array) {
//use the element
++array;
}
and when you hit the \0, the loop ends
or you have two params, the array and size and you can use a for loop
common C patterns
need to dereference for the condition but yeah ^^
oh yea forgot that
++array for saving that one clock cycle 🤓
C has ruined me
but what if I'm on a CPU with a really bad instruction set and the difference is 17 cycles
like really really bad
facts
Quick someone write ++ in 17 cpu instructions
that might be challenging tbh
private User obtain(String email) throws SQLException {
try (PreparedStatement statement = this.mysql.getConnection().prepareStatement(Queries.UserObtain)) {
ResultSet result = statement.executeQuery();
return result.next() ? new User(result) : null;
}
}```
what can i return in the next method? Because null cant be returned because the method is used on my user signup method
Something something mov eax -> add eax, 1 -> mov back. Idk i kinda slept through x86 instructions
movfuscator to the rescue :kappa:
Just handle null values?
Or wrap everything into Optionals 
the problem is the next
...
sorry cellphone dc is wrokign for the ash
if(result == null) {
return null;
}
?
i cant return null
because i use the obtain method on top for handling user losgin
throw an exception then. if it's null, it's null. you have no choice but to try again or give up and print and error message.
idk what you want
let me explain ok?
you want to magically say "oh i got null", "but nvm I don't want null"
"let me just pretend it didn't happen here is ur resultset"
Handle possible null values then.
You dont need this to be in an ternary op
the user shouldnt be null at the login part, thats to begin
i am so confused what the issue is
Then throw an IllegalStateException or something
Same
this is basic error handling, if it cannot be null, and you cannot return null, but it's null anyway you got a problem
throw an exception
that's what exceptions are for
An exception that signals something was null, even
heh
-.-
i just dont know how to proper explain myself
use chatgpt and write in your native language and tell it to make an explanation in english then
System.exit()
And no further explanation
I would go for a more elegant appraoch
System.exit();
fuck Smile beat me to it
hehe
Frame#dispose() better idea 
me in C:
"o fuk my pointer is NULL."
exit(1)
Oh yeah. Bind a dll and call it via JNI. Just set your whole jvm mem to 0x0
easy
why you trolling me? i was trying to get helped
but seriously if you can't explain yourself, then go write to chatgpt your entire message in your native language and say "translate to english" and it will do a much better job than you are doing
and then we can probably help you
maybe
hey i'm trying to prevent Creative player to move items from their inventory but the creative mode duplicate items when the event is cancelled, does anyone has a solution ? Thanks !
but from what you are explaining, to my understanding, you have an object that should not be null, but you're worried it's null anyway. so check if it's null, if it is, you know you're in an illegal state, throw an illegal state exception or something
that's all you can do, you can't just magically recover
What prevents you from doing this:
public boolean signin(String email, String password) throws SQLException {
User user = this.users.containsKey(email) ? this.users.get(email) : obtain(email); // Can return null
if(user == null) {
return false;
}
return user.getPassword().equals(password);
}
pretty sure that is Client side? correct me if I'm wrong, but I'm pretty sure its not possible to prevent on the server
hmm you're maybe right
Creative mode is weird
it doesn't like telling the server what its doing
fuck it x') nothing important thx anyway !
putInt(0,0)
oh lmao really i just overcomplicate too much myself
hold up I'm helping him I think I can do this I just have to read in spanish lol which isn't exactly allowed here
Or if you need a more granular response: Create an enum.
public enum LoginResult {
SUCCESS,
UNKNOWN_USER,
WRONG_PASSWORD,
ALREADY_LOGGED_IN
}
public LoginResult signin(String email, String password) throws SQLException {
User user = this.users.containsKey(email) ? this.users.get(email) : obtain(email); // Can return null
if(user == null) {
return LoginResult.UNKNOWN_USER;
}
if(user.getPassword().equals(password)) {
return LoginResult.SUCCESS;
} else {
return LoginResult.WRONG_PASSWORD;
}
}
how to fix this
Bukkit will attempt to fix it this time for you, but may not be able to do this every time.
If you see this message after typing a command from a plugin, please report this to the plugin developer, they should use the api instead of relying on reflection (and doing it the wrong way).```
I used this code for years
Spigot has an API for that
from when
Idk. 1.16.5 ? 1.17. Something like that
https://www.spigotmc.org/threads/beginners-guide-to-itemstacks.623654/#post-4656870
Scroll down to "Creating a head item with a skin texture"
Depends. Only if you want your server to run properly.
if you wrap the prepared statement in a try (PreparedStatement stmt = ...) {} then close() is called automatically
Otherwise you need to call it, or you leak connections
If others are not using it and are not using try-with-resources (above) then they are coding incorrectly
In honesty it is specific the the underlying implementation.
But i dont think there is any decent porgammer which doesnt close or auto-close this.
porgammers rule
Woah, new orange helpers?
As simplyauthority suggested: You have probably seen code where a try.with.resource block was used.
It automatically closes resources like connections when a scope is left.
can't hurt when you don't have one
It can be. Do note that statements will close automatically after a period of time
:(
The downside is until the system closes it, those jdbc resources are now occupied and not free for something else to use it
I just want to determine if/when a feature is finished
Gotta follow a trail of endless links smh
So it is good practice to close out resources once you are done with them
eh, "it depends"
Profile thing is not working @lost matrix
for example, panama's vector api is on its 7th preview round (or was it incubator?), but it's just waiting for some valhalla jep (value types I think)
yep
which jep
454
what jep is 454
ffm
^
what is ffm
foreign function & memory
ahhh
"jni but not bad"
I see
According to coll its 1.18+
uh probably
Well I am using spigot 1.20.2 api
Your IDE has a different opinion it seems
Yea
In your pom: Move the spigot dependency to the top of your imports
that worked
lol
@river oracle funny coincidence. C23 apparently added bool, true and false as keywords apparently. so importing stdbool would have done nothing at best and at worst would have conflicted with the actual keywords
not sure why that was happening though other than C23 isn't ready for real use and was probably a bug you encountered
Woah C invented booleans
wot
please the colors!! Not most of us are acustom to seeing sun light hahaha
Like vampires
I'm attempting to update a very old plugin to work with modern Spigot versions, and before I understand how the plugin works, I want to just update it as-is. The problem is, it uses a whole lot of NMS (which I will remove in future). The issue I'm running into is, I've configured maven to use the remapped spigot.jar, but the functions aren't being properly remapped, and I'm a little out of my depth.
It's using the right file, reportedly. Just.. the file doesn't have the right mappings?
yo
so i wanna check if args of a command are empty or not, so lets say the command is /ik create <name> <slot> right?
I'm using nms to make a custom projectile entity, and use bukkit for most of my other effects for the entity. When I create an instance of the entity class in my effects class, the methods it inherits from class WitherSkull nor the methods i've created appear as hints/suggestions and I'm wondering whether this is an ide error conflicted between similiar methods with bukkit and the remapped nms methods, anyone got any ideas?
args.length == 2
Ye that
Check for lenght < arg number
I never understood completely how to use Gson and well, create, edit, and delete .json files, where can i see a good forum post or yt tutorial?
Never found a good one
also is using bounding boxes a good method of checking for collisions for my custom projectile?
?json
?gson
😣
@weak meteor
Thanks
Another question
if im making a Kits plugin, whats the best way to represent the kit, a class or interface?
Cause, multiple plugins use interfaces to represent players, factions, etc.
Sry xd
I would probably have an interface as a base that can be extended to encompass the various kits. It makes easier later to identify who has what kit and you could use casting if necessary to do whatever it is you need
So categories of kits is what i meant not the individual kits and then have a config setting for setting a kits category
is there a way to cancel a player's shield blocking an attack?
is there a shield disable event?
dont think so, i managed to solve it by setting the BLOCKING DamageModifier, which is deprecated
yeah im just using the PlayerStatisticIncrementEvent for it
When using itemsadder or oraxen, how do I keep my FPS from dropping when I'm surrounded by custom furniture?
so you want to start off by purchasing mojang for about 8 bil usd, then you want to rewrite minecraft java edition from scratch and finally you will want to push that update out for everyone to be able to enjoy at a reasonable framerate
Is there a better way, I noticed they are all armor stands
Lots of armor stands keep my FPS down
better?
yeah
so little known fact you can also just buy the parent company, microsoft, and then change the OS for windows to be more performant such that when you play minecraft on it you will get even more fps
I don't exactly know how much the market price for buying microsoft nowadays is though
I'll call the CEO of Microsoft. I'll buy his company by next week.
next week? You really shouldn't be living paycheck to paycheck like that
chatgpt says you should be looking at about 2.5 trillion usd to buy microsoft so you might have to cut back on the caviar for a couple of days if you want to buy it
if those plugins used display entities instead of armor stands you could just set proper culling values and that would improve FPS
so its not like Mojang needs to fix that, those plugins just need to use the stuff mojang made for this specific usecase lol
to be clear mojang should definitely be looking at ways of optimizing idle entity overhead
it's really bad
well, for ticking entities yes
but 1800 display entities at once def work without any major performance issues
I ran benchmarks yesterday, server-side I can handle about 14000 ticking armorstands but client-side my insane cutting-edge desktop build starts getting stuttering drops with about 1k entities
the client will try to tick all those armor stands, so yeah
it's not good
doesn't help they are living entities because mojank
hence me saying they should be optimizing them
but 1800 display entities are doing fine (video from bergerkiller, not me)
well I made my system to try to be entity-agnostic where possible so I will be trying it out with display entities real soon
they are so much nicer in absolutely everything tbh
And you usually need less of them because you can transform them freely
she's a beaut
how would you need less of them
you still have the same bone count regardless
unless you mean they can handle large scales
does this generate any number between 1 and 100 ? double lottery = random.nextDouble() * 1001;
1000*
depends on what you are doing, for bones its probably not helpful
but I am doing entity models and animations completely clientside with shaders at this point tbh, way easier
with shaders? I'm assuming you're modding then
no, vanilla shaders
how does that work?
basically this for the client with a server resourcepack and a plugin to control animations and stuff
only downside is enabling shaders in Iris/optifine will break the animations. but its a PvP server so people really don't play with Optifine/Iris shaders that much
how does this work then, is there some kind of resourcepack thing that alters shader behavior?
vanilla has shaders since 1.17. and with a shader, you can change how things are rendered. this basically puts the entire model in a texture, and uses a shader to render a model from that texture
how does the client decode the textured model into something that results in a 3d object in the game? I assume you'd have to pass some kind of custom interpreter to the clients at some point
well that is what the shader is doing
well yeah but how are you distributing that shader
to the client
or is it built around a vanilla shader somehow
The shader is part of the server resourcepack
"shader" isn't just shadows on the ground as its often used in minecraft context, its just a part of the rendering pipeline. You can also do things like turn the screen upside down, render portals like in the Portal games, etc
I've written some shader code before, I am aware
I was just wondering if it was even possible to pass custom shader data via rsp
didn't know it was
yeah its kinda undocumented, classic mojang feature
so does that override the default shader insantly?
yeah
hey everyone, i'm trying to store locations in a .yml file and also read them as a Location. i'm a little confused on this.
https://cartyoo.org/images/47951.png this is the output idk why it is like this
since it's client-side
passing data to the shader itself from the server is a bit tricky, but using a colored item like a potion works
yeah I am not doing any individual bone control and thats probably also not possible
yeah figures
anything even close to touching ik would be either insanely hard to pull off or straight up impossible
Main use case are siege weapons, so I really only need to do play and stop an animation
they don't exactly walk
yeah I mean this is honestly an insane system for a lot of unique applications, it breaks a lot of set conventions for mc
fortunately it doesn't really invalidate the work I've been doing on my own end since mine focuses on applications where you do need very precise bone control
main issue (and probably not really fixable) is that both Optifine and Iris will overwrite vanilla shaders if you enable their shader stuff
yeah no you're screwed on that one for sure
and it's a shame too because stuff like OF is pretty popular
And vanilla shaders are limited in some ways right now, so for actual fancy rendering optifine-compatible shaders are superior
Like I am not even sure you can get the sun position lol
buddy
what sun
there is no sun
what do you think this is, pbr with directional lighting?
well, there is a time of day
get outta here
it's all global illumination with a basic code that crawls from the top of the world to the bottom to set brightness levels
there is no concept of a sun
the only pbr vanilla minecraft devs know is pabst blue ribbon at the end of a work day
Hello
You really don't like Mojangs work lol
it's not a criticism
I don't think mc looks better with pbr
I do wish it had better lighting though
and performance
if I liked pbr I'd use a shader that either uses or emulates that effect
its only something I use for screenshots. all those fancy graphical effects annoy me otherwise
same, pretty much
if I had an infinite amount of time I'd go and make my own custom shaders that are more soft toon shaders than pbr
those work better with mc in my opinion but it takes a lot of work to get them just right
How can i save player data like kills, death in hashmap then transfer it to database?
I'm starting to understand my issue a little better. Why are the class names different for remapped-mojang vs not? I thought it was just function signatures and such?
If I use remapped spigot, net.minecraft.world.level.chunk.IChunkProvider doesn't exist. If I use standard spigot, it exists but has obfuscated function names.
are SQL injections possible within the minecraft chat
yes, spigot mappings don't have member names anymore
Hmm, what do I do in that case?
just use mojang's mappings
if you want to convert from spigot to mojang names:
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
.
You are asking basic Java questions there.
I have a basic java question, should I take mine from beans or from capsules
I hate coffee so neither 🙂
I love the smell, just hate the taste
that's fine, just do what I'm doing right now and enjoy a cup after nose surgery so I can't taste shit
for all I know I could be drinking bleach right now
Nose surgery? Enlargement?
yeah I kept getting ads for pills on my email that say ENLARGE YOUR NOSE
you know how everyone wants to enlarge their nose
yep I've considered it
once it's fully healed up I should be able to snort all cocaine within 50 feet of me, even if it's still packaged
sort of like kirby but less drugged up
is it ok to backup a server while its running?
i plan to use tar and pigz to backup a server once per day
Depends what exactly you are backing up. if it is just world files sure as long as you disable world saving. I have a script that is setup where you can just make a cron job if you want to look at it. Does other nifty things and i have alternatives too
why is world saving an issue? is it file access between threads?
here is my bash for saving
timestamp=$(date +"%Y%m%d_%H%M%S")
backup_filename="backup_${timestamp}.tar.gz"
num_threads=6
cd "$source_directory" || exit
tar -cf - . | pigz -p "$num_threads" > "$destination_directory/$backup_filename"
echo "Backup completed at $(date)"
find "$destination_directory" -name "backup_*.tar.gz" -type f -mtime +21 -exec rm {} \;```
Because if you tried backing up a file that is in use because the world is saving you wont get the updated info or you end up with mangled info which can cause chunk corruption
Realized i dont have a backup command implemented on that. But that service script does a lot regardless lol
When i get home i will look into updating it to add backup command
Is it possible to dynamically listen for events? I Wonder how the skript plugin does it because it doesnt know which events it will Need beforehand
Skript basically translates. But events work because plugins have to register their listeners. Skript uses some generics to do this and does the registering.
So does it register all the Events?
Pov: I see a cute guy...
meme,minecraft meme,big noses,memes,hairstyles for big noses,haircuts for women with big noses,villager,hairstyles for women with big noses,villagers,long nose surgery,long nose pliers,long nose videos,long nose,nose ring,long nose gar,nose,long nose shark,frosty long nose,red nose,ryan's daddy,nose shaping,nose contour,...
She wouldnt know that
💀
No. Just only the ones that the skript needs
So how does it do that dynamically?
Skript itself is a spigot plugin made in java. Skript scripts are what interface with skript plugin and tells it what it needs. All the skript plugin is doing is playing middleman between two languages
That wasnt really my question
There is nothing that says listeners have to be registered at startup. You can register later if you want and unregister as well
But skript also uses generics too
Yes but how would you dynamically create a class that contains a Methode that does what was defined in some textfile
Generics lets you take in objects of unknown type and do something with them
Well probably something worth researching to get a better undetstanding
Yes but still dont know how this helps me achieving the thing
Cant achieve something you dont understand so you have some learning to do 😉
Its not that i cant help. Generics is not something i can teach in 5 minutes
I know what generics are.
Its like its own topic in java itself lol
The point is that i dont understand how this would help me achieving
Because generics is where java derives some of its dynamics from
I would not click on a tiktok meme video even if it contained information on how to become immortal and an infinite money glitch, never ping me with that garbage again
Lol
Thats like saying „please fix this car, you can use my Tools for it“ - Me knowing which Tools to use doesnt Tell me how to repair it.
You only Tell me to use generics @wet breach
Not how to use them to get the thing working…
Blud has recently discovered reposting or what 💀 tiktok isnt contagious dont you worry
if you don't think stupidity is infectious it might already be too late for you
You also cant repair something you have not learned how to do either
I know how to use the tools (generics) but Not how to repair the car Using them
Thats the Point why i was asking the question in the First Place
Then you have learning to do
Ye Tell me
note that the channel says help-development not teach-me-development
Ye i Need help
On how to Register an Event without knowing which Event it will be at compile time
Being a paranoid purist doesnt help you either :|
I find that it has, tremendously so, you should try it out
A method that uses generics can take an arbitrary object of unknown type and do something with it. All events in the api extend from event.
Oh no I watched a meme with tiktok watermark on youtube, did I become a stupid? D:
if it makes you feel any better I suspect it didn't make you stupid
The unknown type part is where the dynamics come in as you dont necessarily need to know what event just that it is one
You can figure the type out by checking it against the event types until one is true
Now you have your type
Well you started freaking out the moment someone sent you one 🤷♀️
Then you would have a general listener class that you create new instances of feeding it your now gathered info
And then register it
Now this is obviously an over simplification of the process.
ah it seems as though I have played myself
I forgot this encrypted volume was like 4tb large
Lol
yeah so updating its encryption is going to take... a while
it would be faster to encrypt, it would not be faster to transfer
the transfer speed is shockingly slow
to be clear this is a vm
Why is the transfer speed slow?
what a great question
You can speed it up by mounting the vm file on the host
Thankyou @frostalf
it's a mix of how the files are transfered and what files i'm transfering
because files are fun this is basically tranfering them one by one but also encrypting them one by one, and this is mostly millions of tiny files
maybe tens of millions
Why are you not using drive encryption?
and I can't buffer them into a zipped file because, well, you know, that would be another 4ish tb of buffer I would need on a bunch of different places
you mean encrypt the entire drive?
Yeah
it's an 11tb drive I'm using for more than just that vm
hell at one point it wasn't even the only vm on that drive
Its a vm so why are you stuffing everything onto a single drive when you can have as many drives as you want
I'm not stuffing everything into a single drive
I have something like 25tb of storage
Well obviously your setup is flawed somewhere lol
Lol
I'm pretty sure that's the 21st ammendment
sounds reasonable to me
I have about as much storage space as you do and tranaferring large bits of data takes me a couple minutes even inside a vm
inside a vm is fine, it's from an encrypted vm to my os when it's for, say, 11 million individual files that things start getting spicy
The hdd file can be mounted on the host without the vm just fyi
but I do agree that I might be doing something wrong with my vms regardless, more often than not I get glacial performance out of them
I have tried just about every option that is available to me in vmware
Which is where you probably went wrong when it comes to large data lol
You obviously didnt setup a discrete volume on the host hardware for the vm. If you did your transfer speed would be faster as the vm isnt emulating hdd hardware
you mean like partitioning my hdd so that that gets assigned to the vm alone?
That would have been ideal
yeah no I didn't do that
I mean I'm fine with it, somehow every other time I open this thing I end up adding another tb to it so I don't want to deal with resizing partitions every few months
Dont have to do that either. You can just let the vm access hdd directly to save stuff keep vm os in its own vm hdd
guess I'll maybe look into that in a year when it's done reencrypting
Lol
the progress bar actually moved, shocking
🤔
What's going on here
Better hope no power failures happen lmao
yeah was thinking the same thing
thank god I don't live in south africa right now
meh everything in these is discardable anyway
Do you have a battery backup?
nah I should get one some day but honestly in the last 10 years there have been 3 power outages
Tf ya guys talking about
Nice
only a single time did an outage take more than 2 minutes
Yeah power failures for me are rare too
the rest were just instantly out and back
I think it was maybe 4 minutes for the longest one
But i had a power failure take a hdd with it though
I am really playing russian roulette for the outages because every time I basically have to guess the encryption passwords for my NAS
Because the power surged like 3 times which over loaded my surge protector just enough
if it goes down I'm not sure I can get it back up lol
I should write that one down and put it in my safe
Lol
Tech stuff
Indeed. I just didnt want you to feel ignored
Magma has a weird vm setup and is decrypting 4tb transferring it and rencrypting it
And its taking forever for him
The only vm I have is the ubuntu one hosted on my laptop that I use to do stuff with mcp lol
So o told him an alternative setup that could speed stuff up and then said pray you dont have a power failure
Think that sums it up
Depends on ur location i guess
Well, here it's rare
someonemine mind looking at my save and load and seeing why some of my values arent saving? when others are
?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 currency variable isnt being persistent on relog, or server restart, but if i just quit out of the game it saves correclty to file... here is all the java files associated with it
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.
Show your join and quit events pls
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.
Not the problem but delete this line
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(player.getName());
Should I use a StringBuilder here instead of just directly typing the query (the data is controlled, no user input, easier to use a StringBuilder)
Ok so your data is saved when you quit, but not when the server stops?
no, its when i log back in and increment the variable again it resets
everything else is persistent, and i am pretty sure its saving just like everything else so dont know what gives
Debug your load and save method. Make sure they get fired and that if (dataFile.exists()) { is true.
how itemsAdder creates custom blocks in caves without creating a problem with armourstand dimming
Noteblocks im pretty sure
there are 3 types of blocks and one of them creates an armorstand
in wiki
itemAdder
They create a spawner. Inside the spawned entity is displayed.
They stop it from rotating, set a block in its head and scale it so it barely covers the spawner.
Thats how it was done a while back.
With the help of notes you can create 25 custom blocks and itemAdder offers more
this might be a back to java moment but...
my question is: how do you use interfaces and what is it for
i could google it but i just wanted to hear
is the element inside the spawner an ItemStack?
this is why itemAdder can create 3d texture?
and is it really possible to expand the texture?
1.16.5
I checked when I clicked on the block. after the 25th attempt the note returned to position 0
1150 in 1.20
Yeah but you have all the different instruments
And also powered/unpowered
different noteBlocks?
When server restarts there is no quit events. You need to have a save method in onDisable()
and how to get them? I've only seen 1 in minecraft
17 different noteblocks
use 1 texture?
If I understand the code in JavaPlugin.java right, shouldn‘t there be a warning everytime I restart/reload my server and the config.yml already exists?
(JavaPlugin 217:17)
and 1 model?
They are all states of the same block
And yes they all use one texture
Change the instrument by changing the block below the noteblock
oh
Isnt there more states for some of them just not used?
Or in the case of plugins you just spoof it
An interface is for defining a behavior. For example:
This interface defines a behavior. X goes in, Y comes out.
But we have no idea what the actual implementation is.
public interface BlockDestroyer {
void destroyBlock(Block block);
}
At this point we can already use this interface.
public SomeListener(BlockDestroyer destroyer) {
this.destroyer = destroyer;
}
private final BlockDestroyer destroyer;
@EventHandler
public void onClick(PlayerInteractEvent event) {
Block block = event.getClickedBlock();
if(block == null) {
return;
}
this.destroyer.destroyBlock(block);
}
We simply use this interface, and trust that the implementation does what we expect.
At this point we dont need an implementation. But as soon as we want to create an instance, we need to pass some BlockDestroyer.
Here are two simple implementations for our earlier behavior.
public class BlockExploder implements BlockDestroyer {
@Override
public void destroyBlock(Block block) {
block.getWorld().createExplosion(block.getLocation(), 5.0F);
}
}
public class BlockVanisher implements BlockDestroyer {
@Override
public void destroyBlock(Block block) {
block.setType(Material.AIR);
}
}
Our implementations can then be used and we can swap them out depending on what we want
@Override
public void onEnable() {
BlockDestroyer destroyerA = new BlockExploder();
BlockDestroyer destroyerB = new BlockVanisher();
Bukkit.getPluginManager().registerEvents(new SomeListener(destroyerA), this);
// or
Bukkit.getPluginManager().registerEvents(new SomeListener(destroyerB), this);
}
Nah that’s all of them
so does the environment change notes?
850 states in 1.16, 1150 now
Not that i am aware. Just the right clicking of them and whatever blocks are under them
that is, depending on the environment, the note block will change?
and also this is why more than 25 notes
hm
This means that at the moment there are 3 ways to create blocks with custom textures. These are note blocks, spawners, armor stands?
In 1.16.5, yeah
Sponges
Sponges?
Display entities
and more frames
You can replace them if you want for custom blocks
Oh we on 16
Because they are typically not useful
Sure but
lol...
Wouldn’t be my first choice
Historically it was the go to block to swap out for custom blocks
Ping me on an answer plez :)
Could even use barrier block for custom blocks
in servers the barrier is very limited
so you can see
this barriers
Leaves and tripwire also have a bunch of states you can use
hm
Leaves for transparent custom blocks and tripwire for non solid blocks
someone should ping this
great exemple
polymorphism baby
thank you @upper hazel
``i just learned a few days ago it was possible to do someting similer to this...
Creeper Creeper = (Creeper creeper) -> Creeper.SomethingMethod()``
❓
looks like a lambda of some kind
Creeper is functional interface?
trying to find the exact code
but it was along of the lines of that
starts ecplise
int i = (int) (Integer) get()
more mindblowing stuff
What are you guys saying??
what i saw was spigot related

to some entity
I prefer player.getPlayer().getPlayer().getPlayer().getPlayer().getPlayer().getPlayer()
But i think you were surprised you could double cast?
What does that even mean??
You guys are trolls
pfft, I like block.getLocation().getBlock()
🧌 xD
also add many loops
and threads
Has to do with primitives and objects
✨ async player getter ✨
Location.getBlock().getRelative(face).getLocation
smart
Smh getRelative in location when
Thats a bunch of nonsense. What is your get even doing? Where does that come from?
everyone is just trolling smh
not me
But i was using it to demonstrate double casting and what the equivalent was without that
Comes from Object
double casting ? xD
Sometimes you gotta make real sure it got casted
Did you see my example above?
you just explained auto unboxing in a shitty way xD
idk what the concept of "double casting" is
like
SkullMeta skullMeta = (SkullMeta) (SkullMeta) (SkullMeta) (SkullMeta) meta;
