#help-development
1 messages · Page 1080 of 1
augusto what r u trying to do? can you recap, i dont want to read the whole convo?
I thought networking was a single thread allocated for all these processes, perhaps I'm wrong
Ah
yeah, by default uses 4 threads netty, isnt it? defined in spigot.yml if im not sure
He just sent code of getting instead of saving which is what he’s so worried about
but the way I'm doing it is impossible to have a door in the world and not be in the DB. Only if an administrator removes the door from the DB, which will not happen.
I’m about to jump
I've already made more than 10k with Minecraft
what do you mean port bro
I'll catch you
dont do that, we catch you
augusto what r u doing?
rust server on minercaft
Ok then I’m confused if you’re confident there’s no way to have an inconsistency then why are you saying that sync auto save will have an inconsistency
ok and what is the problem with ur doors
because I thought auto-save could be async
1000 players on rocketmc and the archon:
1000 simultaneous players
augusto
aight bro
what is the problem with ur doors
auto save is sync
exactly i know now
so is there still a problem or no
so then
but it seems you didn't understand because there are no inconsistencies
I will show the code that I may be confused with as well and you confirm if there may be inconsistencies
is this exact message not concerning an inconsistency?
We're not chatgpt mane
We'll help you with a specific issue, but if you want a code review #1100941063058894868 exists
https://paste.md-5.net/iwiyeyufur.cs blockplaceevent this
for that message, sync auto save will never happen between new and update
the service's put method updates the database immediately. See if there may be inconsistencies with the world and the database in which the database does not have a door and the world has that door
See this is where unit testing comes in quite handy
Augusto, the only inconsistency should be that the door exists in the database but not in the world, not the other way around
Exactly, that's why I'm saying that there will never be inconsistencies like the world having the port and the database not, right? It can only be in the database and in the world having it, but in that case I'll go through when the server starts and remove all the entries that don't have a corresponding port in the world, or aren't these entries usually removed?
if the server crashed before the save happens the door will still be in the database
have you experiended the next problem with git plugin? I cant find what causing the git plugin adding automatically each file created to staging area, instead of just doing it manually with git add <file | directory> command. What can i make?
correct
yes
this is what I was trying to say with the 'if you can't verify' which is the 'remove those that dont have a corresponding door in the world'
How would you do it here then? Would you go through all the ports when the server starts and delete the ports that don't have an associated world port, and use a get that would get it from the DB if necessary or would you keep everything cached when the server starts?
I just didn't fully flesh out what 'verify' meant because I thought it was understood but yes, if you can not verify whether the data has consistency, then you must force a consistency by doing the writes at the same time
ports = doors sorry
Okay there we go. I would probably do a cleanup method which goes through all of the datrabase entries and reconciles them with the current state of the world
THEN load the cache
so now the database doesn't have an inconsistency that the cache doesn't have
and that point, update the cache and the database at the same time when the doors are created/modified/deleted
but why would you save all door instances in the cache if you can just get the door from the db if necessary in the get method?
yesyes I'm doing that already. cache always updated with the db
Because there will probably be more doors than doors in the database, yes? Like this only stores "special" doors
if so then you don't want an unnecessary get call to the database for a door that isn't special
I'd say it highly depends on your situation and if you recognize 1 is causing a database problem (honestly I doubt that it will) then use a complete cache, and if you recognize a memory problem then utilize the database
surely this won't scare away any devs right
I didn't understand what you meant but all iron/wooden doors are the only doors that can be placed and are placed in the database (because they are password-protected doors and are the only type of doors on the server)
Ah so every door is meant to be in the database?
like they're all password protected?
What happens when everthing is null kek
it's defaults
the game just handles that
I love how you documented that it's undocumented
access to the database would only be useless if an administrator with access to the hosting deleted a row in the DB, you know? but that's not going to happen
exactly
Not that way
God I hate the way kotlin looks here
database problem as in you're making too many reads
love you too
but the sheer number of reads you would need to overload a database is not going to happen in minecraft
the vanilla implementation will bottleneck far sooner than the database
the "good luck" is my favourite bit tho
This would only happen if they kept calling the get method, which would access the database and there would be no door on db to put in the cache.
so yes if you want to read the first interact into the cache and a null if it doesn't exist that will also work
what
which is why you store a null, or an empty Optional to represent that it is not there, not that it wasn't fetched yet
What's the @Transient annot?
wont get serialized
ignored from serialize
doesn'T get included in serialization
Ah
goddamnit my discord is slow asf
wdym? storage the db fails on cache?
public StructureItem(Material materialType, String displayName, NamespacedKey key, String schematicFileName, String... lore) {
this.materialType = materialType;
this.displayName = ChatColor.translateAlternateColorCodes('&', displayName);
this.schematicFileName = schematicFileName;
this.lore = new ArrayList<>();
for (String string : lore) {
this.lore.add(ChatColor.translateAlternateColorCodes('&', string));
}
this.structureKey = key;
}```
konstruktor
db fails I speak of queries that return nothing
Bukkit.pluginManager.registerEvents(MyListener(), this)
but that wouldn't happen if an administrator removed it from the DB, so I don't think it's even worth doing that.
what even is @Transient lmao
nerd
Only I have access and I know what I can't do
read above
. @dapper flower
but if I wanted to follow the ideal recommendations, I would have to store these db fails on cache, right?
That is java
THAT IS JAVA
This is the kotlin kek
if every door must be in the database then you can just do it this way
doorRepository = plugin.getDoorRepository();
someDoorCache = new MemoryDoorCache(doorRepository);
on interact with door:
Optional<Door> storedDoor = someDoorCache.get(location);
if (storedDoor.isEmpty()) ...;
Door door = storedDoor.get();
door cache:
Map<Location, Door> # value is null if no door is present, key is not set if the repository has not been checked yet. if the key is set then the database has already been queried for this door
no it's not
What I sent is not kotlin
yes, the database fails MUST be stored in cache for it to be an effective cache
well at least they didn't use operator overloading in the kotlin code lol
ebic help me
Yep you sure do
I consider the lack of data part of the data, therefore something caches should track
@remote swallow
remove the 2 lol
wtf!
use backticks
fun `2dItem`(texture: Key) {
In this case it's not worth it because it's a private project. But I don't know how I would do that.
functions and variables names can't start with a number
smh
(in kotlin they can you just need backticks)
IT DOES?
yep
why would you even use it tho...
in kotlin you can use anything as function name in backtick
I argue that it's annoying af tho to use backticks than to not use a number in the beginning
you can put a fucking emoji in a package name in kotlin
it can even have space
if u have backticks
I'm surprised rad doesnt send this gif more often
associate a null value in the cache to a location and then check the DB for example every 15 minutes, create another map with location and long for example and compare with system.currenttimeutils is what devs do?
I mean if the database doesnt have it you just store null, or you can keep a Set<Location> of all checked locations w/o doors
man the only reason i use kotlin is for null safety and better functional progamming stuff, but you write it just to make java people go insane LOL
@compact haven
Guys help I'm writing in groovy instead of java
wth is groovy
In this case a timed cache is not necessary, the data will be consistent because writes will not happen without a door being placed
you're already performing a write to the cache and database when a door is placed, so an extra read every 15 minutes will not do anything
average alex variable name
If we are considering that they will delete rows in the DB, we also have to consider that they can create that row again. 😂
timed caches are only necessary when your system has writes from services that do not communicate
looks like java but fancy
sure
it does
just use java smh
Looks like java but shit to me
exactly HAHAHAHAH
but I already understood the idea of storing the db fail in the cache. thank you very much bro, knowledge is never denied, right brother? thanks
because this is the only service (the plugin is the one service) that performs updates to this database, a timed cache is not necessary because you can ensure consistency by updating both the cache and database
Because alex is a chad
can you create a class name with an emoji?
if it's in backticks, yes
well no I want to get you to acknowledge the part where the cache shouldn't be reset haha, this part is equally as important
sure
...
but nothing prevents an administrator from deleting a row in a port's database and then creating it again with same location
Correct, if an administrator modifies the database directly
Yes
That's fucking cursed jeez
ah hell nah groovy aint that good to read
If you plan on database administrators modifying data then you can engineer your service around that and a timed cache can be used
That's why I was saying that if we were to consider that an administrator could remove the lines (and then have to store the cache failures), then let's consider that the administrator could add that line again (and then have a temporary cache).
yI will not consider this, just as I will not consider that the administrator will remove it, so I will not do a timed cache.
the problem with this is that there will always be an inconsistency if you're using caches and modifying the database
but now I have more knowledge about this for public projects or orders. Thank you very much brother
because no matter how small your time unit for the cache is, there will be a smaller time unit of inconsistency
of course, good luck mate
yes
now make another class and make something like
val eggplant: :carrot: = :eggplant: () for extra damage
Spigot actually has cool people
were just chill like that
paper dev are ass 50% of the time
thank you success for u
My server runs spigot yeah
(although I would recommend you leave 1.8 cracked, it's very old and a headache to work on)
I like paper more than spigot lmao
he is just trolling lmfao
bukkit doesnt have any main function to run
Performance psh just learn how to write better
everything runs on bukkit :3
(^^ what paper does)
julia lang be like: 💀 = 1
Guys why are we starting the paper vs spigot argument D:
I've already made the entire server so I don't have a headache anymore hahaha. I bet I would have more headaches in the new versions because I would have to learn a new API, but thanks anyway. I'm more into 1.8 because of the low cost of hosting because it requires much less resources.
people here love drama
who even uses julia smh
?whereami
@young knoll gets -1 depression everytime thats used
Shit I missed an opportunity for the ai gif
?ban 756204402087559221 flame bait and trolling
Done. That felt good.
i'm trying to make a plugin for bungee and spigot which can transfer just a string from the proxy to backend using messaging, but the backend does the action on the wrong player.
bungee:
@EventHandler
public void onSwitchServer(ServerSwitchEvent event){
ProxiedPlayer player = event.getPlayer();
Configuration configuration = getData();
ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(b);
try {
if (configuration.get(player.getUniqueId().toString()+".nick") != null){
out.writeUTF(configuration.getString(player.getUniqueId().toString()+".nick"));
}
} catch (IOException e) {
throw new RuntimeException(e);
}
player.getServer().getInfo().sendData("mypluginthing:main", b.toByteArray());
}```
backend
```java
@Override
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
if (!channel.equals("mypluginthing:main")) {
return;
}
ByteArrayDataInput in = ByteStreams.newDataInput(message);
getLogger().info(in.readUTF() + " + " + in.readUTF());
String nickname = in.readUTF();
NickAPI.nick(player, nickname);
}```
big message
big up conclube
He got kicked mid typing too
He'll never receive his closure
wanted to make an alchool emjoi + paper to joke around, looks like they removed alchool emojis
@blazing ocean I beat my record, we're at the 7th deep sea docu now
GO DEEPER
man they removed gun emoji and made a water pistol, i am starting to hate this hand holding of whoever changes the emojis
Don't ever say this to me again D:
😏
I feel like apple was the one who pioneered this
iirc apple didnt change it if anything
ok just kidding
Wow
When was ios 9.3?
around 2015
ah 2016
love it
death to kotlin now
java nerd
Idk from what I've seen you send rad java is more readable
Maybe you just only write cursed functions idk
he just used cursed functions
if you know what you are doing kotlin is more readable
way more so
I don't know kotlin so maybe I'm just a loser 😦
lemme see if i can find some kotlin code
I've seen enough of rad's to want to jump
you might be able to do im pretty sure you can do for(s in event.inventory) :? continue)
wdym
I mean ternary operator exists in java too, what does the colon dictate?
?: is called elvis operator
Oh i see
ternary in kotlin is if (something) doThis else doThat
I thought that was the point
bc ? is reserved for safe calls
it basically does:
if(x == null) {
//do stuff after ?: or assign default value to x
}
like x = a ?: 4
x is equal to a, if a is null then it is equal to 4
or return/continue in this case if you want to do an operation
it is very convenient
there is also !! which throws an exception, but rarely used
I guess I just got confused, I was looking at your example and this
if (isStorming || isPlayerInWater) {
temperature -= switch (season) {
case SPRING -> isPlayerInWater ? 8 : 5;
case SUMMER -> isPlayerInWater ? 7 : 4;
case AUTUMN -> isPlayerInWater ? 9 : 6;
case WINTER -> isPlayerInWater ? 11 : 9;
};
}
return temperature;```
this is java
i would just do an early return on the if to clear that up a bit tbh
public double calculatePlayerTemperature(Biome biome, SeasonsList season, Player player) {
double baseTemperature = getBiomeTemperature(biome, season);
double temperature = baseTemperature + calculateHeatSourceEffect(player);
boolean isStorming = player.getWorld().hasStorm();
boolean isPlayerInWater = isPlayerInWater(player);
if (isStorming || isPlayerInWater) {
temperature -= switch (season) {
case SPRING -> isPlayerInWater ? 8 : 5;
case SUMMER -> isPlayerInWater ? 7 : 4;
case AUTUMN -> isPlayerInWater ? 9 : 6;
case WINTER -> isPlayerInWater ? 11 : 9;
};
}
return temperature;
}```
Thats the whole function, I was just using it to compare to the example you sent, like I said I was confused on what the colon meant
i make this for iron doors. works to iront rapdoors too?
if (clickedBlock.getType() == Material.IRON_DOOR_BLOCK || clickedBlock.getType() == Material.IRON_TRAPDOOR) {
event.setCancelled(true);
clickedBlock.setData((byte) (clickedBlock.getData() ^ 4));
blockBelow.setData((byte) (blockBelow.getData() ^ 4));
clickedBlock.getWorld().playEffect(clickedBlock.getLocation(), Effect.DOOR_TOGGLE, 0);
}
there are 2 types of switch in java
normal switch with case 0: \\whatever then break; and the new switch type that uses arrows and stuff, that is the newer one and requires ; at the end
case 0: is java 8
yeah
case 0 -> is java 16/17 iirc
We stay updated round these parts
yeah it is java 17
for the j8 version you have to berak
j8 version is crap tbh i prefer the arrow one any day
the ; is only required when throwing the result of the switch in a variable btw
Well and you can still define bodies for the cases too
Imagine you couldn't anymore
I'd die
switch (month) {
case JANUARY, JUNE, JULY -> { return 3; }
default -> { return 0; }
}
This doesnt require a ;
Idk for my case I don't need a default as it will always be one of the four seasons
is that your spigot username
yea
!verify then
A private message has been sent to your SpigotMC.org account for verification!
if it is just do !verify (spigot username) follow the steps and it will be applied automatically
why is someone called then
i verifyed before
clearly not
but he saying you already verified
I need to make an enderchest a normal chest. I cancel the event and then what do I do? Isn't it possible to easily make this enderchest be treated as a normal chest where multiple people can use the chest?
just change my name
Uh why not just use a normal chest? I don't get it
oh okey
There are 2 chests: 1 chest without a password and another with a password. The one without a password is the normal chest. The one with a password is the enderchest.
Ok but why?
I could even do it with texture but it is not possible to set "nbt" in a chest
You can't just put a password on the regular chest?
to have easily identifiable passworded and passwordless chests?
but I want it to be easily identified a chest with and without a password
Just use a regular chest and like a text display or something above it show if its locked or not
If you use an enderchest, just because it's locked doesn't mean it will act as a normal chest, it will still hold the functionality of an enderchest
brother, do you code for bukkit?
😂
with all the certainty in the world
wdym?
An enderchest is an enderchest, a chest is a chest. The enderchest has functionality that holds each players items individually based on the player. This means that if you're using an enderchest, whatever enderchest they access it will contain those items
A regular chest does not do this
brother, nothing stops me from canceling the interact event and treating the enderchest as a chest
So then what is your issue?
help to do this
Just use a text display to show when chests are locked
You don't have to use two different items
You'd be going through more work defining your enderchests and changing the functionality than if you just used a regular chest
I'll have to make a custom inventory for the enderchest then
bro is gonna reinvent the wheel using a screwdriver
I wish I could do what you said.
let him cook
ig so idk
What is preventing you from doing so?
Text displays are super easy to manipulate
players and admins
... how?
If I share the same Inventory instance, any changes will be reflected to all people who have the inventory open without any possibility of a dupe, correct?
for the mercy of the lord, just use PDC and store whatever a chest is password protected and add a listener and do stuff in case it is...
You're doing so much more work than needed
I swear I could have implemented this system 4 hours ago
or just use lockette or some other plugin that already does something similar
lwc is good too
Yeah idk from what I’ve gathered he’s trying to reinvent enderchests with a bit of extra functionality kek
so player vaults?
shulker boxes with password basically?
cant you just have it be an actual chest but display it as an enderchest
You could do that too
@runic pine this exists if you wanted to use it
declaration: package: org.bukkit.entity, interface: Player
thats a fake block technically
That's kinda the point
He wants "locked" chests to be displayed in some different way so
Who knows where I can get a good plugin template showcase or who can make one for me?
I have an interface class that creates Coins (name, cooldown, etc...)
and for each needs specific event listenining
what is the best way to handle that
a consumer
in the interface class?
im on 1.8 brother
If I share the same Inventory instance, any changes will be reflected to all people who have the inventory open without any possibility of a dupe, correct?
😂yes sending packets whenever a player gets close to a chest is a good solution
massive L
1.8 is ancient
and you are going to have a very hard time
Who loves nbt?
PDC is better lel
duh
?1.8
Too old! (Click the link to get the exact time)
holy shit we're approaching 10 years
If I share the same Inventory instance, any changes will be reflected to all people who have the inventory open without any possibility of a dupe, correct?
no
you say no for all?
the changes not is reflected to all people?
MC trusts teh client so will accept it when it says I'm taking this item
when multple take at teh same time, dupes for evryone!
i dont see why you arent just using a normal chest and going through all this effort
I think I've said this maybe 6 times?
fr
So how does the vanilla chest work?
...
only one person can open a vanilla chest at a time
what? you've never played minecraft then
several people can have the chest open at the same time
Seems you've only played moded
what??
I think this guy is beyond help
several people can have the chest open at the same time bro wtf hah
I've already told him the answer several times, keeps refusing to listen, and keeps asking the same questions

I've had multiple people open chests at once on spigot
he was teh same yesterday too. He seems to only listen to GPT
people can 100% interact with the same inventory what
I wasn't active yesterday
It's crafting benches that are 1 at a rime
the server is full authoritative with survival mode clients on that
interact yes, vanilla only one can open
thats just not true
its not?
yea idk elgar i think you are wrong there
um
Are you saying that only 1 person can have a chest open? If another person simply tries to open it, is it blocked?
I'll test it, sec
you've never played minecraft bro wtf
mandela effect goes crazy
true
Augusto you cannot be talking
If I share the same Inventory instance, any changes will be reflected to all people who have the inventory open without any possibility of a dupe, correct?I wanted to know the answer to this since Elgar smoked well
just because I have a problem and want to solve it instead of running away like you suggest?
and if it's an order, I can't tell the customer I just can't bro wtf
... I gave you all the information you needed and now I'm telling you to run away?
You said to make another system because the current one is very difficult
ok wait do trapped chests exist in 1.8
Maybe you shouldn't take commission work for things you know little about
OH
SOMEONE
INTELIGGENT
NICE
THX
ok do that
retexture it as enderchest
Now I am telling you to take a hike
Chests can be opened and modified by multiple players at the same time
What only one player at a time can do is trade with a villager
for edgar no and he cursed me in 999 words
He's pushing me to the edge, help!
Nope, I have two players logged in, once one has the chest open the second can not interact with it
???
i just tested it on neoforge 1.21 which is close enough to vanilla right
and it let me open it at the same time
I just want my braincells back
um, perhaps ignore me
it may be spawn protection 🙂
um perhaps not. even op will nto let me open
Yep I'm completely wrong
I know what is throwing me off. It was trying to share a Players inventory
ngl you had me questioning my decade of minecraft knowledge
tryign to share a players inventory was where dupes happen
Yep I'm the fool for today. I'll shut up and go back to numbing my mind with Anime
HAHAHA
not sure what it is with people thinking mysql is slow or something
as the above, just stick with one DB type
Or when people try to stuff all the data into a single record in a single table 
The problem here are relations ig
lol
choco leaks hypixel storage?!?
Like unique keys aren’t a requirement people! You can handle more than one result from a query!
while your here choco, hows america and life without poutine
Now that you mention it, I haven’t had a poutine since I left. Thanks. Glad you reminded me of the suffering I’m enduring
oops
i would say make ur own but you'd probably have to get gravy from the world foods isle
world foods?
america gravy is different to the right gravy
Blood thins out without regular poutine intake
while true, grocery stores sell more then one kind usually
thats breakfast gravy
you speak blasphemy
its not the same kind as chicken, beef or turkey gravy or whatever other gravy you are thinking of.
its not bad, but home made gravy is always the best
So long as you understand a bit of culinary culture anything homemade is the best
My father has ruined regular food for me, I literally eat for nutrional value now unless he's the chef behind the meal
usually its because home made doesn't have all those preservatives or as many depending
What do you say to the guy who uses too much salt?
not sure if you could say anything lol, but I don't use a lot of salt
You're sodium annoying
lmao
Yeah I'm funny
I add a netty channel handler to invoke every single channel read
for some reason it sees only handshake
it works normally for pings
but for some restarted reason
login start is not intercepted
like the READ MMM message is from my handler
the in/out are from packetevents' event listeners
like the channelRead on my very first handler is just not invoked
Not the right channel for this but maybe something like WorldGuard with the enter flag to false. That doenst move you back like this but wont let you enter the region
how do i activate rich presence in idea
u need plugin
Discord integration right?
yea
there's also one called discord rich presence iirc and it's good
ultimate only tho iirc
REAL
ah right, got it thanks
i get it for free 
Imagine being enrolled in school
nah
Oh you're just cool like that?
i have the open source license
damn
Netbeans is totally free and open source :>
isnt it $200/y or something
nvim my beloved ❤️
200$/y is pocket change psh
y'all can recommend a cozy theme for intellij?
kat go learn vim
alright mr rich boy
i use catppuccin 🤷
rad go learn uh
a what
it's a theme
i know rust
no
Gottem
^ fr did
:(
How did I know you were gonna say that
how did I know you were gonna say that
cute cat
then don't use those icons
they do kinda suck for java and kotlin
but for ALL other ones they're great
smh
No it's not
Idk what the top image even is bro
ebic has the server arrived already btw
nah it still hasnt
wtf!
cus you can't code in console
not wingdings 💀
Now that's a sexy font
use hack
best font
JB mono is best
?paste
Oh yes
How do you people have these fonts downloaded
But I am loving it
Idk man they were just there
I have Hack, Iosevka, JB, Terminus, Intel One
you shouldnt need any other
at least 1 satisfies you all
I can't find hack
where is the code review topic?
I guess I'll submit my project, I always love feedback
send a github link here
oh xD
or smthing
D:
ah ty
that works better
I think I know why intelliJ takes 85% of mem
because of the 800 different fucking fonts that are loaded
I've been scrolling for like 10 minutes now and haven't hit the end
I was joking
But I still don't understand why theres ten million different fonts
I tend to ask here about my problems and only expect to be spoonfed the answers
That's the kind of spoon I need man
yurr
Well a lot of people here can help!
Ah gotcha
post the full background
my eyes would hurt
Everyone says this and I don't understand why
At least it's not generic light theme
hey i need help, im coding with client side entities and this one is constantly teleporting to a player. when the player teleports long distances, the entity cannot teleport with the player because it is unrendered
i don't like coding with backgrounds (too much on the eye)
ive also tried destroying the entity and creating a new one at the teleport location, but sometimes the packet doesnt spawn because the player hasnt loaded the new chunk yet either
cant you just wait a tick until its loaded?
i mean, i was considering that but that just seems improper 😛
If it works it works
what happens if the player is lagging and takes long to load the chunk
wouldnt it not render the new entity
thats how you have to deal with certain things
you could also resent the entity every once and a while
idk this entity has to be at the player at all times constantly, even a slight delay will mess things up.
ive used display entities to avoid entity interpolation which helped a lot
ok wait, im looking at protocol on wiki.vg and i see serverbound - confirm teleportation.
could i use this to confirm the player has actually loaded there and is ready to have the new packet entity sent?
sounds like it
I've tried to use buildtools to compile spigot 1.21, and i keep running into this:
error: sha1 information is lacking or useless (src/main/java/net/minecraft/world/level/block/state/BlockBase.java).
error: could not build fake ancestor
Patch failed at 0006 Async Operation Catching
Using the wiki tells me to run git config --global --replace-all core.autocrlf true which I did, but it didnt help.
I then tried running this command while in PortableGit's bin directory to make sure that it would help if it wasnt modifying my computer's git install, but still no help.
(is there a way to use my own git install??)
If anyone can help with this, thanks!
Oh, and heres my debug info and log file: https://hastebin.skyra.pw/rayopajele.nestedtext
mamma mia I'm cooking a mighty fine pasta code once again
this code is so al dente the spider man pizzaria music spontaneously started playing in my IDE
give me inconsolata or give me death
which font is that
that looks like the mc font
it is
i think its this? https://github.com/IdreesInc/Monocraft
I hate it
Theres a similar one but more vectorized:
https://github.com/IdreesInc/Miracode
a
Is this a bad way of doing it? String brokenBlock = e.getBlock().getBlockData().getAsString().replace("minecraft:", ""); I mean... It works but is it bad? 😂
its just so i dont have to put minecraft: in my config
does it not work without minecraft: ?
I would imagine without the namespace it uses the default...
nope, i gotta manually put minecraft: each time. which isn't a big deal the code doesn't look that great tho lol
?xy
use matchMaterial?
so this?
public Material getTaskMaterial(String task) {
return Material.matchMaterial(getTask(task).getString("Material"));
}
Probably, yes.
couldn't get that to work but Material#getMaterial() did work..
plus made it not as bad to look at 🤣
?paste
https://paste.md-5.net/ujaqusutix.java
What fine pasta I've made
man that bbmodel thing is also going to be a whole thing
whats it for?
man I kinda wish I could hit a treadmill right now
it's for an import system for my plugins, made it plugin agnostic so people can install content on the wrong plugin and it will still be redirected to the right place
thats pretty cool ngl
can someone remind me, if I call an event in the traditional way does it run on the same tick or the next tick?
Should run immediately. It invokes all the listeners when you invoke callEvent()
You can pull from the event class all the information you need that might have been changed in a listener, so
thanks babe
💋
also definitely a relevant question in this place, do I try to make a cup out of an hexagonal molecule pattern in blender or in fusion 360 for a thing I'm 3d printing
I think if I do it in 360 this is going to take like 100 different planes
hmmm
Hello, I'm struggling to get my setup for development started.
I'm following along with this tutorial https://www.youtube.com/watch?v=pRzR4OIoVks
And everything I've done following it, however when I try to extend JavaPlugin my eclipse doesn't recognize org.bukkit.plugin
In that tutorial he doesn't use a build system
everyone (and I mean everyone) uses one
Maven or gradle.
I personally like maven
but gradle is equally possible and valid
These build systems download and make available to java other libraries (for one)
I've used maven for other projects before so maybe it's worth using a different tutorial that incorporates maven then?
Yes.
Get the minecraft development plugin
not required and I'm not sure I'd recommend it
Why not?
Is there one for eclipse or are you talking about ij
ij
Dont have to, i just like it. ij
most of it is a glorified wrapper
Its not hard to make a plugin.yml and onEnable() but its just nice.
Thanks guys, I was dying, been at this for like an hour and a half just searching google for the error / other issues
@torn shuttle just started using maven recently. i was importing everything before. xD maven is so much better
Good practice though, try stuff for abit before asking here. its better to learn then to ask for code.
Yeah, I didn't really want to bother with a simple issue, but I kind of hit a wall
I wouldn't have found out that I wasn't really on the right track without asking lol
If you dont know OOP i recommend looking up a video on it before starting comepletely.
I have a decent amount of java experience
Okay good, i dont xD
I just struggle with IDE setups
they confuse me
Did you learn java from mc plugins then?
Yes, and from a buddy that got me started with it. he just taught me the real basic stuff. I've kinda learned OOP recently because of this helpful community. ❤️
That's so cool
learning coding through Minecraft is super fun
I got my start with datapacks
I enjoy minecraft, i enjoy the challenge of coding. I've just been coding a base plugin for if i do start a server (end goal) that all the features besides coreprotect and luckperms coded by me
Make your own essentials plugin 👀
i started back in 2019, with my own server and ended up wanting it to be differen't. ended up giving that server to a friend (due to working a lot) but he killed it. started his own server and i was the dev for it.
recoding luckperms seems like a challenge
Thats what it is.
Ah rip
I wanted to do things back in the day with like homes, you start out with 1. but with tasks/quests you earn tokens and you can buy more homes that way
you couldn't really do that with essentials and it had too many things i didnt want lol.
That's my main problem with essentials. It overrides a lot of minecraft commands which causes issues with other things
Earning more homes through quests sounds like a really neat concept
Alright I got everything working. Thanks everyone
Happy coding!
Fabric has this task runServer and runClient which runs the Client (or server) with the mod already included. Likewise, can this be done with a Plugin?
just copy or symlink the jar to your server
hi guys i have two bungeecord server and i want the inventories of players on these servers to be the same
someone know any method for this ?
How do I make an entity that has certain persistent metadata not killable (like /kill from essentials or /minecraft:kill @e)?
i'm very new to contributing, and i wanted to see if i could add some API for minecraft's latest update.
i've read through the wiki on contributing, and i can follow it generally, but im getting quite confused on what repositories i need to clone and how to install all the libraries that they use.
for example, let's say i wanted to add an event for when Vaults in trial chambers drop loot. what repositories would i have to clone locally?
when i initially followed the guide, just to get a sense of jira/stash, i cloned CB, but no bukkit imports were available. then i cloned bukkit to my local machine and the errors in the CB project were resolved. im still quite confused on what i have to do if i want to add API that needs modification to Bukkit, (CB potentially?) and NMS to fire the event from. i might be looking at this all wrong, so i'd appreciate some guidance on how to move forward the right way
Yes
This sounds like a bad idea
/kill is incredibly useful for getting rid of stale / bugged out entities
Hiya! I'm using the PlayerInteractEvent when a player clicks on a vault block to modify the NBT data so the player can use it again
But after it was opened the user needs to right click it to run the event before the plugin updates the NBT
Is there a better event to use so they don't need to do this?
How would I go about creating a system, where each player is transported to their own world, but each of the worlds are identical
A 100x100 area, but each player should have their own, ideally in their own world
player.playEffect(player.getLocation(), Effect.SNOWBALL_BREAK, 0, 0, 5.0F, 5.0F, 5.0F, 50.0F, 16 * 10, 5); - Cannot resolve symbol 'Effect'
how give effect
inteliji not can find package
for class
Hi, does anyone have an idea of what plugin could do this kind of interface in minecraft?
Run BuildTools --dev, it'll set up everything you need. Bukkit and CraftBukkit are the ones to modify
I feel like I'm setting up a rube goldberg machine for how my plugins work together
a plugin imports content and throws and event, a second plugin listens to the event and regenerates content, the second plugin then sends an event when it's done for a third plugin to listen to that to redo the resource pack merging and autohosting...
Build tools is what it says it is, just a compiler of the spigot software
Hey guys, so I created a chunk collector plugin and I want to collect some item spawned using ItemSpawnEvent, but I wanted to exclude items spawn from block broken, I'm currently stuck and find no solution, can someone help me please? Basically I want to detect if that Item is spawned from broken blocks.
Check the BlockDropItemEvent in Monitor priority and give each Item a scoreboard tag
Just an example
public class BlockDropManager {
public static final String TAG = "dropped_from_block";
public boolean isDroppedFromBlock(Item item) {
return item.getScoreboardTags().contains(TAG);
}
public void tagAsBlockDrop(Item item) {
item.addScoreboardTag(TAG);
}
}
public class BlockDropTagListener implements Listener {
private final BlockDropManager blockDropManager;
public BlockDropTagListener(BlockDropManager blockDropManager) {
this.blockDropManager = blockDropManager;
}
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onBlockDropItem(BlockDropItemEvent event) {
event.getItems().forEach(blockDropManager::tagAsBlockDrop);
}
}
Ah was looking for that event actually. I thought BlockBreakEvent will give you list of Item, but apparently not.
Will do that, thank you!
Works wonderfully, once again thank you so much!
no i get that. but is there a way to include the --dev flag in the GUI
does Bukkit.getEntity get entities in unloaded chunks
i think no
rip
u can load chunks
true
and then check
but it instantly gets unloaded if no players r around
With WorldCreator class
i can force load it tho
?
Hi. How would I go about creating a system, where each player is transported to their own world, but each of the worlds are identical. I want each player to basically have their own lobby
I want to make the entity spawn with a yaml file every time the plugin starts, and kill every time the plugin stops, I don't want the entity to die with /kill
did u just predict the future
u predicted this message :0
Usage?
Did you import import org.bukkit.Effect
oh wait, it's EntityEffect.
should be just EntityEffect.SNOWBALL_BREAK
that's the problem with no such package
1.21 version minecraft
can the background of a scoreboard be made transparent? via api, texture pack or shaders?
public static Boolean playerOnline(String username)
{
return Bukkit.getPlayer(username) != null;
} is thread safe?
how would it not be thread safe?
I was always surprised why the nickname is not a unique id for the player
if you not can log with same nick
or is there some kind of workaround?
If this is executed asynchronously, what will happen? Will some concurrency exception be executed or will a concurrency problem simply occur in which it may say that the player is offline but is actually online, for example?
?tas
why are you even trying to call that async? it has no reason to be async
just answer my question
no
If this is executed asynchronously, what will happen? Will some concurrency exception be executed or will a concurrency problem simply occur in which it may say that the player is offline but is actually online, for example?
just dont call it async
maybe bc he use in some async logic
BRO THE CODE IS NOT MINE I JUST WANT TO KNOW WHAT APPENS
If this is executed asynchronously, what will happen? Will some concurrency exception be executed or will a concurrency problem simply occur in which it may say that the player is offline but is actually online, for example?
yes but after checking if the player is online he needs to go into sync to change something about htep layer
Holy shit they only talk shit and they don't talk about the important thing
synchronize internally asynchronously hahaha
but still a working method
and I'm just about to make without lags to change the block biomes of the entire world.
what?
I'm making a plugin that will make the whole world a tundra.
okay
W- why do you need a plugin to do that? Aren't you bound to end up with misaligned chunks? You can easily create a world with a single biome in vanilla Minecraft.
you're creating, what is essentially a script for a one time thing.
I have my reasons.
No one owes you any support or answer. You need to respect people's time and effort to help you. You're not entitled to anything.
You asked in help-development, which most people send questions in when they're having problems with their own code, how was he supposed to know it isn't yours?
i change biome AFTER generating world
why?
changing after will mean some are teh wrong biome
just create a Generator and you create teh world... done
I'm doing an event that will make all players die after the world freezes over at the end of the server season.
like a change in the weather.
public class SingleBiomeGenerator extends ChunkGenerator {
@Override
public BiomeProvider getDefaultBiomeProvider(WorldInfo worldInfo) { // Always DESERT so no rain nor snow
return biomes;
}
BiomeProvider biomes = new BiomeProvider() {
@Override
public List<Biome> getBiomes(WorldInfo worldInfo) {
return Collections.singletonList(Biome.DESERT);
}
@Override
public Biome getBiome(WorldInfo worldInfo, int x, int y, int z) {
return Biome.DESERT;
}
};
}```
It is semantically thread safe, but the outcome is undefined. Meaning that it will produce unreliable results from time to time.
and this method will work after the chunk is generated?
its a generator so ```java
private World createWorld(String name) {
WorldCreator wc = new WorldCreator(name);
wc.generator(new SingleBiomeGenerator());
return wc.createWorld();
}```
No, this is a generator which needs to be used in the WorldCreator in order to generate a world with it.
It wont change biomes in a world afterwards.
Like Elgarl spooned ^^
you can modify teh WorldCreator to change how teh world will generate before creating the actual world
Do you want to edit an existing world? Or generate a tundra from the beginning=
I need to change at the end of the server season the whole biome (gradually) into a tundra biome so the only way I have found is to go through ALL blocks and change their biomes (or all the chunk pieces if possible)
ah
Edit the outgoing chunk packets. That way you keep the original on the server and just make the client believe he is in a different biome.
I also measure the block temperature, so it won't work.
or work but this will be harder do
I'm placing an order. It's not for me.
"snowstorm" event
for "content"
All players who enter the tundra biome will eventually die as part of the event.
like freeze
1.21.
version
and this tundra should gradually encompass the whole world.
so eh i should
change biom
this crazy yea?
yo
Its possible, but quite a tricky task. There are a few approaches to this.
- Changing Biomes as they load
- Changing Biomes over several ticks in all generated chunks (Can take hours)
- Keeping Biomes but changing outgoing packets
And some more
- using bytecode manipulation to override the getBiome method in nms to return your hardcoded value
- multi-threaded world data nbt editing
Editing nbt data on disk is such a gruesome task...
What's up
been commissioned by a microsoft guy to fetch every book and write it to a .txt on a 30gb world before
check spigot dms
Spigot dms???
forum yeh
Oh okay
Hope you didnt forget player.dats like inventories and enderchests
Was a hard requirement
The one thing I did cheap out on was utf-8 support
the lib I was using converted every chinese char to ?'s
It is what it is
guy was happy, made my money that's all that matters
I forgot to say, everything has to happen domino style. Starting with the corner of the world. Something akin to block contamination. Gradual buildup and contamination, you know what I mean.
Doesnt matter. You can use a virtual radius from the center that slowly shrinks.
And when chunks are sent to the player, you just check if its within this radius.
This goes for any of the listed methods. Its a complicated task either way. Not much we can help you with
other than some general ideas.
when chunk loads -> see if the uh
NbtIo my beloved
Well, it's always more complicated than I thought. What a life.
And then put that chunk up for processing
sorting columns by distance and then flood-filling ig?
🤔
In the queue it goes 🙂
They can be processed async
?workdistro
via chunk snapshots
kotlin coroutines my bae

I switched from using a thread pool with like 4 threads to just yeeting it all as a kotlin coroutine and got like an 8x performance improvement
scanning 350k blocks into 60k valid positions legit went from like 12 seconds to 1.5
NbtIo + DFU my beloved ❤️
And most of it is waiting for chunks to load
They use a common fork join pool i suppose?
its fine, we have virtual threads now :D

no clue
ClassCastException: class com.sk89q.worldedit.bukkit.BukkitPlayer cannot be cast to class com.sk89q.worldedit.bukkit.BukkitPlayer
am I facing classloading issues 🤔
I need to look into that for sure. I havent been excited for new language features since v17
Should probably play around with the new features
haha yea sadly the structured concurrency api is still in preview iirc
:,) but yea its cool
worth checking out ^^
Relocation might work...
I'm not shading it
java.lang.ClassCastException: class com.sk89q.worldedit.bukkit.BukkitPlayer cannot be cast to class com.sk89q.worldedit.bukkit.BukkitPlayer (com.sk89q.worldedit.bukkit.BukkitPlayer is in unnamed module of loader 'FastAsyncWorldEdit-Bukkit-2.8.4.jar' @3e143bfc; com.sk89q.worldedit.bukkit.BukkitPlayer is in unnamed module of loader 'FastAsyncWorldEdit-Bukkit-2.8.4.jar' @37b31548)
different hashes but same jar
loaded twice it seems like
unless my boy updated fawe and /reloaded which is highly unlikely
Thats usually an (I shaded FAWE into my plugin)
it's genius.
Did /reload on a live or test server? 👀
If live then ... yeah

I forgot what is the name of the list for async which gets the first element and removes it from the list
Queue?
ConcurrentLinkedQueue?
gut punch
oh yes
my boy
standard worldedit works fine
Hey guys, I'm working on a BungeeCord Plugin wich registers a command /msg ... it interferes with the /msg command implemented by Minecraft. Is there a way to override the default command with the Proxy command? I tried to disable it in the commands.yml, but it didn't fix my problem 😐
Workaround would be to create a spigot plugin and register this command to execute the proxy command... but there must be a better way to achieve this isn't it?
is there any minecraft block that accepts redstone signal, causes block update, but doesnt transmit signal by itself?
something like a bell block but not as fucking loud 😄
target?
actually targets have the opposite effect
hm
I'm thinking fence gates / powered rails
redstone lamp?
i've tried but im missing something, im learning redstone a bit, so im trying to power a piston using quasi-connectivity, but weirdly enough some blocks like bell power the piston, even if it doesnt transmit redstone, well because it updates the neighbouring piston, and some blocks like redstone lamps power on but do not update piston
learning quasi-connectivity is kinda weird
a redstone torch on the side of a block will trigger the piston
power teh block its on
cant use it since im powering a redstone line at that space
Usually, if the command has been registered properly on bungee, the chat packet from the player won't be passed through to the spigot server
Hence the bungee commands won't display an "unknown command" message besides what they are doing
it is
lord have mercy, using a chain of dependencies now reloading a plugin of mine might reload up to 4 plugins
what in the heavens
whelp also I think I broke it due to calling it from inside of a shaded core lib
oh wait
no, it should be right
yeah it doesn't work
well this sucks
I have the same shaded core lib on two plugins and throwing an event from the core lib of one of the plugins doesn't seem to allow the other plugin to detect it even though I have the plugin as provided scope in the pom dependency
well I'm annoyed but not surprised