#help-development
1 messages Β· Page 238 of 1
Easy as that
I did listen you tried to tell me that it was impossible to lose data even if a connection is live
I explained to you how it was not
you didn't accept it
If data Is lost the connection dies, so no live connection. It is impossible to lose data over TCP with a Live connection
e.getView().getTopInventory()
what does that do?
gets the top inventory, might check the type there
Time to screw with mysql lmao
if this were true you wouldn't be able to game with high latency just fyi
how does shading work?
Why did you put player in paranthesis? I am aware this is a beginners question but just trying to learn
Yes you can. Latency has nothgin to do with a connection state
anyways I am not going to talk with you further because you are obviously outdated on your information
it includes the jar in your jar
Think i got it. Thanks
because InventoryOpenEvent give Human entity , so you need to cast it
lol TCP has not changed in many decades
to Player
Ah I see, we can't overwrite vanilla valued with pdc. I assume that if we want to do that, we're still going to have to work with NMS?
Why do i get this error when i have an artifact?
then you just can't fathom how you can lose packets
must not worked with enough connections or worked outside of the actual data center
Yes discussion over. you will not learn
the artifact you are trying to shade to doesnt exist
what's after get the top inventory? i do if topinventory instance of Chest?
or is there a better way?
isnt there a getType
Thanks for helping me understand morice! π
like this right?
hmm my parser doesnt seem to like precision
might wanna add a mode to calculate with bigdecimals
alr
looks like overflow tho
can i do ?
if its not chest , then return
alr that's better
i learned that the hard way xd
its lookin hot
Packet loss occurs when one or more packets of data travelling across a computer network fail to reach their destination. Packet loss is either caused by errors in data transmission, typically across wireless networks, or network congestion.:β36β Packet loss is measured as a percentage of packets lost with respect to packets sent.
The Transmissi...
read up, in there it states intentional packet loss is a thing by routers that are outside of your control and no you won't simply just disconnect
long story short , iam trying to do something that is a bit hard to do ..
so in skywars , there is islands chest , and center chests , iam trying to first player that open a center chest reward him [finish the Challenge]
it depends on your logic code for such things
ok but there is a problem with something ..
whole wiki just for packet loss and all the ways you can lose packets
if i open a
that have nothing to do with your code π
gui thing , it will run the code
Also, nothing you can do about packet loss when it is the stuff in the middle choosing to do it
y'all mf boomers won't stop arguing
insert Map<Inventory, CustomGui> here
Lol you still don't get it. I never said packets can;t be lost, I said data can;t be lost with a live connection. TCP is a connection based error corrected protocol. If it finds it impossible to send a packet the connection is dropped. If a packet is lost it is resent. If a packet is received out of order the missing packet is requested. It is IMPOSSIBLE to lose data with a LIVE TCP connection.
groupmanager dev is never wrong
W
lol
groupmanager + towny starter
found something π
tf am i looking at
some code for the event xd?
exposing collections meh
love it when all of my tests are working except a big chunk of these ones
get ninjad
darn it , it still send the code !
make that a for each lol
me?
no that alien next to me
ignore what i said
i must do the other thing , damt ..
someone give me some nested expressions lol, like (5*((3+4)%6)) i need to test my parser, got these already
looks like everything is working fine so im out of ideas
not taking operator priority into account
- or / whatever
its doing it all from left to right
so technaccly i can use it like this right xd?
so if its not the same , it will return ? from what i understand?
well thats 21 because it sees the parentheses
3+4*2 would result in 14 instead of 11
thats why i need to rewrite my solving algorithm
its just a bunch of if elses now
is it bidmas or bodmas
already got an idea but its awful
what's the event to stop item frames from popping-off mid air
should be comparing a calculation in pairs of one operator and two operands
3 * 4 + 5
(3*4)-> operator priority 1
(4+5)-> operator priority 2
the first one is higher so it can be executed
otherwise wait and solve the next```
its a mess
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
this for the noobs
aka you
how the hell did they type the first one withou tit becoming a code block
haha
really dont know how to begin lol
Question: Is there a limit for how big my strings can be in pdc?
rule 1 is to never touch ancient code and i broke it
"a".repeat(Integer.MAX_VALUE) hehe
exactly
but it doesnt work as expected
might aswell works with two stacks
__ self __
that's many edits
wouldn't allow me.....
player.setGamemode doesnt work on PlayerChangeWorldEvent, any idea how to deal with it?
it doesnt work on PlayerJoinEvent either
I've done this before, one second...
just discovered IntPredicate exists
nice
nice and clean tho
i would assume it depends on the client and how long it takes to load, not on the server, maybe there is a client put on world event or something?
It does seem to work though?
so iam creating something :
- first player open a chest give him reward , i was thinking about creating a list with Integer , and add the Arena.getplayers.size , after that i check :
int first = firstplayer.get(0);
if (firstplayer.size() == first) {
loopcondition
Yeah. Here's a screenshot of it.
i use it to create a new expression that only reads between ( and )
aka how i handle parentheses
It's the event you asked for, and i'm using setGameMode there
alright will try it ..
unless this isnt the way to change the gamemode, it doesnt work for me
player.setGameMode(GameMode.CREATIVE);
That's exactly it, but @last temple is right.
damn 13ns when no jit compiling is involved
2nd run is probably like 80Β΅s
love the jit compiler
if i'm lazy ? doWork
anyways gn
why has there to be college tmrw
i gotta fix that im not there so i musnt do my presentation
OH MY
THANK YOU
I COMPLETELY FORGOT ABOUT MINE
PFFT-
back to study sql 
i forgot about my assigment webdev
probably got 0/10 now
ill cry about it
i made it but i was four hours to late
at less not -10/10
gn
but oof
@EventHandler
public static void onPlayerChangedWorld(PlayerChangedWorldEvent event) {
System.out.println("hi");
event.getPlayer().setGameMode(GameMode.CREATIVE);
}
[18:06:13 INFO]: misdocumeno issued server command: /mvtp world
[18:06:13 INFO]: [DatabaseInventories] [STDOUT] hi
[18:06:18 INFO]: misdocumeno issued server command: /mvtp world_nether
[18:06:18 INFO]: [DatabaseInventories] [STDOUT] hi
it may be bc of multiverse now that i think about it
i know it sets the gamemode too
so i should delay it
is there a command to tp to another world without multiverse?
Question: Is there a limit for how big my strings can be in pdc?
yea idk why it does that, ill add that permission to everyone
I know you asked for my ChatUtil earlier finally got around to posting it to github
https://github.com/Y2Kwastaken/megumi/tree/master/chat
thankos
thankos the new cereal coming to a store near you
yes
Hello just a nop question , if i add 1 elemnt , to a hashmap , will the size be 0 , or 1 ?
obviussly it will be 1 , but in java will it start from 0 as one , or 1 as one ?
alright thanks for answering ..
i see this chat is active , this last few day's i really like how you guys helping people with their questions , keep it up π
and in on finish i clear it ..
in what prespective xd?
Why shity Stream#map() is not finding the EvenPriority#priority() from my annotation?
that's the only way , i can add the chest
gimme sum code
first player that open a middle chest
that's what iam trying to do
only first
its quest plugin , and a quest that when first player open a center chest , it will finish the quest
whats your parser
well it should only be the first ..
moresoe meant that rather than the annotation
I have a List<ListenerInfo> were ListenerInfo contains a getHandler() method (return the annotation i sent)
Dont worry bro i fixed that
Just need to fix that - But thanksbroda
ideas xd?
hmm not sure
I would suggest renaming getGm() into getGame()
Question: Is there a limit for how big my strings can be in pdc?
Hey guys big newbie here, trying to make a packet only entity. Could i get some assistance?
you know this guy is about to store unholy amounts of data in PDC
π
it's actually just a 32 char long string
but idk the limits
are there downsides to storing unholy amounts though?
You can def. store more than 32(*4) bytes on it
oh is that the limit? i see, thanks!
The math changes depending on whether you are talking in C-chars or java codepoints
I can't wait to store a Player Object in my items PDC
serialize a world in PDC π
For C-chars a 32 char long string would be 32 bytes long. With java chars it'd be anywhere between 32 to 128 chars depending on the encoding and with java codepoints (ints) it'd be 32 to 128 chars depending on the encoding and data
serialize an entire database in pdc
anyone?
I wonder what would happen if I scraped Google stock prices all time and stored all the data into PDC
good luck finding someone specifically good at making packet entities
Hey, someone can help me, i'm on maven and i can't use that :(
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.15-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
Craft bukkit? In this economy?
^
Googled "Spigot maven"
https://www.spigotmc.org/wiki/spigot-maven/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
β€οΈ your welcome next time the search engine is very useful
Also 1.15
Did you deploy cb to maven local yet?
yea there are a lot of problems
Nothing wrong with depending on cb
why
how do u implement nms in a spigoit plugin?
^
why would you ever do that
Spigot and cb aren't that different
there are a lot of methods
personally I use interfaces
?bt run build tools, on the artifact id change spigot-api to just spigot and boom
cb and bukkit on the other hand, large difference
but some people use pure reflection
i did that already
is this right? (maven btw)
If I had to use nms I'd use ASM. The best of both worlds
If you use spigot, there is no need for the spigot repo
Since you are guaranteed to have the spigot-api (which spigot depends on) in maven local
do you want to use moj maps
I'd reccomend it but you don't have to
where are they?
you run buildtools with the --remapped param
in the same folder?
I cbf mfnalex words are good enough I luv him for making this
javascript is the most scuffed language on earth
true
i heard that javascript is hell
Typescript has entered the chat
brainfuck has entered the chat
Shakespeare is a better eso
you can talk about esoteric languages until your faces turn blue, javascript is worse because it's actually used
where do i have to paste this pom.xml?
@river oracle
that would be correct
but there is an error
reload maven
how can i know the level and xp of an offline player?
u gotta get it when they leave
i think
maybe store the uuid in a list until they join back?
why? is that stored client side or what?
?paste
Youβd have to save and retrieve that yourself I donβt think there are method(s) to get the level of offline players
remove line 49
maybe i can access their xp with that player object
pretty sure you can just case offline player to player
might cause some errors on some methods but what you need it for should work
you mean cast?
i reloaded it but i dont see minecraft.net.server in the external libraries
it has to be stored somewhere
oh nvm
yea, i get an error when trying to cast offlinePlayer to Player
ok, but there is no way to make minecraft believe that a player joined the sv?
so it creates the player object and all that
why
https://wiki.vg it is probably stored somewhere
There are limitations to that
Mainly that you can't store something from the past
i will store it myself, the thing is i need to know the xp now for that
The only issue really is how does one want to read those files. There are probably libraries out there, but those are limited
i dont want to reset everyones level and xp
And for that a player needs to be online
And you can't fake the connection on online-mode servers afaik unless you go into really cursed territory
its offline, just me and some friends, and friends of friends, i could literally join with their names, but i want to automate it
Eh, you are better off getting some NBT library and reading it from the playeruuid.dat file
yea, i guess ill do that
tho, also, for some reason, since upgrading mc versions in the past, there are plugins, like the ones to sell regions, that cant get the name of a uuid
but its fixed when the player connects again
so, making a fake connection would help with that too, so id like to know how to do that, if possible
Most likely because the player is purged from the player name cache
sql join and inner join?
i'm a little confused
It's all fine and all but first you gotta get the player entity attached to the player
learning sql for plugins and java applications
sourceforge
and what is that cache exactly? bc i filled usercache.json (using the data from a plugin that luckily stored in a database uuid names keypairs) but nothing changed
If "everything" means outdated
ye things changes
https://github.com/Querz/NBT is what I'd use
At least it is something that is in a random maven repository known by mvnrepository.com (https://mvnrepository.com/artifact/com.github.Querz/NBT/6.1)
.
so, if i understood correctly, all the nbt tags are stored in that .dat file, as if it were an array or something
in that order
and it would be a matter of reading the proper offset, right?
and an NBTCompound is like some kind of object? what does it use as a delimiter?
so how is it stored, i dont get it
the order does not matter
on the player .dat file for example, the first byte is OnGround
the second byte is sleeping
then a short, 2 bytes
there is no order defined here
this isn't a hard coded format for fields and data location
it is arbitrary data storage
you have to parse the entire thing and traverse it in memory
mmm ok so
using this thing
i would have to do
Yeah
But all these entries are named
So playerData.get("XpTotal") (or something along the lines of that)
so getByte, getShort, etc, and using a key
Yeah
these keys
ok, ill do that, thanks
now, about the user names cache
userdata.json is not what spigot uses as a name cache then?
Is the decompressed data for example
(so you might need to decompress the NBT first I am afraid)
NBTUtil.read() reads any file containing NBT data. No worry about compression, it will automatically uncompress gzip compressed files.
In that case you are in luck
wait a sec
you can reset player havn't slept time?
why did i never think to do that
It is possible that it is using the playeruuid.dat file, but that shouldn't get purged - so I have no idea.
well, it depends, where is that file located?
Is it even possible to get that time in spigot api?
if its inside the wolrd folder, then indeed it was deleted
Yeah
mmm
world/playerdata
yea ive done some stuff with that
i guess it uses the file inside the world with the name in server.properties -> level-name?
No idea. Anyways, I urgently need to go to bed now. Cya!
ok thanks and gn
Cyo
alright alright
Where iam?
my bad
This is not paper π π
?whereiam
i cant use this for paper help?
Definitly not!
idk it used to work
?whereami
Lmaooooo
@bright plover
thank you!
Ty!Β°
can i read the config from another plugin?
Yes, just point to the file path.
you mean manually?
I mean, the main config is also available from the instance of the plugin
if you have that
cant i just do getServer().getPluginManager().getPlugin("").getConfig() or something like that?
yea
ye if it is accessible
meaning?
or good luck with fields
getPlugin not returning null?
yes or JavaPlugin.getPlugin(Plugin.class).getConfig();
noob detected
plugin.class is the main class of the plugin you wanna get
if i do config.getBoolean or something like that with a nested prop, like, settings.something.blabla, will it return null if none of that exists? or will it throw an error and it only returns null if at least settings.something exists?
I think it returns false by default
Always javadoc```
getBoolean
boolean getBoolean(@NotNull
String path)
Gets the requested boolean by path.
If the boolean does not exist but a default value has been specified, this will return the default value. If the boolean does not exist and no default value was specified, this will return false.
Parameters:
path - Path of the boolean to get.
Returns:
Requested boolean.```
"if the boolean does not exist"
π
ez make it exist
shouldn't it be
smh
if the path does not exist
then make it exist
javadoc tells you, just read it
oh the boolean does not exist as in the value π
taah is blind
.set("path", true);
not that freaking hard bruh
remember to save
plus you can do a null check

π¨βπ¦―
when getOrSet
addDefault
i prefer the name getOrSet
sounds confusing
ππ½

I commited a major mistake in actually opening up my NMS guide and continuing writing a bit
100 lines in and I'm barely scratching the surface
just write faster lol
I started talking about how TCP headers work
M&Ms?
i like the survey
````Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftRotatable cannot be cast to class org.bukkit.block.data.Rotatable```
```Rotatable bmeta = (Rotatable) block.getState().getBlockData();
section.set("facing", String.valueOf(bmeta.getRotation()));``` im trying to get the rotation of a block
it could be any block but im testing with stairs
stairs are not rotatable
wdym?
i just wanna get the direction a block is facing and stairs can face a dirrection
yes, Directional not Rotatable
Works fine for me on Stairsjava Directional dir = (Directional)loc.getBlock().getBlockData();
What's that website where I can see the nms obfuscations for each version
I forgot what it was called
is there a good way to do custom block textures without raytracing with armor stands and player heads
or is it still hacky hell for blocks
I'm trying to create a system like hypixel skyblock where weapons and armor have attributes like "2x Lifesteal" or "+15 Lifesteal" which all get added up. In this case I would get 30 lifesteal. How would you guys go about doing this?
for(int z = (int) e.getBlockPlaced().getZ() - 11; z <= (int) e.getBlockPlaced().getZ() + 11; z++) {
e.getBlock().getWorld().getBlockAt(x, e.getBlock().getY() - 1, z).setType(Material.RED_WOOL);
}
}``` makes a square of red wool but i just want to make it a border of red wool, how would i do this
that seems like fairly simple math you just have to skip iterations in the second for loop as long its not the last and first iteration
You could parse the lore line by line and if the line has βxβ, extract the numerical value and use it as a multiplying factor whereas if it has a β+β extract the numerical value and use it as an adding factor. Multiplying and adding factors can be stored in arrays I guess? You can extract the numerical values by splitting the lore string.
Just make sure to use order of operations and multiply after doing all the additions.
parsing lore is a tad outdated imho I think PDC offers a much better solution
Whatβs PDC?
?pdc
Oh thatβs really cool, I didnβt know about it
PDC offers a Map like operations. TBH I think a custom PDC type could work here best
wdym skip iterations in the 2nd loop for loop as long its not the last and first iteration
you should sometimes just figure logic out yourself
especially something this simple
i havent done something like this before and i dont know what to do which is why im here
your working with 2d system here so thats why you got 2 loops
if you want a full first row and last row to make the top and bottom of the rectangle/square
and the hollow insides of the rest of the rows
seems like a simple if statement to me
I never said cube
the only thing you need is one if statement
x == 0 || x == x+11
so I have a variable that has many players in it and an integer stat and you can obtain the stat by putting in the player's uuid one at a time and I want to make a list of the top 10 of these players does anyone know how I can do this
would be the boolean header
use java streams for this
I'll show an example
mk
for(int z = (int) e.getBlockPlaced().getZ() - 11; z <= (int) e.getBlockPlaced().getZ() + 11; z++) {
if (x == 11) {
e.getBlock().getWorld().getBlockAt(x, e.getBlock().getY() - 1, z).setType(Material.RED_WOOL);
}
}
}``` now no blocks are set & ```x == x+11``` is always false
oof lmao didn't mean streams
looks like your best option is a TreeMap
ok
wait this is for hashmaps
oh nvm that will actually work the same
You might have to use a bimap tbh
You cannot Sort hashmaps without creating another map
Well I guess one could Copy the Keyset as a list and then sort that but that has it's inefficencies
To update players belowname health value should I run a task that fires very often? If so, how often should I update?
you could just use the scoreboard
wot
ik the belowname can be set through a scoreboard
but how would i go about updating this
it does by itself iirc
whatttt
im confused bro
i thought a scoreboard was a constant
that had to be updated
not everything in a scoreboard needs manual updating, it just depends on what it is and whether the scoreboard supports it already or not lol
ok ty, are there any code examples os i can try and grasp it
hmm
?scoreboard
thought maybe we might have had a command
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
can't really vouch for quality, but nonetheless should still be able to learn something between those two
Bing your question before asking it:
https://www.bing.com/
Good morning , i finished all quests for skywars , i only have 3 challenges left ..
its the hardest , i tried allot of things , and it still not working probbly the challenges are left is :
1- drop 2 player's into void and when they die , will you get the challenge done .
2- this one is a bit hard : when a player collect 8 ender pearl , finish the challenge.
3- if the player is the first one to open a center chest , then finish the challenge ..
i worked on number 2 , 3 .. but didn't really finish them
anyone have ideas on how to do these challenges?
i have the core code , for registering the challenge , guis , etc everything finished , iam talking about the event part ..
- check if the last damage cause is void
- listen to pickupitemevent and count for each player
- do i even have to explain this?
- will the pickupitemEvent be triggered when you take an item from the chest?
- there is islands chests , and center chest
why internet on my pc just cut off xd?
ddos
why no internet π
idk what happend ..
i will show you the code i tried
an NPE isnt "plugin development specific"
alright so this is how i make it :
i hope you understand xd
InventoryOpenEvent maybe?
or PlayerInteractEvent , get the block , and the type?
did you really censor your own todo comment
nullpointerexception
there is something i can use maybe?
i can get the location for all center chests only
what exactly am i looking at
Player open first center chest , if so give him the reward , if other player open a center chest , do nothing ! bcz there is already a player that opned it
what do you think the best aproch for this
there is also a map with loc , and chest
i would probably use the PlayerInteractEvent and have a boolean somewhere which you simply set to true once a player opened a center chest
how would that work?
i mean your api doesnt makes sense to me but anyways, you should have a central point for your game session or whatsoever where you can put a boolean hasCenterChestBeenOpenedYet.
once a player opens a chest, Γ‘ rightclicks, Γ‘ PlayerInteractEvent at a center point, which you stored, check if the boolean is false and if, set it to true and reward the player.
answering to #2: no
btw do not call your event handler "interact", but rather "onChestOpen" or something similar
SELECT * FROM player WHERE uuid = e0b0c9be-944b-43c1-a84f-54c48a25c4e7
[2022-11-28 16:46:43] [42S22][1054] (conn=37) Unknown column 'e0b0c9be' in 'where clause'
why is it only taking the first part of the uuid
Can you show code of your query
public PlayerStats findPlayerStatsByUUID(String uuid) throws SQLException, ClassNotFoundException {
Statement statement = getConnection().createStatement();
String executeCommand = "SELECT * FROM player WHERE uuid = " + uuid;
System.out.println(executeCommand);
ResultSet results = statement.executeQuery(executeCommand);
if(results.next()){
long firstLogin = results.getLong("firstLogin");
PlayerStats playerStats = new PlayerStats(uuid, firstLogin);
statement.close();
return playerStats;
}
return null;
}
this is mariadb btw
Hello, is there any good way to create nametags above the player or some api besides nametagedit?
TAB + luckperms usually works (maybe you need vault also idr) (or well at least PAPI)
Hey, I am trying to build my Minecraft spigot plugin with Maven, but I receive this error:
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-parseable POM [my POM-path]: only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:1) @ line 1, column 1
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project ([my POM-path]) has 1 error
[ERROR] Non-parseable POM [my POM-path]: only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:1) @ line 1, column 1 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
Here is my pom.xml: https://hastebin.com/nigiqaxixe.xml
Non-parseable POM [my POM-path]: only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:1) @ line 1, column 1 -> [Help 2]
you have there an unicode char
I opened the file with notepad++ and it doesn't show me any character there
check file endconding
it is the only thing I can think of
also, it does no good that you pasted the pom to a paste site
as this doesn't actually let us inspect the actual file
odds are if you copied the contents from the paste site back to your original pom it may just fix your problem
just write a program that replaces any \u0 with
No, sadly didnt work
only thing I can say then is check file encoding
or delete and remake the pom file
I don't have the file, so I can't really say what it might be etc
I created a new project with the same main class etc. and copied the pom.xml to my old project. Works now and I have no idea why
could have been the IDE then being dumb
so frustrating
you had some invalid whitespace in the first line
no idea why lol
Does any1 here know how one would make furnaces faster. Say like x2 speed. ?
Furnace interface has a method "setCookTime"
but
you could also loop over all registered furnace recipes and set their smelt time to currentSmeltTime / 2
that's probably the easiest solution I guess
FurnaceRecipe has an integer called "cookingTime" (which probably is in ticks)
Dont know if that will work for me. As i need to modify this for certain players
Each player has a personal furnace
oh well. Okay, then you have to do it like this I guess:
- Whenever a player puts something in a furnace (InventoryClickEvent or however it's called)
- check if it's a player who has this "fast cook" feature
- Set cooking time to maxCookingTime/2
that should do it
but
that would only work if they only cook 1 item, not for a full stack :/
Ahhh thats friking unfortunate
If you wanna do it per-player and for a full stack, then it gets a bit complicated
you need a runnable that does this for every new item
Do you think i could just somehow tick the furnace manually?
I don't think so. I mean, you could ofc, but then the GUI would be fucked up
Rightt..
Do you really want to do it "per-player" or just "per-furnace"?
E.g. imagine only mfnalex has "fast-cooking" perms, then I'd simply make every furnace faster that mfnalex "placed", and not every furnace that mfnalex "uses"
then it'd be quite easy
Well the furnaces dont rlly exist in the world. Its sort of an "ender furnace" that just opens when u click a furnacr
I'm just going to drop my CustomBlockData thing here, might be helpful for what you wanna do - e.g. you could store the "owner" UUID of the furnace inside it, idk -> https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
So its per player ig
No
or only about "normal" interactions with this furnace?
ok
then I would do it like this:
Only normal
cant you match the recipe and put the result manually
Whenever someone puts something inside the furnace, store the dude who did it (their UUID) using the lib I sent above directly inside the furnace
then schedule a runnable and always just add maxCookTime / 2 to the cookTime when it starts
and when someone else interacts with this furnace (puts something inside), you just reset the UUID
you can do player.getEffectivePermissions() or sth like that
then loop over that, and check if it startsWith("a.b.")
that's how it's usually done
doesnt sound very fast
well how often are you going to check it?
if luckperms has a node based permission structure i can probably use the api
not everyone uses luckperms though
Yea i guess i will try this. Could i apply the same technique to brewing stands. Or is that another matter entirely
probably like vanish and ban commands
this is a private plugin
especially big servers very often are still using PermissionsEx etc
oh ok
well anyway, it's not slow - I would only worry about it once it causes lag
ill make a util function so i can change it later
ill use your method for now and see how it goes
this is how I do perms
even for perms that are unknown
public static int getPlayerValue(Player player) {
int value = 0;
for(PermissionAttachmentInfo perm : player.getEffectivePermissions()) {
if(perm.getPermission().startsWith("a.b.")) {
return Integer.parseInt(perm.getPermission().substring(4));
}
}
return 0;
}
yeah
(This will ofc only work if a player only has exactly one a.b.5 perm)
thahhnsk
if they can have more, then you have to create a list or sth before returning it
ill get the max
Also shoulnt i be able to use FurnaceBurnEvent to then update the next cooktime?
yeah
I didnt know that this event exists
public static int getMaxPlayerValue(Player player) {
int value = 0;
for(PermissionAttachmentInfo perm : player.getEffectivePermissions()) {
if(perm.getPermission().startsWith("a.b.")) {
value = Math.max(value, Integer.parseInt(perm.getPermission().substring(4)));
}
}
return value;
}
this should work even when they have more than one perm called like that
and it should always return the max value
and you really don't have to worry about performance tbh
unless you call this 185162 times per tick
nic
actually i bet ill have to use luckperms api anyways
i need to get this for a uuid
as well
looks good
Hey guys, How Can I remove entity even where unloaded chunk?
I tried like below but it didn't work
armorStand.getLocation().getChunk().setForceLoaded(true);
armorStand.remove();
you cannot remove entities from unloaded chunks
Yeah I knew that already
you first of all have to load the chunk. You can use a plugin ticket to force load a chunk
I think that setForceLoaded does not load it immediately
but I am not sure
ahh hm...
are you on 1.16+?
yeah 1.19.2
Chunk#addPluginChunkTicket(Plugin) or sth like this
Oh thx I'll try it
np, if this doesnt work, lemme know pls
okk
you can also force load a chunk by simply doing World#getChunk(int,int)
but that requires the CHUNK coordinates and not normal world coords
before called .setForceLoaded(true) chunk?
you don't have to force load it if you only need it for one tick
Oh I didn't know it
andddd I'll try like this
Chunk chunk = armorStand.getLocation().getChunk();
chunk.addPluginChunkTicket(SkyExcelNetworkMain.getPlugin());
armorStand.remove();
you can basically do sth like this:
Entity entity = ...;
Chunk chunkWhereThisEntityIs = entity.getWorld().getChunkAt(entity.getLocation().getX() / 16, entity.getLocation().getZ() / 16);
entity.remove();
Oh
sth like this ( I only wrote it by hand, might have some syntax error, but in theory, this should work)
Lmao I see
Why it need to make variable?
Ahh ok
It's work!! Thank you brooo
no problem π
π
this will however only work if you remove the entity in the same tick where you call getChunkAt, but I guess that's no problem in your case
Yeah I load chunk only when it ends
oki
there is a Location#getChunk
GOOD!
true, I forgot about that. But it basically does the same thing
yeah, just use entity.getLocation().getChunk()
anyone know of actually good gson docs
it's not
at least not in 1.19.2 π
yeah i know
no
why not?
you cast it to (S) anyway?
now i can do
if (!ctx.senderIs(Player.class))
return;
Player p = ctx.getSender();
ez
but i can just cast the result to CommandSender
just confused why it allows both
or thinks it should allow both
fancy
found out luckperms appereantly doesnt use a tree structure
arent streams optionally multithreaded as well
last time I checked, LuckPerms used a totally normal HashMap<String,Boolean>
but that was like 4 years ago, maybe it has changed meanwhile
wait, I'm talking bullshit
LuckPerms uses this "Context" thing
yeah
the data is stored as a Map<ImmutableContextSet, Node> i think
hm maybe
anyway, if I was you, I wouldnt depend on LuckPerms but rather use spigot's perms system
I mean, just imagine you sometime switch to another perm plugin
why would i switch to another
except maybe my own if i make a tree based one which should be faster
for this kind of shit
with a String -> boolean cache
idk 10 years ago, everyone was like "PermissionsEx is the shit, I will never switch" and now everyone uses luckperms
sooooo
you can never know what happens in 5 years π
me casually having no idea what im doing
but i need to get it for an offline player
too
so yeah i cant
but what could be better than luckperms
so 2*true == 2.0?
javascript vibes
ffs
[] = 0 or something
then taking over the server
erm if it only takes 2 minutes, then ok
yeah
1.19.2?
ok ping me when you're done
ill dm u the ip
I just use GM
never used anything else
give me the ip
Meanwhile, the jvms: it's ... true! Yeah, I'll go with true
error
Shouldn't this be a static immutable map?
Should use Map.of(stuff here) instead
why is your true and false a double
just a tiny thing but I'd put the invalid name into quotes
e.g. "Constant "mfnalex" does not exist"
i will probably throw an exception
and then add a delayed message, 20 seconds later
ah that way
"IT DOESNT EXIST!!! GET OVER IT"
but for what are you doing that?
Wait a sec
im not even sure the user entered a constant that doesnt exist or just a random char
Just use actual constants
How would I setup a scoreboard that shows online players and ping for players
and then a new scoreboard for players in a duel
to for example allow (12*pi)^2
so the user doesnt have to write it themselves
Ah ye true
The constantpool should have a set of static final strings such as PI
Which are equal to the string constant "pi"
If you get what i mean
to be fair, booleans are more optimal if you can use ints instead
but well i dont understand that approach anyways
hi
Math.pow doesnt exist for nothing
wassuuup
can u tell me a good host from where i can buy a dedicated server or vps for my lifesteal smp
How does itemstack in the config look
itemstack has a serialize method
But it has different identifier
"doppelt hΓ€lt besser" huh?
that was just a german sprichwort, chill out
thanks β€οΈ
For players in the lobby, I want to display the player's ping on a scoreboard? How would I do this and update it regularly
are you looking for help on how to do this yourself, or are you just looking for an already done plugin?
how to do this myself
im making a plugin
I think you have to check out "scoreboard teams"
that's the only option if you want to display stuff in the tab menu
you can get a player's ping using Player#getPing() if I am not mistaken
i mean a scoreboard not tab menu...
wait ugh
and Player#getPing() is not a function
oh yeah, but still, you need to create a new scoreboard for every player
what version do you use?
declaration: package: org.bukkit.entity, interface: Player
Player#getPing() definitely exists
im on 1.8 api rn...
?1.8
Too old! (Click the link to get the exact time)
7 years, 4 months, and 5 day
why don't you just use a supported, recent version of MC?
cause im developing for a 1.8 server
Damn 1.8 devs must have depression or something
?paste
1.8 is a huge joke
I deved for 1.8 when o started realized it sucked and upgraded to latest all within a week
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
ok but i want 1.8 mechanics
why would you do that though`?
Plugins exist
that's like saying "I am developing an app for Windows 98"
except that 1.8 is a part of minecraft that is still extremely heavily played
while windows 98 is obselete
nah
you can get a plugin to return 1.8 pvp
windows 98 is still used by many banks etc
yes i know
minecraft 1.8 is obsolete
but ive had troubles with
noone uses it
turning 1.19 -> 1.8
What about the rest of the 6%
1.8 is just extremely outdated, it's over 7 years old
He should ask them
Surprisingly only around 6% last time I checked
Bad example lol
The only reason hypixel uses it is because they can't afford to migrate that much legacy code
No stats on that, but probably not as much as you think
1.8 pvp is still extremely played
and its alot easier to run 1.8 pvp natively
than using plugins to restore 1.8 on 1.9+
as ive tried
π§’
Because it's a cap
its still a significant part of minecraft
Servers are like 6% now
@onyx fjord yo
servers != players
Kinda yes tho
ofc alot of tiny smps will be running 1.19
Can i skip the tocompare?
What
Part on java
Idk why ask me
idk, maybe 5?
L
Just accept the information
I also wish you a very pleasant day
That 1.7ππ
I won't go away from here anytime soon
anyone know how to change plugin Category?
dont say that about alex
it's you who will leave here
you cannot do that. you have to report your own plugin and ask staff to change it
What about we all leave at the same time
is this players or servers
maybe @vagrant stratus can help you (sry 4 ping)
Servers
If there are no servers there are no players
Are we now going to discuss my sexuality?
kacper
but there is a very good chance
that alot of 1.8 servers
will have a vastly higher player base
than 1.19 servers
1.19 servers are also big
such as hypixel
Look at mcci
@smoky yoke

Closed beta but has 1.5k players
yes i get that 1.19 servers can also be big
see you
that is not my point
i think it is likely
that 1.8 servers on average
are alot bigger
how to get banned fast
as they do not include small servers
such as smps
that are often idle
or have very little player bases
then leave
i dont think u can say that 1.8 is not a significant part of minecraft
cause it still is
it is dying
but it still is significant
It's dead and more dead every year
no, you just don't read lmao
maybe. sorry lol
Woh
u make a point that disregards my point
just fuck up
lol thanks that was easy
Idk any popular legacy server Apart from hypixel
@vagrant stratus your time to shine
Stop talking shit about me
Even cubecraft is updating
think you need to grow up
thanks for ping
NMS