#help-development
1 messages Ā· Page 587 of 1
oki
It seems to be fine. The IDE you're using can decompile
Otherwise you wouldn't be able to send the code that you did
not the actual code it looks like just methods it seems
That's an interface
so what do I do ?
whatever it is, it's š„µ
First of all what container do you want to look at
uhm whichever, for example player inventory
so inventory container
Then work your way down the inheritance chain until you find the implementation
it still doesnt have an icon
i forgot what theyre called
favicon
oki, thx, so the only reason why it wasn't showing anything was because it was an abstract class?
?
nvm
i don't find its impl; i'll try another day when i find patience
i can read most nms source code, but i don't find the implementation for this
I can help you find it tomorrow
ty :3
Just give me a reminder
alrightie :))
https://i.imgur.com/qXN9prY.png colored portals, no datapacks/ressourcepacks/client mods š
i like black magic tbh
Please don't tell me that's particles
it's not
try again š
(it's animated too btw)
I think it's a display entity with lime glass
Yeah probably
Just tell us :p
ok ok
it's maps, which my plugin animates with ClientboundMapItemDataPacket š
?nms
mojmaps are the best option
now y'all disappointed
ten_toList: avg 0,0023542090 ms / iteration
thousand_toList: avg 0,0083302920 ms / iteration
million_toList: avg 5,1132297500 ms / iteration
ten_collectorsToList: avg 0,0017662080 ms / iteration
thousand_collectorsToList: avg 0,0086735410 ms / iteration
million_collectorsToList: avg 10,7686530000 ms / iteration
Should have used display entities
Much better for server performance
see what you need it for then just check mappings sites to see what you'll need from them
i did that back in 1.17 xD
tl;dr small list -> collector's faster, long list -> toList is faster
Im trying to send a packet to update an armorstand's data, struggling a bit.. any ideas?
List<SynchedEntityData.DataItem<?>> eData = new ArrayList<>();
eData.add(new SynchedEntityData.DataItem(new EntityDataAccessor<>(6, EntityDataSerializers.POSE), Pose.SLEEPING));
CraftPlayer craftPlayer = ((CraftPlayer) player);
craftPlayer.getHandle().connection.send(new ClientboundSetEntityDataPacket(hologram.getHoloIDs().get(curHoloLine), eData));
Confused on the line that actually sends the packet to the player
the threshold was always roughly 500 to 2000 items where toList starts to be faster
also it's my map2img feature;
u give one link (gif), and require the size (like 5x3 blocks or whatever), my plugin will: adapt to the desired size (center, take the best proportions based on image size), dither the frames (cuz the palette is pretty restricted to 256 colours), and then animate with packets
One optimisation:
If the client is going under lag, my plugin will responsively adapt frame rate for him AND instead of making him download the frames again and again, he will cache ALL the frames in the client (by making one different itemframe entity/map id for each picture frame), and then spam him "entitymetadatapackets" (which are super light compared to ClientboundMapItemDataPacket) for animation.
That's only if the client is struggling, there is a download rate config which evolves dynamically with their lag.
declaration: package: org.bukkit, class: Bukkit
declaration: package: org.bukkit, class: Bukkit
I believe you have to set the interpolation duration first
Donāt quote me on that tho
No
Set the scale to what you want it to be after the interpolation duration
The final state if you will
You were the last one I see that figured out how to use this, mind helping me a bit please..?
minecraft has 4.8 billion lines of code
can someone fact check that
4,815,162,342
im pretty sure thats billion
or by having useless classes like these lol
Help needed w/ custom crafting recipe shape
how can I make a text display entity not be static like this and rotate for the client?
Can anyone help with ClientboundSetEntityDataPacket please
yes possibly
I just used it
My main issue is how to form the List<SynchedEntityData.DataValue<?>>
In 1.16 around 400k
My plugin has 150k soo
bruh
declaration: package: org.bukkit.entity, interface: Display
Do you already have a DataWatcher?
val entity = TextDisplay(EntityType.TEXT_DISPLAY, MinecraftServer.getServer().allLevels.first()).apply {
text = Component.literal(hologramText)
this.billboardConstraints = Display.BillboardConstraints.CENTER
}
val entityMetadataPacket =
entity.entityData.nonDefaultValues?.let { ClientboundSetEntityDataPacket(hologram.id, it) }
if (entityMetadataPacket != null) {
MinecraftProtocol.send(player, entityMetadataPacket)
}
This is what I do for it
I was using datawatchers like this and was told I was doing it harder than it had to be? ```java
for (int curHoloLine = 0; curHoloLine < hologram.getHoloLines().size(); curHoloLine++) {
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_METADATA);
Optional<?> opt = Optional.of(WrappedChatComponent.fromChatMessage(hologram.getHoloLines().get(curHoloLine))[0].getHandle());
WrappedDataWatcher metadata = new WrappedDataWatcher();
metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class)), (byte) 0x20);
metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer(true)), opt);
metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class)), true);
metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(15, WrappedDataWatcher.Registry.get(Byte.class)), (byte) (0x01 | 0x10 | 0x08));
packet.getWatchableCollectionModifier().write(0, metadata.getWatchableObjects());
packet.getIntegers().write(0, hologram.getHoloIDs().get(curHoloLine));
try {
protocolManager.sendServerPacket(player, packet);
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
Wait wtf
uh I dont use protocol lib so idk
theres a TEXT DISPLAY entity now??
1.20.1
are armorstands no longer needed?
1.19.4+
Yeah no more armor stands
WOOOOOOOOOO

LETS GOOOO BABYYY
theres also block and item displays
What is this? MinecraftServer.getServer().allLevels.first()).apply
and would they still be created like this?
ClientboundAddEntityPacket spawnPacket = new ClientboundAddEntityPacket(
id,
uuid,
hologram.getHoloLocation().getX(),
hologram.getHoloLocation().getY() - 0.3,
hologram.getHoloLocation().getZ(),
0.5f,
0.5f,
net.minecraft.world.entity.EntityType.TEXT_DISPLAY,
1,
new Vec3(0,0,0),
0.25
);
Idk cause you need to pass a level in for that all I use for TextDisplay's is to get the entityData
How are you spawning the entity?
Thats just client side
So spigot doesn't think there is actually an entity there
you should be able to do World#spawnEntity for text display if u want it to be there for everyone
What if I want to have it show different text for everyone..?
or possibly only be visible for some people?
Why isn't there a SlotType.OFF_HAND ?
inconsistency/forgotten ?
or is there an actual reason
off hand is just another inventory slot
in an inventoryview, each slot are represented by integers
Now InventoryView#getSlotType(slotnb) lets you know what type of slot it is, QUICKBAR, ARMOR, CRAFTING, RESULT, etc
would be useful if it wasn't
Shields seem to have a āblockingā value, specifying if the player is blocking, obviously. The value is not a boolean, but a number. How can I set the blocking value on the shield?
Actually, nvm
Figured it out
it isn't forgotten
nor is it inconsistent, it depends which inventory you pulled up
if you pull up a player inventory, the main inventory won't contain those slot numbers
slot numbers 98 and 99 is for main hand and offhand
but, these also correlate to the hotbar
so, slot 98 is not only main hand, but its the first slot in the hotbar
and not only that to go further, main hand doesn't actually exist since its just any item they have selected from the hotbar
now, that is for players
since players are entities, you couldn't apply these slot numbers for entities
so you would need to change the inventory API to conform to that instead of the way it is now
fair
i see
SlotType.QUICKBAR slots appears in every inventory
so that explains its existence
indeed, but slot number 98 is ambigious as its just any item in the hotbar selected. Its not a specific slot itself
what is its SlotType ?
weapon or weapon.mainhand
I know, but that is its type, it doesn't exist because slot 98 could be referring to the item in slot 2
because that is what the player has currently selected
but what does InvView.getSlotType(98) responds ?
I have no idea, probably give you some generic thing or nothing at all
hmm
?tas
meaning that there will only be 8 slots responding QUICKBAR ?
98 is main hand, 99 is offhand
yes 0-8
thats 9 xd
anyways, now you know something as mundane as slot type can get you a nice look into some intricacies š
haha
stay here longer and you might very well learn more things you didn't know lol
i love esoterism
haha
i feel like i'm sometimes going too deep in some stuff here
yeah poke too much and you get these nice rabbit holes
some are shallow and others seemingly just go on forever
yeah it can be fun especially when you learn there is something you could actually make use of that isn't quite known
there is a lot in the code API and NMS that you can make use of in a variety of ways and really just comes down to knowing about it, and your skills to use it or apply it
it was fun for me when I helped introduce holograms to the game š
making use of that horse age bug someone found and turning that into a feature in a plugin
now, its permenently part of MC š
Does the interpolation not work?
Hmm
Try also calling setInterpolationDelay(0)
Before you set the duration
The item doesnāt matter
Any item can have pdc
Try delaying everything 1 tick from when you spawn it
Sorry not pdc
cmd
CustomModelData
Might work, if not use a scheduler
Itās a value designed specifically for texturing
I assume paper was chosen as itās just a nice basic item that doesnāt do anything special
I donāt think you can detect that
Maybe
depends what the method does
why are you spawning a new display on every tick instead of reusing the existing one
to cause lag obviously
š§
my new plugin called AsyncLagCreator creates Display entites every tick for 2000 ticks than starts spawning ender dragon spawners at random positions in loaded chunks
I plan to release it as a premium plugin for $15
dude are you trolling
you shouldn't sell it for less than 40$
Entity#getTicksLived()
Hi, I've got a problem.
I'm trying to make a spigot fork (don't ask why, I just need to do it for a server)
But when I try to install mvn clean install, it cannot find org.spigotmc:minecraft-server
BuildTools is not downloading it or is there something I should do?
clear the caches and try again
Sorry, I think I don't know what "clear caches" mean, is it removing local maven repo?
So I have to build again? š
I see, everything is a conspiracy so that we must use the new buildtools gui š
did you run buildtools before? did you run applyPatches.sh?
1 - Yes
2 - Yes
try building bukkit and craftbukkit before with mvn install
In that same order, or it doesn't matter?
Nvm, the same error when trying to compile craftbukkit
Agh
My bad
IntellIj not using the same repo as the one I have for mvn
Like some weird configuration I have there
NOWNAD
No f##### way, it's empty
?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!
Fixed it, maven is using C:\ instead of D:\ for .m2 folder, even though I have set to use D:\ in settings.xml š
which of these images is correct lol
The yellow
Yellow numbers
The second one
thank
How can I put listeners in a class where there are multiple instances of that class and have the listener in each instance of the class have access to the memeber variables?
what?
1 sec
i have this class
each player has an instance of this class
i have implements listener and register the events in this class
but
when that listener gets called
it thinks player is null
it doesnt have access to the specific player member variable of that instance
how can i fix this
First of all, why do you add a listener for each player?
its just the way im doing it
You should think about changing it
maybe, but if i can fix this i would rather do it this way
If you have a custom even, it's because you have an API
No one will want to use an API which requires a player for even handling, instead of obtaining the players on the event
Anyway
A possible fix might be to use player UUID instead of player object
I also see that you have an empty constructor
If you create an instance using that empty constructor, then the player will be always null
ok
im guessing the problem is that when i register the events, it does not register all the new instances im creating
registering the new events when i make a new instance is just going to get messy and not worth it
ill be switching up how i approach this
After using the sendBlockChange method on a player skull and updating the block after, changing it back to a player skull, the skull is the default Steve head. Which packet is the right one to update the skull with the NBT? I've noticed that rejoining fixes it and that the texture remains in the skull's NBT after updating it again so I'm unsure on what the issue is.
I'll try them, thank you both.
So are text entities the new way to do holograms?
I canāt figure out how to efficiently update their data
?
With Mojang mappings
Is it different than armor stands
Not sure but I canāt figure out how to update armorstands either without protocollib
I was told protocollib sucked and to use mojang mappings instead so
Well if itās the āproperā way to do it then I wanna do it
Is this for 1.20? I am using 1.19.4.
I just canāt find a working example ANYWHERE
You were probably told by retrooper that plib sucks
NMS is fine
Bukkit API best
Display entities don't need to tick afaik
Ah, yes it is
They donāt tick, no
But you still canāt make them different per player with the api
How do you send spawn/metadata packets with bukkit api?
Oh
Yeah I need the text and visibility to be per player
You don't need to do it with packets
Is there another way with 1.19.4 by any chance?
player#hideEntity is a bukkit thing
NMS
But sure if you want it to be with players
And what about text..?
I am using NMS currently, but I can't find the correct packet to send.
you could spawn multiple entities
But that can be annoying
Idk I like packet events because I can shade it
API wise plib does seem a bit nicer tho
tinyprotocol
Wha that
protocollib's shadeable thing
That's basically just a listener
Is it version independent
public void setHoloData(Player player, Hologram hologram) {
for (int curHoloLine = 0; curHoloLine < hologram.getHoloLines().size(); curHoloLine++) {
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_METADATA);
Optional<?> opt = Optional.of(WrappedChatComponent.fromChatMessage(hologram.getHoloLines().get(curHoloLine))[0].getHandle());
WrappedDataWatcher metadata = new WrappedDataWatcher();
metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class)), (byte) 0x20);
metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer(true)), opt);
metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class)), true);
metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(15, WrappedDataWatcher.Registry.get(Byte.class)), (byte) (0x01 | 0x10 | 0x08));
packet.getWatchableCollectionModifier().write(0, metadata.getWatchableObjects());
packet.getIntegers().write(0, hologram.getHoloIDs().get(curHoloLine));
try {
protocolManager.sendServerPacket(player, packet);
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_METADATA);
WrappedDataWatcher metadata = new WrappedDataWatcher();
//metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class)), (byte) 0x20);
//metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class)), false);
metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(15, WrappedDataWatcher.Registry.get(Byte.class)), (byte) (0x01 | 0x08));
packet.getWatchableCollectionModifier().write(0, metadata.getWatchableObjects());
//packet.getIntegers().write(0, hologram.getHoloIDs().get(curho));
try {
protocolManager.sendServerPacket(player, packet);
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
This was how I updated the hologram info before
it just doesnt work anymore
Yeah you can get rid of the datawatcher
I just wanna spawn a text entity for a specific player and set its text
I think that might help with my main issue
whaaaat a website?
what happened to the search index?
sad!
I still use search index
It's just that I posted this before search index was a thing
oh so you regressed
no comment
he's returning to monke
Ah I found out my issue, I was converting the wrong thing to a TileEntitySkull. Thank you for the help.
?paste
?sendyourcode
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.
š
p.sendMessage(aHCF.getInstance().getConfig().getString(ChatColor.translateAlternateColorCodes
('&', "ability-items.usage-message")).replace("%item%", i.getItemName()));
ability-items:
global-cooldown: 10
usage-message: "&eYou have successfully used %item% &eand you are now on cooldown for %cooldown%."
why is it not changing the color codes into colors
ChatColor.translateAlternateColorCodes('&', "ability-items.usage-message")```
you're just passing a string
you mixed up your call order.
p.sendMessage(
ChatColor.translateAlternateColorCodes(
'&',
aHCF.getInstance().getConfig().getString("ability-items.usage-message")
)
).replace("%item%", i.getItemName());
you did translate -> getString
when you should have done getString -> translate.
no problem
whats the event fired when a small fireball from a blaze hits a block?
ive been searching for like 20 mins and cant find it
@echo basalt I dont have anything called a WrappedDataValue? https://gist.github.com/IllusionTheDev/8b0761be3b699fcfc0c082b753e6f063?permalink_comment_id=4586178
update
im on 1.20
declaration: package: org.bukkit.event.entity, class: ProjectileHitEvent
isnt java great
protocollib
Man your code is so confusing that you confused the IDE
just tryna do some funky function stuff and avoid reflection lol

looks like my ide is just shitting itself
occasional intellij moment
sometimes when writing rust in intellij it puts "Loading error.." errors on random lines
Oh lol that fixed it, where can I find the indexes and such for the text entity guys
found it finally
https://i.imgur.com/QBAyI3M.png
Which values go where if I wanted to update the "Text"
https://i.imgur.com/Zcd2pbS.png
no its just lack of knowledge
All of thees are wrapped data values
Do display entities havce a max text length
The getIntegers getWhatever are fields present in the packet class
In this case you want to set text, which is a Chat (component) type at index 22
So you do a Registry.getChatComponentSerializer and you pass the text
List<WrappedDataValue> dataValues = List.of(
new WrappedDataValue(22, WrappedDataWatcher.Registry.getChatComponentSerializer(), (byte) 0x40)
);
so like that
Why are you writing 0x40
Im trying to figure out what needs to go there lol
thats what you had in your example
That's because in my example, 0x40 was the bitmask for the invisibility thing
First parameter is the index defined on the metadata page
this seems more complex than it should be lol like why cant I just say I wanna set index 22 to "Testing" and it just work
Second parameter is the serializer for the 3rd parameter
Ok how do I know what to use for the serializer?
You'll want a serializer of this type in the second parameter
And a variable of that type in the 3rd parameter
Use the Meaning to understand what the variable does
In this case you want a value of index 22, of the type Chat
Chat's serializer is Registry.getChatComponentSerializer
So for varInt, I dont see a Registry# for that, or is there not one for that..?
And if you have a chat component serializer.. you want to serialize.. chat components
varint is just int
ah
different encoding but in terms of serializers it's the same
but what serializer do you use for it tho?
Registry.get(Integer.class)
Oh lol
easy enough
So what about this part..?
metadata.getIntegers().write(0, player.getEntityId());
That's... the id of the entity whose metadata is being applied to
Whats the 0 about?
If you look at the packet class, it's the first field
gotcha
this mf
I see I see..
new WrappedDataValue(22, WrappedDataWatcher.Registry.getChatComponentSerializer(), WrappedChatComponent.fromChatMessage("Test"))
Is there something else you gotta use to set text values?
Don't think so
Internal Exception: io.netty.handler.codec.EncoderException: java.lang.ClassCastException: class [Lcom.comphenix.protocol.wrappers.WrappedChatComponent; cannot be cast to class net.minecraft.network.chat.IChatBaseComponent ([Lcom.comphenix.protocol.wrappers.WrappedChatComponent; is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @24c8a521; net.minecraft.network.chat.IChatBaseComponent is in unnamed module of loader java.net.URLClassLoader @1ed6993a)
On which specifically?
the wrapped chat component
ah
do fromText instead
fromChatMessage returns an array
no need for getHandle then
same error lol
then yeah gethandle
: Squallz lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.ClassCastException: class com.comphenix.protocol.wrappers.WrappedChatComponent cannot be cast to class net.minecraft.network.chat.IChatBaseComponent (com.comphenix.protocol.wrappers.WrappedChatComponent is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @768dcebd; net.minecraft.network.chat.IChatBaseComponent is in unnamed module of loader java.net.URLClassLoader @1ed6993a)
Welcome to entity metadata
YAYYYYY
KILL ME
LES GOOOO
I broke it lol
So im trying to make it so rotate with you, and be visible from both sides. By default it sits still and you can only see it from one side
Do display entities havce a max text length
Display entities u can set the billboard to be Center
u a real one, works perfectly
Had the same question earlier haha!
Is there a way to make the background less dark? I see background color, text opacity and Is See Through
opacity
that made the text white instead of red lol
and the background is just as dark
new WrappedDataValue(25, WrappedDataWatcher.Registry.get(Byte.class), (byte) 128)
Because its text opacity
Not background lol
clear
the opacity
You could set default color to 1 in index 26 for bitmask
And see through to 1
If you are trying to make it not see through
new WrappedDataValue(25, WrappedDataWatcher.Registry.get(Byte.class), (byte) 0)
sadge, black background still
Did you try index 26?
26 and see through..?
Set the byte for 26 to 00010100
new WrappedDataValue(26, WrappedDataWatcher.Registry.get(Byte.class), (byte) 01010000)
it wanted me to change it to a decimal literal
0b00010100
new WrappedDataValue(26, WrappedDataWatcher.Registry.get(Byte.class), (byte) 0b00010100)
same thing
Use int 40
new WrappedDataValue(26, WrappedDataWatcher.Registry.get(Byte.class), (byte) 40)
like literally like that?
yea
Yeah
Interesting
got a code example? lol
we cant figure this out
val entity = TextDisplay(EntityType.TEXT_DISPLAY, MinecraftServer.getServer().allLevels.first()).apply {
text = Component.literal(hologramText)
this.billboardConstraints = Display.BillboardConstraints.CENTER
this.backgroundColor = 0
}
val entity = TextDisplay(EntityType.TEXT_DISPLAY, MinecraftServer.getServer().allLevels.first()).apply {
text = Component.literal(hologramText)
this.billboardConstraints = Display.BillboardConstraints.CENTER
this.backgroundColor = 0
}
val entityMetadataPacket =
entity.entityData.nonDefaultValues?.let { ClientboundSetEntityDataPacket(hologram.id, it) }
if (entityMetadataPacket != null) {
MinecraftProtocol.send(player, entityMetadataPacket)
}
thats all i do
Im just sending the packet I just create a TextDisplay so i dont need to deal with entityData
u should try it
I need per-player text
yeah thats fine
thats what i do\
you just send the packet to specific ppl
You see I never spawn the TextDisplay
I feel like theres gotta be a way to do it with my layout..
Whats ur layout
PacketContainer metadata = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA);
List<WrappedDataValue> dataValues = List.of(
new WrappedDataValue(22, WrappedDataWatcher.Registry.getChatComponentSerializer(), WrappedChatComponent.fromText(ChatColor.RED + "Test").getHandle()),
new WrappedDataValue(14, WrappedDataWatcher.Registry.get(Byte.class), (byte) 3),
new WrappedDataValue(26, WrappedDataWatcher.Registry.get(Byte.class), (byte) 40)
);
metadata.getIntegers().write(0, hologram.getHoloIDs().get(curHoloLine));
metadata.getDataValueCollectionModifier().write(0, dataValues);
ProtocolLibrary.getProtocolManager().sendServerPacket(player, metadata);
thanks for the benchmark @tender shard .
Guess I'll swap pretty much all of my toList()'s to collector since I barely ever have large amounts of data
Help me... I remapped 1.20.1 and the classifier remapped-mojang isnt working š
Could not find artifact org.spigotmc:spigot:jar:remapped-mojang:1.20-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexux/content/repositories/snapshots/)``` i ran buildtools with `--remapped`
do you have the specialsource plugin aswell
Make sure you built 1.20.1
And not another version
enter mvn dependency:get -DgroupId=org.spigotmc -DartifactId=spigot -Dversion=1.20.1-R0.1-SNAPSHOT -Dclassifier=remapped-mojang -Dpackaging=jar
and show the output
how can text display's get multiple lines
since the text is a string
or nms component but its not a list or nothin
as in hologram displays?
oh they just use \n
im pretty sure they dont
cuz i put \n earlier in and it didn't work
Does Component.literal break that?
I would assume it does lol
From what I can find online \n does work
this is so weird
so when I process a blockbench model it faces south incorrectly
when it should be facing north
and when I add rotations the rotations are still relative to those directions so they're wrong
how do I even fix this
make the model in the "wrong" direction so it is correct in the final product
10/10 best solution mhm
ew differently scaled pixels
does the model engine not have some support or something ?
it's not model engine
wait I thought it was you who was trying to get stuff work with it
the only thing that comes to mind is to manually rotate every single coordinate in a model
no I'm making my own model viewer
man how did this even happen
Oooh
well that sounds interesting
In that case: can you not just do -angle :D
that fixes the angle but every UV texture faces the wrong side and every origin point is at the wrong location
I remember creating a minecraft clone while using models from blockbench
was quite pain to write model generation from blockbench files so everything is correct
It even has animation support.
Took me weeks
yeah now try to get that to work as a mc plugin
Hey everyone.
Im trying to migrate to kotlin dsl from groovy for my plugin but im failing
tasks.withType<JavaCompile> {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}```
in here it says that Val cannot be reassigned
anyone know how to send packet in 1.19.4?
i need "CraftPlayer", but it was removed in 1.19.4 xd
InventoryView#countSlots
public final int countSlots()
Check the total number of slots in this view, combining the upper and lower inventories.
Note though that it's possible for this to be greater than the sum of the two inventories if for example some slots are not being used.
Returns:
The total size
Can someone explain me how this can be greater than the sum of the two ?
uuuhh I don't think it was ?
Sadly its true
I would assume donkeys ?
public final int countSlots() {
return getTopInventory().getSize() + getBottomInventory().getSize();
}
this is litteraly the source code
Idk if this is a correct place to look at the file but
It seems that a commit was created for it yesterday
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
donkeys have slots that are hidden until you put in a chest, and even then the slots might be hidden based on their strenght
I suppose that is what they mean
Okay listen, I'm having an issue with InventoryOpenEvent.
@EventHandler
public void invOpen(InventoryOpenEvent event){
InventoryView inv = event.getView();
for (int i=0;i<inv.countSlots();i++){
ItemStack newItem = inv.getItem(i);
}
}
For example, that makes java.lang.IndexOutOfBoundsException: Index 63 out of bounds for length 63 when i open a single chest (=27 slots) (considering that my inventory is 36 slots, so the limit should in fact be 27+36=63, but countSlots() thinks otherwise)
@smoky anchor
I assume the player inventory has slots for crafting, offhand, equipment that are counted in the view but not visible ?
I would look at how the getSize for tne inventories is implemented
hmm, so how would I check for the actual amount of viewable slots in the view
you're probably right tbh that seems like the best explanation to me
declaration: package: org.bukkit.inventory, interface: Inventory
Just need to check both inventories separately
idk if getSize() would work
that's litteraly countSlots
^
oh ye right lol
well since it seems that you're only getting the items then the getContents will be enough
no no no
my function was just to highlight the error and i cut off all the unnecessary lines
i need to get the slot index because i'm sending SetSlot packets
slots index are what interest me most
not the actual item in that index
i'll think i'll prolly do a while loop and stop whenever it exceeds size
Slot indexes go to 500
Just depends on inventory
yeah
Always a good idea to take a short, yet very effective, break
I probably need more than a short break, I've been nofilfing this for so long I don't remember how many weeks it's been
._.
its avaible to remove description from it?
"weeks", OOF
now I'm finding myself eyeballing rotations and this sucks
for what? Displayblocs?
armor stands right now, display blocks come next
ah; I also had the intention of making a library to work more easily with those things, cause, fk me, they are weird
I'm refering to using commands, cause I haven't used the spigot API yet
ok finally found the magic number
it was 1.395, obviously
as you may well have guessed
Ah yes, obviously, almost as obvious as 0.00001745329251 for displayblocks (#157097006500806656 message)
these models have layers to how they are wrong, sort of like an onion
declaration: package: org.bukkit.inventory, enum: ItemFlag
Hide attributes
seems that downgrading all the way to 2019.3.5 made the problem go away, but certain java features wont work with it lol
yes, works
cant do this now for example
IntelliJ version shouldn't have effect on your java compliance level?
i thought so too
Have you tried without the mc dev plugin
yeah it didnt work
and it got more and more frequent too
couldnt even select text without cpu going to 100%
Ouch any other plugins installed?
yeah
a lot of people have been having this issue for a long time too it seems
they just dont know why it happens
but yeah, intellij version shouldnt affect compliance level but it does, could it be configuration?
oh thanks for letting me know, iv been using vscode, which is not that bad, but it's not perfect
im working on java 17 regardless so that should be fine too right
vscode works but intellij's features are just so much more convenient
better intellisense too
How do i check if a player is in group test.1 or test.2 with luckperms?
Read their documentation
It is configuration, you can change language level in project settings
eh vscode is pretty whack for java
It dosent say exacly how i do it
language level is just sdk default
I'm sure they say how to check for permission, so check if player have perm1 OR perm2
this is quite literally the first paragraph on the api page
It does
like immediatley after the index
Probably, pattern matching in instance of is added in 15 as experimental
Im talking about group not permission
Same thing lol
They sent you screenshot
experimental doesnt include it so i guess its just too outdated
So i got this
public static String getPlayerGroup(Player player, Collection<String> possibleGroups) {
for (String group : possibleGroups) {
if (player.hasPermission("group." + group)) {
return group;
}
}
return null;
}
And how do i check if a player is in two of these groups?
if (player.hasPermission(getPlayerGroup().equalsIgnoreCase("Test", "test2"))){
this is pretty basic java man
if(isPlayerInGroup(player, "group1") && isPlayerInGroup(player, "group2")
public static boolean isPlayerInGroup(Player player, String group) {
return player.hasPermission("group." + group);
}```
so close yet so far
at least it looks like I fixed the origins
it sort of baffles me that the legs have the right rotation and literally nothing else
oh I think I finally got it
are you just brute forcing vals until it works lol
uh worse
for some reason I found out that inverting all but X values fixes this specific issue
for the rotations
there's a weird mismatch where it expects to export facing north but ends up facing south
and even when I fixed that the rotations had the hardest time figuring out where they were
it was 80% math and 20% guesswork
funny little question but is it possible to install language levels into intellij lol
its in the project settings
yeah but theres none past 13
what jdk do you have
is that what your project sdk is aswell?
yeah
You also have 17 in maven?
ill double check
yup java 17
i think im just gonna try to install even more intellij versions and see which one fuckin functions lmao
might as well
?nms
How to:
- From a
Playerinstance "player", determine whether they are online or not ? - From an
Entityinstance "entity", determine whether they are loaded, or not.
Impossible to have a valid Player instance if they are not online
(cached)
can you please reply to my questions ?
i don't care
use the Players UUID
Then I can;t help you to use teh API incorrectly
so nms?
OfflinePlayer#isOnline
yep nms
if you have a ServerPlayer its either a Player or an NPC
thx
no flag
Properly made plugins like Citizens will add that
ok now how to determine whether an Entity (and i'm talking about spigot this time) is loaded or not ?
We all know there are a bunch of people copy pasting npc implementations and not adding meta data
Yep they only have meta if you/the plugin add it
dont they have an isLoaded as well
when you are talking about NPCs all teh rules go out the window
do i have to listen to EntitiesLoad/Unload event to keep track of their state ?
or is their a simpler way ?
(i'm keeping track of some entities)
mk thx!!
I would listen to the events
i do it as well; just taking extra measures to ensure i'm not keeping useless cache
cache needs to be dynamically updated tbh
You can always weak map them just in case
yeah thats what i'm doing :))
For Both Player and Entities you shoudl perform all queries by their UUID
That's like DeadPerson#isAlive
OfflinePlayer is just a good way to check information about a player to which you don't know if they're actually online or not.
or you don't care
Sounds like a utility useful for like minigames or something
Hello I have a problem with Luckperms and Vault, people not OP cannot make the Vault bases commands ( / money, / Baltop ect ...) Do you know that permission is it?
sounds like #help-server
Not really, it's useful as you can safely cast OfflinePlayer to Player if isOnline return true
If isAlive in DeadPerson returns true you can cast it to AlivePerson safely too
ĀÆ_(ć)_/ĀÆ
Why dosent this work?
I am trying to make so if you are in any of these groups it should do something
if(isPlayerInGroup(player, "testGroup1") && isPlayerInGroup(player, "testGroup2" ) && isPlayerInGroup(player, "testGroup3") && isPlayerInGroup(player, "testGroup4")) {
you are checking if the player is in all of those groups
Use the logical OR operator instead.
And learn how logical operators work in... programming I guess
How do i check if the player is group testGroup1 or testGroup2?
Do i just need to make 1 & or what?
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
But the symbol for logical or is ||
Hi i'm trying to create a ItemBuilder class but I don't really if i'm doing well: https://paste.md-5.net/buwefotehe.cpp
Thanks
Builders don't need getters
okey
Also not following builder pattern at all
How should be done, i'm new at this
Something like this
https://github.com/Y2K-Media-Creations/AquaInventories/blob/master/src/main/java/sh/miles/aquainvs/screen/builder/ItemBuilder.java
why isnt it adding to the combat xp
https://paste.md-5.net/uyipemeyub.java
okey thanks i'll try
this is serious some1 help
might wanna do id (entity.isDead) return;
For less nesting
These constant calls HypixelSkillCore.getInstance().getPlayer & getPlayerAccount are just worsening your performance I bet.
Might wanna create a local variable, unless you have a reason to not create one, in which case I would like to hear it.
people are here to complain not help
Not complaining, advice on how best to do things
I am just saying that I would be able to help you faster if I could read the code better.
Anyways, I'd say it looks fine, try to put some more debug lines since the problem is probably in your implementation somewhere else.
okay
unless isDead doesn't return true for dead entity š¤
since the entity might not be dead yet
Check for HP <= 0
but even when i damage the entity, it doesnt add xp
That does not sound like a good solution.
Probably should have added: check if the entity will be dead if you deal the damage.
so e.getEntity().getHealth() - e.getDamage() <= 0
(after setting the new event damage)
alright i will try that one
Why dosent my gui open?
I am getting send "debug1" and "debug2"
Main class:
if (sender instanceof Player) {
Player player = (Player) sender;
if(isPlayerInGroup(player, "testGroup1") || isPlayerInGroup(player, "testGroup2" ) || isPlayerInGroup(player, "testGroup3") || isPlayerInGroup(player, "testGroup4")) {
sender.sendMessage("debug1");
if (player.getWorld().getName().equalsIgnoreCase("C")) {
new ShopIron().open(player);
}
if (player.getWorld().getName().equalsIgnoreCase("B")) {
new ShopDiamond().open(player);
}
if (player.getWorld().getName().equalsIgnoreCase("A")) {
sender.sendMessage("debug2");
new ShopDiamond().open(player);
}
ShopDiamond Class:
gui.setDefaultClickAction(e -> e.setCancelled(true));
gui.getFiller().fillTop(new ItemBuilder(Material.STAINED_GLASS_PANE, 1, (short) 3).setDisplayName(" ").buildAsGuiItem());
gui.getFiller().fillBottom(new ItemBuilder(Material.STAINED_GLASS_PANE, 1, (short) 0).setDisplayName(" ").buildAsGuiItem());
gui.open(p);
}
}
nothing called getHealth() in the entity class
idk man, i like making weird shit tbh https://i.imgur.com/24DSSh2.gif
dude I don't have the source here, I can't check every method call
Find the method that does health getting yourself
I'd guess the world names are not "A" or "B"
LivingEntity has getHealth(). Not all entities have health
theres no such thing
so ((LivingEntity) e.getEntity()) ?
If I can make a suggestion, there's a search bar on the Javadocs here: https://hub.spigotmc.org/javadocs/spigot/. If you're unsure where to find a method or whether a method or class exists, you can search for some keywords there and you'll find it
Based docs enjoyer
I have no context. If you know it's a living entity, then yes
you might want to check if the entity is livingentity
with instanceof
okay thanks
you haven't posted entire shopdiamond code
looks weird
what mc version are you coding for
1.17.1
Does creating a list in MySQL and working with it heavily overload the system? I need to create a list with String, and then delete some string from all users, will this load the server heavily?
and java version?
list? you mean a table?
errors in console?
Nope
I have a database and I need to store a list of Names there.
also what's inside your Gui class code
add a debug before
to see if it proceeds to this part
I mean how do you even save a list in mysql if not with a table
Just a ItemBuilder and a SkullCreator class
as a string? yikes
I thought the list could be done like this
how are you going to save it though
but how to do otherwise?
imo its way easier to create a table and then just have the skull ids and like the player id
then you can get them using a join on the player id
you are performing all of the operations in sql
how can it possibly load the server
that too
skull ids?
yeah
i mean your impl is ugly but it would work perfectly
and then just save it like that
and won't load your server
also do all of your players have the same value in this column?
same set of names
there will be many columns, given that more than 7000 players need to be stored, where everyone has a collection of heads
no there are only 2 columns
is collection same for everyone or not
not
It works fine when i am op but when im not its not working
Could it have anything to do with this?
public static boolean isPlayerInGroup(Player player, String group) {
return player.hasPermission("group." + group);
}
if(isPlayerInGroup(player, "testGroup1") || isPlayerInGroup(player, "testGroup2" ) || isPlayerInGroup(player, "testGroup3") || isPlayerInGroup(player, "testGroup4")) {
if a single player has over 40 heads saving it in a string will be a bit of a pain anyways
then you arent using the database to a better potential
you are anyways getting the debug messages
im just saying to make a 2 column table column 1 being the name of the head, column 2 being the player id that this head belongs to
then you also dont have to get all of a players head anytime you want to add one
and you can easily get all heads of a player using simple query logic
also why are you reusing the same part of code like 999 times
and while having a method getPlayerAccount() you still use it's contents just before using the method itself
sigh how are you still stuck on this. Use the code I sent
I havent seen you have sent anything
@timid hedge
it would probably have to do with the permission
its my second plugin ever im not really experienced
I cant ready that
well, just refactor your code
a bit
you have this method
HypixelSkillCore.getInstance().getPlayer(e.getDamager().getUniqueId()).getCombat().setXp(HypixelSkillCore.getInstance().getPlayer(e.getDamager().getUniqueId()).getCombat().getXp() + 5);
you use it instead of this mess you have rn
var combat = getPlayerAccount(e.getDamager()).getCombat();
combat.setXp(combat.getXp() + 5);```
var????????????????? it isnt javascript
it's added in java 10
var is also in java? xD
never knew that
its for when you hate typing annoying type names
leme just add the code you gave me
you have to write the thing on the right side anyways tho
cuz it's not a dynamic type stuff
yeah it can only infer the correct type
you have to initialize on the same line where you used var
then it will just get compiled or preprocessed into the same thing
ye ye
also use pattern matching
if (!(e.getDamager() instanceof Player player)) return;
player.doStuff();```
@fluid river the thing you said made my code 10x more readable
already done
if(!(e.getDamager() instanceof Player)) return;
if(e.isCancelled()) return;
if(!(e.getEntity() instanceof LivingEntity)) return;
call me if you want your code to become 10 times more readable again
md_5 should add a link to my profile to ?learnjava
and btw why does my server say youre running a server with limited api functionality when enabling essenial?
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
can you make all code 10x more readable?
I mean thats still mightly impressive
what if I give you code, you optimize it and give it back
I can also make code 10 times faster and 100 times less readable
free
and then I guve it back to you, will it get optimized again?
if so that means you can make infinitely good code
wait what
which I need
bruh abusing the matrix right now
your is correct
i compiled your words in my head
thats correct
got OutOfMemoryError
@last temple a simple rule is, if you can replace youāre with you are then you can use youāre
he's
the easiest way to be correct is to just say you are everywhere you use you're, if the sentence makes sense its correct to use you're
you're
same with itās (it is)
i'm
and so on
wontnt
your != you're sadly
ikr(i know russian)
nice
idk how good is my eng
somewhere on B2 ig
maybe C1
never passed an english exam which determines eng level
i think c2 is mother tongue
C2 is not available for most natives i'm sure
do you think youāre close to mother tongue
idk what is a mother tongue
look at your moms
my mom is russian
nice tongue
is your english as good as ur russian
idk lol
.
i mean i got 88 out of 100 on state exam
i lost all 12 points on "letter"
Nice to hear from you again...
Best Regards,
JoeDad```
i fucked up all the formatting
yeah there should be tabs
and i completely forgot about them 2 years ago
you can call me ig
so we can have a conversation
essential?
you also need this shit on the right
Yeah I would have forgotten that too
that's how i lost 12 points
Ouch.
and got 88 out of 100
i had no mistakes in the entire test part
Conditionals, Times, Forms
but fucked up the letter
Even my essay was perfect
which was like full A4 page
english essays are 99 times easier than russian ones
there are like 0 commas in each sentence
well, i think it's because russian government wants you to use complex sentences in essay, which always require a comma at least once
Yeah, english essays are incredibly easy.
German ones, not so much. But that is mainly because I am pretty terrible at my native language
Well, russian is called hard-to-learn language for a reason š
But it's hard other way than chinese or arabian
Chinese has freaking characters
how can I stop players completly from moving, turning their head etc...?
does it have anything to do with packets?
PlayerMoveEvent#setCancelled(true);
that wont stop them from turning around
Chinese is the last language I'd attempt to learn
it would tho
rly?
i studied it in school for 7 years
Cuz i was forced to
Yeah PME is triggered for head movement
By school itself
head rotation is calling move event
cuz it does change your location's yaw and pitch
and so the move packets are sent to the server
alr I will look in the source code thanks tho
well it's not that hard to write actual characters
the problem is
on exam you have to write them line-by-line
ordered
And the teachers check your order
wha
and if you placed one line before another, they just yell at you and give you F-
I've always heard hilarious things of the chinese education system
there is a sun character in chinese
basically just a big meatgrinder
they are same in both chinese and japanese
mean both sun and day
I still have it
on chinese it's ri
is the chinese character for moon and month the same
at first you draw left line
