#help-development
1 messages · Page 1159 of 1
I got it from my personal stash lol
for anyone who isn't good at reverse image search, just use https://imgops.com/ btw
Useful collection of online image tools that you can launch directly for any web image.
goated site
you're good at being the inventories person
Well I'm not even good at that :<
except for that one method
I want to commit it's removal to post soft spoon [redacted] for closure
🫂
Has to do with titles
Ah
I cannot seem to reproduce this issue I am having. I already tried the other sqlite driver as suggested here. I cannot even produce it spamming /sethome and other commands, trying to log off at awkward times, etc.... but the database doesn't fail.
It only fails after the plugin has been running for a few hours with databases being locked:
Caused by: org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)
Even trying to repoduce events leading up to this issues are proving inadequate. Anyone have suggestions on how I can debug? Its so annoying that it works for awhile and then it just doesn't.
But it’s useful :(
Useful but brakey
If Mojang removes that quirk I’ll just tell my contact to tell their contact to revert it
I may have a legitimate use case for getTitle actually
text width for font fuckerisation
maybe if there was an option to change the displayed title in an event, or a method to reopen the inventory with a new title
that'd be super
I'm looking into that for inventory pr component 4
Dw!!
Player#openInventory(Inventory, String)
Sorry, HumanEntity
because ???
abstraction over a class that doesn't exist on the server even
truly a bukkit moment
It seems to occur with specific commands, ex /sethome and /rank .. but others work like /home and /spawn all using databases. Could it be beacuse I am doing it like this?
String insertUsername = "INSERT OR IGNORE INTO homes (username) VALUES ('" + name + "')";
String insertX = "UPDATE homes SET x=" + x + " WHERE username='" + name +"'";
String insertY = "UPDATE homes SET y=" + y + " WHERE username='" + name +"'";
String insertZ = "UPDATE homes SET z=" + z + " WHERE username='" + name +"'";
String insertPitch = "UPDATE homes SET pitch=" + pitch + " WHERE username='" + name +"'";
String insertYaw = "UPDATE homes SET yaw=" + yaw + " WHERE username='" + name +"'";
statement.addBatch(insertUsername);
statement.addBatch(insertX);
statement.addBatch(insertY);
statement.addBatch(insertZ);
statement.addBatch(insertPitch);
statement.addBatch(insertYaw);
statement.executeBatch();
Why does this work for a few hours but then not?
shit I love that one
This made me laugh
Me when /sethome DROP ALL TABLES
Okay but this doesn't help explain why my program is not working after a few hours. Is it not using prepared statements.. also, it says sqlite is BUSY not cannot find table
You need to close statements and connections
I did close connections on everything
In sqlite you can have one connection iirc
Your db still is locked check for a lock file or another program which is using it
This can happen if your server doesn't fully close
I should have known to close statements -_- ... I am new to this ;-;
Thats likely why it fails after a few hours
Also use PreparedStatments
String insertUsername = "INSERT OR IGNORE INTO homes (username) VALUES (?)";
try (PreparedStatement psInsertUsername = connection.prepareStatement(insertUsername)) {
psInsertUsername.setString(1, name);
psInsertUsername.executeUpdate();
}
String updateHomes = "UPDATE homes SET x = ?, y = ?, z = ?, pitch = ?, yaw = ? WHERE username = ?";
try (PreparedStatement psUpdateHomes = connection.prepareStatement(updateHomes)) {
psUpdateHomes.setDouble(1, x);
psUpdateHomes.setDouble(2, y);
psUpdateHomes.setDouble(3, z);
psUpdateHomes.setFloat(4, pitch);
psUpdateHomes.setFloat(5, yaw);
psUpdateHomes.setString(6, name);
psUpdateHomes.executeUpdate();
}
Like this?
(and obv I got all the try catch statements, one set to try to close the connection)
Why isn't that one statement, I don't understand 
Or are those two separate blocks of code, you just joined them together into one snippet?
Seperate blocks, I should probably use pastebin or something.
No no that's fine, I'm just throwing myself into this conversation with no context haha
If they're separate, it's fine
Yep! I am new to databases.. just trying to figure out why it works for about 4 hours and then returns that its busy later on 😅
Its just probably my execution of it
As long as your connections themselves are getting closed, you're okay
You could do that with a finally statement at the end if you'd like
Or throw it too into your try with resources
try (Connection connection = getConnection();
PreparedStatement statement = connection.prepareStatement(string)) {
// Do stuff
}
Format however you'd please
finally {
if (connection != null) {
try {
connection.close();
} catch (SQLException e) {
e.printStackTrace(); // Handle exception
}
}
}
Which I got at the end. I think I fixed it, I was executing in batches before which turns out is probably a janky and not safe way to do it. Whether that's the problem or not, either way atleast I made my code better 🥲 ... will push the update and see if it works. I only code for my small university community so its not a huge deal if it doesn't work again after time, I have lots of ways to remedy any issues.
If you're adding multiple homes in a single method call then batches are fine, but prepared statements do actually have a way to add and dispatch batches
(see the Statement#addBatch() method)
You can prepare multiple queries (the same query string, different parameters) and it will send them all together in a single batch
Yeah, I feel like that might have caused my sqlite exceptions last time ... it was specifically for any method that ran in batches. as I have said, they worked great for many hours after the sevrer started, but eventually they stop working. I am guessing it had something to do with memory or threading... Tried a different database driver but that didn't fix it.. so heres hoping using try with resources solves it
you have to remember to setAutoCommit to false
Also, if you don't like the single connection nature of sqlite, you'd want to enable WAL journal mode, with a NORMAL synch mode preferably as well as a multithreaded threading mode
Well sqlite doesnt have a connection. Its a file handle.
are you able to do IoC in any way with a plugin, like with the spring framework?
Its not
I don't see why not, however I must ask, why
bloating your plugin with something like spring doesn't sound like a good idea
💀
say bye bye to the persistence part of the java persistence API
one power outage and your data is gone
Minor issue in my opinion lol
yeah i don't literally mean add spring. i like doing ports and adapters and spring IoC makes that really easy. was curious if there was a pattern people lean into with plugins
I dont mean this
I know what you mean, but that's the dumb way of doing it
when sqlite has the feature by default
Lol
plugins are rather simple programs for the most part, they don't require of complex object dependency graphs, so you won't really see such a pattern being applied much
at best, you'll see some plugins playing around with guice
if you want one plugin to have the capability to swap between multiple persistence implementations, say flat file, mysql, and mongodb (depending on the user's needs), how would a plugin handle swapping those kinds of implementations?
like a factory maybe?
Hikari doesn’t support mongo :p
eh, not a big deal considering how not popular mongo is for plugin dev
you could make an interface with the interaction methods and then each storage impl has its class with interaction stuff
Anyway, make an interface for your database access and have different implementations for each option
it used to be at some point, don't know what happened with it now
sniped

Then just pick the right implementation based on what the user selects
in like a config?
yeah
if the plugin even allows it, since supporting multiple database options means having to dynamically download, or shade in a bunch of sql drivers
cough libraries feature
neither is a good option since the average plugin dev doesn't find this to be trivial enough for it to be sensible
you can't conditionally load libraries
load them anyway, or use something like libby
while it wouldn't be much of an issue to just load the ones you support, it is eh
still as said, the vast majority of plugins will just stick to one solution rather than providing the choice
yea
it'd be interesting to see more IoC in plugin dev, but due to the fact that there's a huge percentage that starts out in plugin dev, they find things like Spring rather daunting
besides, Spigot/Paper as a platform covers one pretty well, that for the longest time people would rather use yaml configs as storage rather than well, an actual persistence solution
"shade in a bunch of sql drivers" - what does it mean to 'shade in'?
include them inside your jar
uber/fat jar
ahhh
Spigot already has MySQL and SQLite drivers
for better or worse
at least we don't have some old ahh version of ebean around anymore
i remember when spigot updated the one sqlite driver and it broke hibernate
i assume it's impossible, but is there any way to generate a client-like render from some position on the server side?
that's mb
i just thought again and i was being stupid lmao
i was trying to generate a render of the world from a pseudo-client from the server side
that makes no sense tho
im dumb
You could do like a buttload of ray traces to get what blocks the fake client would see
Other than that not really
didnt cmarco do that shi
render the faces it traces with
basically you just need to know the camera position, fov and all of that
wouldn't it be an issue with transparents and stuff though?
like i don't want to put the whole minecraft rendering pipeline into a plugin
yeah gl with that
i think this was just a bad idea from the start lol
for (int i = (number == 100 ? number : 0); (number == 100 ? i >= 0 : i <= 100); i += (number == 100 ? -1 : 1)) System.out.println(i);
}``` i hope this is okay
So if the number is 100 it counts down and if the number is 0 it counts up...?
yeah... Magic 🪄
Bros allergic to if statements
why would you do this
i would discipline you for this, if you worked for me
Idk if I'd bother even disciplining probably straight to the can
depends on if he got a signing bonus
public static IntStream countDynamic(int start, int end) {
var actualStart = Math.min(start, end);
var actualEnd = Math.max(start, end);
return IntStream.rangeClosed(actualStart, actualEnd)
.map(i -> start > end ? (actualStart + actualEnd - i) : i);
// or without making end configurable
private static final int END = 100;
public static IntStream countDynamic(int start) {
if (start > END)
throw new IllegalStateException("start exceeded the end, end: " + END);
return IntStream.rangeClosed(0, END)
.map(i -> start == END ? (END - i) : i);
}
countDynamic(0, 100).forEach(System.out::println);
countDynamic(100).forEach(System.out::println); // countdown since we start at 100
for (int i = 1; i <= 100; i++) {
System.out.println(i);
}```
you've made 2 lines of code into 10
congratulations
Does anyone know how to create a respawn packet in 1.20.6 using protocolLib? The old way of doing, using the internal structure, doesn't work anymore.
?xy
There is no problem, im just asking if anyone found a way to create a respawn packet in 1.20.6 using ProtocolLib.
This is the only post ive been able to find so far, https://github.com/dmulloy2/ProtocolLib/issues/3108
Why though?
It's to change the skin of the player. Its been the way ive been refreshing the players skin once the game profile is modified.
Lol 😵, i maybe should yea.
I normally copy over the same gradle every time i create a new plugin. But the gradle i copy over is a few years ols now
simulate a world change maybe
altho it might be more complicated than it sounds
Like teleport them to a different world and back?
no, with packets
change their world but it's the same world
something like what bungee does
it triggers a load screen which i think should update the client's game profile
How to send message to player in action bar ???
player.spigot.sendmessage chatmessagetype.actionbar message
It's not work for me, i use 1.21
show code
Sry i dont have code for the moment
Then how do you know it doesn't work for you ? 🤔
oh yeah i forgot
message has to be new TextComponent(message)
i assume action bar doesn't use hover/click events
Yeah they're just ignored when present
Hello, how could I put data in a block ? I tried using metadata but they are gone after a restart, and PDC are not available in 1.12.2 (version i work with and can't change)
NBTAPI maybe
Idk if it exists for 1.12.2
I tried, it exist for 1.12.2 but only for items, blocks are not available before 1.14 i think it was
Not certain of what version NBTAPI has NBTBLOCK working, but not 1.12.2
use a database of your own
it's the best way to handle it
I was thinking of it but idk for some reason im unsure, for example a player use WE to replace a block, or fill command, the block wont be known as destroyed so i cant really handle it can I ?
if a block has changed state you could invalidate data
and run a purge every so often
Okay, thanks
Assuming you save on chunk unload you can just block check the state there
Blocks dont have pdc?
Even in newer versions
Use chunk NBT to store data in blocks
TileEntities do have NBT but that's just a small amount of blocks
but I do believe you need to mess with NMS to get it to save properly and even then loading will be a problem
so storing it in your own database is the best option
so that means even on newer versions WE caused state changes won't reflect in the pdc
It does
It probably leaves some dead tags in the nbt
Could give it a try and see
anyone knw why its not js blocking for more data
public static int readVarIntFromStream(InputStream stream) throws IOException {
return readVarInt(() -> {
int r = stream.read();
int t = 4;
while (r == -1 && t > 0) {
r = stream.read();
t--;
}
if (r == -1) {
throw new IllegalArgumentException("Unexpected end of stream while reading var int");
}
return r;
});
}
``` ive tried adding retries as u can see here
end of stream means end of stream
no amount of retries is gonna make new data appear
ok so this means the connection was closed
or what
bc it should block for data if the socket is open
interesting
could be some concurrency shit that im like closing the connection myself but after i check whether its open on the read thread
unless mc servers sometimes just close connections without a packet
a connection can indeed close without a packet
i mean in normal operation of a minecraft server specifically but ye
yes its routine, players make it happen all the time
oh
if you close the client via the x button or task manager, the server closes the connection after a period of not receiving anything back
sometimes routes die that the connection was using, and you won't get packets for that either
im confused bc its happening randomly somtimes while connected to hypixel, also like never after the same amount of time or anything
you could have a flaky route
i feel like something in my protocol impl could be fucking it up but idk
try changing your dns servers to something else to see if you can force a different route for connection
it connects fine on a normal client tho
oh well it could very well be your implementation then lol
only difference is that im using std sockets not netty
shouldn't make a difference really as long as you are sending those heart beat packets at the appropriate times
hm
not only do you have to send a keep alive packet but you need to respond to the servers keep alive as well
oh wait
i think im only responding to server keepalives rn
not sending my own
yeah im only doing this i dont think i saw anywhere that i needed to send my own heartbeats on the wiki.vg
might just be blind tho
but I think there is a couple of other packets that get sent too
might want to go through them to see which ones need to be sent routinely
and you are right, seems it change maybe but you only need to respond to the packet
but you only have 15 seconds to do so
otherwise server dc's you and if the client doesn't receive one in 20 seconds the client dc's
ye i do it as soon as its received so im pretty sure thats not it
im on 1.8.8 ver of the protocol btw
so maybe i do have to send them frequentyl
not sure why i decided to implement protocol 47 it has some weird choices of field types and shit
wonder if this it or what they changed it to
oh wait
dude this shits so confusing because ive also ran it for like 10 minutes without issues multiple times
its just completely random
well, try sending that packet every so often
forgot about that one
server sends a ping packet as well lol
where do i find spigot devs 😭
Have you looked in the closet?
there's a section on the forums
I have some laying around in my basement if you want one
I'm in the closet
why are these not the same when i compare them ```
Location{world=CraftWorld{name=world},x=-90.0,y=-59.0,z=-15.0,pitch=0.0,yaw=0.0}
Location{world=CraftWorld{name=world},x=-90.0,y=-59.0,z=-15.0,pitch=0.0,yaw=0.0}
too long do it for me
are you comparing with == or .equals?
==
bruh
does it make a difference here?
yes
== is checkign instance
ah
Is bro making a gambling plugin
yea
Great 👍

code for me 🥺
What are you onto
me?
ye
wdym
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
is a hashmap as or almost as fast as direct access?
:(
Hi, someone asked for a refund saying he did not download the plugin. Is there a way of verifying if they downloaded the jar?
Not even close
You have to go through the hash function than it's O(N) over the linked list if there are any conflicts
Hash functions themselves could be O(N) or greater
okay, is there an average speed difference?
no
No it's entirely dependent on the given hash function
depends entirely on your map load, the speed of hashCode() and yea, collision
okay
If you have a bad hash function your map will be slower
is the auto generated one bad?
No it's pretty good
okay
In some cases a for loop is actually faster than a hashmap 🫡
how many elements in the for loop?
Depends 💯
ok
Don't design for speed though design for best practice
Unless you're working in embedded systems such thoughts aren't necessary
Considering you're not using C on a low level system any performance gains you get by these micro optimizations aren't worth while
i heard java was pretty fast nowadays and in some cases close to languages like c++
so its still probably worth it
seems worth it 💯
Go run jmh on it you'll hate yourself
jmh?
https://openjdk.org/projects/code-tools/jmh. Contribute to openjdk/jmh development by creating an account on GitHub.
Don't overcomplicate things
Design a good api
If it's slow to a detrement fix it later
Computers are stupid fast take advantage of that by prioritizing dev UX over computational speed
ok
You will find chatty / unoptimized use of persistence usually far most impacting to performance
Async profiler can make some cool flamegraphs for you to see the distribution of cpu samples
language doesn't matter when it comes to performance
it does
it does not, the only place where it may matter is embedded systems since you have to save every bit you can
other than that, modern hardware has pushed the performance boundary to memory-bound operations, so in the end it only matters how efficiently you can store data to get as much cache hits as you can
you can argue that in the grand scheme of things, languages like Java might make that harder considering the Object header is like 76 bytes, however it makes up by leveraging the flattening as well as techniques to avoid fragmentation to the GC
so in the end, it truly doesn't matter
The game?
is 1.21.2 safe to run?
No you’ll get hacked
It will make your cooker explode
not the cooker
Hi, i was ask. I have ClearLagg i want add with items adder. Config - 'time:400 msg:&4 %img_serverlogo% &cWarning Ground items will be removed in &7+remaining &cseconds!' i want this img_serverlogo as a rank prefix?
and its work?
yeah bc I remeberd that game teaching how to slave farmers
clearlagg is useless anyways
but you would have to use a resource pack if you arent already
also please try using something like google translate or some AI to make coherent sentences
not to hate but its hard to help when I dont really know what you mean
@worldly ingot as you look online ^
So you give me 100 grand and I give you 15k back?
they meant to say give me 15k
Does someone know how to modify TagKey's from Minecraft via code ? or at least where the data from the tags are stored (in code)?
hey, does anyone have any helpful code that will help me create an npc using mns for version 1.21.1?
do you start from scratch or know how nms and os on works ?
I'm new to nms and I need a little help. I saw a guide on spigot 1.14.1 on how to create an npc using nms, but it doesn't work on version 1.21.1.
in the newer version you need to create a new entity type and register it.... and i think i modified packets to send packets directly for the player for the npc
I recommend you just use Citizens
Hey guys, is editing item meta broken?
I have this
item.editMeta(meta -> PhoneKey.PHONE_INSTANCE.set(meta, phone));
set just does this
default <T> void set(@Nullable PersistentDataHolder holder, T value) {
if (holder != null) {
PersistentDataType<Object, T> type = this.getType();
holder.getPersistentDataContainer().set(this.getNamespace(), type, value);
}
}
And it was working fine yesterday, the meta/pdc was being updated, but today it doesn't work, afaik the code wasn't changed
If I debug Phone#getNumber() before and after, it is changed successfully but the pdc isnt changing anymore
Is this like an unstable api?
?whereami
How can I disable shif clicking items into an invventory
cancelling the event doesnt seem to cover this case
inserting items manually doesn't get placed and the message fires
but not shift clicking
Inventory holders 🔫
Also the clicked inventory won't be yours since they're clicking the player inventory
is this not a spigot method?
oh // Paper start
paper really deprecates some pretty nice methods that work on spigot and then introduces broken methods
nice
/j
Hello, did you know how to get tag in the new data system 1.21 ? I try to get a new registered enchantment with NMS and i need to get the enchantment on an item, all spigot/bukkit methods to verify enchantments use the base minecraft registery, so i want to verify by the data component item.
net.minecraft.server.v1_21_R1 doesn't exist, CraftItemStack.asNMSCopy(itemStack); return net.minecraft.world.item.ItemStack
NBTTagCompound doesn't exist anymore too. (Logic 🤓 )
Could just load a datapack
to register your enchantment
@worldly ingot do you have any tips to to deal with patch merge conflicts I'm like dying from skill issues out here
No need to modify the internals
Patch merge conflicts are always annoying tbh. There's really no great way to clean them up lol
Choco should join the NDG team
I mean I tried to just ONLY take the patches from master, but I get application errors then 😭. But if I just checkout master and apply it works fine I'm so confused
I feel like I'm clearly just not taking the master patch
Yeah, way I do it is basically just delete the patches I've generated (i.e. if there are any new ones, discard them), merge in master and make sure the patches align with the master branch, apply patches so you have the newest source, then re-make your changes and regenerate your patches
well with how little diff their is I feel like their has to be a way to automatically do it no? I mean I could manually redo the patches, but I can't even get that far right now
You're probably just not doing an applyPatches after you pull in the master patches
I do, but I end up getting malformed patches for the ones I've changed
I just have to delete them before merge ig like you said
Yeah
is their seriously no tool for merging patches though?
There is no patch patcher
sadge :(
What can I use to permanently set 64 lapis lazuli in the enchantment table
InventoryOpenEvent probably
And the close event to remove it, otherwise it will be given to the player
Hey how can i get a hotkey like the SwapHandItems
What
You can't add keybinds
no
i know only mods
But I can still get which one the player has occupied. So what he put sprinting on or something like that
Well
Ah ok
We’ll have an input api soon™️
👍 I like it
you gonna do that??
but I know that from other servers that show my hotkey and like F for changing item to off hand so that doesn't work yet?
If you want to show the keybind in text you can do that
That's part of Minecrafts text component system
ah ok do you have a documentation then I can take a look at it and found nothing.
net.md_5.bungee.api.chat.Keybinds and
https://www.spigotmc.org/wiki/the-chat-component-api/#keybindcomponent
md_5 is doing it ig
ah that
Not quite the same as what they were asking for
why does my code run faster if there are print statements and its slower if there arent?
im sending 1 million packets per test, when i print the number received and number sent, it takes 4700ms, but without prints it takes 6100ms? I've ran it multiple times
shouldnt it be harder for my pc to also print to console?
The time can vary depending on background tasks that your system has running
Everything is fine, I think I expressed myself a bit unclearly
im running the tests one after another
At least you should be able to make a nice double jump now
Without relying on flight
tested it again same result
has this something to do with my cpu cache
World's most useful packet
@Override
public void handleBundleItemSelectedPacket(ServerboundSelectBundleItemPacket serverboundSelectBundleItemPacket) {
this.player.containerMenu.setSelectedBundleItemIndex(serverboundSelectBundleItemPacket.slotId(), serverboundSelectBundleItemPacket.selectedItemIndex());
}```
no event for selection items ig, well maybe actually I didn't realize you have the player in this class
have you fixed ur checkstyles yet
or merged the pr
bundle packet is managed async 👀
pain
this must be new [16:26:21] [Server thread/INFO]: Server empty for 60 seconds, pausing
Aren’t all packets managed async
no
they are all sent and recieved asynchronously but not all process asynchronously
only packets with PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinteleportaccept, this, this.player.serverLevel()); are forced async afaik
seems like This is gonna take more than one brancell to figure out
I can lend you one, but I want it back
Hello, I have this error with ProtocolLib. Anyone knows how to solve it ? Thanks.
here is the code:
public static void sendCooldownPacket(Player player, Material material, int cooldownTicks) {
try {
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.SET_COOLDOWN); // Use PacketType instead of int
packet.getIntegers().write(0, material.getId()); // Item ID
packet.getIntegers().write(1, cooldownTicks); // Cooldown Ticks
protocolManager.sendServerPacket(player, packet);
} catch (Exception e) {
e.printStackTrace();
}
}
1.9.4 wild ah release
i tried using this packet: https://wiki.vg/Protocol#Set_Cooldown
ye
That's how the packet looks in 1.21
ah
Check the 1.9.4 version
@young knoll This is wild but you can actually get a packet on hover for bundle
Or just use your IDE and see what the packet contains
which means you could technically have an ItemHoverEvent that only works for the bundle
very strange but very awesome
Ah, not as cool
yeah very not as cool :(
But a gui button that can be scrolled through for more options is kinda neat
yeah we'll def have an event to do that, what I find weird though is how I'm still getting -1 xD
I put it in an if statement that excluded that
ooh wait that'd be fucking epic
I think taking stuff out of bundles might be client side
gotta double check the full server but the code is like never used
its the same in 1.9.4 tho ( i think )
https://wiki.vg/index.php?title=Protocol&oldid=7959#Set_Cooldown
why are you using 1.9.4 anyway
bc i want to make a freebuild server working only between 1.9.4 and 1.11
to have only blocks in these version
and honestly
crazy fucking versions
What did modern blocks do to you
i wouldnt be able to survive without concrete
I wouldn't be able to survive with F3+F4 anyway
when did they add taht again
1.19?
atleast 2 weeks ago
i dont like them tbh
Bullying the waxed lightly weathered cut copper stairs
4.5 years ago
hater fr
"I don't like them" Don't use them tehn
like you have a choice you know
no one is going to kill you if you don't
is stupid
is solving this error
Too old! (Click the link to get the exact time)
almost the same
bro what
were u not here or smth for 1.8 because how could you mistake 1.9.4 for 1.8.8
is 1.9.4 outdated?
LOL
clearly there needs to be a 1.9.4 command
your comment suggests that 1.9.4 is somehow the current version
@ phoenix616 make howoldisminecraft194.today
maybe I live in an alternate universe
of course you do
1.9.4 is very far from the current version
but I couldn't ever see someone mistaking 1.9.4 for the 1.8.8 command and site
right so your argument is moot on whatever point you were trying to make in regards to 1.8
like that was just too iconic to forget
i love playing on that random version like people on 1.20.1 still
girl shut the fuck up
legit the point wasn't that 1.9.4 is new or supported
it's that 1.8.8 and 1.9.4 are not the same
they are both outdated
yeah I think rad knew that kekw
are you lacking reading comprehension
"almost the same"
not sure why you are trying your hardest here to win this finite detail argument
there is no 1.9.4 site so they send the 1.8 site as they were released at similar times
Hey what's so bad about 1.15.2
1.7 was my favorite
no it was moreso that they did ?1.9 as if to send the 1.8.8 site (as in they thought that 1.9 was 1.8.8)
but whatever not important
1.7 is now older than @cedar saffron
no I didn't lmfao
im older then minecraft
shame he was born in the wrong time period
well that is what it looked like
Buddy you're 8 years old
apologies then boy
im 15 but ight
lies
don't apologize to me just don't be an ass lmfao
apologize, boy
my tiny joke remark about how you could possibly mistake the two was not being an ass
i love 1.8.2 and 1.16.2
frost just had to come in and yap
indeed
@young knoll it honestly doesn't seem like this event is cancellable 😭
stfu dominick 🗣️ 🔥 ‼️
cuz its async
its the equivalent of coming in and slapping someone in the face
frost is amazing!
im not sure that mine was somehow slapping Y2K but okay
like I would say that in front of his face if he made that mistake in front of me
anyone ?
deadass
We just need a ?howold
and then I would apologize if he told me that I was wrong in thinking he meant 1.9 was 1.8
deadass x2
no, my comments towards you lol
With a site that shows how old each version is live
oh yes that is what it felt like
?outdated honestly
just stay away from the js and you should be fine
x.x.x.minecraftishowold.today?
Can you do a live timer without js
1.9.4.minecraftishowold.today?
hell yeah
that's one domain and easy af to program
can probably do it with just nginx
kekw
if we still had adobe yes 😦
Minecraft 1.21.2 released about 11 hours ago! Happy Birthday! 🥳
Minecraft 1.9.4 released about 8 years ago!
@young knoll do you have permissions to add CCs
if so
please
if you took an extra minute or two I would've been convinced you just spun that up
also lmfao today 1.21.2 birthday
i only found it out this way
radstevee definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.
cba has no args
tbf that's not an arg
im not sure that it does args, it could* match spaces though
cba just uses ur name
ah
md_5
This bot is an instance of Red, an open source Discord bot created by Twentysix and improved by many.
Red is backed by a passionate community who contributes and creates content for everyone to enjoy. Join us today and help us improve!
(c) Cog Creators
?howold 1.20.4
?howold 1.9.4
yay
coll magician
?howold urmom
lmao
Now someone find the author of that website and make them add embeds
@drowsy ginkgo I assume
@young knoll there's also https://howoldisminecraft.today/1.20
Minecraft 1.20 is 1 year, 4 months old.
@young knoll I have a very lame discovery., Seems like bundles are mostly client sided
i cant find any whois for it
1.12.2 is undoubtly the best version out there
shut the fuck up feist
but yea this ones better
No u
Minecraft 1.16.4 is 3 years, 11 months old.
W coll
Minecraft 1.0 is 12 years, 11 months old.
?howold infdev
We don't need that command it's only annoying
You#re annoying with saying 1.12 is the best version
Can't wait to see idiots spamming ?howold 1.12.2
I can't wait to do that to you!
?howold 1.12.2
Minecraft 1.12.2 is 7 years, 1 month old.
Gonna be spamming that into your fucking face
If someone of you spams ?howold 1.12.2 fuck you
its 7 years old!
Dang that’s almost as old as epic
7 years old and still the best, what an achievement!
no thats neon
can confirm miles is above TOS age
Probably scrapes from versions json
I'll now once in a while regex the discord chat through with ?howoldis just to write a message recommending to use 1.12.2 for everyone that wanted to make it look bad by typing that command
guess it don't work
Check the piston meta
?howold b1.2
Minecraft Beta b1.2 is 13 years, 9 months old.
Nice
Minecraft Beta b1.0 is 13 years, 10 months old.
cant believe 1.0 is 5 years older than neon
Minecraft Alpha rd-132211 is 15 years, 5 months old.
does it do snapshots
?howold 15w37a
Minecraft Snapshot 15w37a is 9 years, 1 month old.
Yes
?howold 1.21.2-pre3
Minecraft Snapshot 1.21.2-pre3 is 1 week, 4 days old.
?howold 24w39a
Minecraft Snapshot 24w39a is 3 weeks, 6 days old.
?howold
Syntax: ?howold <text_final>
Created via the CustomCom cog. See ?customcom for more details.
?howold 1.21.2
?howold 1.8
yooo also 10 years now
?howold choco
The world may never know
younger than 33
does anyone know how to calculate the number of characters before a TextDisplay cuts to the next line?
For ex. my text display lineWidth is set to 300, but the display cuts off characters well before 300 characters are in the line
the javadocs are the poorest for display entities, so there's also no infomation on what set/getLineWidth does
I believe that is 300px and if so, there's not a good/consistent way because clients can use different fonts with different character widths
Wiki also just says this: line_width: Maximum line width used to split lines (note: new line can be also added with \n characters). Defaults to 200.
for context im trying to get centered text along with text that's aligned to the left
so like
Some Cool Text!
- Hello World
- Hello Minecraft
etc
if that's rendered by the client that seems pretty impossible to do that if Some Cool Text! changes from string to string
You could do it like this but keep in mind that this assumes the font the client uses:
- append your centered text
- append newline
- append your text to be left aligned
- append
(maxWidth - widthOf(leftAlignedText) / widthOf(" ")spaces (pseudocode)
Or, if you're already using a resource pack, you can use The negative space font to add a spacing of n pixels
the plugin i am developer runs on a server that requires a resource pack, which i can freely modify. is that something i can combine with this?
i didnt fully understand this, could you elaborate a bit more?
sure, along with a copy of the vanilla font so you're sure the widths are the same
what part didn't you understand?
appending centered text? how do i do that if i dont know how many pixels to centre it in
Oh it's just centered by default
oh so you mean the text display's alignment?
Yeah
I mean to be honest tho
I'd just use multiple text displays with diff alignments
(I just found out about them lmao)
finna be a nightmare with what im trying to do, but thanks, i'll look into it
but just a quick question, if everyone is using the same resourcepack, will the pixel width still be the same?
or is that affected by client GUI components?
Sure if you're changing the texts font (Not possible in the Spigot API for text displays, will have to use NMS)
does that require the resource pack integrating what you sent above?
or all using the same texturepack is enough
Not necessarily
so everyone using the same resource pack is enough to have the manual width calculations be consistent with everyone? such that my 100px is everyone else's 100px?
I just meant that the font will have the same widths of characters and that people don't override it
so if i want consistent widths then my resourcepack must integrate what you sent above?
Hey, that might be really dumb but for some reason, I can't put an item in a chest, i debugged and it's technically supposed to have an item in it, but it doesn't.
Here is the code and the debug in the console :
public static void chestFill() {
Location location = new Location(Bukkit.getWorld("world"), -17, 62, -5);
Block block = location.getBlock();
block.setType(Material.CHEST);
Bukkit.getScheduler().runTaskLater(MyBattle.getInstance(), () -> {
if (block.getState() instanceof Chest) {
Chest chest = (Chest) block.getState();
Inventory chestInventory = chest.getBlockInventory();
// Créer un ItemStack avec les informations de l'objet que tu veux placer
ItemStack itemStack = new ItemStack(Material.DIAMOND_SWORD, 1);
// Placer l'objet dans l'inventaire du coffre
chestInventory.setItem(0, itemStack);
// Mettre à jour l'état du coffre
chest.update(true);
Bukkit.getLogger().info("Chest has been filled with a diamond sword.");
} else {
Bukkit.getLogger().severe("The block at x=" + location.getBlockX() + " y=" + location.getBlockY() + " z=" + location.getBlockZ() + " is not a chest.");
}
}, 1L);
}
[01:31:44 INFO]: Chest has been filled with a diamond sword.
Nope
Remove chest.update
Okay thanks ! But why does update make it not work ? 😅
is there a way to prevent players from tabbing in chat to see the players online
Not unless you hide the players from the client
The client is aware of all online players
getBlockInventory returns the live chest inventory
I guess just hide all players and put no header/footer :D
The update method overrides the chest with whatever it contained when the snapshot was made
oooh
Yeah I don't think you can remove name suggestions. That's all client-driven. No server communication there
thank you !
doesnt hypixel do it
I believe there is a getSnapshotInventory if you want to use the update method
what if I modify the packets that are sent to the client regarding the player's name
None are sent
The client has a list of all online players. It just knows about them
The way they know is with the add player packet lol
As long as they exist in the world to the client, their name can be tab completed
Modify every add player packet to report the players name as poopbutt
hypixel does do it somehow
you cant queue a bedwars game and tab to find player names
Oh, that's because we hide the players themselves lol
The players themselves have fake profiles, basically
(not leaking anything, that's just literally the only way that can work)
They have custom skins and their names are random
I mean yeah basically
with the player's skin and the jumbled name, copying their movements
Well an NPC is just a player that doesn't move, cause there's no associated server-sided player
These are players, their game profile is just swapped with some other game profile on the client
They are moving
They're normal players. When the players are added on the client, their profile is just changed. That's all
I see
The player is still mirroring a real player, they just have their name and skin changed
Basically listen to this outgoing packet and if the action is "add player", change the profile property
and then at the start of the game you have to reset their profiles
Yes. You have to remove those profiles and re-add the regular ones
(there's a player info remove packet)
Does the skin have to be signed
I believe so but that's not hard to do. You can get it from Mineskin
Yeah
I think we just have one skin that's signed and reused
No it's a black skin with a question mark on its head I think lol
Aww, Boring
I will be sure to bring up internally: Change the skins to cat maids
Excellent
I made a system where the player loses redstone when he gets hit, but there is a problem with pvp, it also gives redstone in closed areas
wait hypixel has bedwars games in seperate spigot servers than the lobby whereas my stuff is all running on the same spigot server so it doesn't send an add player packet when changing worlds
I have an idea
You can manually send packets
In this case send a remove and then another add
Or just hidePlayer and showPlayer which should do the same
I think theres a way around that
Are you gonna put ur maid skin back on
does it
there's no way they have a separate server for each arena, they have a ton of them
most likely like x amount for each server rather, but I wouldn't know
no they have about 5 or so lobbies running on a server, and maybe like 30 bedwars arenas running on one server, etc
those numbers are guesses
I am always amazed at how they have a well-built archquitecture behind it yet bedwars is the one gamemode where lag is a constant lol
goes to show just how MC isn't made for that kind of scale I guess
Skyblock:
well, skyblock is more understandable with all the farms and shit
bedwars shouldn't be an expensive game to run
fr when is hytale coming
Funny
[11:49:51 INFO]: UUID of player BuckyBallsTV is 4fc626ce-f01a-4312-ab11-2eeed4a0cdf3
[11:49:51 INFO]: Player join event: CraftPlayer{name=BuckyBallsTV} Location{world=CraftWorld{name=lobby},x=2.4291644106742267,y=99.0,z=26.19026505980617,pitch=53.849976,yaw=-270.74948}
[11:49:51 INFO]: action: ADD_PLAYER
[11:49:51 INFO]: [PlayerInfoData[latency=0, gameMode=ADVENTURE, profile=com.mojang.authlib.GameProfile@2e707093[id=4fc626ce-f01a-4312-ab11-2eeed4a0cdf3,name=BuckyBallsTV,properties={textures=[com.mojang.authlib.properties.Property@5cba55b4]},legacy=false], displayName=null]]
[11:49:51 INFO]: newData: PlayerInfoData[latency=0, gameMode=ADVENTURE, profile=com.mojang.authlib.GameProfile@6713ac88[id=1b7b6c60-dd98-4748-a5e9-4bb21feaffc1,name=aaa,properties={},legacy=false], displayName=null]
[11:49:51 INFO]: action: ADD_PLAYER
[11:49:51 INFO]: [PlayerInfoData[latency=0, gameMode=ADVENTURE, profile=com.mojang.authlib.GameProfile@2e707093[id=4fc626ce-f01a-4312-ab11-2eeed4a0cdf3,name=BuckyBallsTV,properties={textures=[com.mojang.authlib.properties.Property@5cba55b4]},legacy=false], displayName=null]]
[11:49:51 INFO]: newData: PlayerInfoData[latency=0, gameMode=ADVENTURE, profile=com.mojang.authlib.GameProfile@48a66463[id=1b7b6c60-dd98-4748-a5e9-4bb21feaffc1,name=aaa,properties={},legacy=false], displayName=null]
[11:49:51 INFO]: BuckyBallsTV[/127.0.0.1:32454] logged in with entity id 4140 at ([lobby]2.4291644106742267, 99.0, 26.19026505980617)
protocolManager.addPacketListener(new PacketAdapter(
this,
ListenerPriority.NORMAL,
PacketType.Play.Server.PLAYER_INFO
) {
@Override
public void onPacketSending(PacketEvent event) {
EnumWrappers.PlayerInfoAction action = event.getPacket().getPlayerInfoAction().read(0);
System.out.println("action: " + action);
if (!action.equals(EnumWrappers.PlayerInfoAction.ADD_PLAYER)) {
return;
}
List<PacketPlayOutPlayerInfo.PlayerInfoData> newPlayerInfoData = new ArrayList<>();
List<PlayerInfoData> playerInfoData = event.getPacket().getPlayerInfoDataLists().read(0);
System.out.println(playerInfoData);
playerInfoData.forEach((data) -> {
// we can now change the profile here
GameProfile profile = new GameProfile(UUID.fromString("1b7b6c60-dd98-4748-a5e9-4bb21feaffc1"), "aaa");
PlayerInfoData newData = new PlayerInfoData(WrappedGameProfile.fromHandle(profile), data.getLatency(), data.getGameMode(), data.getDisplayName());
System.out.println("newData: " + newData);
newPlayerInfoData.add((PacketPlayOutPlayerInfo.PlayerInfoData) PlayerInfoData.getConverter().getGeneric(newData));
});
if (!newPlayerInfoData.isEmpty()) {
event.getPacket().getModifier().write(1, newPlayerInfoData);
}
}
});```
this sets the name in the tablist to aaa, changes the skin to alex/steve (which isnt actually the skin of player aaa) but still when I tabcomplete in chat itll show the real player name
r/programminggore
this screams c++ templates
too bad the language is based on JVM
sure you can use interfaces, but then you have cancer of implementing interface for each data type, also delegating each type at runtime if you want to use one generic vector class
all of this just because kotlin doesnt implement operator arithmetic under Number type
but delegates it to each concrete type (Int, Short, etc.)
maybe you guys any have ideas
how to achieve this, but in like clean code
because this sucks
the good thing is that it's readable and I can understand it
the way to do it is to stop trying to be clever and overriding operators
it is the worst thing modern languages allow
the only one solution to this i can think of is probably to implement Vector1D interface for each data type (IntVector1D, Long...) then create
class VectorialVector2D<T : Vector1D<T>>(val component1: T, val component2: T)
class which constructs Vector2D from two Vector1D's
then afterwards i could probably create
@JvmInline
value class IntVector2D(private val vector: VectorialVector2D<IntVector1D>) {
constructor(component1: Int, component2: Int): this(VectorialVector2D(IntVector1D(component1), IntVector1D(component2))
}
which would create compile-time object, which at runtime will consist of only VectorialVector2D type (basically fake class, it gets erased when program gets compiled)
and create such type for each of the type
but extension functions allow me to create any numeric type from one type
var vector = Vector1D(4.toByte())
thus the need of implementing every type of Numeric type is not needed but then you get this bulky mess, also i need to import the functions i use
I believe what you are doing in the first screenshot
if you try to be more clever about it, you'll just drown your code in rather unnecessary abstractions
sure, it is repetitive, but repetitive doesn't mean bad, it just means there's no clean way. But simple beats clean any time of the day
Glorified array
When saving values like a currency is there anything wrong with using the minecraft scoreboard rather than storing it in a file?
I would figure this would save time because minecraft would already be saving and handling these value for you when the server goes down
probably could become an issue when trying to scale your server (like a network)
but if i was cutting corners for private plugins
that's what i would do 😄
I mean its not really the end of the world just was wondering if there was any downside to doing this.
Minecraft scoreboards are not crash-persistent lol
if your server crashes, your scoreboard data can and will be lost considering it is most likely saved on world save rather than on write
That's fair
besides, it would be hella awkward to work with them in such fashion, I wouldn't personally recommend it given that they do not have a pretty API either
I mean with currencies I probably wouldnt save on every action but rather on a timer with the world so would that be no different? I feel like updating a file every time a currency is spent/changed would be intensive based on the player size no? But in this case I guess I couldnt force save the world without restarting the server
why are you trying to make this work, what's wrong with using a database
if you don't feel like coding an economy system, then use an existing solution
Im just exploring different options when making something
Does anyone have the updated versions / locations of these dependencies
Project..
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
</repositories>
Module..
<dependencies>
<dependency>
<groupId>org.github.paperspigot</groupId>
<artifactId>paperspigot</artifactId>
<version>1.8.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord</artifactId>
<version>1.12</version>
</dependency>
Im not trying to get around making something but rather think of better ways to make it
it is certainly a radical idea, I'll give you that. However I assure you anything that depends on Minecraft's own systems doesn't scale at all since it often goes far and wide to what its intent is
?whereami
?1.8
Too old! (Click the link to get the exact time)
Thats fair thanks for the help
bungeecord = spigot 😅
paperspigot is definitely not
you can't ask any forks questions on spigot discord
ask in paperspigot
not here
:D
Bungeecord
omg the real message
isn't bungeecord on sonatype?
also the artifact should be bungeecord-api
Heres the full repositories chunk in my POM:
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/nexus/repository/public/</url>
</repository>
</repositories>
This is a old project, years old - just trying to rewire it so it compiles
been a while since I touched java or anything maven just going off the errors when trying to compile now
well, that doesn't have the repository for paperspigot, which should be in papermc's maven repo
not the one for luckperms either
for bungeecord it does, but the artifact id is wrong
ah, luckperms is in maven central so it should be fine
any plans on adding the new consumable component?
you mean the FoodComponent?
I think he’s referring to the new nbt data that’s present in 1.21.2?
Now players right click on the compass and When they select a game, we teleport them with mvtp. I want them to be teleported back to the location they left from. How can I do this?
Store the location somewhere
Everyone says this, yes I know I can save the location but players are teleported to the world with the mvtp command multiverse core, if we save the location, should we teleport again with this command?
Or what
You can use Player#teleport function
is this question development related?
because I don't understand why you would use mvtp if you were using the API and not the teleport method as aglerr suggested
ah yeah, forgot they split the food component into food properties and consumable
It’s pretty cool
That open a lot of customizable options
XD
I have a weird one for yall ... recently I am having an issue where whenever anyone exits the end through the center portal, my PlayerRespawnEvent keeps getting triggered. This did not occur previously.
Why exiting the end is calling PlayerRespawnEvent, I have no idea... but it keeps replacing the first item slot with a claim tool as it thinks the player has respawned
Does exiting the end through the middle portal have something to do with respawning 🤔
If thats true I have no idea how it hasn't been noticed until now
weird
why would minecraft ever count going through the end center thing as respawning?
going to the nether or the end in the first place isnt respawning
I cannot find anything online for this, not sure If I am searching correctly. I keep searching for things relating to the end and PlayerRespawnEvent Do you know what it is?
I think it's because the end is special and the first time you go through the portal and get the credits screen that is kind of like dying - it's not an instant teleport, you're waiting to respawn
Philosophically the end is the afterlife and you're being reborn, obviously
I suppose, but as a developer I always assume it only happens on death.. you only respawn when you die. Did not know the game logic worked this way for real.
Sounds like a very notch thing that was done, the end is very old afterall. Im sure notch would want to make the code consistant with the story :P
Why exiting the end is calling PlayerRespawnEvent, I have no idea
they were lazy and didnt feel like extracting the "teleport to your spawnpoint" code out of respawning
thats it
mojang moment 👍
no, theres a new consumable component, the food component is meant for the nutrition/saturation etc
we can only assume md will cook something up when it is released
ideally, I want the current component API to be re-thought tbh, as having those getters which aren't actually getters in the ItemMeta isn't going to scale at all with the phase MC is adding all these components
then again, it is a lot of work so one can only hope
Thats wht the respawn packet did 😅
i'm sure there's a change world packet
you don't respawn when you change worlds on bungee
at least i think so
the world can have the same uuid and name and it just works
unless bungee pads those
Hey so my plugin sometimes throws this error when the server is closed,
Im closing a websocket connection in my onDisable
Does anyone know if theres a way to suppresss or fix this?
Is this happening because the disconnectioon is async and my plugin is already unloaded while the disconnection has not yet finished
so some kind of race condition
most likely yeah
i really like Executors for this, you can shutdown them on stop and have them finish all the work in sync
which is true for futures too i guess
my solution was to use nms, and not protocollib
does spigot's event system use adventure lib in any way?
?howold 1.9.4
Minecraft 1.9.4 is 8 years, 5 months old.
?howold 1.7
Minecraft Snapshot 1.7 is 11 years, 1 days old.
no
fuck
paper adds adventure
ok then I need to ask paper lads
spigot barely has any component & custom font support
i forgot.
so spigot does not add adventure? D:
no
the pr will add bungee components to everything
compromise mds bitbukkit account and merge it
rn
Except the async chat event iirc
do u think its a mistake to make a minigame lib that supports both minestom and paper?
haha
what does minestom have to do with spigot
adventure comes with paper
you are asking in the wrong server bro