#help-archived
1 messages · Page 119 of 1
- Because there are already other classes named Main
Now I get this error
only one in bukkit
🤦 ...
Is voltaneSpigot better than Paper and taco and normal spigot?
sorry i tend not to read nonsense stuff
?
well now I am confused
why
private static Main instance;
public static Main getInstance() {
return instance == null ? (instance = new Main()) : instance;
}```
to reload it every seccond
@pastel igloo Every forks differ, there are pros and cons. Depending on what you need exactly
this works too
seems like a xy problem to me
so More ingormation
I have made a scoreboard that show time and date I want that is reload / updates every sec
with a () retrooper
where
and initialization
where
nOt ThReAd SaFe
(instance = new Main())
you can't assign without ()
ok
I honestly put !=
k
is this for me?
o ok
maybe
hhahaha
private static Main instance;
public static Main getMain() {
return instance == null ? (instance = new Main()) : instance;
}```
@south shoal you haven't imported anything
why hahaha?
@south shoal It's not an error, it's a warning cause you're launching a task useless (TIP: hover the message to see the errors etc)
I have used ctr + shift + o more than once (using eclipse)
Also I quickly looked at your code
it's a bit of an error because none of the symbols are defined because he has one import
you're missing override annotations
@silk bane This is imported nah?
@undone narwhal forr PVP and around 50 plugins and 200 players
@pastel igloo ?
what is?
So what do I need to do?
oh maybe class names are just highlighted red
@pastel igloo You can then use a fork that remove entities mechanics or reduce it. Paper is really enough but I don't really know the others, have to take a look
interesting design choice
Yep konsolas, if the class weren't imported, the methods would be red
Paper can probably handle 200 players with proper optimization.
Note that this doesn't mean to just throw in aikar's flags and set every value in the configs to low expecting to automatically get 20.00tps 24/7
or underline
the whole thing would probably be red
Paper and configure it to remove entity mechanics and other uneeded stuff (hoopers, etc)
I mean if he told it's a pvp server there will actually not be a lot of entities
which helps the server a lot
For sure
But in my case I prefer disabling entities in that kind of server, then the server will (I hope) totally not calculating for entity spawning or other stuff
is it better ro ask development questions here or on a forum thread?
yes
Just ask we'll tell you
blushes for inclusive or
yeah I want to call Server.Spigot.restart() but get a compiler error "Error:(54, 26) java: non-static method restart() cannot be referenced from a static context" Although Server.Spigot is static and my context is non-static... which is extremely confusing
restart method is part of a Spigot instance, so you can't call it statically
ah, thank you so much
I was utterly confused, because it didn't even seemed to be right calling the class directly
also I would like to use the same CommandExecutor for two different commands
but it does not work as I intended
public void onEnable() {
Commands cmds = new Commands();
this.getCommand("one").setExecutor(cmds);
this.getCommand("two").setExecutor(cmds);
}
you can't ?
you'll need to register aliases in the plugin.yml
or make two separate classes
oh okay, thats news to me, thank you!
pro tip
i don't want to advertise this every 5 seconds but...
ACF library is real good for managing commands
found the corresponding wiki page
I don't think I'd have any use for ACF atm, but I made a note to use it later on, if the project grows
well i was kinda forced to use it
the onCommand method simply was getting too complex without it
so how can I update a scoreboard every sec
you use a BukkitScheduler that runs every 20 ticks
and how would that look?
plugin.getServer().getScheduler().runTaskTimer(plugin, () -> {
//your task here
}, 1L, 20L)
so a //Your task here needs to ve a void
so put that in the void onEnable
i have no idea what are you trying to achieve 🤷♂️
that is just how to do a repeated task
hahah me iether
🤦
@shut ember you can use subcommands if you only want 1 command class
how though? @keen compass
give me a sec to show you an example
yeah i hope you're not going to have a different command for each subcommand
you basically have to work with the args passed by onCommand
or use ACF 🧠
don't have to exactly do it that way, it is just an example in how it can be done
Subcommand like
/command subcommand
/command subcommand2
Hey, do you know any idea how to add a list of bans in a plugin?
what does that mean
because I mean like
/command1 arg1 arg2
/command2 arg1 arg2
you can do subcommands by checking the array of strings passed by onCommand
that's what I am doing
gg
well the classes I linked to do exactly that
I have two commands with the same syntax but different outcomes. They are bonded because they trigger a scheduler of which only one can exist at a time, so I assume I have to work with the aliases. Or how else would I be able to find out if the scheduler is already running?
only thing is, they are separated into their own class to make it easier to tell which is which
instead of them all being in the same class
oke explanation about my code
RED > Scoreboard on the right of your screen
GREEN > Luckperms prefix gethering
BLUE > eco gethering
ORANGE > Date and time gethering
@shut ember assign the scheduler to an int to get its id
this way you can always check to see if the scheduler is running
and how can I make it that the time eco and rank get a update very sec
hhaha ok
put the date and time in its own thread and then access it when you need it @south shoal
i can assign the scheduler to a var when using the same class for issuing both commands (what I am currently doing)
but how can I callthe id from another object (?)
@sturdy oar I can help you with SQL if you like
make the ID available to the class via a method
i'd like that
The time and date need to shown all the time
but it's kinda not easy stuff
no prob, I like puzzles
if you want to help i can write a full explaination on what I'm working on
@south shoal that is fine, you can still have its own thread to be updated. Use a method in your scoreboard area to get it.
that could help
ok it'll take few mins let me write it well
and then you could just use a runnable to get it every so often
and how would that runabel look like?
just like any other? o.O
hahah
I don't do much with scoreboards so I can't really tell you what methods to make use of really
I am not a particular fan of scoreboards
I have this table which has the current rows:
player_uuid of type CHAR(36), player_name of type CHAR(16), and three rows of type integer called (flags_ipv4, flags_domains, flags_words). The uuid of the player is of course the primary key of my table and is unique. However the usernames and the flags are only not null. What my plugin does is listen for whenever one of does flags gets triggered from in game, and as soon as the flag gets triggered an sql query on the database should increase the correspondent flag on the database. This sounds pretty simple however there's this issue: if the player is online and already present in the DB, i just need to increase that specific flag by +1 , but if the player has never joined i need to add him with that flag set to 1 and initialize all of the other flags to 0 (I have access to username and UUID so that's not the issue).
I've currently only figured out how to do the part where the player is online and already present in the db
This isn't spigot related support at all , so i don't expect to get help.
so your issue is if they are not in the DB?
yeah, because i don't know how I would set every OTHER value than the flag to increase to 0
first I would query
SELECT flags_ipv4, flags_domains,flags_words FROM tablex WHERE player_uuid='uuid'
If youz get an empty set you can initialize it
and everything else you can update pretty easily
I am not 100% sure but I think the empty set will be null
my latest attempt was setting the integers as nullable, and using a null check to set them to 0 when null (indicating the player has never recieved those flags before), but I don't think that was a good idea
Make sure you use a prepared statement ^^^^
to also aide you, can use the api methods to check if the player has played before as well on the server
Does anyone know how to make a kind of list of bans ?, and with a command that list comes out?
That doesn't necessarily correlate to if the user is in the database
@keen compass
yeah Kevin_ im using IDB repository from Aikar so i don't have to make prepared statements, the lib does everything for me
to also aide you, can use the api methods to check if the player has played before as well on the server
@keen compass lol i didn't think of that
that might actually make things much easier
i'll have two different statements
@gleaming helm maybe not, but it makes it easier to know if an insert if exists statement should be ran though
No it really doesn't
You still have to check
And you can reset your player data
And not the database
and cause massive problems
@sturdy oar should just add everyone that joins with 0 values
yeah
That's the dumbest thing I've ever heard when you can just check if it exists
Or even do an upsert
to verify if the entry is present you can either do this:
https://javarevisited.blogspot.com/2016/10/how-to-check-if-resultset-is-empty-in-Java-JDBC.html
Or you count the results (which you should if you only query for one result)
https://stackoverflow.com/questions/2763659/how-do-you-access-the-value-of-an-sql-count-query-in-a-java-program
Just do an upsert lmfao
Does anyone know how to make a kind of list of bans ?, and with a command that list comes out?
Is your goal to either update or insert if it doesn't exist?
Use an if statement in mysql
SQL is a turing complete language
well it's SQLite im using , although it's pretty much the same
Still query language is SQL
Which is a turing complete language
That (as turing complete languages do) supports branching
With some small exceptions to certain SQL things though
@balmy sorrel what exaclty do you mean with a list of bans? Your own list? another plugins list?
sqlite has some things not quite the same with MySQL
sqlite even breaks between spigot versions to be fair
The query structure is the same @keen compass
My own list @shut ember
to an extent it is, depends on your query is done. For instance sqlite has a couple different data types that are different
so in regards to say creating a table, the query is not the same
@balmy sorrel I think you need a multidimensional array//list and a storage layer. ?
java 32bit
But it's still SQL. The query language is still the same, and the base query features are still the same. And turing completeness, which is my entire point, is definitely a base query language feature.
🤦
you hava java32 bit
Damnit
i bet my ass on it
Anyways, depends on how your servers are setup. I usually keep track of all players that have played regardless of the server and regardless if its a new server in the network
@shut ember I just need a command, for example / banlist to say in the chat the list of bans and the reason
why the hell jdk 13 lol
This way, I don't have to run unnecessary queries, I always know if a player should be in the DB or not. Of course there is exception checking which is where depending on what happened the DB gets fixed 😉
i'll check upsert on some tutorial online
And inside code different logic for if it exists or doesn't exist
No error checking necessary
Except, depending on how many records there are, isn't always optimal to do
whats the website to download java 8 from
the thing with adding whoever joins into the database, creates the issue that the database gets massively big without a proper reason
and i want to avoid it
You should be using indexes
If you're not using indexes and PKs properly
Please stop fucking using sql
the fastest method I know of aside from just having functions already on the DB server, is using Insert Except if you have large amount of records
No
You misunderstand me
You do realize
You can write an if statement
inside of a query
Correct?
@balmy sorrel so you need a plugin or are you developing one? Sounds like the first
Yes I know
Good
So it's settled
The fastest method with the lowest query velocity
Is to write a single query to the DB
That performs a different action depending on
If the user is already in the DB or not
And if you're using indexes properly
The size of the DB doesn't matter
Or just already know which should be ran before hand 😛
And if you're not using indexes, your query length will be the same either way
How you going to know without checking the database
which is impossible if you don't know your data beforehand ^^
https://www.oracle.com/java/technologies/javase-jre8-downloads.html is this the website
That i use for java 8
Do I need other exploit fixer such as "CustomPayloadFixer" with this plugin https://www.spigotmc.org/resources/2ls-exploitfixer-professional-server-antiexploit.62842/ or not?
because the servers know if a player has played before on the network the moment they join. Therefore an insert isn't required unless for some weird reason they were not added before
It is my first plugin, and I want to implement the list of bans in my plugin, and I am saying how to do it @shut ember
And do some reading first
which generally shouldn't happen but because it is a rare case I just catch the exception
and fix it from there
That is such a terrible idea
To any reasonable person who knows how to properly write SQL queries
Also
Just so you know
I run a relational SQL database at work with more than 1 billion rows
The average query time
that is fine
your solution isn't the only one
SQL can handle very VERY large row counts
never said it couldn't
Assuming you're indexing properly
I'll try to post my sql whenever i've finished writing it so you can tell me if i've done it right
A check to see if a row exists
Is something sql does ANYWAYS when you're inserting with a unique constrained key
Which you should be doing if you're using a UUID as a PK
(Well... which you are doing, because the PK is uniquely constrained)
But, I don't do inserts all that often unless someone is new to the network is the thing
all the queries are fetches
Yeah easy, so you just fetch the row and if you get no row you assume some defaults
Don't even need to write your defaults to the DB
I don't even do that
I don't bother fetching a row if they never played on the network
@balmy sorrel sender.sendMessage("message");
How do you know they've never played
oh okey
Oh right
By using some potentially ephemeral player data file
That sounds REAL robust
My setup keeps track if a someone new connects to the network. I don't use the player data file on the servers
why access player data files when it I can have it centralized?
So before a player even gets to a server, the data for if the player has been on the network before is already available to said servers
no
Wasn't the whole point to not make database calls?
I don't make a database call for it
I guess the servers player data way is magic too for you
guess there is no other ways
because you can't fathom other methods XD
If you don't handle a playerdata file. And you don't make a database call. How the hell do you reliably replicate the data to all nodes in the cluster? I mean... can't possibly be reliable at all
@wind dock https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html with an oracle account
^
Don't use that
You don't need an account
Also stop fucking using java 8
Please upgrade
😐 my network runs java 11 so idk what you're on about
Guys it doesn't really matter what version other people are using
every second plugin needs java 8 which is fucking anoying...
?
Except I want to use java 11 features and I can't and it's balls
me too
You do realize that java is fully backwards compatible right?
unless the plugin is real retarded
If a plugin doesn't work on java 11 it's because the person who wrote it is mentally retarded
^
@gleaming helm symlinking a file that all servers have access to for reading is a thing first off, even if not on the same system. Second, you can use plugins on the network to communicate with each other, and only one of those really needs to keep track of the data. Essentially I just the concept of what the servers do, and just have it in a central place.
If a plugin doesn't work on java 11 it's because the person who wrote it is mentally retarded
@gleaming helm some have been found
it's better to delete them lol
Most that don't work is because of reflection
reflection changed after java 8
starting with Java 11
It was removed
Well it isn't so much removed
but it was changed in how it was done
How it is done now in Java 11 higher respects security
i think now trySetAccessible has been set as preferred over setAccessible
I assume you guys use openjdk?
I use oracle JDK but I do also use openjdk since the CI hates oracle JDK
@shut ember I'm a proud user of GraalVM
requires a license to use Oracle JDK unless what you are using it for isn't for commerical purposes @shut ember
haven't been able to set it up right on windows and am too lazy to properly set up any server fpr it
@keen compass it isn't commercial
if it would be I would have had a good structure already
I am just pointing out the caveat if you decide to use oracle JDK lol
still struggling with lot of stuff because I only occasionally do anything
There is an NPE in the event for that plugin
Author needs to fix it, and if you are the author then you have a problem in the event
Okay
I see Kevin_ on the other hand is going to routinely make their debut to complain about someone's methods in doing something 😛 I look forward to our encounters everyday 😉
and now, I am off to do some work. Have some leveling to do with the tractor. Unless someone needs my help
Any idea why this throws UnsupportedOperationException? I'm just trying to remove an integer from the list of integers right? 🤔
https://gyazo.com/b79482650d0cd19849515fdad42bfee9
ChunkSnapshot chunk = worldChunk.getChunkSnapshot();
Player targetPlayer = Plots.getTargetPlayer(player, target);
if(Plots.nullOwner(player, worldChunk) ||
Plots.noPermission(player, worldChunk) ||
Plots.getTargetPlayer(player, target) == null) {
return;
}
List<Integer> trusted = Survival.getPlot(Plots.getName(chunk)).getTrusted();
if(!trusted.contains(Profile.getProfile(targetPlayer).getId())) {
player.sendMessage("§ePlayer §6" + targetPlayer.getCustomName() + " §eis not trusted on this plot.");
return;
}
trusted.remove(Profile.getProfile(targetPlayer).getId()); // this is line 188
SurvivalDatabase.setTrustedPlayers(Plots.getName(chunk), trusted);
Survival.mapPlot(Plots.getName(chunk));
}```
I marked the error line
you are removing it from the list at the same time you are trying to read it
read it first before removing it
oh wait read that line wrong
Try getting the profile id first before removing it from your list. could be due to accessing another list while trying to remove something from yours
Ah will try that, thanks!
Has someone here already used Factions API?
many people have
just don't expect welcoming comments though
as many tend to dislike it
Yeah for sure
but feel free to ask your question anyways 😛
Just wanna know if there is a method or kinda custom event thrown when the player move and enter in a faction or in a warzone region etc
Or if I've to check on the playermoveevent lol
since it uses worldguard, you can just listen for worldguard region events
Really? Awesome. Didn't know that it used WG
yep that is how it makes its regions and what not
but Worldguard throws an event when players enter and leave regions
so I am back to my drawing board.
I tried to use the alias-key in plugin.yml, but that didn't work as intended.
my Goal:
Have two commands with the same argument interface, but doing different things:
/broadcast -time 12 -comment "hi" -asConsole
/log -time 12 -comment "hi" -asConsole
(examples)
I don't want to have messy code and fix one detail on the argument handling in multiple classes. There has to be a simple way.
since the root command name is different
just use 2 command classes
not really an issue to register 2 commands in the onEnable()
just make a method class that both use
this way your command classes are small and just execute the same methods
a method class 🤔
yep, a class or even in the main class, that both call but it does the same thing but differently depending on which command was ran
just have it take in the argument of the command name
sounds reasonable. Could input the args[] and output a results[]
public void commonMethod(String command) {
if(command.equalsIgnoreCase("broadcast") {
//do something
} else if (command.equalsIgnoreCase("log") {
//do something else
}
}
then in your command classes, you can execute that method
so command classes stay small relatively and both share common code
without duplicating it
but its however you want to do it as well. Just an example after all 😉
could even make it a boolean method if you want to check to make sure it ran fine
alright, now I am off. Have fun everyone 😄
i think SQL fiddle is not working lol
I'll probably use DataGrip because that website sucks tbh
what setting controls how far the players vanish? entity activation range?
Im trying to spawn a falling block but a lot of stuff seems to be deprecated
How are you supposed to spawn a falling block?
I have a location and a block
@keen compass I think something like this should work, although i'll need to use String.format of course
Yeah that's perfect
(Don't use String.format, use a prepared statement. Even though it's difficult to SQLi in this instance, it's better and faster to use a prepared statement because the database can cache the query)
(And don't think it isn't possible to SQLi this. In an exploit chain in which the user has control over your server side username, possibly through a bungeecord exploit or similar, they can insert illegal characters and execute queries on your DB.)
i can't use prepared statement everywhere sadly
Why not?
however i am 100% the input is sanitised
For that best practice is to write n separate queries to increment the fields separately
Yeah make a different query for each flag you're incrementing
and do a switch over the flag i'll need to use*
exactly
uhhhhhh I just tried running a server while another one was running and it said it couldnt because something about not being able to move a file
you tried running them on the same port let me guess
Are you running them from the same like.. folder?
I wanted to make a plguin and im using a wrong version what version of jdk do i use and where can i download it
Hi! I have a question (not minecraft related but SpigotMC related). Is there a discord bot that I can link my account to and get the bot to send messages on a channel when a new alert appears on spigot? Or an api I could use to make my own bot?
no
sad :< ok thanks
when the block.getRelative(face, distance) does the same as block.getRelative(face)? with distance 0 or 1?
ok so i am pretty new to this, and this might be a stupid question, but is it possible to reduce tps lag by making players invisible?
How do I force a player to click a slot in an inventory?
send the items lot packet
is all ik, but i believe spigot has a method for it
What would be the best way to solve this? The class was moved between 1.13 and 1.15 and I'd need to be able to support both if that's possible
https://gyazo.com/3e6c286e84546cc1a4bd0eadf9e9e51d
I tried to do something like this but I've litterly no clue what any of these methods does, and it error'd me on line 2
Method m1 = base64Class.getMethod("encodeBase64");
Object h = m1.invoke(String.format("{textures:{SKIN:{url:\"%s\"}}}", skinURL));
Field f1 = h.getClass().getField("getBytes");
byte[] encodedData = (byte[]) f1.get(h);```
interfaces has left the chat
like any sane human being?!
lol
so how beneficial is the nerf-spawner-mobs flag? given entities are our biggest perf issue, I assume that can really help
The method encodeBase64(byte[]) is undefined for the type Base64
on java.util.Base64
that method exists in the other classes
have you bothered to try to learn how that class works yourself?...
iirc there is a getEncoder method that returns the encoder that has the encode methods
Yo guys
Someone should make a spigot plugin without using the spigot api
Just raw java and reflection
hmm
is there a nice way to access a BukkitRunnable independend from the scheduling object?
count me in @torn robin
Failed to start the minecraft server
java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:213) ~[patched.jar:git-PaperSpigot-"4c7641d"]
[Pterodactyl Daemon] Server marked as OFF
[Pterodactyl Daemon] ---------- Detected server process in a crashed state! ----------
[Pterodactyl Daemon] Exit Code: 0
[Pterodactyl Daemon] Out of Memory: false
[Pterodactyl Daemon] Error Response:
[Pterodactyl Daemon] Aborting automatic reboot due to crash within the last 60 seconds.
Someone here may help me with that error?
could be a paper issue not a spigot issue (?)
what does guava api stand for
@short cape i can see u are using titan nodes. can you press Start?
I can, but 10sec after, it get automatically stopped.
@frigid ember what do you mean what does guava api stand for? o.O
guava is a library made by Google.
ik
i thought the letters stand for sth
i thought g is google and didn’t know the rest
ok pce
u is utility ^^
the rest?
idk
does anyone know how to create a hash map that checks if the player is oped
?
and if the player is oped it will let them see a hologram
that players that are not oped can't see?
i would love the help!
why would you need a hashmap for that?
cause
i want
to
hide the armor stand from that specific player
only admins get to see it
not the random passerby
just the server ops
that's all I want
and I want to get the package
and not let them see the entity
at all
only admins
@tiny dagger
you need to spawn that holograms with nms
how so?
i was hoping you knew because it isn't short to explain
not that big
but you have to go thru nms spawn the entity, keep track of it and so on
Is there a way to force an item to craft and add to players inventory instead of clicking on the result slot?
If a server was running version 1.13, is there a way to allow 1.14 and 1.15 clients to join? I've seen some servers where that is possible but I don't know if it can be done on spigot
You can use ViaVersion plugin (but I strongly recommend you updating your server to 1.15.2 as many security and other impovements are made, don't bring back the version conversation now ^^)
This is me so much painful giving the ViaVersion stuff Fendi 😢
Well, I mean 1.8---
How do I remove all the items with amounts used in a recipe?
shouldn't need nms for that @tiny dagger
imagine making plugins without using any API
just pure reflection
that hooks into the server
Only the creator of Brainfuck can think something like this
there is such plugins @sturdy oar
Ruby isn't that interesting, create a JBrainfuck plugin
If you do so, I pay you a beer
But you've got a filled paypal account ^^
well , let's not bring this up again
you might need that one year to build that plugin, sooo
can someone quickly explain how pingvis calculated in minecraft
i get confused, is it the time it takes for client to respond to your keepalive packet
k e e p a l i v e
like server sends keep alive and the time the client took to respond
let me read wikivg real quick
Hi guys, I have a problem in my plugin, when putting any command in my plugin literally nothing happens, it does not show errors in the console, nor in Eclipse, any suggestions? If you want, I can show you the classes and those things
Have you well registered your command in onEnable and in the plugin.yml @balmy sorrel ?
.
Retrooper you're tiring 😢
what
he is a youtuber lmao
his fault he posted it lol
i do
so someone does give a shit
Dude
then create your discord, and populate it with retards like you
alright big man
@undone narwhal yes
lol
@gleaming helm Anyway thank you for the help from before, SQLite seems to be working fast and ok
technically the same statements would work on MySQL although i'll double check it before
kevin whats a good way to strings in files as small as possible
Just keep in mind that a real database server like MariaDB or MySQL will always be way faster and way more efficient than sqlite (in terms of query velocity)
encryption?
Then can you please send your command class slayerzqx?
@frigid ember compression
AES
gzip works good
javas inbuilt gzip
AES isn't compression lol
i thought he was going encrypt
???
ok
Then can you please send your command class @balmy sorrel ?
ig
?paste
Depends on file size
depends on the algorithm you're using?
a 50 length stri bf
Depends on hardware
string
Benchmark it yourself
which of all the classes? @undone narwhal
wtf why are you compressing 50 chars string
is there sth faster than gzip
And realistically speaking data is SOOO CHEAP
i saidnan example
And GZIP's dictionary will likely result in very minimal compression ratios possible
I wouldn't even bother compressing that data
1000 characters
still a small amount to be honest
lets say i have a complex model
Storage is basically free
no
you need 1 million 1kb files to equate to 1 gigabyte
do u recomend compressing
not for that size order
Oh oh you're compressing models for your game?
im jist imagining
Well you're only going to decompress once so
some small optimization
It's not a huge deal
on start up
@balmy sorrel your plugin.yml, onEnable and one of the command class please
ok
it compresses to ancustom format
Optimizing something that small could even just increase the total load
and can decompress and read that
Thanks
That's really just quite dumb tbh
why
You're fussing about 1kb
you need millions of files of that size to make a difference
OBJ files are quite small, but they're also quite easily compressible
Not a lot of entropy
how do i compress it
With. GZIP.
why should i not then
Or your favorite algorithm.
u just said dont
Retrooper
Well
??
It doesn't really matter
this is an XY problem tbh
^
why
what are you even compressing
It's annoying as fuck to go back and forth with you
Because you exclude useful details
About your poorly worded questions
the only reason you should be compressing something is because you intend to send it over the network
if its just going to remain on the same hardware it originated from no point in compressing it
@undone narwhal I have things in Spanish because I speak Spanish, if you don't understand something tell me and I will tell you what it means without any problem
@keen compass Or your file is so large that you're concerned about it taking too much space on cold storage
@gleaming helm that is true too but that isn't very common though usually lol
donf
Because your files are tiny
bruh
@balmy sorrel Perfect, don't worry French can understand mainly Spanish
storage aint free byw
@keen compass My uncompressed database backups are more than 30gb, compressed they're closer to like 2
Storage is REALLY FUCKING CHEAP
these days
If you want a minecraft related example of compression, go look at how the server handles and compressed unused logs into .tar.gz
u said its free
There are better examples
cheap isnt free
well that is a proper example , where compression may actually be useful
Let's calculate
@keen compass My uncompressed database backups are more than 30gb, compressed they're closer to like 2
@gleaming helm why shouldnt i then
i dont see myself losing anyth
Google's data storage system
Which is "expensive" with respect to industry standards
you are just wasting cpu cycles over little gains if any at all
Charges $0.026 per gigabyte-month
having smaller sized files
You have 1 kilobyte of data
why wouldnt you compress backups
0.026/1e6 is a REALLY small number
Charges $0.026 per gigabyte-month
@gleaming helm expensive asf jk
fyi, depending on the block size on the HDD, compressing it smaller the 1KB isn't going to change that it will still occupy 1KB of space
he said 1kb
1000 bytes you said
So give a more reasonable example so we can assist you better
well my comment still is valid
Because the file size actually matters
a char is 2 nytes
@gleaming helm He still hasn't given any info about what he needs to compress... im out to be honest
bytes
Yeah same
i said complex models
Give some info or I'm out
Dude you're so entitled
i gave info
what does blender even have to do with spigot plugin development lol
by default windows uses 4096 bytes for block sizes, so even if you comressed smaller then that, your file still takes up 4096bytes of space since it has to occupy a block.
ok
linux it is different, don't remember what the default block size is for ext4
and then Mac's have a different assignment as well lol
either way though, if you are dealing with files that are no more then say 10MB or so. probably shouldn't worry about compressing it. Unless you really are dealing with millions of files
I mean, still probably shouldn't worry about it unless you are going to send it over the network
i do actually
but then you just compress it at the time you are going to though
the derver will send to clients
So you're now telling me that you're sending .obj files real time
That is about the dumbest idea I've ever heard
anything sent over the network is real-time
Yeah it sends a byte representation of the world state
why cant i send world data
you can, just not particularly wise to send game models over the network as is lol
lol
i said server sends to client
ok so i am pretty new to this, and this might be a stupid question, but is it possible to reduce tps lag by making players invisible?
@frigid ember on a hub server that actually can help with client lag, but not server lag
Not sure why you're asking everybody here to basically design it for you
what happened to org.bukkit.Achievement?
seems to have been yeeted
the way you say it kevin isn’t helpful
The way you ask questions isn't very helpful
but frost sort of explains and doesn’t have this “fuck off” impression
So
Kevin_ are you good with geometry
Frost hasn't been pissed off enough by you yet
lol
i would need an opinion
what
Well i'm generating a sphere
@frigid ember you can't figure out why cosine needs a paremeter so shut up lol
ok
Lemme guess, you want to determine a "grid" of points around the sphere?
Ping when you're ready
@frigid ember I just don't really care why someone wants to do something lol. If someone is going to make something and its not an optimal way, well then so be it. Who is it for me to correct everyones software 😛
Or just DM works too
have to learn at some point XD
also him when u dm:
This is after me unsuccessfully explaining the unit circle
😂 lmao
After about 30 minutes of attempting
And not because my explaination is bad
Because I know of at least one other person here who also knows why the cosine function take a parameter
Who failed to explain it
In a way you would understand
Oh there was math earlier o.o
And him essentially acting entitled to responses
@gleaming helm So I've worked on this small library a lot, however i've never made anyone actually good give an opinion to it. How i generate a sphere is done this way:
I generate a circle which stands on the (minecraft) Y axis. I then calculate a set of points that make up half a circumference. From that half circumference i loop through each point and make another circle on the X and Z axis at the height of the picked point. This goes until the bottom is reached and I have a full circle. A shitty image is attached:
mmm no
well from what I'm understanding you want to do
I don't really understand
What exactly are you trying to do?
A sphere from the center
Are you trying to create a grid of points that lie on a sphere?
You’re trying to make a sphere starting from top to bottom formed like a spiral
noice wats the lib
I have made this so far, however i don't know if there is a less CPU expensive calculation
Oow
The best way to do it is
So first create all of the circles
On the Y axis
And like cache the radius and Y position
And then for each of those circles calculate the x and z position
Also just so you know you can spawn particles async (at least on paper)
of course i do
So you can run all of your calculation async
anyway the particles was just a visualization sample
Although it really should be quite fast to calculate either way
the library isn't bound to spigot at all
vectors instead of sin/cos 👀
Vectors still use sin/cos under the hood lmfao
And if you use vectors you're recalculating either x, y, or z
So that's actually a lot slower
not that kind of vectors
if you want to optimize, just know you only need to iterate 1/8th of the sphere and can then just mirror it. Depending on what you are doing
is mirroring worth it'
the calculation spread across ticks 👀
^
That true
Spreading out the calculation doesn't make it any faster
Just hides the problem
I also avoided using any stream
mirroring doesn't really take any processing. Just need some basic math to know all the other points once you know where 1/8th of the sphere is at
Actually generating the 8th sphere thing isn't really super effective. The standard java trig functions cache values
And will mirror them appropriately
ah yeah
calculate the sphere loc then just offset it??
That also doesn't help at all @tiny dagger
You're still executing 3 additions per point
The sphere is the hardest one i had to do so far
once you actually learn the tricks to it though
you will find that it really isn't all that hard lol
and easy to optimize XD
well then you will retain that knowledge even better then
yea
We don't really learn how to make a sphere, and in most case we need something else cause it's too heavy
cos of this virus all school sht delayed
but, all you need to know is where the center of the sphere is going to be at, and then you should already know the radius. which is how large it extends out and upwards
yes radius and center is all i have, and all I need
and then its just some math to get the 1/8th of the sphere slice
Retrooper, you can learn math online like dumbly fast
not fast
once you have that slice, mirroring is just rotating it
well not really
takes time
remove the fast part
and understanding and its not easy
you can't simply skip the whole math that comes before
its not like watch a video and i instantly get it
we are different people and differently too
Everyone should kinda stay on his level and master what he can do currently
there's no need to push too far
yeah
In my mind, if you have the computer logic math a ridiculous easy
i didnt learn those trigonometric functions yet ik basics alr but kevin is just making fun
not everyone grasps trigonometry if there isn't anyone to really address their questions. Sure you can watch a video but its not like you can just pause the video and just ask someone on the spot a question in regards to what you are learning XD
Yep
Until you're reaching a great level
computer logic?
@keen compass I'm starting analytical geometry after summer
we are humans not computers
It's a stretch to say you know the basics
But, my tip is when learning math that you save formula's though
Google exists though lol
then dont make fun
remembering formula's for certain things makes it a whole lot easier to do things with math 😛
yo lol apple logo
Remembering formulas for things makes it a whole lot harder to learn new math in the future
ok
Rip custom emojis disabled
Understanding concepts is the only sustainable way to learn math
Rip custom emojis disabled
@stone rampart ahah it's not a custom emoji
it's UTF-8 the thing i just sent
well i dont understand what most videos are saying
Nah I tried
true, but with a handful formula's should be able to accomplish just about anything you want, whether optimal or not. And I mean the more useful formula's lol
so u cant get mad at me for not understanding
and start using it against me
Also
@frigid ember If you don't understand something, you're probably missing prerequisite information
Learning all the properties with the evidence is kinda really boring but then lath are easy pz
I use Pythagoras theorem for a lot of stuff and is quite handy just about anywhere XD
Yep
oof then it's just the apple logo
Guess Samsung just doesn't like Apple :/
yeah 100% blocked them
kev ik its a strech
That's hilarious though
Wait how old are you retrooper
12yo
nah
My guess: 15
My guess 13 or 14
C is real fun tho
nah
For sure
Then you should learn C++
C# over cpp :0
OH GEEZ
well C really makes you understand how computers work
NO
i know the basics, imwhy tell me to randomly learn cpp
MAKE IT STOP
Cpp and c's only good application is Arduino
indont wanna master cpp
Change my mind
@stone rampart Ok bet
It is usually good to learn more languages even if you don't need it. Different languages excel at different things.
Retrooper still waiting your age
I work in the low level electronics industry
Yo i think we are kinda spamming #help-archived
lol zoom electricity goes
Yep -----------> #general
C is critical for my job function
ok?
generally anything to do with low level hardware stuff you need to know C
Yep
“so fast with tutorials”
and probably wouldn't be a bad idea to know ASM too
Point is I don't do arduino, and C is incredibly useful
Most people don't have a use for ASM
and try hard bro
ASM can be hard to learn fyi
Any kind of electronics C is important