#help-development
1 messages · Page 604 of 1
what
😩
that wouldnt make sense?
Becuase doesnt the packet only expose the section initally and the column exposes the chunks?
The packet is for the entire chunk
I now see that casting the chunk to this would expose the block pallete
yeah
how can i get the name of the potion
yeah
for some reason the item meta getDisplayName is empty
It doesn’t have a custom name then
making wrappers can be really annoying and difficult sometimes
supporting many versions
is there any way i can get the name of the item then
and my other issue was that how can I check when given an x, y, z if the chunk contains that?
since the getMethod always returns NotNull
getMaterial().name() ?
what is that referring to
Give unique plug-in ideas
PlayerToilet
make a bedwars plugin and let me sell it
add all features i request
my idea so
ours
what’s “that”
prayer plugin
oh wait i already made it
plugin that kicks if you don’t pay every few minutes
pray*
/pray <message>
XD
Amen
nice xD
I have an andrew tate plugin
randomly every night at 3 am you have to get out of minecraft bed and workout
contains that location
kill 10 mobs
it asks you the color of your bugstti
XD
you can start off by checking if the chunk column contains the global position
by using bitwise operations
int chunkX = x >> 4;
int chunkZ = z >> 4;
compare column x and z and make sure they are equal
I want the name of the potion
then it’s within that column
name of the potion type?
no
ok
what about y ? for setting how to go from a location y to a y that gets passed into the set function
i don’t get the question. but you now move onto chunk sections if you want to identify in which chunk section it is in
chunk sections go vertically
chunk columns are an x z region
chunk sections go upwards
are you following
yes
is it possible to do the reverse
is there a way to identify which Y corlates to a chunk section?
is it just Y / 16 = the index?
get the name from PotionEffectType
How dat work
randomly once or twice or many more times per day player has to go to their toilet and thats about it
if they don't they get a slowness potion effect
and later on neusea or whatever its called
toilet would be a block on which player can sit
let me open up my minecraft rewrite
int y = globalY;
y -= minHeight;
int chunkIndex = y >> 4;```
is what i have
then you get the chunk section at that index
in the array
ty ❤️
Nah but it gotta be something useful man not just a random ahh plug-in
Well it would match real life
Something good bro pelase 😭
XD
yeah im tryna recreate akumamc's private mine system
What’s akumamc
conceptually
I have many ideas but I don't wanna share them
since 1.17 minHeight is -64
Bet
is globalY just your location.y?
by placing down a lever you have to also place down redstone lamps which you can turn off/on with that lever
fosho
global is the locations
and we convert
but first confirm the location is in the chunk column
How does it know which lamps match with which levers
with code?
block pdc would be easiest
you can store the locations of them like so:
lever-name:
lever-location: .....
lamps:
list.. .
That’s not what I meant…
that would be painful
Would it be like all the lamps in a 10 block radius of a lever
It's fairly easy to do really
I just haven't had time for it
i mean the file
❤️ preciate it
Pdcs are ass whatever he said is better
I'm working on something bigger
@quaint mantle plus you’re in my discord server
fosho yeah
storing it in a file would be painful, just use block pdc
if you needed help why didnyou ask
why? xD
I did ask and this guy gave me a really terrible overly complicated solution
with like caching chunks
its not meant to be manually changed, its a data file
or you can use JSON if you prefer it
what
It don’t exist on the superior Minecraft version, the version of god, the version of holy
or whatever that is i've never heard of it
i hate pdcs ngl
bro i hate 1.20 but devving on newer versions is so much nicer
Shout out to Minecraft 1 dot 7 to 1 dot 8
i code on 1.12 tho
Real 😭
did i give you a good idea?
I don’t fully understand it
Which lever turns on which lamp
1.2 on top
ok so with levers you basically can turn on/off a set of redstone lamps that are managed my that lever
Shout out to bro 🗣️
redstone lamp can be turned "OFF" and "ON" by changing the block type
TURNED_ON or off
I get it but like what if there are 2 lamps beside each other and 1 lever which one gets turned off and on
you can just do redstoneblock.kaboom()
bro my friend made a hack client for alpha minecraft
both, because they are under that lever
its so fdun to code on because u can litterly spawn in items
each lever can have a set of lamps
realistic electricity is so cool i should prolly make that
like a 1/5 chance of a lamp burning
Is it radius based?
no
what are you trying to make?
That is but realistic but ok
its wireless
it is
What if a lamp is 29765 blocks away
if the chunks are loaded theres no problem
well load the chunk and turn it on xD
So every time u turn ur lamp on it has a 1/5bchance to Burn?
how do tou make a chunk loader?
So 1 lever controls all
Easily
ye so it doesnt power on and needs to be repaired or switched out
Cool
very descriptive and educational explanation
thank you sainte
🙏
yes the ones you "connect" to that lever
Gotchu gang
And how does the connection process go
i have a love and hate relationship with coding on legacy versions
sometimes its shit
listen for when a lever is triggered and then get the lamp associated with it and act accordingly
that's easy.. look if lever is in the config.. check the lamps list and run for loop on them and change them so that they turn on, or off depending on the prev. state
If ur curious Chunk#Load()
ah thanks
Ok but who would download that
so I got this problem
items stacks are same but I am getting total of 0
and how do i get a chunk by location
its actually a cool idea
add debuggers
Some people would if you make it really configurable and add some cool features like the ones some people mentioned in the chat like 1/5 chance that it breaks
item is either null or isnt similar to the one youre looking at
open images I debuged it
that was my idea! 😠
I came up with this idea because I was starting to get pissed off in survival where i had to place torches everywhere
so whats the problem
I think I’m good on allat it should be more useful then wireless lamps I am trying to create an impact
yeah i mentioned yours
and lamps are better?
all data is same on two itemsstack but is saying they are not simular
then they arent similar
simple as that
Spexx what are the other ideas put me on 🙏
I mean you can turn off and on the torch too
or the item i null
I can't share any more
those are two items which I am comparing
😢
whenever yiu right click a torch you can turn it off or on
that would be cool
yeah sure..
i though it would be cooler with a lever
it would make it look like a real house sort of
do amount = amount+1
Anyone else got plug-in ideas
ypu also are not debugging it at all
add a log for when u check whether its similar or not
ItemMeta meta1 = itemStack1.getItemMeta();
ItemMeta meta2 = itemStack2.getItemMeta();
if (meta1 == null && meta2 == null) {
System.out.println("Item Meta: Same");
} else if (meta1 == null || meta2 == null) {
System.out.println("Item Meta: Different");
} else {
// Compare display name
String displayName1 = meta1.getDisplayName();
String displayName2 = meta2.getDisplayName();
if (!displayName1.equals(displayName2)) {
System.out.println("Display Name: Different");
System.out.println("ItemStack 1 Display Name: " + displayName1);
System.out.println("ItemStack 2 Display Name: " + displayName2);
} else {
System.out.println("Display Name: Same");
}
// Compare lore
List<String> lore1 = meta1.getLore();
List<String> lore2 = meta2.getLore();
if ((lore1 == null && lore2 != null) || (lore1 != null && lore2 == null) || !lore1.equals(lore2)) {
System.out.println("Lore: Different");
System.out.println("ItemStack 1 Lore: " + lore1);
System.out.println("ItemStack 2 Lore: " + lore2);
} else {
System.out.println("Lore: Same");
}
// Compare enchantments
Map<Enchantment, Integer> enchants1 = meta1.getEnchants();
Map<Enchantment, Integer> enchants2 = meta2.getEnchants();
if (!enchants1.equals(enchants2)) {
System.out.println("Enchantments: Different");
System.out.println("ItemStack 1 Enchantments: " + enchants1);
System.out.println("ItemStack 2 Enchantments: " + enchants2);
} else {
System.out.println("Enchantments: Same");
}
// Compare custom model data
if(!meta1.hasCustomModelData()) {
System.out.println("ItemStack 1 Custom Model Data: " + null);
}
if(!meta2.hasCustomModelData()) {
System.out.println("ItemStack 2 Custom Model Data: " + null);
}
if(meta1.hasCustomModelData() && meta2.hasCustomModelData()) {
int modelData1 = meta1.getCustomModelData();
int modelData2 = meta2.getCustomModelData();
if (modelData1 != modelData2) {
System.out.println("Custom Model Data: Different");
System.out.println("ItemStack 1 Custom Model Data: " + modelData1);
System.out.println("ItemStack 2 Custom Model Data: " + modelData2);
} else {
System.out.println("Custom Model Data: Same");
}
}
// Compare other meta attributes as needed
// ...
// Compare all other meta attributes
if (!meta1.equals(meta2)) {
System.out.println("Other Meta Attributes: Different");
} else {
System.out.println("Other Meta Attributes: Same");
}
}
}```
i aint reading allat
Real wtf
AND ARE THEY THE SAME ?
that is debug
evertything is same
just use your nose honey
in debug
So whats the problem
That’s insane 😹
do this
bro add a log for when the .isSimilar() is ran
wtf
if I do bukkit method isSimilar it returns false
How can you be so sure
its a problem with amount = amount +1
simple all data on item stack are same but isSimular returns false
Paste the code I’ll fix it
I am counting how many of same items players has in there inventory
Paste the code I’ll fix it
Paste the code I’ll fix it
Sorry but what do you think it is wrong with my code
int amount = 0;
for (ItemStack item : inventory) {
if (item == null) {
continue;
}
if (item.isSimilar(target)) {
amount += item.getAmount();
System.out.println(item);
System.out.println(target);
}
}
return amount;
}```
Paste its
Ok
what is exactly problem
well I am comparing two itemstack and they are not similar
Show us how u are calling the method
BUtils is redudant that’s all I can help you with bye
Jk can u paste the code I’m on phone I can’t really read it thanks
Real wtf
Work on ur OOP bud
How does it even accept that
Or does it implement ItemStack
because it extands ItemStack
extands isn’t a java keyword
He extended it he’s all good ‼️
Any unique plugin ideas
Hi i have a problem and i dont think any one know how to fix it ..
my life
Yeah probably not
Anything fr tho
also you are using paper, not spigot
yeah, you shouldnt do that
make an item builder
you have a .build method which returns ItemStack
that is not why you should use inheritance lol
i have a plugin with load / save method for users data (uuid , kills , etc )
i have 2 servers using the same plugin same server version and same database detail my problem is its not loading the correct data if i use bumgeecord , velocity to connect to server
but if i joined server A
and left (it will save data) , and joined server B it will load the data , but if i use bungeecord , velocity to travel bettwen server it wont load it on 1 of them ..
i did add a delay to the load method (playerjoin event ) ..
this is something like itembuilder so you can call methods easier and it should return regular itemstack
class gas not custom data fields
really need help guys
i have been struggling with this for the last 3 days ..
are you saving async ?
yes
ok let see I wll make it like you said
Then I will see will it comparing item stack return again false xd
then don't do it lol
if i dont use a proxy such bungeecord ..
it will save and load data for both servers correcrly
whats the problem?
if i use a proxy it will not load the correct data on 1 server .. and the other will load , save data ..
using hickaricp
do what goski said
Who got da unique plug-in ideas ‼️
PlayerToilet
No ‼️
ChatGPT said that PlayerToilets is good idea
He just says stupid shit
Repeats himself and doesn’t
He’s just a 40iq person
Who read a book or some shit
Idk
well I must admit your were right
😅
I saw it long time ago in one plugin class was extanding ItemStack
and it was ItemBuilder class for mini game
So I was thinking it woked there it should work here to
but looks like that has big time problems with comparing items
i already told you
Go make a free seasons plugin
What is free seasons
Make a plugin that allows load balancing
What is seasons what does that mean
tried removing it .. still same thing
you kmnow irl
Seasons
I’m good on that 💀
Those things that exist on earth
spring, summer, autumn, winter
Change colors
Oh nah I’m from planet Zog
actually one idea that might be good is the more items you have in inventory the slower you move
How
Ohhhh
Custom biomes
That’s kinda cool
Sainte maybe make a better model engine plugin
Wym
I mean what I said
Who’s downloading that bro
you
for survival it might be cool
Ion fw custom texture
?
i dont fuck with?
Engine for what
You seem to not fw a lot of stuff :(
Models
Gives several ideas
wants plugin ideas
doesnt fuck with any of them
“No not those”
They are ass 😭
No lol
Go uhh
Dis one’s too easy
Make another join message plugin
And load balancing is too hard?
model engine is too hard?
It's not so easy as it sounds
Unique unique
you have 2 options
If it was easy it would already exist :p
Ok I’m up for the challenge
who needs plugin ideas
Don’t spam useless threads sainte
????
When you say load balancing, what aspect? Players or smth else?
Me send
fully unique is painful as balls and would be bug full
"unique" would already exist but you make it better and add more features
Basically you split ur worlds into regions and each region is a backend server
isnt that folia
Soooo, folia?
Folia but not
The downside to a load balancing plugin is that it wouldn’t be seamless
multi paper then
Yeah well, your reverse proxy has to handle the seamless part
Since you probably will have to establish sockets between each node in the network
Afaik you need to fake a world change to switch to another server
So it’ll never be seamless
I mean yeah probably with spigot, was more thinking the traffic goes through the super proxy so for the user its seamless
I mean like, the backend servers can communicate how chunks and entities are gonna be ticked w/o telling the players
Once the logic is decided and processed, send it to the proxy and it sends it to the player
I see
Considering I’ve never seen even a big network do it I imagine not
Well.. maybe I have seen a big network do it but it was seamless so I didn’t notice
:p
:,)
man I miss drinking soda
Not this robot again
I am going to remove myself
Guys I have a plug-in that gives you 4 wood instead a log when u break a log, how do I make this extremely pay to win so I can profit
Or should I sell op for 5$ instead
I feel like that's a very easy thing to make lol
Id like to see you try, it took me a good few months
default - 1 wood/log
vip - 2 wood/log
mvp - 3 wood/log
ultra master god elite overlord mvp+++++ xxl premium - 4 wood/log
i can write it in 15 min
a few months???
yh
yeah
Haha liar
Yeah
that's a little embarrassing if true
Got it
bro give me a setup gradle project and 5 min i can write it
You are all just talk lmk when u actually write it
k
how can I get the player count of other servers on my bungeecord network in one of the servers spigot plugins. I'm using this for the lobby of my server. I'm showing the players in the lobby the player count of the other servers in the network.
Plugin messages between bungee and spigot
You'll need both a bungee and spigot plugin for this though
It's not
It should take like 15 minutes
gotta do all this output utcptcupi thingie and i have no idea what any of it means
It's just a for loop
No you don't
That's why plugin message channels exist
yea thats what I tried to use
hm
Just keep to the plugin message api
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
yea I tried to do what this wiki said to do but it made no seneshttps://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
sense
yea
What doesn't make sense
like what does this stuff do
It's just an input stream if you read the wiki page it explains subchannels
it says its registering the bukkit/bungee channel or smthin
God your obnoxious Sainte
It shows how to register in the tutorial
fairly certain its a bit my man
Hey I just started making plugins and everything was alright,no errors , the plugin is working in the server but it is not doing anything ( it is supposed to say "Block Broken" when block is broken but it doesnt)
He was laughing at me cuz it took me a few months to make a plug-in that gives you wood planks instead of logs when broken
"long" "took me months"
That's the obnoxious part
okay
It will take you months
my intellij crashed on me twice
Skill issue bringing you down
u sure
☹️
Orby you bored or something
can you stop arguing and whining
Probabaly a lie u just can’t code that
i need to learn chemistry
damn dude woke up on the wrong side of the bed haha
Wish I could help more but im on mobile so can't give code examples sorry
alr
Don’t feed the trolls
Damage entity packet issues
ik ur trolling but here it is i think thtis is what u meant
yeah ikr
You definitely copied the code from the internet
im the fastest coder in the world
shit u caught me
yeah i copied ur code
wouldve taken me months
ima go learn abt covalent bonds and fucking salt now
here, it wants the "PluginMessageListener" how do I do that for the last argument?
Yeah I can do that in about 5 minutes
Lol
lmoa
Register the event lil bro
okay fixed that
For broadcasts on my server they will be ordered and will broadcast every 5 minutes, should I use a Deque for this?
nvm
Ive never seen a lowercase classname low key didnt even know that was possible lmao
Make sure the plugin is loading on the server
it is loading
tho not doing anything
if you do /plugin does it show up green
A list would work just fine for that. Why would you need to use a deque?
u got the startup message?
mnope
Make sure your plugin.yml has the right main class if that isnt the problem
well i changed the thing in "Artifact" where it should automaticly replace it tho idk
ah thats right nvm then
that wont work as ur using maven
so you will have to put that in your pom.xml
for now just go to target and copy the jar ig
i just watched a yt video and followed it so XD
to check if it works
I've got gradle build script to auto copy plugin jar into debug server, saves a lot of hassle
you arent building with maven
tried that too
shows maven build in the top tho
idk ive never used either
me = confused
try clicking the play icon in the top
press the play button here
jar looks replaced
now thats maven
so do i copy the thing that says "original" or the other one
What do I do with examples and responces? It doesnt't really tell me what is going on here. I have no idea what to do after I put onPluginMessageReceived in my main class and after I register incoming and outgoing pluginchannels.
eyyy it worked! Thanks!
is there any way to throw entity that player hit really high?
entity.setVelocity(entity.getVelocity().setY(10));
I tried using this, but it doesn't go as high as I wanted
set the value way higher then
maybe try
entity.setVelocity(entity.getVelocity() + 100);
thats not how velocity works
oh it needs to be vector
Well I'm trying to throw player or entity that is damaged up really high
you can use multiply aswell
either using vector or somethng else
but seems like there is limitation to velocity's y-val
can't throw higher than 10
well... they will when they're using my custom models I guess
always?
what about ghasts?
1.62 from base of mob im assuming
ghasts too?
ghasts are bigger so its in the front, at the same height, 4 blocks out, 1.62 blocks from the bottom to top
man this game
what are you working on?
shooting tower?
yeah
it already does
so whats the issue
How can I convert a spigot location x to a x relative to the chunk (0..15)
I'm deciding how I want the model plugin I made to handle the eye height / hitbox / shooting point things
no thats to get the chunk x
I think modelengine is using eye location which is the pivot point (origin) of the hitbox
Ah
int chunk = location.getBlockX() & 0xF
Wait can’t you just % 16
F is 15, 0x is a prefix for hexadecimal value
Did you remake model engine for this :p
it would be very fun it you could make a model that actually shoots from several points
basically yes
eye height is interesting
apparently it's always 85% of the entity height (if standing in normal pose)
hm
I think for ghast it's a bit different since he always shoots from around the middle if not slightly below
oh that's true
maybe that's where the pose comes into play
But then also, is the eye location the same as the shooting location?
that would make sense
there are many factors to think about xD
I think the pose changes when ghast shoots and then it returns back to normal
so it halves the eye location I guess
it looks like they hardcoded the eye height for ghast at 2.6 (standing pose)
interesting
different calculations for each mob, but those who shoot projectiles and are similar sized have similar shooting point
In paper are commands ran on their own thread executor ?
skeleton, witch, drowned
im banned from paper discord
why isn't this working?
Idk
Maybe don't get banned next time :)
yes
I put my pronounds as "sp/ed"
they do run on their own thread executor separate from the main server thread
Yeah maybe read the discord probably should be obvious that won't fly on paper
All the communities im in dont really support those ppl so we all set our pronouns as trolls and just forgot that specific servers see it
“Those people”
Lol
yk.. the gays
and discord pronoun users
both!
frick discord pronouns
just get nitro if u dont want other servers to see
Yes very edgy
i have no money
samee thing
Lol I just guess I'm being forcefully transitioned now
on topic to this channel though, is it possible to get the items "newly brewed" from the BrewEvent? I noticed that the results will also contain potions that were previously brewed but not removed.
I don't think so
Though let me check
?jd-s
Doesn't look like it. Maybe hold a cache? Best I can think of
Brewing stands are awful
Or since potions don't stack anyways PDC
Run away from them
Is there anyway to improve the api or is this mojangs deal
Probably a bit of both
They don’t support datapack recipes like all other blocks, which sucks
I'll look when I get home
They are basically stuck in 2015
I need to finish one commission then I just wanna pr to spigot
1/10th of a name change
how can I get a block id from a nms BlockState?
You know what I'm feeling nice I'll donate 2 dollars 💸 only if md goes no life though
Block id?
Like the old legacy crap?
integer
fosho fosho im working with raw packets rn and I need to write the id
You ever wanna look at prs then realize you can't cuz your on your phone and your password is like 600 characters
Yeah :*)
My everything be like this
My passwords are so secure I'm pretty sure my weak point is 2fa
Like I think it's less secure than just not having it
Unless you get token grabbed
Is this an expensive operation?
val chunkX = packet.column.x shr 4
What is shr
kk
Why is my plugin reacting to 3 duplicate PrepareAnvilEvents every time I do something with an anvil
for some reason he just cant acess the enchantments, if someone could help me
Mix of tabs and spaces. Unusable
no
Egg
Guys if im running blocks[player]?.get(Pair(x, z))?.filter { it.first.worldName == world } and the .filter thats its being called on goes through 500k entries will that be really terrible if im doing that every single time a chunk data packet gets sent
I mean yeah probably. That's a lot of elements it will have to sift through
And not only that, comparing a string
So you have to compare 500,000 strings
quick q
so I have this weird issue where my villagers don't seem to be saving their persistent data containers on crash
do these containers rely on a world save to be saved long-term?
scratch that I can't even find them when the world saves
man how is this happening
The BrewEvent could just be expanded upon? Right now, it mixes the ingredient into the potion and if it cant, it returns the original potion. All you'd have to do is create a second arraylist, and add the potion to the list if it's different to what is already in that slot. Send both all and new brew results off with the event.
Besides that though, I think you could just rely on the blocks inventory as opposed to creating a cache? I mean, it essentially is it's own cache until the event is done.
https://github.com/lthoerner/betteranvils/issues/1 what do you guys think might be causing this?
I'm getting the persistent data container
it should survive restarts right
on a villager
yes but they're not saved to the world. entities are stored in a separate file in modern versions
entities.dat iirc
alright any reason why the data wouldn't save if the server crashes?
no idea. they're saved in the exact same way as all other entity NBT is
it's not that tight, it could run for an hour with the entity there
and it will not recognize it on boot
ok... got it narrowed down to it only not working on startup
For starters I'd use the player's UUID instead of the object
What I do at work is have the user class as a sort of collection where I can put my own variables
Sometihng like
public class User {
private final UUID playerId;
private final Map<String, Object> data = new ConcurrentHashMap<>();
public User(UUID playerId) {
this.playerId = playerId;
}
public <T> T getData(String name, Class<T> clazz) {
Object data = this.data.get(name);
if(data == null) {
return null;
}
if(!(clazz.isInstance(data)) {
throw new IllegalArgumentException("Invalid data \"" + clazz.getSimpleName() + "\" for field " + name);
}
return clazz.cast(data);
}
public void insert(String name, Object object) {
// Feel free to do type checks here
this.data.put(name, object);
}
public Player getPlayer() {
return Bukkit.getPlayer(playerId);
}
}
And usage would go something like
ACUserData userData = user.getData("anticheat", ACUserData.class);
...
I'd also make a UserManager with default data values
public class UserManager {
private final Map<String, BiFunction<Player, User, Object>> defaultValues = new ConcurrentHashMap<>();
private final Map<UUID, User> loadedUsers = new ConcurrentHashMap<>();
public User createUser(Player player) {
UUID playerId = player.getUniqueId();
User cached = getUser(playerId);
if(cached != null) { // WTF?
return cached; // sanity
}
User user = new User(playerId);
for(Map.Entry<String, BiFunction<Player, User, Object>> entry : this.defaultValues.entrySet()) {
String name = entry.getKey();
BiFunction<Player, User, Object> function = entry.getValue();
Object result = function.apply(player, user);
if(result != null) {
user.insert(name, result);
}
}
this.users.put(playerId, user);
}
public User getUser(UUID playerId) {
return users.get(playerId);
}
public void registerDefaultData(String key, BiFunction<Player, User, Object> function) {
this.defaultValues.put(key, function);
// Feel free to loop over users and re-run the function
}
...
}
At least that's how I'd do it
Feels a bit more scalable imo
But it's also more suitable for unstructured databases like mongo
So you'd run something like
registerDefaultData("anticheat", (player, user) -> new ACUserData(0))
And it'd create "empty" data for the anticheat
So you can skip null checks
But it's optional
Well your central hashmap would be gimmicky
First because it's a map where the value is also a map
And second because your time complexity would really suit your goals that often
Your structure's more optimized for "I want to get all the Anticheat data" rather than "I want to get all of ImIllusion's data"
Not really
Because you still have a map and buckets for each user type
It's just gimmicky
Seems like more cpu usage for less ram consumption
Except that ram is cheap and abundant
how would one find out if something is lagging the netty thread
since that doesnt show on /tps
ofc because tps is server
Really the only way the netty thread is going to lag is mostly going to be with the OS doing something in regards to the connection. The netty thread relies on a queue in regards to receiving and sending.
Unless you got something doing some kind of weird reflection in regards to how netty works which i highly doubt
Yes I am intercepting the chunk data packet and have a feeling that what im doing with that data is lagging the netty thread
Its possible but it really depends on your code. Generally when you intercept you want to just handle it all manually thus you need to do nothing more then remove it from the queue
There is only a few things where it may be necessary to let the packet continue
Hi, currently using spigot-api version 1.19.4-R0.1-SNAPSHOT and I'm looking to get a inventory name when InventoryCloseEvent fires, I tried doing e.getView().getTitle() and tried sending it to the player and it only returns a blank line, I tried doing it with text as well and the text shows up, but not the actual title of the inventory. Yes it does have a custom name to it. When I open the block selector gui in creative mode it does return "Crafting" though
I have also checked online and they all say to use event.getView().getTitle();
Any help would be amazing
You can use spark and use --thread
I do let the packet continue and in that that packet I loop through about 30k entries in a list
well about 3k per packet and it updates for about 10 chunks maybe more
Based on your messages in PacketEvents and wanting to do a per-player block system, I would just cancel the original chunk send packet and send your own
I finished it pretty much, I feel like that would the exact same would it not? (Some blocks in the chunk are bukkit's)
It wouldn’t because you wouldn’t be doing the looping on the netty thread, you would build the packet on another thread and then send it
could I cancel this packet and then resend it on a dif thread? (Doesn't netty not support sending packets async from it threads)?
You’re sending it through PacketEvents aren’t you?
Im not sending anything atm I do this, and in that function I modify the packet
Is there a better way to do this?
A better way to do what?
This is basically what i was referring to in regards to intercepting packets
I'd probably give that packet some kind of internal id or "bypass" and have a thread pool and a queue
So you'd have a "processing" queue with a thread pool going at it and once the packets have been modified you can send them straight through
Netty uses thread pooling to queue packets. If you stop the queue no other packets in that queue on that thread can continue until your done doing whatever
So packet events is pausing the item in the queue while I modify it? thus causing it to pause all other packets?
This is why you would typically just cancel the packet ie remove it from queue do your processing needing to be done then resend packet
^ That's my idea
Have your own thread pool processing the fake chunks and cancel the original packet
Once the processing has gone through, you can add some sort of tag to ignore processing for the finished packet
Yes, because this is how events work
TCP should assign them an id but I doubt it's exposed
Yeah not sure if its exposed or not. This is what i meant
You can make a wrapper class for the PacketWrapper and check instanceof
mhm that's crunchy I doubt it'll work
It will with PacketEvents
Anyways back to tires for me. Hope the information was helpful 
Thank yall so much for the help
if you go with frostalf’s solution
we have a sendPacketSilently function
so you can process the stuff
cancel and send silently
avoid a stackoverflow
What manages the queue?
Oh yeah I forgot about that I’m stupid lol, that’s what I use
has anyone seen this error before? This is on 1.20.1 and I get kicked immediately after joining the server, after a lot of testing i only found out it was indirectly caused by scoreboards, the server has a much longer error log as well https://pastebin.com/pHZBTYzj
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Did you check for updates to any plugins you are running?
yes, ive updated all of my plugins, as well as removed them one by one to see which one would cause the kick, and it turns out to be my own plugin, which ive also updated to 1.20.1
all plugins show up as green, ive also tried both ProtocolLib 5.0.0 and the latest dev build, but the problem still happens
Seems to be a problem with casting, might help to see code maybe?
The kick stopped happening after i removed the scoreboard functionality from my plugin, but I still havent been able to find exactly where the problem is happening
this.player = player;
target = null;
//Util.log("Creating new scoreboard");
scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();
//Util.log("Registering LibsDisguises");
DisguiseUtilities.registerAllExtendedNames(scoreboard);
DisguiseUtilities.registerColors(scoreboard);
//Util.log("Registering Colors");
registerColors();
//Util.log("Setting scoreboard");
player.setScoreboard(scoreboard);
cache = new String[15];
next = new ArrayList<>();
taskID = -1;
//Util.log("Attempting enable scoreboard");
if(Settings.getConfigBool(player, Settings.PATH_BOOL_SHOW_SCOREBOARD, true)) {
enableScoreboard();
}
tracker = null;
//Util.log("Starting tracker task");
trackerTaskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(Derp.inst(), this::tickTask, 0, 1);
}```
All debug messages would print when a player joins, but then the player would get kicked a split second after they join, just removing the line `scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();` stops the kick
Its complaining about item being casted to something else. Generally nms stuff changes between versions
I didn't use nms in my plugin at all, but I did depend on ProtocolLib, maybe I should just wait a few days until they have an official release for 1.20.1
It might be an issue in libdisguises but you also didnt show the full class either
thats an idea, ill try removing libsdisguises and test again
you were absolutely right, thank you, theres some sort of conflict between my plugin and LibsDisguises

guys is it fine to make plugins for 1.8.9?
I usually make them to support from 1.8 to the latest MC server version
as there is still some servers on 1.8 especially PvP servers
yea i would like to make a plugin for 1.8.9, cause its related to pvp
and 1.8.9 pvp is the most popular
can i make a plugin for 1.12 and it would work for 1.8.9?
or how do i make it support for 1.8.9
so for the pvp to work according to 1.8.9, just the server has to be 1.8.9 right?
do note you wont get much support here using 1.8
i see
Wouldn't recommend it.
- Outdated
- You will hardly receive support here.
- Extremely limited API
But, you do you.
but then how do we make plugins for a 1.8.9 pvp server
If you use for example Spigot API for 1.12 then some APIs won't work on 1.8.9 so you would need to avoid using them if you plan to support 1.8.9
1.8.9 is only a client version
i see
1.8.8 is the latest server version
oh
but shouldnt make much of a difference if i used 1.8.8 right?
Yeah usually a server version changes when.. it's anything but a rendering issue
but do note like shaddow said, you miss a hell of a lot of api and barely anyone here will help you with it
1.8 doesn't even have titles or boss bars lmao
This isn't a problem you can just use 1 if statement that check if server version is too low in order to support those features.
Like
Ah yes, spaghetti.
they are features
But no API
Titles need nms
Bossbars use hacky upside down withers
That spawn client-sided particles
just skip them in 1.8
I remember those days. Luckily it was pretty simple.
It was
and use them in supported MC server versions
just a couple packets
but like
Spaghet
i mainly just want the pvp to work according to 1.8.9
OldCombatMechanics go brr
and the plugin to have all api
It's actually just one if else statement not a spaghet XD
or just 1 if statement with return
Imagine using if statements all my homies use hashmaps
so like what do i do
i just want to keep the pvp 1.8.9
but the plugin can have all api
You have 2 options.
- Use 1.8.8
- Use a newer version and install OldCombatMechanics
What plugin do you plan to make?
its an rpg kinda plugin
has classes and stuff
u can choose one and pvp
basically 1.8.9 pvp but with powerups and classes
i see
so oldCombatMechanics allows them to pvp like 1.8.9?
how do i use it
and i think 1.8.8 has limited apis like u mentioned
https://www.spigotmc.org/resources/oldcombatmechanics-disable-1-9-hit-cooldown.19510/
You just download it and put in your plugins folder.
oh ok
aight
so then i can just use 1.19.2 plugin for the functionality
and that plugin for 1.8.9 pvp
If you don't plan to use any new features than use 1.8.8 for development.
if you plan to use some new features, but only on newer MC server versions than use the latest MC server version for development.
If you want new features, you have to run new versions.
the 1.19.2 api wont work then
ah makes sense
For PvP servers you also don't need new blocks, mechanics or anything else introduced in later MC versions.
And performance on 1.8.8 is blazingly fast in comparison to latest MC server version.
your run 1.19.2 server, and use 1.19.2 api and old combat mechincs
You can't run new things on older versions.
the main things i would need is
making gui's using inventories
particles
and some text on screen like scoreboard or alert
i see
GUIs can also be made in 1.8 with ease
ill just need to position them ig
No custom model data, no pdc
I remember using player heads
That's as fancy as it goes
so 1.8.8 should be able to cover them right?
btw
can we make gui using book
in 1.8.8
I even don't know how this would look like...
So my plugin is using 0.45% of the cpu because of metadata. Because I'm editing metadata every block
Never seen that before
Should I update it every 5 blocks or what?
nvm i prolly saw them on forge mods
With 1 person and I'm planning to have atleast 30-50
You would need to provide more context on what you want to achieve
and probably a better way to do this exists
Well it's the only major thing with performance in my plugin
Ik 0.45% isnt much but that's with 1 person
And metadata is using 0.41%
Because I'm updating lore every crop I break
hello, to make an "avance" gui system I looked https://github.com/Flo0/GUITutorial but I don't really like the system.
So I preferred to do this:
I no longer use button classes (everything is done directly in the menu class itself) the same for click events, everything is defined in the gui class
Is it a good idea ?
Yeah by not updating the lore every block xD
Does lore include how many crops the item has broken?
you can basically just increase the number in the event and later on like every second update the lore
so it won't change instantly
Hello, what is alias parameter in TabCompleter#onTabComplete()? You know, it would take a lot of time to test, so I ask here.
Its a way to register or check for another name for the command
