#dev-general
1 messages Β· Page 610 of 1
we found dkims alt

Is there no meta flag for hiding the "dyed" or "color id" from leather armor? It seems client sided
d;fields spigot itemflag
org.bukkit.inventory.ItemFlag%HIDE_DESTROYS
org.bukkit.inventory.ItemFlag%HIDE_POTION_EFFECTS
org.bukkit.inventory.ItemFlag%HIDE_PLACED_ON
org.bukkit.inventory.ItemFlag%HIDE_UNBREAKABLE
org.bukkit.inventory.ItemFlag%HIDE_ATTRIBUTES
org.bukkit.inventory.ItemFlag%HIDE_ENCHANTS
org.bukkit.inventory.ItemFlag%HIDE_DYE```
HIDE_DYE
Doesn't that hide the actual dye though? I'm talking about the text when you hover it
Ah yeah, btw paper plugins works for geyser right?
Same but kinda required in this case sadly
Is geyser a server software?
Unless it is based on paper api, paper specific stuff wont work
Yeah it's a crossplatform server software
Still not perfect though
That wouldnt work as i remove from the db if the block was created by a cobblegen or added if the block was moved by a piston.
im not using it as a lnockoff core protect as i only need to tell if it the block has been modified by the player to prevent people from just placing and breaking the block to gain skill xp or tools that give more items back if they broke a non player modified block
its only for duplicate xp protection
im not sure if hooking into coreprotect would be a better option
hello I have a question what is the use of having a lot of cores on your minecraft server if it is not possible to do multi-threading for the generation of the world
heart?
cores *
ah
well you noticed correctly, there isnt really a point in having a lot of cores for a single minecraft server instance
even paper can only take advantage of around 4 vcores at most for some async stuff, and only 1 is responsible for the main server tick / bottleneck
so tldr there is no point in having a lot of cores for one server
OK, so why do some hosts offer services greater than 4 cores if it's not useful?
because bigger numbers sell
is it just to have a more sales aspect?
also if you're getting a dedicated machine you may be able to run more than one minecraft server instance on what they provide you
which would be a valid reason to need more cores
since more cores = more total servers than can be run on the dedi
that just to doing a VM ?
but yes if you're just buying a single server then anything above 4 cores is just a sales tactic
yeah if they sell you just the vm then you can deploy more than one mc instance on it, so in that case cores matter
well if you are getting a dedicated machine, you can run multiple servers on the same thing and not overlap CPU cores
okay so in my case I have a dual xeon server so what will be the optimal configuration?
that's what I do for my server, we run a proxy and four Paper servers
It has been changed now to https://repo.triumphteam.dev/snapshots/, I suggest you join my discord if you want more info on it though 
Running a lot of servers lol
i mean it depends on what you're doing but you definitely dont want to give all of your cores to one instance
okay so it will be more useful to connect several servers with bungeecord in this case
that would make better use of the hardware yes
you can also take advantage of those extra cores and run an sql server or other services on your machine
ok thank's and I have one last question, do you know what will be the best OS to install on my server so that it is specially made for Minecraft servers?
any linux distro
i would recommend ubuntu server 20.04 because of the large community base
but you can do whatever you like
if you're running a single server then the type of drive isn't super relevant
but if you are running multiple servers off of a single drive iops will start to matter
ok and in this case I can use NVME ?
if you have nvme you're golden
nvme is better in all categories compared to any other drive type
(except by cost)
snaps π₯Ά
yeah but I already have it so this is the best way to use it?
what do you mean by 'the best way to use it'
I'm personally a Debian gamer myself, but Ubuntu will be fine yeah
NVME is the best way to doing a lot server
I'd recommend doing docker stuff to make it easy to run multiple things
yes nvme is the best
Pterodactyl panel is so freaking good I can't believe it's free
so might want to look into that
Star do you know Unraid ?
21.10 latest smh
Not super well
actually i guess the new lts for ubuntu is coming out soon isnt it
I presume it lets you do docker stuff eh?
22.04 iirc
yeah it allows you to do dockers in a much simpler way
yea, 3 more months
i mean it seems like an okay panel
might be worth looking into Ptero still though
free, open source, really really good at game stuff
much more lightweight
agones π₯²
what is that
pricing for unraid
oh ok
Do you know of any other software that allows you to have a docker management interface?
Pterodactyl Panel
that a free OS ?
would it be a good idea to load data from sqlite async when chunks are loaded and save when they unload and save every couple of minues async or should i load all the data from sqlite all at once?
depends really
lazy loading is probably the smart thing to do if you have loads of data
i would have to load the data asap but unloading can be done later. maybe queuing would be better
lazy evaluationπ
i dont really want to load each chunk seperately, more group the chunks together and load the data for those chunks at once
atleast thats the idea of how to run very few queries from the database without killing the servers tps in the process
I mean if it runs async, TPS is unaffected
So why not do everything async? /j
BASED
Bukkit.getScheudler.runAstyncTask ({
() -> new MinecraftSrrvrr(run).run()
}
i want to add skills, skill xp is given if the block is classed as not being placed before, im still working on figuring out a idea that could work for loading the data and saving it later.
i want to protect against people placing the block and breaking it to get xp
i cant store nbt on blocks that arent tile entities
i have a hashset of locations (world,x,y,z) which is what i would rather query then directly from the database
okay then do that
if the database gets quite large then it would ultimately make it not possible to pull the entire database and load it into the hashset
which is what i wanted to do
load on a chunk by chunk basis
or queue multiple chunks
im just not sure the right method for it
not the code, the idea.
honestly, even if the entire chunk is filled, it'll probably not take much more than a second to query & load, so just go for loading chunk by chunk
i doubt you'll need a queue
so should i query when i break a block in the chunk or query when the chunk is loaded?
You'd have to wait for the data to be loaded
indeed
or make every block take as long as obsidian to break so you have time to load 
so this system
is basically storing a boolean value for every coordinate that has ever had a block broken
basically.
and only once
i dont need to store who broke the block or when it was broken
you could try some funky logic to reduce the footprint of all these coordinates
like right now your worst case scenario is if every coordinate in a chunk has had a block be broken
instead of storing each block individually, maybe there's an algorithm to detect cuboid patterns in the broken blocks - then you can just store the 2 corners of the cuboid
it seems a little complex but it can greatly reduce the impact of the worst case, as well as the chances of the new worst case happening
you can also consider straight up compressing the coordinates somehow and storing that blob, then loading that in on the chunk being loaded - instead of storing each coord in the db
cause i could probably figure out a way to convert that blob of data back into location and coordinate
that shouldnt be hard
just serialize the chunk data and compress it to make the blob
then decompress and deserialize to get the data back
each block is a single bit, and you only need the relative coordinate within the chunk
then it's just 3 nested loops for x y z for the offset of the bit in your binary blob
and if almost the entire chunk is either 0 or 1 the compression ratio should be really good
(which is very likely)
Set<World<Pair<X,Y>,Set<relative coords>>>
huh
i think this is honestly a really good solution
o wait i couldve just converted the blob back into locations
it's easy to get the locations from the blob
the offset of each bit within the blob is the location
now to actually realize this
by my math the size of each blob uncompressed is ~12kb
guys does anyone can help me with a code in java?
i think it's 384 at least
then if you're lucky you can get an average compression ratio of 90-95%
so that brings it down to about ~1kb
per chunk
which is very tantalizing
imagine
you could even consider immediately saving the blob back to file as soon as the chunk is unloaded
async ofcourse
yeah
might not be required though, idrk and it'll be easy for you to figure out what's more convenient when you get around to deciding that
tbh i just need something that wouldnt lag the server every time i break a block and wont hog memory with large amounts of data
honestly your original idea would have been fine for that criteria
the only way mine is better is it uses less space on disk
but the memory usage is about the same
if you really want to save memory you'll need to unload / save the block data on chunk unload
or at least not hold onto it for as long as the server is up
again you can figure out better rules down the line, like maybe waiting X minutes before saving to file
how many code? best i can do is 7
@timber gust
wait so can u?
the question is how im supposed to add a timer or smth like that
that was my try to do that
and its failed
do you want the task to run multiple times
Bukkit.getScheduler().runTaskTimer(...)
this accepts an extra parameter; the interval between each additional execution of the task
and you can still set the initial delay
hello good I have a problem because I want to put a texture to a menu but I don't know why I always have the gap at the beginning of the menu as if it detected the character that is placed in the deluxemenu itself in the title menu
I have a question what will be the amount of ram recommended to support about 10 players with Paper
π€£
I'm doing well π
Does anybody know what this is?
- RAM 32Kx2
- RAM 14Kx2
- ROM 14Kx2
https://i.imgur.com/PMpqqRb.png
POGGGGGGGGGGGGGGGGGGGGGGGGG_ _ _ _ _ _ _ _ _ _
finally
given it has a read/write state input line it's RAM, and.. 15? address lines, 32k
I'd say D0 and D1 are data lines but.. only two?
it is from a test, don't question π€£
:))
idk, this class is stupid, so is the teacher
all semester we did arduino simulation and now we have this shit at the final test
β οΈ
also, do you know what 8kx16 represents for a ROM 8kx16 memory?
8k is the amount of memory, 16 would be the number of data lines for each address?
based on this, that's what makes sense the most (32k mem, 2 data lines)
the answers are
a) 13 adresses, 16 data bits
b) 8 adresses, 16 data bits
c) 8000 words with 16 bits each
d) 8k adresses, 8 data bits
Trying to translate what the teacher translated from english, and it makes no sense
id say b) π€£
ok em
8k words, each word is 16 bits wide
and RAM 2kx8 means 2k adresses, 8 data bits?
gratz
time to get lazy and let copilot do everything for you
took 82 days tho π
I see it was very worth
o
yeah, incredible good
apart from the vid you sent
tell him to
Because Kotlin bad
π
π
it works best when you already have some actual code
and it suggests based on what you previously wrote
but yeah, this happens too
and that's only part of the screenshot
there's like 50 more lines with the same if statement
hmm
https://cdn.discordapp.com/attachments/821820809642246185/916424533878116463/unknown.png this is my favourite copilot fail so far
it's somewhat profound
ay that's quite ironic nah innit bruv?
shut your face

yo can you guys consider adding a collaboration channel? it would be meant for people who arent hiring, but are devs who want to collab on a project, and they can post in there to get other devs?
well, I just think more people would see it if it was in its own channel
Ok guys i want your thoughts...... So i hired this dude months ago to make me a plugin, this plugin was so broken and was missing key elements, so i messaged the dude and said that it had to be fixed cause it was unuseable, firstly he blocked me and then i threatened to report him here.... He then said he would fix it, i am still yet to receive the plugin, he keeps saying that he will send me the finished plugin, but hes been saying that for nearly 2 weeks.... Keep in mind, ive been waiting nearly 2 months after he said he would fix it.... What should i do?
report him
not worth your time
Most likely got scammed, did u pay already?
I can fix it for you if you want
Ages ago when he sent me the first version of the plugin
Im not sure if ive got the updated source code, but to me the plugins had the exact same errors and everything so maybe
I can decompile if needed
That really sucks though, hes been saying over and over that he would fix it
yeah, it is hard to know if you have found a good dev
some just want the money but dont want to put the effort
I know a few
like that
I recommend using freelancing teams next time, a lot safer since there's almost always a middle man (the management)
Senior Team has a few of them
I payed this dude on october 10th
woah
Sounds just like the dude
But honestly i think that he doesnt know how to fix the plugin
lol
Cause hes now posting on mc market like hes moving on
report him there too lol
I only found his mc market page today
how much did you pay him and what did he complete?
you dont have to answer
just curious
$35
So the plugin was supposed to be a brackets plugin that outputs the brackets to a discord bot
brackets?
It also auto started the brackets event every day
Pvp tournaments, 1v1 where the winners vs winners
ah, he didnt code the actual tournament right? he just made it connected to discord with the auto start?
So he coded most of this, but in the worst way, instead of it supporting the unlimited players like i asked, he made it to be a even number which you had to set
Now this was a problem
yeah
oh wow
And the auto events stayed open if noone joined it
This meant that when i came on to host event, i couldnt do anything
This meant, that if i setup the event to host 10 people but only had 8 people online, i was stuck and had to restart the server
ummm....
that is a issue
anybody in the right mind would have seen that as problematic from the start
Also the outputs to the bot was completly wrong, instead of it showing who would go against who, it would show it AFTER the round LOL
So that made the bot useless
yeah
So i came back to him and asked for it all to be fixed
He simply blocked me
So i got my brother to message him
He agreed to fix it, then just gave me broken code that did nothing except flood my console.... He did this over and over
Then he judt left the dm group and blocked us both
Thats when i pinged him here like last month.....
Now he just comes up with excuses and says "ill send it tommorrow" "oh sorry, ill send it tommorrow" "ill send it in a couple of hours"
did you send the money through like PayPal friends where you cant revoke it?
We sent it by paypal normal bussiness thing
But its been so long that we probably cannot charge back
I documented half of it onto a google docs
But i stoped when he finally agreed to fix it
honestly if I were you, I would try and revoke the money through paypal
they typically side with the person who paid the money
π Ill have to ask my friend, as he was the one who payed the dude for me....
But yeah
for like $5 or $10 I can fix it for you, maybe even free, depends on the amount of work left
π
Ill send you over the source code tommorrow, maybe you can tell me if its a massive job to fix
alright, thanks, good luck on the paypal thing
Yo, anyone knows any good both MySQL and SQLite lib which is preferably good and easy to use. (Only find ones that either only have SQLite or only MySQL, not both)
why not just use the java one?
^ just use jdbc
hikari and then you just use mysql and sqlite jdbc
Hi there. Can someone explains me why nobody can access my maven packages on github despite the fact I can deploy them ?
https://github.com/Rosstail/Karma (here, the latest version is 1.9.5 with both package and release with latest commit).
anyone know the plugin that makes adding people to groups and removing easy with LuckPerms?
Anyone know any useful API's?
vault
Which language?
Dont use github packages, i tried the same thing a while back and theres just no good solution... In the end the reason it doesnt work well is because you need an access token to access(even public) packages... Heres a gradle plugin for it if you really want to: https://github.com/jarnoharno/gradle-github-packages-plugin Or this: https://stackoverflow.com/questions/57373192/how-to-add-github-package-registry-package-as-a-gradle-dependency
I'll check it. Thanks
Jerry liked this.
whats the place holder to put someone's xp on a scoreboard?
I use animated scoreboard if that makes a dif
Wrong channel #placeholder-api
where can I get help
depends on what you need help with
Best API for loading in schematics?
worldedit?
I mean it's the only one that I know of that fully implements the schem specification
and it's the only one that i know of
and it's the most used plugin if not the second most used lmao
You've got FastAsyncWorldEdit is another
But honestly usually me pasting in schematics with -a (to ignore air) works wonders for me
Hmm
With what?
FAWE bad
really? :o
oh you mean paste via java basically
most if not all non-user issues in worldedit support is because they're actually using FAWE/AWE 
I want to load a schem in the server directory using a plugin
(also its lighting update system sucks)
To generate maps
wait really lOL
and it tends to do very funky stuff between updates, there was this funny thing once that it just randomly filled chunk sections with lava
I'd rather be on the safe side and use good old and stable worldedit, no reason not to
haha thats so funny
Alright, thx both of you :))
my personal experience with it was disastrous but some issues may have been fixed since then, years ago
Yeah I've been out the loop so long so wsn't sure
yeah just use the worldedit api, you're gonna have a hellish time trying to reinvent the wheel yet again
@wintry plinth this is the one i was talking about lol https://github.com/IntellectualSites/FastAsyncWorldEdit/issues/897
[REQUIRED] FastAsyncWorldEdit Configuration Files /fawe debugpaste: https://athion.net/ISPaster/paste/view/ff34bfe693e543709a558e7491ce3e2f Required Information FAWE Version Number (/version FastAs...
yo anyone knows in which java version single line variable initialization got added? (private String x, y, z;)
since forever?
It's pretty old, idk exactly which version but it's very very old
wait java 13 has text blocks? the fuck
String html = """
<html lang="en">
<body>
<p>Hello, world</p>
</body>
</html>
""";
first time I see this
15 iirc
I think it was experimental in 13 but only added in 15, but i could be wrong
before or after java 8?
likely before
k ty
or just go through all the versions manually and find it out yourself it it compiles
π€
Ah yeah
This is a preview language feature in JDK 13.
Then here it was released https://docs.oracle.com/en/java/javase/15/text-blocks/index.html
ah, it says here too
Is the syntax correct?
I can't manage to apply the nbt on the stick in DeluxeMenus, which according to the documentation should work fine.
'air':
material: STICK
nbt_int: CustomModelData:2
slot: 1
display_name: '&8&Ltest'```
Are there any appropriate help channels?
Thanks for any help π
just wait until you see var and switch expressions π
When I do %player_exp%, I have 2500 xp points but in the scoreboard it says 0.7542857 what do I do?
Question, would it be possible to create a chat filter which uses machine learning to detect different variations of blocked words?
hey im trying to create a custom javascript placeholder and when i try to use it in game it says my function is not defined even thouhg it is, this is my code
`var region = %worldguard_region_name_capitalized%
function regionspaced() {
return region.replace("_"," ");
}
regionspaced();and this is error i getCaused by: com.koushikdutta.quack.QuackException: ReferenceError: 'regionspaced' is not defined
at <javascript>.<eval>(?:6) ~[?:?]`
hello
rename it to regionSpaced(), god
Omg Iβm so dumb ππ
probably possible and probably been done somewhere, good luck implementing it yourself
this plugin does that
but it does not have source
wait no im not that dumb it still dont work
Add "" around the placeholder
I was told this plugin just uses tons of regex
Blocking that last one is outrageous, at a glance it's not a word. Tbf blocking the word stupid is outrageous in the first place
maybe converts stupid in a regex with diff options something like https://regex101.com/r/WyOKyZ/1
- instead of {0,} but ye
true, was trying with +, but it requires at least 1, so i just used {0,} xd
blocking the word st*pid * π
Does it block s-chew-pid
Hi. Anyone knows the benefits of using enums for configurations for example compared to other methods?
To be more precise, why are enums good? And where can they be used inside the spigot api.
Also, canβt you use Soundex for filters?
Never personally used it for filters but maybe who knows
You mean, to use them for paths?
I personally use enums for messages because I can just define a field, put there the path and other info and then use Message.SOME_MESSAGE.send(player)
yes, that's technically the idea
but I also wanted to know where else I could use them
where else you could use enums? or where else you could use configurations?
Material.SAND
enums
(sorry for late response)
Any time you have a set of symbols you want to refer to
It also helps in more functional languages with limiting pattern matching and stuff
But yeah, Materials, messages, I use an enum for the possibilities of a Vote in a voting plugin I made, so yea, abstain, nay, and not yet voted
Any time you have a choice really
Materials isn't particularly a good example tbf
how to I get my custom domain to wor
You need a DNS SRV record pointing to the port of the server and an A record pointing to the ip
i have those
Are they correct and have you waited for your DNS cache to flush?
It takes a while for DNS changes to apply
Usually takes like an hour for DNS updates to happen
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.
Friend me if you can help me make a battle royale server
Yo. so I dual boot windows and popos and I was wondering, is there a way to add windows to popos' boot loader? so I don't have to go into the boot menu, set windows as first and then restart and then do the same when I want to switch back to pop?
no
Looking for discord support?
HelpChat is a Minecraft plugin and development support server and is not affiliated with discord in any way.
If you require support from discord, we recommend you to visit their official support website at https://support.discord.com
On this website, you can read their FAQs, or open a support ticket if necessary.
uh trying to explain to friend why adding a static getter to get the Main instance AKA the plugin, is a bad way of doing it...
how can I explain it to him lol
Adds an unmockable dependency which makes the consuming class not unit testable. Exposes what isnt needed to be exposed to any consumer class.
static things should be constants, that are always the same
the plugin class instance changes on every reload/restart
I mean letβs be real, nearly nobody unit tests mc plug-ins as far as Iβve seen haha
its not about mc plugins chazza. is about understanding what the fuck you do
general rule
you'll see those guys call themselves programmers and all they do is copy paste. (yes I know its part of being a developer but understanding also is)
use di lol
I have a kinda random question:
Should you avoid having a lot of Runnables, doing more inside the same Runnable, or doesn't it really matter?
I mean every Runnable is a new Thread so
wdym? BukkitRunnable? runTaskAsynchronously?
a Runnable isn't a Thread, so you need to be more precise
Sorry, to clarify I meant BukkitRunnables
I want to make entities look at near by players, but I surely won't be using the PlayerMoveEvent
so I was asking myself, whether I should have a separate Runnable for each and every Entity, or have one, which handles it all
just have one
not teleporting, packets
ah
What's the best way to explain the difference between .equals and == to a beginner? Like they barely know about classes or anything like that
(I am trying to explain the usage of String#equals, and why using == might not produce the expected result)
im thinking of using this as some guide too
With equals() you can check if all properties of an object are equal with the ones of another object, while == does some very basic checks that are mostly good for stuff like numbers
Trying to think of an analogy that would work but can't come up with anything
== is "are they in the same place in memory"
.equals is "do they have the same value"
memory = box, string = a thing in the box, == checks if they're the same box, .equals checks if the contents of the box is the same
a == b if and only if a is b ->
- if
a==bthenaisb - if
aisbthena==b
we can also negate this: - if
a!=bthenais notb - if
bis notathena!=b
(also good to mention, that two strings with the same content may not be the same string, similarly how two tomatoes that look identical are necessarily not the same tomato)
For big plugins, should I have a config class for each yaml file? There will be like 3-4 files but a lot of configuration
Just not sure how it would be best structured
Right now I think one manager to save and load everything, and then a class for every yaml file?
If you already have a few yaml files, a class for each file is probably the best way
Yeah and then a manager for those right?
Yep
Looking for discord support?
HelpChat is a Minecraft plugin and development support server and is not affiliated with discord in any way.
If you require support from discord, we recommend you to visit their official support website at https://support.discord.com
On this website, you can read their FAQs, or open a support ticket if necessary.
==, both are actually the same
.equals, are equal in the data they contain, but not necessarily the same
Hello i was wondering if any common plugins like essentials have the ability to change the player's NameTag
/nickname
use a plugin like TAB to change that, and just use essentials nickname placeholder instead of player name
Theres this plugin NameTagEdit but im looking for if i can do it already without getting to many pl in my server
TAB has such function, and you can also use it for Tab
Hi, i need to spawn an npc or an zombie that has noAI but he can hit me, Is it possibile to do if yes how? Thnx
if (p.hasPermission("trail."+trail)) {
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
final ParticleEffect effect = ParticleEffect.valueOf(trail);
scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
public void run() {
if (!proj.isOnGround() && !proj.isDead())
effect.display(0.0F, 0.0F, 0.0F, 10.0F, 1, proj.getLocation(), 15.0D);
}
}, 0L, 1L); } else {
p.sendMessage(ChatColor.RED+"You do not have permission for this trail!");
}
}```
my problem here is ``if (p.hasPermission("trail."+trail)) ``dont work
if I remove the`` + trail`` and in the ``""`` I put ``"trail.lava"`` it goes with all the trails when I would like to do it one by one the plugin however consists in creating a GUI where inside I can choose the particles but as you can see it didn't work for me Thanks in advance
im so annoyed lol
i completely forgot that string interning exist
so when i tried to make an example that == and .equals are different, i forgot abt string interning and it kept returning true for ==
XD
kinda embarrassing
This isn't strictly true for primitives though, which is what makes it confusing
Well, the same place in memory just means that their pointers are equal, which is in turn just an int/long comparison
i try to avoid the word pointer cause it might be a bit confusing
cause they aren't really pointers
?
how is it going to hit you if it has no ai
but?
?
But in reducer bot that thing exist, reducer bot is not even moving, but he is also hit me.
Well yea just make the entity not move, there's lots of ways to do that
Here's a pointer, you can do some research on it https://www.spigotmc.org/threads/stop-a-mob-wither-from-moving.435065/
Thanks i appriciate it
what are they if they aren't pointers?
There are no pointers in Java. I usually call them just memory addresses
I don't want my students to go around and say that it's a pointer or something because that isn't true.
In other words, it's references, not pointers
what's the definition of a pointer in your opinion?
a pointer is just a memory location, whereas a reference is a pointer that has to reference a valid value
rust and go have references, c++ has pointers
and probably references too idk
boot up your server No cached version of me.mattstudios:triumph-config:1.0.5-SNAPSHOT available for offline mode.
I pinged you before about it
smh
soo, I am spawning an Entity like this:
this.entity = (LivingEntity) location.getWorld().spawnEntity(location, EntityType.ARMOR_STAND);
and I need to get its entityId, in a different class, before the Entity actually spawns
idk if this is just horrible code design, or if this is possible
help is appreciated!
inside #spawnNpc() I need to run the register method before spawning the entity, but for this I need to get the entityId, which doesn't exist yet https://pastie.io/pexmld.groovy
Hello, does anyone have time to help me with a crash and optimization of a survival server?
just rewrote some code and now it does what i need it to do in 10 line instead of 50
feeling good
Nice
any servers actually use custommodeldata?
I feel like only super rpg-oriented servers would use this custommodeldata thing
cuz most of the servers would be quite reluctant to make resourcepack for this
nah im asking a question not showcasing
sorry if it confuses
On #showcase you can find a lot of stuff that are most likely done with CustomModelData and aren't related to RPG
np
lmao you can basically make anything with custommodeldata and custom font
CustomModelData is nothing more than just a numeric identifier for items
so you no longer have to depend on stuff like display name
Yeah itβs just a simple nbttag
Thoughts about licensing systems / anti-leak systems?
Isnt it more worth to just make it open source and those who want to pay, pay, since most people dont know how to compile a plugin anyways
You usually pay for support and updates, sooo
Or am I wrong?
no you are not wrong. I like freemium
can I get placeholders with discord.js?
like for a bot
which shows some placeholders
Boooooooo π
π
Pog champ then
I mean its not that Freemium
Since it takes some knowledge to compile a plugin
But lets hide that.
Our plugin includes a texture pack, so paying for the plugin instead of compiling gives you those default assets
I don't see the issue with licensing, it all comes down to what the product is, the same thing with obfuscation. Of course, I've became much more pro-open source from last year, which is why I always laugh when clips stuff isn't open sourced (because everyone here preaches it so much).
Even for my own project, the spigot plugin/adapter will be open sourced, but the dashboard itself wouldn't be (for obv reasons).
I think the choice should be up to the individual (except when there is some license which overrides your choice, in the case of bukkit plugins, that would be the bukkit license)
clips stuff isn't os bcz its his stuff not ours and he hasn't been around for 2 years. I thought I made this clear already. but ok
I know..?
The idea is that you charge for support AND built jars, not just the jar itself
gamered i guess
lol i think i start understanding the benefit of dependency injection libraries
now my ClanManager depends on WorldGuard which is only used in a single place
Yeah theyβre quite nice, altho they insinuate themselves into the code base so it was somewhat painful to switch.
I am attempting to create a massive network, with a multitude of super complicated features. How practical would it be to make my own fork of Spigot, and make everything in the server jar, having everything directly edited, without a plug-in?
Can someone make it shorter?
r=readline;f=r().split(" ");s=r().split(" ");a=[];for(i in f)a.push(+f[i]+~~s[i]);print(f.length!=s.length?"Invalid":a.join(" "))```

i hate py so much :c
I=input
a=I().split()
b=I().split()
d=len(a)
if(d!=len(b)):I("Invalid")
print(*(int(a[i])+int(b[i])for i in range(d)))
My code:js s=readline().split("") e=[...new Set(s)] print(s.map(l=>l==e[0]?e[1]:e[0]).join(""))Ruby:
k=gets.chars.uniq
puts$_.tr k*"",k[1]+k[0]```what the hell 
Ew god, why???
I wouldnβt make everything that way, I just thought it might be more efficient if some of core stuff was on the server jar
tbh I'd just use Fabric
with mixins you can do pretty much anything you want with a mod, no forking, no patches, no hacky brittle workarounds
Dont think so, its just way more messy and i see no benefits
I've been brainwashed into this too :p
if I ever make a public server again, I'm building everything in fabric
There's even APIs for custom items server-side, but vanilla client-side
I like how the API is just a collection of pre-made events and utilities really to facilitate its usage
Rather than a fully fledged server API
yeah
because at the end of the day an API is almost never enough
unless it gets tons of additions
as people find features they want
What conclusions can I make, if teleporting an entity asynchronously (#teleportAsync()) takes 2 seconds of laggy teleporting? Like the entity teleports to random positions between old and new location
Is this just the way async teleportation works or is the Thread literally at its limits?
What
The entity wonβt be teleported ansychronously
But it wonβt cause sync chunk loading this way
I think it also depends on the hardware, before we changed the server, teleporting took like 3 seconds and a lot of falling
dafuq
yeah idk
what's the best way to convert the armorstand headpose y to a yaw?
(I'm rotating the head by setting the eulerangle y but I also need to do the same thing with the full body)
Iβm talking about the headpose that is an eulerangle, not a location
armorstand headpose y to a yaw
Already googled for like two hours
nvm, I missunderstood the question
HeadPose seems to store the angle in radians
Location -> yaw needs it in degrees
so its
yaw = y * (180/PI)
ok thank you
so relateable
Actually relatable
@ocean quartz your repo still down or?
Ah okay gucci
[java]
Hi there, I would like to know why the first regex doesn't work when I try to check matches. What shall I must change on my regex ?
"\\{#[a-fA-F0-9]{6}}" //Doesn't work with "{#FF00FF}"
"#[a-fA-F0-9]{6}" //Works on it with "#FF00FF"
I tried with that method but it seems to doesn't apply to the armor stand, is this a spigot bug?
https://paste.lorenzo0111.me/wevixeveca.java (the output is "0.0 - - - - 220.5")
the first one should definitely work tho
how are you testing it?
yeah it works fine
If your string has other characters besides that hex, you want to use find()
Don't you have to setHeadPose instead of teleporting?
Don't you have to Matt Matt of Matt?
True
no, i'm changing the location yaw, not the headpose because i need to "apply" the headpose to the body
Then setBodyPose?
I'm testing by changing the pattern
Yes it has characters around
Pattern hexPattern = Pattern.compile("\\{#[a-fA-F0-9]{6}}");
Matcher matcher = hexPattern.matcher(message);
while (matcher.find()) {
try {
String color = message.substring(matcher.start(), matcher.end());
message = message.replaceAll(color, String.valueOf(ChatColor.of(color)));
matcher = hexPattern.matcher(message);
System.out.println("HEX");
} catch (Exception e) {
}
}
//doStuff etc.
My code actually
you dont need to reassign the matcher
bad habit of one of my old code, i didn't see it. Thanks
if you want to get the color from the matcher, use \\{#([a-fA-F0-9]{6})} and then String color = matcher.group(1)
Pattern hexPattern = Pattern.compile("\\{#([a-fA-F0-9]{6})}");
Matcher matcher = hexPattern.matcher(message);
while (matcher.find()) {
try {
String color = matcher.group(1);
message = message.replaceAll(color, String.valueOf(ChatColor.of(color)));
} catch (Exception e) {
}
}
I'm a bit bad with regex, should the parenthesis be written ? {(#FFFFFF)} or does this means it's a group ?
your code most likely doesn't work because of that ^ your substring will also contain the {# and } and ChatColor#of will throw an exception which you ignore
No, Rosstail, the parenthesis are used for groups
group() or group(0) will be the entire thing {#FFFFFF} while group(1) will be just the hex FFFFFF
@hot hull what's the explanation for this? https://github.com/Frcsty/FrozenJoin/blob/0af59eb177dcbba59892cbe7786788554be7f97c/src/main/kotlin/com/github/frcsty/message/MessageFormatter.kt#L103 I don't see you setting the metadata value anywhere. do you rely on developers setting it or what exactly?
that's the 'api' for SuperVanish
oh IC
I'll use the group(0) then
No, you need to use group(1)
np
Pattern hexPattern = Pattern.compile("\\{(#[a-fA-F0-9]{6})}");
Matcher matcher = hexPattern.matcher(message);
while (matcher.find()) {
try {
String matched = matcher.group(0); //Trying to replace the whole {#XXXXXX}, works well
String color = matcher.group(1); //Gets #XXXXXX, works well
message = message.replaceAll(matched, String.valueOf(ChatColor.of(color))); //Replace matched by value in message, ERROR on replaceAll, not in the ChatColor
} catch (Exception e) {
e.printStackTrace();
}
}
I got an IllegallRepetitionNearIndex pointing at the matched when I want to do the replaceAll. does it means my pattern/match/replaceAll is illegal ?
(And yes, I need the # inside {})
As a side note, you should put the Pattern as a private static final field inside the class, compiling regex patterns is sort of expensive so it should be done only once
That aside, this is how it should be done #development message
at first glance, it appears like you just need to replace the {} with ()
i have never used {} as a group operator
Pattern hexPattern = Pattern.compile("\(#([a-fA-F0-9]{6}))");
#112233
group 0 = #112233
group 1 = 112233
that's because they aren't using it for grouping
the color pattern is {#rrggbb}
and the parenths capture the #[a-fA-F0-9]{6}
I'll check it soon.
===EDIT===
In my case, I have to use .replace() and not .replaceAll(). Else, the code will try to replace the pattern multiple time but he cannot found it so it just break.
That's not a proper solution, the one linked is
Anyone here good with nms?
Im having some issues with ghost blocks, and the block being set via NMS
I don't know what you're trying to do, but if you're trying to change a block's material, another way to do it avoiding NMS is by using Player#sendBlockChange
Yooo the shirt is here. Just need to go get it from the post office
ok iβll try this
anyone has idea how i would parse this JSON with Gson?
custom TypeAddapter probably
@dusky drum with the ip's you'll want a map of some sort
problem is with that the status will get bundled into the map (unless you use a custom type adapter)
so you can either separate the status & ips into different objects, bundle them into the same map, or use a type adapter
for the map I recommend making an object to represent the objects those ips correspond to
i'll just try with JsonObjects ig, cause i have the ips already
wa
im only sending 1 ip
so its like this
{
"status": "ok",
"1.10.176.179": {
"proxy": "yes",
"type": "SOCKS",
"port": "8080"
}
}
if there's only one ip why don't you just change the json
i cant
then I'd use a type adapter to map it to an object like this:
String status; // boolean/enum might be better depending on what statuses are available
String ip;
String proxy; // boolean/enum?
ProxyType type; // enum
int port;```
i'll see, just trying to make simple antivpn for private server
it's a cleanliness/quality thing
if you use json objects you'll probably end up parsing the structure (albeit through gson's api) at the same time you use the data - to do otherwise would be more effort than just using a type adapter
whereas if you use a type adapter, you're guaranteeing that the parsing is done before
you're putting the data in a ready to use format before hand
using something like this? https://www.tutorialspoint.com/gson/gson_custom_adapters.htm
Gson - Custom Type Adapters, Gson performs the serialization/deserialization of objects using its inbuilt adapters. It also supports custom adapters. LetΓ’ΒΒs discuss how you can create a
I'd just implement JsonDeserializer & JsonSerializer
you'll need to loop through embedded objects
of which there'll be only one according to your json schema
ah, i never actually played with json so i have no idea what is what, ig i should read that before doing anything with iot
ya but then
you can then get the status, via retrieving that property
i know his part but then how do i get what that object contains?
then remove the status property
so the only property remaining is your ip one
you can find the ip with #entrySet
that'll give you a Set<Map.Entry<String, JsonElement>>
there'll only be one element in the set
the String the ip, JsonElement is a JsonObject containing the other stuff
because I've only ever used Ptero and Multipanel or whatever the shitty one was xD
i like it but i dont understand why they made console not print full errors anymore
pretty sure its always had a limitation
too many lines too fast or something like that
i mean it literally just connects to the std out of the java container
it doesn't really do much else
DON'T PANIK 
very indeed cool stuff
java functional interface sucks
c++ function pointers > all
You should avoid sarcasm an irony on the internet
lol, I'm having quite a bit of good fun with Consumers and such
Using some spicy callbacks in a complex GUI I'm building
Not sarcasm at all
Java is just rubbish so unnecessary
ok
So um...
Im writing a batch file, or a bat file, And I want to ask the user for the filename and then create the file with the users filename... How do I do this?
7z a "C:\%name%" "-file to compress here-"```
This dosent seem to work...
Thoughts on module/extension based plugins?
Also, #development is probably the right place to ask
@obtuse gale Can you accept my friend request?
Any way to update linked accounts? the account that was previously linked to spigot account no longer exists?
and im desperately trying to get a hold of a Dchat dev build for 1.17.1 
pls someone ping if they have the solution
~~Yo if anyone feels kind enough, I'd appreciate a thumbs up on the feature req https://youtrack.jetbrains.com/issue/IDEA-287959
which is that we can through intellij change the default gradle wrapper version (without having to change Use Gradle from in Settings)~~
nvm this is alr a feature req oopsie
Using the jpms or what? Im writing a extension loader for minecraft client side and using java modules makes it super easy
no idea what you would use, was just asking about the general idea
What should I use instead of '&' for adventure api?
just components
Component coolio = Component.text("foo", TextColor.color(0x123456), TextDecoration.ITALIC);
add static imports for extra style points
if you're talking about configuration or general user input, minimessage is the (modern) way to go
Thanks!
Hey...just a doubt,
public void broadcast(@NotNull final List<String> messages, int delay){
if(messages.isEmpty())
return;
for(int i = 0; i<messages.size();i++){
int finalI = i;
manager.getPlugin().getServer().getScheduler().runTaskLater(manager.getPlugin(), new Runnable() {
@Override
public void run() {
audiences.all().sendMessage(MessageFormatter.transform(messages.get(finalI)));
}
},40);
}
}
What it should do is send each message with a delay of 40 ticks right...but for some unknown reason..its having an intial delay of 40 and after that its all gets send together
So in this image...
my kill got registered on 29 and 2 of the messages came together at 31
i tried with forEach() first then with the pure forloop...both resulted the same
- Loop is called "at the same time"
you are not telling the code to wait 40 ticks, you are scheduling the messages to run after 40 ticks
you'd better use runTaskTimer with an interval of 40 ticks
or try a different approach
This one was actually a new information for me...
Both are apparently the same right?
could you show an example of implementing it with a list<?>
So um, I am a complete beginner on building mods.
I decided to take a easy project as my first,
- Turn off auto-save
- Zip/tar 'world' folder
- Upload it to Google Drive/Dropbox/Outlook
- Delete older backups.
Can someone guide me? Get me started?
What world
the 'world' folder, which has my world stored?
when you are in a singleplayer world?
Nope. Imagine you had 10 people lined up, each with a different message memorized. Then, you walked along the line of them, telling each of them to go tell someone a message 100 ft away, but to wait 2 seconds before going. Then, right after one another, they ran up to the person and told them their message all at the same time. That's what your code is doing
It's not doing a message at a time, it's queueing all of those runners at basically the same time and giving them a starting delay
Oooβ¦thanks for making it clear
Is it possible for u to provide an exampleβ¦for what to do in my case
Well, there are many ways to address this, and honestly none of them are great. My idea would be a queue that you have a scheduled repeating task for that just gets the first thing in the queue and broadcasts it, or doesn't do anything if the queue is empty
public void broadcast(String message){
manager.getPlugin().getServer().getScheduler().runTask(manager.getPlugin(), new Runnable() {
@Override
public void run() {
audiences.all().sendMessage(MessageFormatter.transform(message));
}
});
}
public void queueBroadcast(@NotNull final List<String> messages, int delay){
if(messages.isEmpty())
return;
manager.getPlugin().getServer().getScheduler().runTaskTimerAsynchronously(manager.getPlugin(), new Consumer<BukkitTask>() {
@Override
public void accept(BukkitTask bukkitTask) {
if(messages.isEmpty())
bukkitTask.cancel();
final String message = messages.get(0);
messages.remove(message);
broadcast(message);
}
},delay,delay);
}
Well how about this...I haven't tested it yet...
Apart from having a new list object for each message, I am not seeing any major drawbacks for it
That actually doesn't look terrible, besides the fact that you have to have the entire queue before you broadcast any messages, and that removing the message from messages before sending it might do something weird
Yeah...i reorganized it...but for some weird reason...even after I remove the message...the isEmpty() is not getting triggered...or atleast the bukkitTask.cancel(); ....i am adding debugs to know whats happening
don't know whats happening....
https://paste.helpch.at/eyesonibet.md
bukkitTask.cancel(); doesn't actually triggers...even after the Cancel, it just continue to print messages....
i haven't worked with bukkitTask...is this how it should be done
maybe this.cancel()?
cause cancelling the bukkittask just cancels the brodacast method before you even run it, so it won't cancel anything
isn't the consumer method deprecated?
i mean, even just returning instead of cancelling bukkittask would probably work
nah
Runnable interface doesn't have a cancel method
that would still make the timer execute after x seconds right?
it wouldn't get out of the scheduler right?
new BukkitRunnable() {
@Override
public void run() {
//code
cancel();
}
}.runTaskTimerAsynchronously(manager.getPlugin(), delay, delay);```
This should work
^
if you have a condition like if something then cancel() make sure you add a return; after
except pretty sure it's @Override not Overwrite
Yeah xD
wait...actually that might be my prob with bukkitTask right?
lol
yes
IntelliJ auto fills it...so π
π
it doesn't cancel the method in that moment, but after the run() method reaches the end
π
haa...y tho..lol...
public void queueBroadcast(@NotNull final List<String> messages, int delay){
if(messages.isEmpty())
return;
manager.getPlugin().getServer().getScheduler().runTaskTimerAsynchronously(manager.getPlugin(), new Consumer<BukkitTask>() {
@Override
public void accept(BukkitTask bukkitTask) {
if(messages.size() <= 0) {
bukkitTask.cancel();
return;
}
final String message = messages.get(0);
broadcast(message);
messages.remove(message);
}
},delay,delay);
}
Finally this worked... thanks Gaby & Star for the help
and a lambda
on that if you check if !iterator.hasNext() and then to get the message, iterator.next()
Do you know any spigot plugins that host their own webserver, ideally combined with a react frontend?
Would like to look at some code for inspiration π
maybe dynmap, Plan, BlueMap
Oh true, my small brain didn't think of all these map plugins. That's a good start π
yea
because web servers use so much resources
just bundling nanohttpd or something will use fuck all
damn piggy why you gotta do me like that
yes
I mean the big java ones probably are
but that's probably because it does a shit ton more
yeah, im not a fan of those webservers hosted on the game server xd
dynmap uses jetty
idk how much jetty uses
probably way more than necessary but probably still not a huge amount overall
it's okay, my poor oracle server can probably handle it
i thought the oracle servers were pretty good
just kidding, don't run big servers on oracle ARM lol
are they bad?
learned that lesson the hard way
I was able to run some intense modpack servers on it
well, for 75 players with a bunch of heavy plugins, they ain't that good
oh
migrated to OVH dedi, now we coast at 20 TPS with 100 players with even more heavy plugins
NOT ORACLE
my brain likes to swap them because they both start with O
OVH is cool, is the point I'm getting at
and they just provide a no-frills setup too
no web panel, no stupid network stuff
just raw SSH into a server π
it really does
and there's some really questionable design choices
but I mean, I had all the same fluff on Azure, AWS, and DigitalOcean and they all were useless
but if it wasn't implemented so shit, all of that fluff would probably be useful
just made me have to implement firewall rules twice lmao
well it's not just the firewall
it's just the stupid things like how you can't reinstall an operating system
that's such a trivial, but essential functionality
Ooβ¦yepβ¦I thought of thatβ¦its more faster comparing to the regular loopβ¦will do it
uh question, if I have a proxy (bungee) and I have 2 servers in it, let's say a lobby and prison, is it possible to make a /lobby in prison that sends the player to the lobby without needing a bungee plugin?
No
Just was wondering, how did they add the ----- here in the category names in a way where they scale well on mobile etc
font?
Yes
and categories are forced to be bold ish i think
I think so. Not sure though.
so how would they use bold
and you cant change the font, its probably a special character
but my question is still how it scales so well with with mobile, cause ud imagine it would cut it off and do the ... thing
You use a font generator
copilot be like
Good
You type something then start scrolling down and suddenly your code shifts down and you don't know why, then you scroll back up to see the giant suggestion from copilot
item loot item
rn using nginx, but is there a faster way to edit the html file(s) without having to use cmd all the time?
Or maybe a batch file that can sync my folder on windows to the machine in linux?
filezilla won't work bc it requires sudo/root
i'm not even sure if I can ssh with a batch file
so
maybe i can put some cmds on sticky note
and paste them in ssh
butttttttttttt im cli noob
what in the actual fuck
is that someone's real code???
you can scp the html over after editing it on your windows machine
scp?
scp is a way to copy files over using ssh
uh
also scp is poopy no use
scp isnt poopy ur poopy
o.o
According to OpenSSH developers in April 2019, SCP is outdated, inflexible and not readily fixed; they recommend the use of more modern protocols like sftp and rsync for file transfer.[3] A near-future release of OpenSSH will switch scp from using the legacy scp/rcp protocol to using SFTP by default.[4]
slander
literally from the wikipedia page lmao
idk this is just a simple joke/learning website so i dont need vcs
Β―_(γ)_/Β―
that's what copilot was suggesting that I add to my code lol
that is fucking insane dude
oh i guess you could use nano
look into vim though
it'll change your life
bit of an initial hurdle, but once you get over it, it's all straight up improvements to editing speed and ability
it does that quite a lot actually
speed?
it's really funny
π
yeah it lets you edit like, 9000x faster than a normal text editor
which is what you spend most of your time doing when coding anyways
this it gave to BM when he was writing the rules page for the devden site https://media.discordapp.net/attachments/744126296677941320/936338773153808454/unknown-10.png
but
the thing is
i know i personally spend most of my time not directly inserting text
i dont think most people spend time coding actually typing
i heard π₯²
yeah that's literally what I said

