#help-development
1 messages ยท Page 796 of 1
nah that wasnt for us ๐ญ
oh okk
I imagine it fires the the fish event with reel in state
wth is the fish event
yea but i cant see one for the line snapping
so how does it snap
Like I said I assume that just fires reel in
oh shit fr
well thats a bit problematic i guess because it doesnt differentiate between players manually reeling in and it snapping
Check distance I guess
cant u just check
if there is a loot or not
ya it fires another event if there's loot
i mean not another event
another thingy
but then are we gonna kidnap players until they find loot
or they get a loot
ye dont cancel it if it is failed attempt, bite, caught entity, caught fish, in groud or reel in
else cancel it
then you're cancelling fishing in general no
which i populate manually?
alright thanks
no moron
i said dont cancel
well no bc then ur cancelling FISHING
dont talk to me
.
@molten hearth i did it
no way fr
im not talking to u
HUh why
ok come back to dm
Stop edating smh
Hmm, is it expected that the following would be false? Correctly returns true for InventoryType.WORKBENCH.
Inventory inv = getServer().createInventory(new RecipeHolder(), InventoryType.FURNACE);
...
InventoryClickEvent.getInventory().getHolder() instanceof RecipeHolder
InventoryClickEvent.getInventory().getType() is correct
its a limitation o9f the current API
you can't create inventories like that
Ah, nevermind, SPIGOT-4274
Is that a custom inventory holder
you'll never actually beable to create a working furnace like that
๐ฉ
its impossible
I don't want a working furnace. I want one where I can intercept click events (custom /recipe command)
ahhh yeah you need NMS for that atm
currently a PR in the work to solve that
should see it around 1.21 probably
Hmm. Bummer. Because I was hoping to fix a bug in my plugin where players could just yoink items out of a furnace /recipe. I'll come up with another solution then.
Can you not detect click events in a furnace gui
the event works fine itself, but checking whether it was opened by my code quick&easy will have to be another solution
this might help you
at keeping track of it
Compare by instance or view
current API has so many weird bugs, dya see the one recently where you can't use setItem in certain Inventory's created by Bukkti#createInventory
Donโt make custom holder plz
To be fair, this is currently why it's a holder
Untouched for 9 years, not surprising things have changed ๐
don't use InventoryHolders
but considering its so old best to learn now :P
for now I fix the bug another way, later I refactor the recipe command. Yep ๐
@young knoll I know I've been annoying about this for a whlie, but I would enjoy feedback about Inventory PR at some point, its getting to the point of being pretty much finalized so not much will change
I won't tell if you don't ๐ if (!(e.getView().getTitle().startsWith("Recipe:"))) return;
title ๐
there is InventoryView#setTitle now
just a heads up
Yes I know ๐
Can we just make inventory holder sealed :p
that's actually smart
Yeah I probably should look at it Iโm just lazy
I wouldn't be against it
probably a good idea?
Wonโt happen cuz itโll break plugins and requires a java version bump
I added the Commodore changes so you can just use old plugins just fine
MD_5 has held its not supposed to be implemented afaik
Iโll see how my inventory framework handles it
And then yell at you when it explodes
nothing should explode unless you're captilizing on the quirks that were bugs
such as having multiple people share the same InventoryView
imho inventory frameworks should work around views no Inventories
or rather store state for an inventory and replicate it for multiple views
I mean
huh interesting, createInventory supports setting the inventory title easily but the getTitle function for inventories is gone. Whoops :LUL:
Mine just works with an inventory and then does a good ol openInventory
its because inventories can't actually have titles under the hood
its bukkit making up for a legacy feature being gone in nms
yeah I remember learning that back when updating the plugin to support newer versions
I know a bit too much about inventories so lmk if ytou have any questions
I think it was for our.. backpack command?
for good reason imo
technically its back in my PR ๐
Wtf hax
it needs to be unfortunately :(
with MinecraftInventory gone the only thing to hold the title is CraftInventory
Granted it's only there for legacy purposes and would be null given you use the new api
Inventories can have titles in vanilla tho?
No cuz it's no in bukkit
No they can't
Rename a chest and open it, you got an inventory with a title
That's a Menu
Not an inventory
Completely different
not really but whatever
but its the thing plugins should care about
Inventories are basically just the glorified lists of Items
no plugins should also be concerned about the InventoryView aka Menu
just because the API wasn't able to allow plugins to care for a long time doesn't mean we shouldn't switch now
further now more than ever its becoming increasingly important to distinguish between a InventoryView and a Inventory
or we end up with AnvilInventory which is a disgusting implementation
the whole inventory api is kinda not great tbh
its actually not bad
it just needed some tweaks
the base idea of the Inventory API is actually quite great its implementation was what was subpar
but by fixing its implementation the Inventory API will be much better. Much like other older API's all it needed was a little love
sometimes you just need to give something a little love 
so proud of everyone who made this GUI 
I love using it
Hmm, this seems fishy.
[14:30:57] [Server thread/WARN]: java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because "text" is null
[14:30:57] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_20_R2.map.CraftMapView.getId(CraftMapView.java:36)
[14:30:57] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer.sendMap(CraftPlayer.java:852)
Wonder if it's because I'm using outdated calls or whether there's an actual bug related to maps..
For reference, this is just a
private void updateMap(Player p, MapView mv) {
p.sendMap(mv);
}
after
// args[1] = "close"
String sscale = args[1].toUpperCase();
Scale mvs;
mvs = Scale.valueOf(sscale);
mv.setScale(mvs);
updateMap(p, mv);
So I don't think I'm doing anything special?
String text = worldMap.id;
Preconditions.checkState(text.startsWith("map_"), "Map has a invalid ID");
๐ค
how do you get the craft entity or crature and the handle?
cast
the handle you just get by doing CraftEntity#getHandle
after you cast
๐ฎ
we got ourselves a race
๐
I say it leaves you with about 3GB left
place your bets
I say 20gb
yknow I should probably just remove the unedited timelapse footage I accidentally recorded in 4k 60 fps
fun fact these are not even the files I am going to be using anyway, I had to convert them to mp4 to work with my editor
how can i save the player stats from database before leave?
PlayerQuitEvent
i got error
well I don't know how low it got but it cleared it
lol
how do you create a map with FastUtils
I'm trying to create a Short2ObjectMap i'm not really sure how
nothing in Short2ObjectMaps seems relavent for just initalizing an empty map
wait nvm I figured it out, but which one to chose ๐ idk the difference between most of these.
I'll just do the OpenHasMap and hope nothing explodes
there are multiple implementations of it
you probably want Short2ObjectOpenHashMap
just use your IDE to look at implementations of the Short2ObjectMap interface and find constructors
private static byte[] unpack(short packed) {
return new byte[]{(byte) (packed >> 8), (byte) (packed >> 4 & 0xF), (byte) (packed & 0xF)};
}
``` lol I love bit shifting so scuffed
Can we change the player UUID? I've tried changing it in PlayerProfile but it does not work.
Are you an online mode server?
No
Why do you want to change the uuid
Since it is still useless, so I would manage a new UUID system myself.
So, can we really change?
Not supported by the api in any case so you would have to do some hacky stuff
yeah you can so first thing you need to do is make a custom client and distribute it to all of your players to load up and join your server with. Second off you'll want to fork spigot and add further support for your custom UUID system
its really only 1 custom client and server fork away!
couldn't be more simple
Any suggestions for advanced cosmetics system for a skywars plugin?
kits , win dance, kill effect .. etc etc etc
also cages ?
Why is kits included in a cosmetic plugin
its for a skywars plugin :p
Oh yeah nvm
listening to your suggestions ..?
No clue. But bing has a few ideas
Some possible suggestions for advanced cosmetics system for a skywars plugin are:
- Trails: Players can choose different particle effects that follow them as they move around the map. For example, fire, smoke, hearts, stars, etc.
- Taunts: Players can perform various animations or sounds to mock or celebrate their opponents. For example, laughing, dancing, clapping, etc.
- Balloons: Players can have a floating balloon attached to them that displays their name, rank, or custom message. The balloon can also have different shapes and colors.
- Pets: Players can have a small companion that follows them around and helps them in combat. The pet can be a mob, an item, or a custom entity. For example, a dog, a sword, a dragon, etc.
- Cages: Players can customize the appearance of their cage before the game starts. The cage can have different materials, patterns, or effects. For example, glass, wood, iron, rainbow, etc.
Source: Conversation with Bing, 18/11/2023
i mean the structure of the code
Hmm?
SOLID principles.
pet following mechanics are a pain
I asked chat gpt do simple pet following and it worked :)
anyone know how I can get an NMS block state from a material?
?xy
Asking about your attempted solution rather than your actual problem
For?
I am trying to change a bunch of blocks quickly. I read this post https://www.spigotmc.org/threads/methods-for-changing-a-massive-amount-of-blocks-up-to-14m-blocks-s.395868/ and it says that using nms to change blocks is faster
but it doesnt' seem to be in mojang mappings
How many blocks?
I'd have a look in the underlying source from spigot to see what is happening when you set a block (I assume update some kind of mapping and send the packet to all players?) if it's something you could manually do after the blocks have been set then go for it, otherwise split up the iterations in custom sized chunks an run them asynchronously
That would've been my solution to this problem
Most likely it's just calling some nms method and converting the material to the nms one
Probably, but that wouldn't explain why the setblock method is so much slower than invoking the method handle manually
The conversion of material to NMS material certainly happens at O(1) no?
Who knows, it's bukkit code
Fair
so apparently the setBlockData method invokes WorldServer#sendBlockUpdated which then invokes ChunkProviderServer#blockChanged that is calling PlayerChunk#blockChanged - maybe the root of the problem lies in here
where can I find some good resources on how properly use packets?
additionally, other than protoclollib, is there any good packet util?
I tried both the bukkit method and nms method
I timed both
they do seem pretty random
with the same amount of blocks, sometimes bukkit is faster while nms is slower
and other times it's the opposite
I can use block.setType() asynchronously?
alr
?scheduling
๐
NO
I wish I could thread.sleep you for a float's maximum value
Damn ๐
bless your heart
virtual machines are such an absolute pain to deal with
every time I try to get into using them I just keep getting plagued with issues
I think that's a you problem
you too
gottem
Looks a bit longer than half a tick to me ๐
grandpa be like
moderately longer than a tick
?nms
how do i use that with gradle xd
You can try this
https://github.com/typecraft-io/gradle-specialsource
thx
Hey, quick question, hopefully.
I'm pretty sure that there is a lib for opening a browser tab and doing actions in it. Anyone know how one is called, I can't seem to find one.
You mean something like Selenium?
Yeah, I think so. Gotta test.
hey I have a question where can I find on spigot: disable-unloaded-chunk-enderpearl-exploit
You mean through code?
yes
This is how you access the configs as YamlConfigurations. Just need to get the config entries through a path, like you normally do with FileConfiguration.
how can I get the startup flags used for the server?
i dont can send a picture
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
I think you need some sort of instrumentation for that. Try the RuntimeMXBean.
ManagementFactory.getRuntimeMXBean().getInputArguments() from what I can find online
sweet thanks
what's the best a cleanest way to refresh a custom gui?
i've tried like 3 diff things and nothing works lmao
just open a new one?
wym?
from my experience, simply opening another gui while another one is open is quite seamless
just have a runnable check the title and if it matches reopen it?
well it depends for you
idk how you want to do it
but the general idea still stands
would that be a simple way?
yeah thats good
or something more robust by checking the inventory instance
either or
wym instance?
Does RGB/Hex affect performance?
doubt tbh
such as storing the inventory in a map of some sorts
and removing it on close
hmm
just check if they are the same
wait
nvm
thats entirely different
but you get the idea
what would be the most efficient way
to apply a remapping function on all of
ConcurrentHashMap's entries
anyone got up to date SQLite tutorial?
how can i get all folder .json file?
like, i have a folder named /kits/ in plugin data folder
how do i get all files of that folder
all sons?
children*
thanks
how do i represent the folder in a file?
cause im doing this:
and throws a npe in the for loop
i guess im getting wrong the file
Does the file exist
probably empty one
this is the config
also your dont need / around "data" here
I have this issue: when I start the plugin for the first time and it creates the config files, it creates a fake value - let's say 'b', but it should be 'a' (b is used as well and it's stated in the next line), but next time I run it with the config created already, it works normally.
I assume it's some loading issue but the all config stuff is called before creating the thing that causes the issue.
Make sure you use the api of the lowest version you want to support when developing
but then you might have some issues cuz some things didn't exist yet
Yeah that's the price you pay to support older versions
@young knoll can you help me with this?
Can we see some code
alr
Then will that API support the latest versions?
yes
this is the main class
We basically never remove stuff from the api
u deprecate some
yes but we don't remove em
Remove all the config.addDefault and just use saveDefaultConfig
what's the #addDefault for then
will it use the values that are there?
Yes
Defaults are a magical hidden value that will be used if the key is missing
Also you don't need that manifest file :p
ok thanks
@EventHandler
public void onChunkUnload(ChunkUnloadEvent e) {
for (BlockState state : e.getChunk().getTileEntities()) {
if (state instanceof CreatureSpawner) {
System.out.println("spawner found");
}
}
}
does anyone know why this only works for naturally generated spawners?
is the manually placed spawner actually spawning?
because if not I don't think it's considered a BlockEntity
yes it has a mob inside it
also why are you unloading chunks
I just checked, it's a block entity
okay
I need to detect if a spawner is being unloaded so I can update a pdc
I need to check for both, I just put the unload as an example because the same problem happens for both
the event triggers when players unload chunks right?
when the server unloads the chunks yeah
How did you place the spawner? It may not have updated teh tile entity correctly
just with a spawner block
then I put the egg in it
it also doesn't work when I set the spawned entity with my plugin
how do you do that
you mean the spawner doesn;t work?
something like spawner.setMobInside(blaze)
spawner.setSpawnedType()
and does it spawn the mobs?
it works fine, but it isn't included in the getTileEntities() list
I assume so but I cancel the event
I don't see why it wouldn't spawn them
Is it included after a restart?
your problem is with updating the list of active BlockEntities
good question
A while ago Bukkit had an issue with TileEntites not being replaced/updated correctly. I thought it had been fixed/
like when the chunks get unloaded for a restart?
no
if the list is updated
and the spawner you placed before the restart is there
Bukkti would give an error and try to update the TileEntity on loading
in the list
restart the server after you have placed a block, then run your code to see if teh TileEntity is there
oh
the tileentity is never found both before and after a restart if it hasn't been generated automatically (e.g. in a dungeon)
what version of Spigot?
Its a client side light rendering issue. You won't prevent the lighting changes without a custom shader
1.19.4
you can make that automatically with a plugin
It is on the the head of an armorstand but that might do
do you think it's a problem with spigot?
or am I not doing something right
I'm going to assume you are updating the type when you place (with no delay)
I see no reason for teh TileEntity data to not be updated unless you are somehow updating the block incorrectly
it gets detected in different events if I get the chunk from the location
just not in the unload event
what obfuscator you guys recommend to dont break spigot rules?
perhaps that event does not have an updated chunk, but it sounds odd
You said the TE is never detected before and after a restart if it was not naturally spawned
but you now say it does exist in some events?
when I use e.getChunk() in the chunkunloadevent and then use that to get the TEs the spawner isn't included
but if I use location.getChunk() in a different event and use that to get the TEs the spawner is included
Hm? Show your ChunkLoadEvent pls
If thats the case, it should exist after a restart
so how i can secure my plugin?
Secure from what?
@EventHandler
public void onChunkUnload(ChunkUnloadEvent e) {
for (BlockState state : e.getChunk().getTileEntities()) {
if (state instanceof CreatureSpawner) {
System.out.println("spawner found");
}
}
}
src leak
Is the spawner in a spawn chunk?
ex i got paid plugin with license system
External licensing systems are not allowed on spigot
is there a spawn chunk in the end? because I'm testing on the end island to stop dungeons getting detected
so how example vulcan anticheat securing own code?
Load your plugin with the STARTUP property instead of POSTWORLD and see if this changes the detection
BlockPopulator - load full chunk or 16x16x16 ? and i can use PDC from chunk?
in this moment
it doesn't seem to affect it
You did restart not reload when testing the TE?
yes
Your described issue makes no sense
There is pretty much no spigot resource out there, which is worth obfuscating.
If you write code this spectacular, then you should do some research on obfuscating outside of this discord as well.
sorry if i've been confusing, I'll try to summarise it
in the chunkunload event e.getChunk().getTileEntities() is empty except for TEs that have been generated by the server automatically
But if I use location.getChunk().getTileEntities() in the chunk where I know the manually placed spawner is, it returns my spawner and all TEs normally
also e.getChunk() in the ChunkUnloadEvent never returns the same thing as the location.getChunk() in the other event
My confusion is where you say after a restart it is still not there
If the TE is there in other events/location then it shoudl be there in an unload after a restart
it isn't
That's called (bytecode) obfuscation, there's a limited number of defined obfuscators you are allowed to use with spigotmc
Talking about this topic, how would one implement a limitation to number of servers of a plugin to avoid people from spreading? I mean you could do it with an external licensing system but that seems to be forbidden. Is there a way to check if a user has bought a plugin?
There is some things, but nothing really big allowedd
I mean if I recall correctly konsolas had a licensing system in his Anti-Cheat system, but how would he have done it without violating the rules?
Generally I'd say the best approach is to first make your plugin open source, that way everyone who will not buy your plugins won't get malware on their systems for it, no one deserves malware even if they aren't willing to pay for your product. Secondly only provide support to those who've legitimately bought your plugin on spigotmc you can do this in a variety of ways like making them confirm their spigotmc username and making some system to ensure only one person claims a username. Obfuscation and licensing systems are a waste of time and effort they will be cracked anyways its so easy to edit jar files you may as well just not
My server has a problem, can anyone help me?
Unlike vanilla on my server, for example, in Guardian Farms, when an entity passes through the portal and enters the Nether, it must be driven to the next portal by its AI, but the entities mostly stay in place or go to the portal very late.
How do I fix this problem?
Your bottom line won't be affected by those who wouldn't buy your product anyways.
Ask in #help-server a d donโt crosspost
ok ty
Thereโs like two static variables that can be set other than that ๐คท๐ฝโโ๏ธ
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
"like making them confirm their spigotmc username" - what do you mean by that? Or rather how could this be implemented without violating the rules of spigotmc?
Look at what JanTruck posted above
Ahhh very interesting thanks a lot
That is indeed very helpful and what I was looking for, thanks!
is it ok for the repository pattern to be loading stuff and saving stuff like files
Jantruck
a bit of math here
how to get the location in front of a player?
get location and do some direction stuff
well I did it but the Y is the issue
I want it to always be on the same Y no matter how player look up or down
I assume what you can do in the background is check against an external database (through a REST API) whether the NONCE has been used on multiple servers already recently and possibly to killswitch the current downloaded file for the user to require to redownload the plugin. Even though this won't help against advanced leakers...
and minecraft's direction vector is kind sus?
and ignore it :l
just need to set the pitch to 0
Just take the location of the player, add the direction of the player and multiply it by the range (in this case one), no?
Ah nvm
and again
given a plane and 4 corner and a vector how to find the point that the vector is pointing on the plane
what do you mean the way it's pointing? Thats what a vector is
like the location where that vector is pointing on the plane
do you want its angle, like yaw?
um, you need an origin to calculate a location
yeh it should be given as well
if you have an origin you need to zero the Y value, then normalize. Multiply by however far you want to go in that direction, then add it to your origin
so with your 4 corner example, if you want to move all, you add the resulting vector to all corners
well the multiply is a brute-force way that I want to avoid in the begining :l
you are trying to find the intersection point of teh vector?
You also need the plugin to work if there's no internet too
the block of light doesn't seemed to be helping at all?
and it seemed to be the armorstand facing?
in fact it does also happen when you holding it on your hand
Any Exceptions?
how do i programmatically activate a sculk sensor
pretty stupid question but I haven't found any help online
This server is running Paper version git-Paper-243 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT) (Git: 3a5c6f8)
Sir this is spigot
this.task = Bukkit.getScheduler().scheduleSyncRepeatingTask((Plugin) GalactiCore.getInstance(), new Runnable() {
public void run() {
if (item != null && !item.isDead()) {
final Firework f = (Firework) item.getWorld().spawnEntity(item.getLocation(), EntityType.FIREWORK);
FireworkMeta fm = f.getFireworkMeta();
fm.addEffect(FireworkEffect.builder().flicker(false).trail(false).with(FireworkEffect.Type.BALL)
.withColor(Color.RED).withFade(Color.RED).build());
fm.setPower(10);
f.setFireworkMeta(fm);
Bukkit.getScheduler().scheduleSyncDelayedTask((Plugin) GalactiCore.getInstance(), new Runnable() {
public void run() {
f.detonate();
}
}, 2L);
} else {
Bukkit.getScheduler().cancelTask(FlareThrow.this.task);
}
}
}, 10L, 10L);```
how come if i spam this the fireworks just dont show up?
Anyone know why when I try to compile using Maven, I get
newPosition < 0: (-1 < 0) as an error.
This only happens when any .YML files have any content in them. If I delete all content in the YML files it builds fine
what would be the simplest way to change a friendly entitys ai to attack a player
Nms
Entity#setTarget()
small question to packets.
which packets are called when a player gets out of render distance of another player and which packet is called when a player enters the rende distance of another player?
oh no my worst nightmare
Nms is my bro, especially on older versions
i think you only need the entities id
You can edit an existing one
Just make zombie, and edit the packet the player gets to sheep easy easy /s
Is there an advantage to sending text components over strings? If no, does it bring drawbacks, or should it not matter which is used?
Doesnโt matter, strings need to be converted in most cases though.
Yea I'm rewriting my utility class to support hover/click events and so on, so I thought why not just use components everytime
how would one even do that sounds complicated tbh
do you guys know if with intellij CE there's a proper way to generate the package
because by default it only creates src/Main
ultimate has the groupId feature in advanced settings but idk if CE has it somewhere
When creating a project?
yeah
CE also has it in advanced setting
then help me with it xd im gonna loose my mind soon
bro actually takes a photo of the computer screen with his phone ๐ญ
its not my laptop
the same bruh
omg
Anyone have a suggestion to determine if there is an active conduit near a player and the level it is even when they are out of water?
how can I make a custom tablist without header and footer? like fake players?
You'd send player info packets
can you give me an example
If you mean write it for you then no
thats not what I mean
What version are you making the plugin for
Do you plan on using NMS or ProtocolLib or PacketEvents
To add players to the tab list you need to send the player info packet. You'd use the Wrapped version from Packet Events
and to send it you'd just get the protocol manager from the packet events api
wait theres a method sendPacket(Any!, Any!), what are these args?
Would be channel and packet
I've never used PacketEvents before so I'm just looking at it's code
Looks like you can get a User object from the player manager
The players channel
its literally a Collection<Object>
The User class will handle that part for you
took a bit and nothing is showing in tab. no errors. code: ```kt
fun createFakePlayer(username: String, displayName: Component) {
val profile = UserProfile(UUID.randomUUID(), username)
val info = PlayerInfo(profile, true, 0, GameMode.ADVENTURE, displayName, null)
val protocolManager = PacketEvents.getAPI().protocolManager
for (user in protocolManager.users) {
user.sendPacket(info)
}
}```
ive just been doing this on player login
Try waiting a second and running the code
okay
oh wait
does libraries not exist in 1.8
It doesn't
bruh
true
what about we go to beta 1.7.3
Rayden o ly ur so machochist u go there
Nty
still no worky
Rip
lmao
Looks like you're trying to send PlayerInfo as a packet
isnt that what i have to do?
You want a WrapperPlayServerPlayerInfoUpdate that contains the player info
and the add action
so WrapperPlayServerPlayerInfoUpdate(Action.ADD_PLAYER, info)
okay im gonna try
theres still only me in the tablist
hm
well thats a start
Not sure why it isn't working
You could test and see if that send packet method is called
pretty sure that on 1.20.1+ you need to send a spawn entity packet too
for goodness sake
do I use a WrapperPlayServerSpawnPlayer or a WrapperPlayServerSpawnEntity?
because both have an insane amount of arguments
Alright so I tested. You want to send all actions at once
WrapperPlayServerPlayerInfoUpdate(EnumSet.allOf(WrapperPlayServerPlayerInfoUpdate.Action.class), info)
Not sure about those wrappers, but the actual ClientboundPlayerInfoUpdatePacket has a shortcut method for this, createPlayerInitializing
How do i change/customise the world loading screen? I want this in a Spigot server and im wondering if its physically possible?
not possible
thought so
you might beable to with a resource pack but I'm pretty sure the resource pack loads after you've already seen that screen
was wondering for a project
tbh i just want it for loading into multiverse worlds
ill try find a file for that idk
save in chunk pdc blockData shold be like this? - https://paste.md-5.net/aroyifisax.cs
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
For inspiration
i was check but this classes use some api how i undestand
@tender shard explain
Hello everyone, does anyone have any advice please. I have the Pterodactyl panel. That's pretty cool, but my self-made plugin can't establish a connection. despite correct database access data.
all other plugins that work with databases
I think my code will work too after all I don't need to make it with version support
No, but that code u posted wonโt work
That's what most of the code is designed to do, as I understand it.
I mean sure you can save it to relative locations
But what if a block is broken and replaced
You still got the old relative locaiton
Data
i will use listeners
Try it then ๐คท๐ฝโโ๏ธ
oh wait i see now
you mean location not good id for block?
i need check material
or smth else
or use blockState as a string
hm
Donโt store too much data
what's the best fit? Material+location?
Just relative location in the chunk
Remember to clean it on anything that replaces the block though
the pdc itself is not deleted, is it ?
not unless the chunk gets deleted
if i reload server
relative location is easy to get if you only have the x y z too
int relx = x & 0xF
int relz = z & 0xF
oh what this
Hello i am trying to make a book interface but i get Invalid Book tag
public static void gui(Player player){
ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
BookMeta bookMeta = (BookMeta) book.getItemMeta();
bookMeta.setAuthor("Handy");
bookMeta.setTitle(name);
book.setItemMeta(bookMeta);
player.openBook(book);
}```
can someone help me?
int best option for this or double
no access
can there be a block at .5 coordinate?
The answer is no
So doubles are unnecessary
https://paste.md-5.net/ohedawobux.cs - now i think this will work how you think?
It was easier than I thought.
n & 0xF
Is n & 15 because blocks in chunks are identified by 0-15?
Is that the idea?
Itโs the relative location in the chunk
I know
And do you know how to read it?
Also, storing just the x and z would be just fine
No Server Booster rank?
yes
if you have a binary number e.g.
apply to your coordinate 15
01100100 -> binary 100
00001111 -> binary 15
--------
00000100 -> binary 4
so should I go with former guide to making classes or just use methods straight up from latter link
Thats called Bit masking right?
I would go and use SQLite directly without any 3rd party, atleast to start. I have tried to use the librayr link you sent and i could say its sucks, has really weird querying format and many other things
I would use SQLite and HikariCP
https://www.sqlitetutorial.net/sqlite-java/ like just using this kind of tutorial?
This SQLite Java section teaches you step by step how to interact with SQLite using Java JDBC API.
let me see what saids there
yeah that seems really good
But i will implement it via HikariCP
oh right, i was told it makes better rendiment
Because of the pooling handling, thats what i have read some months ago
what is the better way to create custom snow on all server?
but i dont want to change all biomes
You could spoof biomes with packets
sorry
ffmpeg -i file.avi file.mp4 :chatting:
avi isn't bad and sometimes can have smaller sizes then mp4 when it comes to quality
avi is known for limited losses but also its enormous size
Still dont get why there are so many types
Should be mp3 for audio and mp4 for video and call it a day
lossy
mp4 and mp3 are compressed to the rim. You would end up with a pixel mess after reusing those formats in editing tools for example
then you have fucking Bink video format which it provides no real benefit and only games use because "every other game uses it" and isn't used outside of games because there isn't a reason for it
mpeg is fine for videos distributed through the internet. Other than that i wouldnt really use it
Another loved one: WEBM
I really like to see those, after downloading videos 
flv
it's a tradeoff between file size and quality retained
there is no one size fits all solution
Because different formats are specialized for different cases.
Imagine embedding avi videos. Half the people would have to buffer 480p youtube videos for some time
under certain settings yes it can make it larger, however if you know what it is you need avi could be the better choice
Their problem I got good specs
:]
there is plenty of good formats already
you just need to determine what it is you need
some formats exist purely because it is easier to work with
I see, but still distributing it over the web is wack considering it can't be embedded by discord, at least, and run easily
*by discord was an edit
and this is due to the fact mp4 has frames(can't think of the word)
every so many minutes
avi doesn't support chapters/frames
an alternative to mp4 is mkv if you want a format that is more close to it
I love how much you know about a ton of random shit lol
however, avi, mp4, and mkv are all containers and therefore are not necessarily the codecs for the video itself
which is why it depends on your settings that dictates quality/size
and they said learning all this stuff would be useless ๐
if you grew up in the early 2000's you would probably know some of these things with the formats
since you know that was one of the times where formats were a big deal and all the format wars etc especially with dvd
yeah, so not much of a reason until probably recently were you might need to learn something with the formats
back then it was a big deal because sometimes you might want to play a copy DVD and so when buying a dvd player you had to make sure it played formats you were familiar with
and then internet back then wasn't super fast so you had one format for transferring online
and other formats if you stored for backups to retain that quality
Hello, I wanted to know how I could detect if there is an entity to avoid this small error.
Don't ask about the music I was listening to :V
That ain't music that's a whole ass movie
whats the issue there? I couldnt really what happens because i was entertained listening the music
I don't even understand the question to begin with
neither me haha
what error?
not sure how an entity fits into this when you are messing with blocks
I just need to know if there is an entity where the block is being clicked, because do you think that when I opened the custom inv it put the block.
What I try to do is not put the block when there is an entity in that position or when it has the block but opens the inv
what entity? any entity appears there if thats what you mean by entity
I mean that the block is not placed in the direction the player is facing.
What
we cant really understand what you meaning. If you are a none native speaker would better to translate it from your lang to english with deepl. So we can have a better understanding of what issue you are having or what you expecting
um, beacons don't have a particular direction they need to face or one that is distinguishable
but I take it your issue is the inventory thing?
Where it isn't opening the beacon inventory and instead some other kind?
I think thatโs intentional?
If you donโt want blocks to be placed when your custom inventory opens, cancel the interact event
Ah I get your question. You can iterate over nearby entities through the getnearby method
what i need is to know how to avoid that the block is placed in the position of the player because in the video i showed when i right click with the block and the direction in which the player is, the block is placed in the position of the player and the same thing happens when i have the item.
uhm i never used heads before cause that im asking how to set an head in an inventory with texture of the discord logo?
For everyone else I think what he is trying to do is place a block when clicked but when there's an entity at that position there shouldn't be a block placement
ok that is fine, but uh what entity are they referring to though? I don't see an entity there to begin with
Himself I think
unless they mean the player? but in that case it doesn't show them standing in the same spot as the block being placed
Find the texture on something like minecraft-heads and then use the PlayerProfile api
What @young knoll said ๐
Happens the best of us
uhm does it work for spigot 1.8.8 cause i only found one for paper
I mean it's been done like this in legacy versions that's for sure
Legacy you need to use mojangs api
AuthLib^
Idk if AuthLib was even separate back then
Kinda wish Mojang made their NBT system open source
Fr
i guess im stupid
only thing i found is
<dependency>
<groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
Microsoft loves open source look at VSCode!!!!!
Smh smh Microsoft is an ally of open source! They own github too
You silly little dummies and saying Microsoft hates foss
Are you trying to install 1.8.8 Bukkit as a dependency? Is that what you are looking for
Maybe nms here? No clue how to with legacy paper though
what no im only trying to set an head with discord logo texture in an inventory
but i never used heads so im helpless
& hopeless
xd
Well I'm pretty sure you need nms here for sure
So start there ig
I can't help you since yk legacy
Hey they made brigadier and dfu open source
Microsoft purposely breaks office so that it doesn't work with wine
No they don't!! It's on all accident trust me. Just switch to windows
#AD
Y2K biggest troll on this server
I'm a pretty helpful guy
Imperial System >>>> beta European brain washing units
Hahaha
Yeah of course
Inches, feet and miles over scientific metrics
Makes sense to me
I'm named after the greatest unit of all time
Please do not speak ill of my legacy
I won't I promise
Good
How many feet are in a mile
5280
Ah yes normal values
10,560 in 2 and so on
Whoever invented it must have been using random.nextInt(10000)
This system was perfected before we even invented science
science was invented by George Science as we all know
Thomas running invented running when he tried to walk twice
FR the greatest American of all time
We're all nerds
how does one go about creating custom structures and thingies out of armorstands wearing/holding blocks? is there a library for this
Hello, good evening everyone. I would like to know, if I make a economy plugin and save all the players' money data in YAML databases instead of MYSQL or Lite, is there any problem on my server in the future?
yaml isn't a database, so a yaml database doesn't exist
As long as you aren't planning on running multiple servers, you should be able to do this without issues.
Just don't do the I/O on the main server thread, but thats the case for sql too
Hm, okay. Thank you!
hello
if i want to save player xp i need a hashmap right?
but which event should i use?
Im having an issue when compiling a nms project, im extending CraftPlayer, the IDE shows no errors or missing methods, yet i get the following error
com.bedless.virtualplayer2.nms.v1_20_R2.CraftVirtualPlayer is not abstract and does not override abstract method playSound(org.bukkit.entity.Entity,java.lang.String,org.bukkit.SoundCategory,float,float,long) in org.bukkit.entity.Player```
I just checked multiple times tho
there is no method in entity.Player
with a long as playSound
Itโs new
But how is my maven getting the compile error, if my decomped jar.. doesnt have it
wat
your ide is lying
anyone have any idea why this wonโt work
manager.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Server.BLOCK_BREAK_ANIMATION) {
@Override
public void onPacketReceiving(PacketEvent event) {
event.getPacket().getIntegers().write(0, new Random().nextInt(2000));
event.getPacket().getIntegers().write(1, 1);
getLogger().info("RAN THE LISTENER");
}
});```
it just doesnโt get called no exceptions or anything
would Player#setAllowFlight(true) get set to false when the person leaves?
true
it stays true?
no, your statment is true is what I am saying ๐
oh
lol
it should get set to false because I don't recall that being a setting that gets saved in the player data files
so uh warning, depending how your server is setup
it may be wise that players don't log out while high up in the air
because when they come back, they may find themselves falling ๐
and potentially die
Its a player ability, mayFly. Player abilities are saved in player data files. Unless the craftbukkit/spigot somehow breaks this, it will stay
its possible that the server is setting the gamemode again on join, that would override it
doesn't the player ability refer to elytra?
if so the setAllowFlight is not quite the same thing
nope. Elytra flight is what mojangs call "fall flying"
nvm, went and looked it up. I don't remember how exactly CB implemented it
but I don't remember flying being permanent exception if you were in creative mode
since flying didn't really need to be saved even if its supported
it could have since changed and it is guess they would just need to try it and see which it is
I wouldn't be surprised if somewhere in the login process the set gamemode method in ServerPlayer is called, that would set mayFly back to false
this would make sense
is there documention for NMS?
ok, ty
I want to make a packet manager util for my library, but I'm unsure where to start. How might i provide ways to manipulate and read the packets after its been injected? Perhaps an abstract perform class that accepts the packet object? what will be the best way to do this?
I'm just stuck
this sucks
I'm having to guess my way through how the rotations are meant to work here
it's so weird because while testing individual parts it just seems like it is working correctly but when the models get more complex it just dies
what am i doing wrong with my remappings? https://github.com/KyTDK/NeoUtils/blob/master/api/pom.xml
i installed the buildtools with the remap flag
so idk whats happening
there are no mojang mappings for 1.8
๐
1.8 ๐
cross version compatability ๐
how would I make it so when a chest is open they can't move certain items into it and around their inventory?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
assuming thats what you're doing
then you listen for inventory item moves and canel it
wait what
I'm decently sure that getAllowFlight stays the same
like 99% sure
as I said it could have changed. I just don't recall flying staying enabled when you relogged. But its also been a while since I have specifically used fly
I recall it staying enabled
since like 1.10
not flying
the ability to fly
but flying also stays
I have been around since the beginning of MC ๐
so not everything I recall is correct since things change ๐
anyway more than 7 years ago
off by a year
maybe even before that
ever since player abilities became a thing
my animation system is so close to done I can taste it, it's so frustrating
the feature for flying existed since beta 1.8
'member magic carpet? I 'member
is there an event listener for all events?
or a way to find when a player does literally anything
without packets
no
no
they're not if you learn them
they are if you have to code them from 1.8 up to 1.20
I can send you my github on how I've restricted all packets from a player
Easy fix, don't support 1.8
why?
because my plugin works for 1.8 up to 1.20
what exactly do you wanna do?
create a metric on which players are sending the most data to the server
With a bit of reflection you can easily listen to all events
whaaat
packets are still superior
you really don't need to
you can shade it in
yeah i dont want my plugin to be 5mb
is that really a problem?
can't upload it to spigot
i would have to use an external site
surely there is a lightweight packet listener for all versions
that isn't a plugin
depends
there is some events that can be listened to that have others below it
is there one that has all of them below it?
Yes technically
when checking if a string matches a gui title, do I also need to check for the color or?
and his name is?
you cant just listen for event can you?
/**
* Tries to remap all events implementing Cancellable
*/
private fun tryRemapAllCancellable() {
val section = config.getConfigurationSection("other") ?: return
if (!section.getBoolean("listen-to-all-cancellable", false)) return
val nameSpaces = section.getStringList("cancellable-namespaces")
val ignored = section.getStringList("ignore-cancellable")
val isCancelledMethod = listOf("isCancelled")
nameSpaces.forEach { nameSpace ->
val reflections = Reflections(nameSpace)
reflections
.getSubTypesOf(Cancellable::class.java)
.filter {
it.declaredFields.any { field -> field.type.name.endsWith("HandlerList") }
&& !ignored.contains(it.name)
}
.forEach {
EventRemapper.remapAndSubscribe(it as Class<out Event>, isCancelledMethod)
}
}
}
implementation("org.reflections", "reflections", "0.9.12")