#help-development
1 messages Β· Page 2081 of 1
how do you do that tho
you can
weird it gives me that error whenever i try it
the variable just isnt defined in that
yeah its defined in the class scope
player.sendMessage(MessageType.ACTION_BAR, . . .) or similar
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));
This was from a old spigot post
idk if it still works
you cant use message type in sendmessage
ChatMessageType
and what i have to do in main to aplicate it
either dependency injection or make a getter for it in the class extending JavaPlugin
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
both ways are incredibly simple
just a matter of preference for how you want to do it but i recommend a getter so you can basically use it as an API
oh btw
thats api is 1.9+
wont work on 1.8
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));
That API is not needed
use the spigot() method
oh ok
if your using actionbarapi though
ActionBarAPI.sendActionBar(player,"Action Bar Message");
its a static method
just make sure you check if the plugins enabled on the server first
and soft depend on it in plugin.yml
is possible check if a packet entity is visible for a player?
When i spawn a Packet Entity and go away, the packet refreshs and destroy the entity
any way to check if that packet has "destroyed" for the player?
ok
@noble lantern for some reason now the entire code stopped working after that
I dont know why
wait it says my plugin.yml is invalid but I dont think anything is wrong with it
wait now it "works" but the action bar doesnt show
no
you can do some location checks
but that's about it
Does BlockPhysicsEvent not return the block thats getting its data effected? Or is the block returned from this event the data from the block thats already changed??
I tried using BlockPlaceEvent and BlockBreakEvent to simulate state locks, but nothing really worked for that (it just didnt keep its data)
So i tried BlockPhysicsEvent and now the data from the block just seems to be the already changed data?
IE doing this ill get the TInkersBlock from my registry map, but using PhysicsEvent it just doesnt seem the case here
Javadocs arent too helpful either, theres this method here but i assume this is the block that caused the state change
FYI: Im trying to prevent noteblock instrument changes when a block is placed underneath them
?jd-s
gonna look thru
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/BlockPhysicsEvent.html
Theres this from the javadocs, its Extends BlockEvent and getBlock from that event is the block involved in the event, but it seems the blocks data is already modified from this
declaration: package: org.bukkit.event.block, class: BlockPhysicsEvent
what if u cancel the event
events already getting canceled
o hmm
sec lemme test one more thing and ill send a vid
it appears its working now with block placements
but for breaking not so much
okay placings still rather screwy as well ngl
its cobalt haha
theres the changed meta in here but its private to the event i wonder if that would be of any help or not
either way though im pretty sure the block that PhysicsEvent uses is after the state change
which is a rather odd behaviour
how can I loop through a collection of entities to teleport them to a location?
well got it working by setting the blockData one tick after the update event, something ide rather not do as it creates a flicker effect but it works nontheless
for (Entity entity : yourEntityCollection) { entity.teleport(toLocation); }
ty π
still wondering if this is do-able
?bing
Bing your question before asking it:
https://www.bing.com/
sure it is
any starting point for me to look after?
i mean dont get me wrong i dont need spoonfeeding
just the right direction
π π€·ββοΈ
cause i didnt find much in the api to manipulate pending commands
either overwrite the command or use the playercommandpreprocessevent
only for plugin commands at best which is permissions i dont use
i alrdy use the preprocesscommand to block certain commands at runtime
so how can i override the op permission of vanilla commands from there without opping them for the time being?
Does anyone know what causes this error? This happens when I try to use MySQL after my server has been running for some time. Caused by: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 35,886,624 milliseconds ago. The last packet sent successfully to the server was 35,886,717 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
did u ever close the connection?
I tried periodically closing and reconnecting the connection but it seems the problem just appears faster
idk much about sql hate it
but usually to keep a connection alive u send a ping periodically
like once a sec or so
Alright, I'll try that. Thanks
@storm crescent use a connection pool, donβt just create one connection that you hold onto forever
what is a way to loop through all players other than using getonline players
what are you trying to achieve
nvm I got it

"Is there a way to do this without using the only way to do it?"
hey choco
how do I make "tap to eat" stews / "tap to throw" potions?
PlayerInteractEvent, check their held item?
Is there a method that allows the player to eat
Is there a way to achieve preventing noteblock state changes without calling runTask on the data setters? without runTask it act really clonky (video down below this message)
You would basically have to get the nautrition of the food in players hand
Ehm, physics event would be my only bet there
Do I do that by hand, or is there an attrivute?
and in the itneraction even, if right click consume it
get get the item in the players hand (right one not offhand)
yes but with physics im having to set the data one tick later sadly
oh, mb, when i said by hand. i meant do i use a hashmap with values, or does the ItemStack have properties to it?
ItemStack should have a food property attatched to it π
okay! thank you!
only issue with using the runTask here is that it creates a flicker effect
its only logging because that event fires so much btw
Yeah it's an ugly event
i agree it reminds me of AnvilPrepareEvent lmao
So i assume with this ill just have to live with the flicker effect?
not sure if anythings do-able with packets for this either
you can get rid of the flicker
with packets
by cancelling outgoing packets for the old block
not a bad idea
havent done much work with packets so this is gonna be a fun experience lmfao
ProtocolLib will save your ass
Makes packet listening a breeze
& version independent
funny enough
yep yep gonna take a look at theyre docs right now
I posted a client-side entity tutorial with protocollib
and got hated for it
because how dare I use dependencies
"NNOO how dare you not use the raw packets library nms provides"
ProtocolLib is fine. It's standard and installed on a majority of servers as a dependency
Ignore the ignorant lol
Woo!
Protocolib, Vault, Worldguard/edit, PlaceholderAPI almost every server should have imo
Yep
I'm still trying to think of tutorials I should make
you see, any interaction is a good interaction
"How to make a lifesteal plugin"
I've made a gems system with client-side lore
using only packets and nms too
no bukkit api allowed for that tutorial
oh nice
imagine an april fools "bukkit 2.0" tutorial where instead of registering your listener, you use reflections to find your way into the handlerlist
instead of registering a command, you use reflections to access the command map
instead of broadcasting a message, you gotta make a json chat packet to all players
easy, right?
just make a whole bukkit 2.0 library upload on spigot as a meme
we just nuke the entire api and make 2 methods
"sendPacket"
"processPacket(consumer<packet>)"
but yeah I'm out of ideas '-'
make a wrapper for protocolib
that makes it feel like your working with vanilla packets
perfection
never heard of either of them
they're as raw as nms
oh no
Ok so i have a gamemode where the spawn radius is 10,000 blocks, and understandably the entire server lags when someone respawns
is there any way i can minimize this?
perhaps i could make a prerenderer that would render little spots on the map and have my own custom repawn method
but that's a lot of work and someone might have a better idea
By chance would you know what packet it would be for block updates? i see BLOCK_PLACE and BLOCK_BREAK on the client side but nothing else
Uhh
that shouldnt be causing any lag?
yeah it does
a lot
and once in a while it kicks everyone from the server
from the lag
just from rendering the new chunks ig
You have something else wrong
BLOCK_CHANGE
more than like 2 cpu cores maybe?
lol
i mean i'm using akliz.net to host
thinking of transferring to shockbyte
unless you are respawning everyone at the same time to different (un-rendered) chunks
nah
just one person
lol
Ah so the Server one only has that, i assume listening to Server.BLOCK_CHANGE is server -> client packets? Sorry never really worked with them before
ie PacketType.Play.Server.BLOCK_CHANGE
uhh
check out my protocollib tutorial
java minecraft is also a terribly optimized game π€·ββοΈ
but i'll try
oh wait yeah thats right i didnt read that tutorial the whole way
yeah, ok it doesn't lag nearly as much when i do it in singleplayer
ill take a look at this too ty
i'm using papermc
imma make a local server with paper and try it
i mean ive made RTP plugins where the radius was over 100k, it has to be in the way you are respawning players to a location
Maybe show some code on how you are achieving this?
ok
i'm using /gamerule spawnradius to do the spawn radius stuff
i'll send a datapack i'm using
why not just set a world border
https://github.com/pricedown/mhmahayesok/tree/main/custom-minecraft/world/datapacks/mhmahayesok-BETA-3.0 The shitty datapack i wrote
https://github.com/pricedown/mhmahayesok-plugins The shitty plugins I wrote (Respawn stuff handled in SoftcoreSMP)
what class is the respawn stuff handled in
send that
rather you do that than us playing guessing game which class it is
ty
o.o
lol
i think i did that when i was first making commits and saw the warnings and thought that i had to resolve them
these are the first methods i wrote of the plugin i think
if (that == null) { // handle null values }
"minecraft:execute as " + player.getName() + " run function namespace:respawn"
Is this calling something in your datapack?
I dont see a reason to handle any respawn stuff manually if you set a world border for the world
wdym
besides the applying potion effect stuff
in this plugin players spawn at random positions across the whole map
If you set a world border to 10k, the player wont ever go past the 10k mark
I dont see any code editing the respawn stuff though so its odd
wheres that code at
that's just /gamerule respawnRadius 10000
ah
remember they said they were using the spawn radius of the server
mb
which I probably wouldn't use
it removes some things you could control more optimally
well only if you don't understand the internals work
let's try without the weird command execution
so the reason it lags is because of your spawn radius
oh really?
spawn radius keeps the chunks loaded π
your better off making some type of random location getter tbh
and then teleport them to that Location if its safe
but they're not lagging all the time
only when they get respawned
no, but the server only has so much resources to work with
so in the right conditions, depending on what everyone is doing, your server is having a hard time keeping that many chunks loaded
that's insane
but also that makes no sense still
do you have proof that that is actually what happens?
390,625 chunks squared is the approximate amount of chunks you have loaded
it's not spawnprotection
./gc
beat me to it
spawn radius controls how many chunks around the spawn stay loaded. Spawn protection is similar except it controls how many blocks from the spawn point someone must travel to modify blocks
well, I mean that is just not understanding the MC internals is all π
you can always dive into mojangs code or just use /gc from essentials
that's incredible
or since your running papermc, /timings report, spigot has the same command too
well, it is and isn't. It makes sense π
yep
also that spawn radius setting in the configs I don't remember if there is a sperate one for each world, but pretty sure it applies that to all the worlds
I think you have to manually set spawn radius's to each world for that to not apply
If you don't like it, make a better version of it
LMAO
It's a small development team
Mm surely
i assume that bedrock is a bit better
bedrock has loads more quircks
so, that means in reality that 390,625 for just the 1 world, is actually 1,171,875 chunks between 3 worlds lol
: |
Man pulled up the calculator
Like said your better making a random location getter for player respawns
right but
so now it should make sense where some of that lag is coming from π
yeah
lol
Then it's totally fine
i could copy paste it tbh
anyways what you decide to do is up to you, I can only just give you the information π
π true
if you wrote it i mean
why not
but yes if you do have your own respawn method
i would gladly appreciate that
i mean i'm thinking of making my own client
generally I am not wrong in remembering the internals, I mean I was part of bukkit before mc officially released so π
well it may not work anymore/be the most efficient way anymore to get a random location tbf plus it used async to get Location's
because these clients can be sorta garbage sometimes
well
the main reason the clients are garbage is because it makes use of openGL. Nothing inherently wrong per-say except it doesn't make use of GPU specific driver stuff
that explains a lot
it's a 32 bit voxel game
should run at 900 fps
almost 64bit now
oo
DO NOT just copy-paste this, just use it as a relative learning experience/example to go off of getSafeLocation was the method to actually grab the Location randomly within a certain range
ok copypasting it
i doubt it works for 1.18 anymore
think the only things using 32 bit is just the coordinate limit in the worlds?
its really old code
everything else either doesn't require 32bit or has been moved to longs
32 million right
i think thats max for mc worlds
or around that number
or 32 billion
imma check rn
so, you can no longer go past that limit
π
Anyways, easier to set a hard limit, then to change all the internals for that
so its fine it uses 32bit numbers
since it has a limit π
side effects of being around a long time
ok is this proof of it
or otherwise what others like to call it, being old π
or were we wrong
1,410 chunks in the overworld loaded
and only uptime of 30 seconds
so it seems I was wrong about the spawn radius and that the setting in the config only applies to the over world
oh yeah now it's 3k
so at least that is good
lol
3k chunks is still a lot for one person on a server
but still bad considering how many chunks it will still load π
yeah
it isn't 3k chunks for 1 person
that is 3k chunks for the spawn, not counting the players having chunks loaded
oh before we go further
what jvm flags do you use to launch your server?
ie as hes the only person on the server
not for the one person individually, should of worded that differently mb
oh uh
lemme see
ok
but use all the other flags π
this should help your server out, and might even make your issue
a non-issue
oh my server runs it straight from the jar
is this a problem
or do i misunderstand what flags are and how they're used
no, the jvm flags control how the JVM behaves and how the GC should run
javas defaults are sometimes good but for MC they are terrible
so we go ahead and tell the JVM how it should actually do things π
computers are not there yet in being perfectly able to change settings on the fly for applications lol
how should i do that? the only way i know how to is by running it with a batch
well do you do it currently?
nope
you just type in the terminal for it to run?
oh you double clicked on it?
well its fine if its an external host, but you are able to control the JVM flags right?
let's find out
as long as they allow you to add JVM flags of your choosing it should be alright, if not then yeah we are back to the original problem and thus need to change some settings and use some plugins to help do what you are wanting lol
dedicated servers as cheap as like $50/month from there I think it was
oof
and then if you want cheaper you can go to kimsufi
yeah that's smarter than a minecraft hosting website though
probably better value
is it better value?
always better to go with proper hosters π
proper hosting providers all you full control of the server
even if it is a VPS/VM
mhm
ok they say that they already use the best flags π
which i believe but still
let me change them
these random mc hosters that have panels only are not really proper hosting providers most don't even control the hardware themselves π
ok back to writing getSafeLocation()
lol
wtf am i retarded or something
3 year old method still pretty good code though
i couldnta done it better
i'd be this fancy if i wasn't so new to java
and also idfk what a bukkitrunnable really is
okay yes i am i accidentally compiled in protocllib like a retard instead of using the provided scope
?runnables
?runnable
?schedular
?scheduler
ffs bot
lol they should add aliases
?help
lmfao
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
bad bot smh
?schedularprogramming
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
since the bot wont send the link
they should hire you to be the bot
reading code like this def makes java a lot more sufferable
maybe i just suck at java and that's why i don't like it lul
Its called OOP which is what your supposed to do in java lol
yeah ik and i write in OOP languages already
it's just something about java makes me write like shit
as opposed to cpp
maybe its this IDE
makes me lazy
anyways it gives me hope and inspires me :prayge:
how is this wrong?
return (Location) belts.getAsJsonObject(loc.toString()).get("target").toString();
its saved like this
"Location{world=CraftWorld{name=working0},x=-102.0,y=1.0,z=99.0,pitch=0.0,yaw=0.0}
full json
{"Location{world=CraftWorld{name=working0},x=-102.0,y=1.0,z=99.0,pitch=0.0,yaw=0.0}":{"level":1,"target":"Location{world=CraftWorld{name=working0},x=-103.0,y=1.0,z=99.0,pitch=0.0,yaw=0.0}","holding":{},"filters":[]}
Not sure that's doing what you think it's doing. You can't cast a String to a Location
You're going to get a ClassCastException
Generally speaking, Java contracts imply that the result of toString() isn't a parseable string. This is the case with a Location as well. You're better off serializing this as your own object or some special string format that you can then parse when re-fetched
but casting a String to a Location won't do that for you
and scraping the location from the string?
similar to that
Yeah basically. Though you would still have to write at least a basic serializer/deserializer for it so long as it's a format you expect
aight i can work with that thanks
yea
?remapping
sad
Where can i view remappings for remapped jars, im trying to find what IBlockData is named to i assume its BlockState though
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
frost I've already done the remapping, I'm trying to find the link where it showed all the remappings for the methods and classes
I remember there being a link somewhere to view them
Yep! thats it thanks π
iirc quite some time
is there a better way to do this?
you just want to detect all pickaxes correct
pickaxes are gonna have custom names
but yes
Names wont matter since your checking the Material
you can pick or choose one of these, and if its a pickaxe it will be true
you could even name the pickaxe DIAMOND_AXE if you wanted lmao
xd
and for the future, you can always use a switch statement. no need for a bajillion ors
MaterialTags.PICKAXES.getValues().contains(material)
take a look at MaterialTags and MaterialSetTag
can a switch statement work with just one true/one false?
sure it can
or nms
sorry its a paper thing
because it doesn't show up in the 1.18.1 api for me.
out of curiousity why not use paper?
This is the Spigot discord
if you develop for paper you wont support spigot servers
but if you develop on spigot you support all of its forks
IE pufferfish, paper, etc
pufferfish forks paper BTW
yes but its still a fork of spigot
There are still people who use default spigot
okay nvm
as paper is a fork of spigot
it frustrates me a bit. my server is using paper for our core plugin while using a lib thats supported for spigot. paper wants us to use chat components, spigot wants us to use legacy
thats why you just develop via spigot API
if you use strings for paper it wont care
and if paper ever removes the string methods then your gonna have LOTS of angry people
Does anyone know how often session tokens get reset? Do they get reset if you restart your client?
why would you need to know that type of info?
iirc for minecraft those tokens dont ever reset unless logged out
uwu can i have a peeksy weeksy at your token woken

Cause Iβm pretty sure I got hacked
π
Why is that?
if your hacked go change your password
even if you suspect it, change the password
It was a malicious mod of some sort. I was using it for skyblock and I ended up being stupid
Iβm pretty much screwed though right
just change your password and uninstall the mod and your chillin
Nah
couldn't hurt to run MalwareBytes scan too
You sure they canβt do stuff?
6000+ servers
Canβt they login tho with session ID
thats how most accounts are stolen now a days through token logging
even discord accounts fall victim to this
this
and this
Oh that will change the token?
yes
Oh phew
because it forces you to relog on your client, which requests a new token from microsoft
I changed my Microsoft password cause I already migrated
Yeah
As you can tell Iβm a complete idiot
Iβm a developer and Iβm still gullible
Can somebody tell me what I do wrong here?
Whats the error?
server hanging & recursive text
well, I know what was wrong
just questioning to see if you guys can figure out π€£
like I'm so dumb..
spent hours of debugging
well hard to know whats wrong when we have no idea what page is and how its handled
i would of just put a debugger in my for loop and from there changed values as needed also <=
its a number inputted by the user
well, it doesn't matter
look close at "start++"
it should have been "i++"
π€¦
ah fair enough lol
hey, i'm trying to get a custom remote console client in javafx (messing around) to work with the chat colors, whats the best approach for that?
Use the RCON websocket + port
yee there should be some really good rcon libs tbf
Okay, you'll hear me out I'm probably being overly retarded:
I'm trying to cancel block state changes of note blocks (IE when you place a block underneath a note block, it changes the instrument, I'm trying to prevent that from changing) via protocollib but it's not entirely working
Packet listener code: https://paste.md-5.net/uxayicaqug.cs
So the desired activity isn't happening, IE the actual block's instrument isn't changing however it does change one thing which is the note color that is rendered on the client's end, but when logging the data server-sided the notes still stay the same
I've tried canceling the packet on both onPacketSending and onPacketReceiving and both don't really achieve the effect i want to do
This is a video of what the above code does if anyone needs a visual representation
maybe send a packet with the unmodified data to the player
Thing is wouldnt the packet in that listener already be modified?
or is it only modified after the fact
idk how it would work but you could maybe construct a new packet for the note block with the unmodified data from the server and send that
schedule something to send it after handling the packet
or snth
not a bad idea, i could definitely do that
In that case, then how would I be able to convert an NMSBlock to a standard Bukkit block? I 100% know you cant cast directly so i was planning to just get the position of that block in the world, the only issue is i seem unable to find any coordinates methods in the NMS Block class and nothing when googling seemed very helpful
my lib that checks what block is what what on the Bukkit block and retrieving its BlockData, NMS's block data or BlockState doesnt really support casting to a NoteBlockNMS, and even then the NoteBlockNMS doesnt have methods for getting the note + instrument
ahh
MULTI BLOCK packet lets me get block position
nice at the same time it makes BlockData not accesible smh
packets are a load of bs lmao
it seems easy its just results arent exactly as i had in mind
im gonna take a look and see how oraxen does this
There should be a method where you can go from NMSBlock to CraftBlock
and then if need be from CraftBlock to the api side
iirc it would just be getHandle() or casting to CraftBlock but:
No methods returning craft block exist in: net.minecraft.world.level.block.Block
And Block isnt implementing or extending CraftBlock so it cant be cast to it
Block doesnt even have methods retuning a Object either
Look under CraftBukkit
there is a method that you can stick NMSBlock into to get a CraftBlock instance
isnt that a block type
Thats Blocks
net.minecraft.__.Block
interesting my IDE doesnt register that class hmm
Blocks is the Enums for all blocks in the remapped nms
Block is the actual Block instance
here ill show
does it store an instance for every block?
oh wait i see what you mean
its like CraftBukkit.getFromNMS() or something similar
So yeah it is a type but the actual Block class holds data inside of it too just nothing related to BlockPos
isnt that Blockstate
I see no CraftBukkit class which is odd i wonder if remapped changed its name ill have to check
I do indeed have the Blocks BlockState nms too, i had just assumed getBlock() on the blockstate would of gotten me somewhere
its org.bukkit.CraftBukkit.CraftBlock
Ah its path is a little different, but the static methods for that does return a CraftBlock but requires you to have a BlockPos:
which is uh, what im trying to get lmfao
BlockData or Block provides neither of it, isnt accesible from reflection either as neither store a BlockPos or a Vector3
its odd that ProtolLib doesnt provide a block position for this packet or something of the sorts
well if you have a NMS block, it should have a block position?
i hate how the craftbukkit package is still version dependant
Its not exactly a NMS block, just a net.minecraft.world.level.block.Block which is the only type of Block im able to get from Protocollib
the Block class is just the block type iirc
I am able to get a net.minecraft.world.level.block.state.BlockState from protocollib as well, but nothing reguarding position there either
and blocks extend thata
i beileve so as well after checking the src
do you have at the very least a location?
like BlockDispenser or somehting
if you have a location, you can stick that into CraftBukkit methods to get a block instance
Negative good sir, i cant even get a x y z integer from any of these which is very odd
ok what packet are you messing with that doesn't have a location?
use netty listener lol
BLOCK_CHANGE which is the event that is fired for updates like note blocks changing instruments
theres MULTI_BLOCK_CHANGE but its not fired for note blocks
BLOCK_CHANGE should contain an array or a chunk of some sort containing the blocks
isnt multi block change for multiple block changes per tick
oh just a single block it should still have a location of some sort
indeed it is, i just thought i should test but it doesnt provide the BlockData accessor, tells me its not part of the class in an error
let me double check
oh
yeah just checked
block change packet has a location field
which is the block's coordinates
well it should have the world in the location
oh is it like an org.bukkit.Location
thing is when i tried with this method: final BlockPosition position = event.getPacket().getSectionPositions().read(0); it said i couldnt access this for NoSuchFieldError
but ill try again
that is odd
because there is 2 fields required for that packet
location and blockid
it returns a StructureModifier<BlockPosition> for getSectionPositions
structure? o.O
com.comphenix.protocol.reflect.FieldAccessException: No field with type net.minecraft.core.SectionPosition exists in class PacketPlayOutBlockChange
hmm
imma check other methods really quick
Yeah im modifying the packet thats Server -> Player
ie onSendingPacket
there is getBlockSectionPositions ill try that instead
that seems promising
any particular reason why you need to stop the packet?
so when i prevent changes with BlockPhysicsEvent it creates a flicker effect like this this video
one sec
as i have to use a runTask to actually make it function
yeah, that flicker isn't going to go away unless you cancel the event like I said the other day, don't remember why it was you couldn't just cancel it lol
it is cancelled
thats the thing
BlockPhysicsEvent is really weird
here one sec
if i run it just like this
it simply refuses to prevent the block updates
uncomment the runnable, and it works like in the video
wow what an insult protoclib
net.minecraft.network.protocol.game.PacketPlayOutBlockChange@532850[
a=BlockPosition{x=0, y=65, z=1}
b=Block{minecraft:note_block}[instrument=banjo,note=0,powered=false]
]
so its 100% there lmfao
but refuses to give me it lmao
hmmm
worth a try
one sec
ah wait
BlockPhysicsEvent doesnt provide a player
forgot thats why i didnt try that
you have to cancel the packet
not the evnet
I've done this before myself
You either A use protocol lib to cancel the packet, or B inject your own packet handler in the player's pipeline
not hard to get a nearby player π
odds are whatever physics event there is, the player is going to be like within 5 blocks of it lol
well in regards to what you are doing
Only issue is protocollib doesnt like giving me the Location for the block i could just serialize the string if worst comes to worst
however frost
not a bad idea
i can just send that update to all nearby players
sec ill try that then go back to protocol
what if
a player does that and another one is 10 blocks away
could just send an update to all players on the server but...
that sounds expensive for cpu
whats weird is oraxen isnt doing anything for packets theyre just using the raw BlockPhysicsEvent
so i wonder if theyre blocks also have this flicker effect
frost solution you provided kind of works sec ill show
What gradle task should I run to build my plugin project?
I'm not using shadow jar
should just be the task at the bottom on the far right
either build or the config on the bottom
Okay
this one helps the flickering be a lot slower, feels like less than a tick but due to a client sided thing it still considers it another state for a second
Is compileOnly the same as provided scope?
yessir
I got a compile error and it's kinda weird https://paste.md-5.net/eruqelaxuc.http
my point wasn't to say they will be exactly 5 blocks, just that they would be close enough you could easily get the players around it
well it is an improvement π
What is a plugin message in BungeeCord?
indeed it is π if all else fails ill just send block updates to everyone on the server and hope and pray it doesnt cause any performance issues
when im back at my pc im gonna give protollib one last shot
?pluginmessage
?pluginmessaging
ffs this bot
?pm
ffs
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
it basically allows spigot and bungeecord plugins to communicate to each other
Burchard37, this is my build.gradle
I read it, it's why I'm here
aglerr ill check your file when im back at my pc π
Oh okay π
?paste
https://paste.md-5.net/odiqucuxam.coffeescript
Here is the build.gradle i typically use if you want to compare in the meantime
this on creates a build task like shown here
What questions did you have about it then?
I don't get how that would allow spigot and bungeecord to communicate with each other
It allows communication via strings/bytes in a sense through a socket
well I wouldn't do it for players all on the server
only issue is wouldnt it cause issues for lets say, players in the nether when they go to that specified block?
since you should have the block coords in question, you can use some math in combination of how far render distance is and obtain players within in that radius quickly
it shouldn't because their client hasn't requested the block info for those chunks
ahh i see
the server would as they got within render range send a chunk update
so i can just get the server render distance *16 and then force render for all those players in that range
yep
okay ill use that as my fallback if protocollib doesnt wanna work for me :p
anyone beyond that their clients would request the block info anyways which would get the updated changes anyways π
Am I supposed to use this to get information about my sub servers and such?
You can use it for a variety of things
say transferring between servers
you would send a Connect and server string to the player
What exactly do you not understand about the plugin messaging system?
For some reason it's trying to find this Could not find net.md-5:bungeecord-chat:1.15-SNAPSHOT even tho I didn't use it at all on the code.
even with the build.gradle i sent too?
that dependency is used for chat colors
^
I don't know how it's supposed to be used
how about this
Well I can tell you how it works
what are you trying to do that you think you would need plugin messaging for?
I know, but I don't use it at all
I'm not doing anything, I'm just reading up on Bungee
brb
So the plugin messaging channels are part of the MC protocol. They allow you to use the players existing connection between bungee and the mc server to send information
since the server listens for packets from the player and the bungee listens for packets coming back, you can use it as a way to talk to those two things without having to create a new connection π
Alright, thanks
smh, this is why i don't use gradle
Oh, another thing. What are BungeeCord plugin message channels and sub channels?
same thing
Bungeecord has to implement it just like the mc server does so that plugins on the bungeedcord proxy
can utilize it to speak with whatever is on the mc server
(Tell me when I can ask something)
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
I know there's a convo going on, so I try to not interrupt it
and wait until ya'll are done to ask mine
Well I am quite capable of talking to multiple people π
Talking for the other people, who might get confused π
anyways
protocolManager.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Server.ENTITY_SOUND) {
@Override
public void onPacketSending(PacketEvent event) {
System.out.println("Sending entity sound packet");
}
});
protocolManager.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Server.NAMED_SOUND_EFFECT) {
@Override
public void onPacketSending(PacketEvent event) {
System.out.println("Sending named sound packet");
}
});
protocolManager.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Server.CUSTOM_SOUND_EFFECT) {
@Override
public void onPacketSending(PacketEvent event) {
System.out.println("Sending custom sound packet");
}
});
```Seems to not fire ANY of these (Context: Trying to detect spyglass closing)
Imma try with packet receiving
Nevermind
basically none of those are fired
you can't I don't think
You can, spyglass has a stop using sound packet
I can just listen to that
but the thing is none of those are fired
how do other clients know when a client stopped using a spyglass?
also its in the sound packet list
ID 1013
do they get a sound notification too?
yes???
wtfff
yoooo thats sick i just tried it
I use Maven too but I honestly fucking hate it
i prefer either or
better than gradle
depends on the project
Spent 3 hours trying to get my fucking Maven configuration to work before I just gave up on my project as a whole
My opinion:
if i know im gonna need to depend on a lot of external jars gradle is easiest
depending on jars in maven is aids
Gradle, Maven, Ant, and Bazel are all terrible
There are no good Java buildsystems
im not saying gradle or maven is shit
Well there's one but it uses fuckin' Python for plugins
theyre both good
It also only works on Linux and I use my Windows PC when I code most of the time
I also just
don't use WSL
since it breaks too much shit
Spent like 2 hours trying to get my Rust configuration to work

oh god rust
Uninstalled WSL some time ago as I was gonna move my Windows PC away from programming
...decided to move back to programming on it
Didn't reinstall WSL
Rust compiled fine π
So effectively, compiling Linux Rust on Windows IntelliJ for a Linux target fails to work
It was unable to find a dynamic lib or smthn
Researched it, had that lib installed (on Linux)
Also had other issues with WSL
Like the fact I had to fix it resetting some configurations I made to its like, network adapter or whatever
WSL2 will, out of the box, be incredibly slow to download things
There's an obscure TCP feature you have to disable on it
But then it reset me disabling it
So fuck you WSL
(Also it doesn't quite work with GUI apps yet, but I imagine they'll eventually implement a X11/Wayland display server adapter or smthn)
Because Go has terrible fucking syntax
It's one of those things where I tried to like it
I tried to pretend it made sense
But in the end I just didn't use Go because why the fuck would I?
And no I didn't just take a single glance at Go
I read the documentation and everything
fair i cant use go for the life of me
tried making a discord bot
failed horribly
Unlike SOME PEOPLE
Who see screenshots of Kotlin or Rust
and immediately assume
"I dun like it"
because it's too different or too complicated
who tf reads docs
BECAUSE OF FUCKING COURSE IT IS

I'm just sick of this attitude
3
Also exercise*
Aaaand I've had anger management issues my whole life, breathing exercises don't work on me
this.attitude.isAcceptable()
I mainly just have to spend 30 minutes cooling down
Imo you have no right to talk shit about a language you don't know anything about
just like
People don't defend the honour of esolangs lmao

in all honesty im just joking, never used rust but sounds like a pain
I don't like that either
One of my strongest pet peeves is like
In the middle of a debate
"Oh lol I'm just joking"
I can't interpret that tone properly
I'm usually good at seeing tone in messages but when I'm trying to argue a serious point my brain has a Poe's law moment and takes everything seriously
And, honestly, sure. It's really hard to learn. It, like a good FPS game, has a steep learning curve, but that's mainly because it's densely packed with a lot of great features and design that make it one of the languages modern developers obsess over.
It introduced a lot of unique, brave ideas.
i mean i wasnt being serious at all tbh
maybe i just sound serious when i talk lmao
90% of the time im just talking out my ass unless im helping someone
No it's just me
im not the person you want to debate with, im literally dumber than a box of rocks
Told ya, I can't interpret jokes as jokes when I'm in a serious mindset
I am a maven fan
I mean I definitely prefer Maven over Gradle but I just don't like Maven very much
what is it you don't like?
I kinda miss Gradle's simplicity when it comes to handling multi-module projects :p
maven has a command for it....
I can usually figure out some solution to any problem since Gradle has a lot more StackOverflow answers than Maven
exactly
gradle its one line of code
and you never have to install the file
just import a directory with jars and boom
Oh yeah I hate installing shit
but you can import a dependency without a command too
I hate I have to install a subproject to be able to use it in other subprojects like tf?
I can't figure out how to automate Maven
It's just way too fuckin' complicated
compile fileTree(include: ['*.jar'], dir: 'libs') does maven have something like this
you don't have to do that either
you just have to specify where its pom is at
where it auto imports jars in a directory
I don't like that
I don't like having my project depend on file locations
It just feels icky to me
you don't, but I mean you can't just expect maven to automatically know either
how dare maven not read my mind
Well the project is listed in my parent module's submodules, right?
Shouldn't the other submodules know that each other exist?
That's how it works in Gradle :p
only if the submodules have anything to do with each other
but yes they know they each exist
What is that supposed to mean
you can have 2 submodules not related to each other at all
as in they do two entirely differently things and only get compiled into the final product
in such cases you really don't want the two interfering with each other
Are there any enchantments that can be applied to all materials?
not really iirc
that was patched loooong time ago
who remember fire aspect sticks
I just want to make the itemstack glowing
good luck :)
hello guys i have name, surname and id with a section i want to get name and surname by searching its id but i couldnt do it can you help me
anything with this?
Uhh... like, in SQL?
Oh
