#help-development
1 messages · Page 588 of 1
I'm pretty sure I've read dates in chinese before that I could understand
there is one which means month/moon
2021.1.3 seems to work slightly better and allows higher language level 👍
on both chinese and japanese
on chinese it's yue
i don't know how to write tones in discord
japanese and china invaded each other like 99 times
long ago
so they have a lot of similar characters
just yoink what they want, give it their own spin and then add two more alphabets into the mix because things that make sense are for cowards
I mean sort of like lambda sure
well, china has just on alphabet
japanese and chinese have to change
it's ridiculous
though tbf chinese does have simplified chinese now
yeah and it sucks
you can write stuff using default letters
but with tones
i only remember one use of them
english me is chinese wo
where above o there is a v sign
wǒ
the pinyin sucks
which means yo go down and then up again
pronouncing this word
W-lowO-higherO
More like a woah
like Chongqing does not sound at all like what it's spelled out to be
then just write zh
everything about china is mid
middle kingdom
french is Fa guo
germany is de guo
but hell why the fuck is russia
Eluosi
why
explain
japanese also breaks the usual nomenclature for the name they have for china
Where does PlayerMoveEvent get called?
wdym
what class it gets called in the nms source code
what exactly are you trying to do
idk why do you need it
it just works
I wanna check some stuff
?stash
when player clicks on block, open the associated with it storage
You can store a PDC on a chunk
and if player clicks on the block in that chunk
check if the block location is stored in the chunk PDC
And open the inv
Tho it won't store items, just a link to the block
Unless you create a saving system
no
okay, then
you can add 2 entires to pdc
one is gonna be location
and second itemstack[]
and keys to those entries should have some connection
so by knowing key to the location you would be able to open associated inventory
look, i'm trying to do like the chest, but without the actual chest
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
you can also try this
it has the same chunk thing under the hood i guess
but provides you an easy API to store ItemStack[] in a block data
ye, thanks for help anyways
Tho you would need to use Bukkit.createInventory() anyways
and fill it with items from data
and then save the data back when inventory is closed
i dont sure if it will work okay for all players who looks into right now
well, you can make an instance check
what is a BarStyle?
So when first player opens the inv, he gets the first instance
And others get the same instance, not a new inventory
idk if it will work tho
The bossbar has different styles... meaning it can look different
oh, no
?jd-s
For example it can be one solid bar or split in to smaller sections
i will have many of these blocks
doesn't really matter
i know servers who already did it perfect
there will be one inventory instance per block
an what is a BarFlag?
i will look into it, but i think there can be simplier solution
and all of them would be null unless there would be at least one player currently viewing it
thanks anyways
paid if you can help it working :l
and these are barsyles
.
okay thanks
is having multiple bukkitRunnables (10+) gonna make the server performance worse? the only thing they do is hide a bossbar from a player
Na not rly
i dont have a lot of money around so performance is my number 1 priority
are there 10 runnables per player
It's bad if there is like 200 that do stuff every tick
when using the player.attack() method is it possible to buff the damage of that? like for example doubling its damage? the method uses the players mainhand item to calculate the damage
Listen for the resulting EntityDamageByEntityEvent
does it call any event
1 runnable per player
if it does, then just check for it
and that the damager is the player you are messing with
@fluid river when I am cancelling the event it teleports me back
I dont want it to move at all
I guess I need to remove it with packets
then how does hypixel do it?
probably sending location packets fast
Wait what are we doing
cancelling every move event is about as good as you can do it, but you may see a TINY movement each time on the client
you can try setting to to the from
Set their walk speed to 0
e.setTo(e.getFrom())
Also give them negative jump boost
The only way you could improve that (by a few ms) is to spam location updates to teh cloient
idk what's gonna happen
also yeah
flyspeed and movespeed to 0
but it won't change head rotation mechanics
that would help too
?paste
for (HypixelPlayer player: array) {
player.setTrueStats();
player.getSkillBossBar().setVisible(true);
if(player.getSkillBossBar().getPlayers().size() != 0) {
player.getSkillBossBar().removePlayer(getServer().getPlayer(player.getUuid()));
}
}
is this gonna lag the server? its in onEnable()
Does anyone know what this error means <.<?
onEnable will have no players unless it's a reload
Did you use a lib and not shade or provide it in another way
will try that thx
Im not sure, how can I check?
you can also try teleporting player to his original location each tick xD
You should know your code?
with a runnable
new BukkitRunnable(){
@Override
public void run(){
ArrayList<HypixelPlayer> array = new ArrayList<>(uuidToPlayerMap.values());
for (HypixelPlayer player: array) {
player.setTrueStats();
player.getSkillBossBar().setVisible(true);
if(player.getSkillBossBar().getPlayers().size() != 0) {
player.getSkillBossBar().removePlayer(getServer().getPlayer(player.getUuid()));
}
}
}
}.runTaskTimer(this, 1L, 80L);
full code
is this gonna lag the server with 10+ players?
noone can answer that
why?
I need help with the new version of itemsadder
sounds like #help-server
how do i format a long like 2.628e+9 to a yyyy/mm/dd/hh/ss format?
code:
getServer().getPluginManager().registerEvents(new com.amirparsa.hypixelskillcore.Listeners.PlayerAttack(), this);
error :Cannot resolve symbol 'PlayerAttack'
im 100% sure it exists. why is it telling me that it doesnt exist
DateTimeFormatter with Instant
dateformatter gives me a date like 1970
it works with hh/mm/ss
but when i do yyyy/mm/dd/hh/ss
?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!
it gives me 1970
f
can some1 help me with this? it just worked 2 seconds ago
Make sure it's actually in the correct package
it is
are you using maven? does it compile if you just urn mvn package? Is the constructor of that class public?
and is the class public too?
even maven doesnt have a problem when building
anyone knows what im doing wrong?
Error:
16:38:00 [SEVERE] Could not pass event PLAYER_CHAT to MineCraftBetaTest
java.lang.NullPointerException
at nl.timtendo12.listeners.BetaPlayerListener.onPlayerChat(BetaPlayerListener.java:30)
at org.bukkit.plugin.java.JavaPluginLoader$6.execute(JavaPluginLoader.java:279)
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:706)
at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:694)
at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:89)
at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:453)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
yes it is public
if it works fine in maven, just do File -> Invalidate Caches in INtelliJ
stacktrace and code don't match up. What's line 30 in your original code?
I guess it's settings.getConfigString? If so, "settings" is null
if only there was a newer java version that told you the problem
sorry, its on chatFormat = settings.getConfigString("chat-format");
"settings" is null
I dont understand how Settings is null as I imported it
show your main class
1 sec
are you using copilot?
btw PlayerChatEvent is deprecated, you should be using AsyncPlayerChatEvent (but that's not the issue right now)
i think they're on a very old version...
Does anyone know how to use the blissmp plugin
https://www.toptal.com/developers/hastebin (I know, this is a older version)
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
here is my main
Ask in #help-server
Import doesn't really means variable is initialized
that's an empty paste
tysm for helping me fix it
I did no one answerd
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Then wait some more. This is the wrong place
using what
okay
you initialised settings after creating the listener instance
you create your listener in line 17, but you only assign a value to "settings" in line 34
therefor, getSettings() returns null
ah I see, Thanks I'll check it out!
to fix this, move "settings = new BetaSettings(...)" to the top of your onEnable, and then AFTER that, create your BetaPlayerListener object. Or even better, instead of using plugin.getSettings() in the listener, just directly pass the settings object into the listener's constructor
why is that difficult to make a plugin xd
it's actually not that hard if you know maven and basic java and a bit of spigot's api 😛
github copilot
im soo new then xd
i am not
do you have any specific issue?
nah sorry
is there any good tutorials out there on userdata saving and loading?
here's a basic tutorial to setup intellij + maven for spigot plugins, idk if that helps oyu: https://blog.jeff-media.com/how-to-create-your-first-minecraft-plugin-using-the-spigot-api-and-maven/
for java ofc
do you need to access data for offline players too, or only for online players?
reading now
when they join it reads the playerdata and saves it into a map<UUID, HypixelPlayer> the structure is also complex
but i already know the basics of that, the thing it to make builder and that staff, no idea
okay so you only use online player's data. I'd use the PDC to save that data -> https://blog.jeff-media.com/persistent-data-container-the-better-alternative-to-nbt-tags/
builder? wdym?
like a MenuBuilder
That’s a named design pattern
Just google it and, if you have the basics down, then it ought to be reasonably easy to understand
this is gonna make a mess(50+namespaceKeys)
Yea sure
Well you're going to need those keys somewhere
I’d try to read about it in effective java also to understand its applications @quaint mantle
How else would you save and read your data
there any complete course or something for Java Free?
i thought it could be just a simple key, value map
yes but i thought a key would be just a string
idea: save a map in the PDC and only have one namespaceKey
?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.
You can do that if you want
?morepdc
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
It's probably more work though
wow thanks
so i should add implements ConfigurationSerializable to my HypixelPlayer class and its done
?
you can do that, but then you also gotta add the serialize() and deserialize() methods.
If you wanna then use PDC, you can check out MorePersistentDataTypes which adds a ConfigurationSerializable datatype
?morepdc
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
i know about morepdc and what should i put in those two methods?
it's all explaiend in the javadocs https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/configuration/serialization/ConfigurationSerializable.html
declaration: package: org.bukkit.configuration.serialization, interface: ConfigurationSerializable
ahh gotta love people tryna recreate hypixel with zero knowledge
basically, your class must have a method
public Map<String,Object> serialize()
that returns a Map<String,Object> of all your data.
And then there must be a static deserialize method that turns your map back into your object
public static MyClass deserialize(Map<String,Object> serialized)
it can also have a constructor that accepts a map
yeah or a valueOf method
Could you help me also ;-;
I prefer the constructor to keep it as close as possible to normal classes when using it myself
don't doubt, just wait until their server is the next Hypixel
Don't ask to ask, just ask
example
public class Person implements ConfigurationSerializable {
private String name;
private int age;
public Map<String,Object> serialize() {
Map<String,Object> map = new HashMap<>();
map.put("name",name);
map.put("age",age);
return map;
}
public static Person deserialize(Map<String,Object> map) {
Person person = new Person();
person.name = (String) map.get("name");
person.age = (int) map.get("age");
return person;
}
}
be sure to read the javadocs of ConfigurationSerializable
ugh 1.12 has no mappings
Ehh
did u let chatgpt code that?
no, why?
because you were so quick with it
no, that is a COnfigurationSerializable example
so the serialize is just "player":this ?
?
do you guys even know what serialization is?
the return of the serialize method
I mean the example is pretty self-explanatory
because you might wanna store it in json, or yaml, or whatever?
or you might wanna turn it into a byte[]using a BukkitObjectOutputStream
public class Person implements ConfigurationSerializable {
private final String name;
private final int age;
public Person(String name, int age) {
this.name = name;
this.age = age;
}
public Person(Map<String, Object> map) {
this.name = (String) map.get("name");
this.age = (int) map.get("age");
}
public Map<String, Object> serialize() {
return Map.of(
"name", name,
"age", age
);
}
}
It could be all automate with reflection ^^
where's the difference?
yeah o know im making myself look so dumb
good luck doing that if the values you are serializing are not serializable themselves
More like, let’s say you have a complex type which to some extent might be a configurable value in ur config for the server owners, then maybe
We could do type adapter for those case ^^
way too much reflection for such a basic thing
yeah but there is really no point in telling someone "yo we could do that using reflection" if they haven't understood at all what serialization is in the first place
wait name is a string but the return map is string to Object
configurationserializable saves you a lot of boilerplate
Yeah, well I prefer configurate either way but bukkit’s api is one way
I mean it is resuable
Just deal with it and fuck off, no need to write a fancy system that serializes your object with reflection and only takes 20 seconds to parse
It's a map where the key is a string (name) and the value is any object
Everything in java extends Object
But you can just cast back
so ANYTHING is an object?
other than primitives, yeah
It is oop …
alright leme setup the methods
@spare hazel well when you get to higher ordered types, then you’ll find that Object is just a type in terms of being covariant and contravariant
except primitives
and the public Person(Map<String, Object> map) does the the deserializing?
That's the constructor
have you not read the javadocs?
declaration: package: org.bukkit.configuration.serialization, interface: ConfigurationSerializable
i did
Avoid constructor if possible
Use a static deserialize or valueOf if possible
doesn't matter which one you choose
why?
Because there’s much more freedom if you favor the static factory method
For one you can yield an instance that maybe was allocated long before
I like the constructor since it feels the most natural when creating the object yourself
i always use deserialize() because it just makes sense - one method is called "serialize()" so the other is called "deserialize()" lol
If possible decoupling creation and instantiation is almost always nicer to work with long term
my brain is exploding leme tale a break
Reminds me of that one time I did packets in forge
You can still create another static function inside that does call the constructor. And you would have to create another function anyway since otherwise you can use your already created object
Huh?
oh the deserialize method takes the map that was created by serializing and then assigns each variable of the class from the map?
Using the constructor directly enforces you to allocate a new instance every time
Which is bad
Because it couples creation and instantiation
Its objectively worse
Less flexibility
How do you wanna reuse your instance if you only have a map param for the static method?
You might have a repository singleton that you invoke in the function, grabbing a cached object and then just sinking the values from the map
...
generally yes
if that's the case then wouldn't constructor DI also be bad?
static deserialize(Map<String,Object> map){
var id = map.get("id");
var transfer = Repository.instance().byId(id);
transfer.name((String)map.get("name"));
return transfer
}
As an example
Not saying its the best practice
But this way if needed, let’s say you work with identity values (not value based in other means)
I do get it, yes.
But saying creation and instantiation shall be split apart would mean that constructor DI is a nono
no lol it doesn’t mean that at all
instantiation refers to when you explicitly call new
what would creation be then
well constructor DI does set values during instantiation then
Creation means just creating an object to yield that obeys the contract of whatever function or premise you have
the object does not have to be created explicitly on invocation
Moreover if you have a static factory method you can also return subclass instances
Or null
return Map.of(
);
error : Usage of API documented as @since 9+
(Atho that’s not particularly nice; null)
yeah a factory that returns null would be weird
what does the error mean and what can i do to use the of method without any problems
looks like im so dumb that people are ignoring me
but then again you could always split it. And never have a public constructor. Instead have a static function that creates an instance from the private constructor. I just can't agree with the statement that splitting it whereever possible is better
Factory pattern in general means you decouple instantiation from creation
or maybe a bi tch discord employee is messing around with me and preventing my messages to be sent
factory pattern in general is nice because you have more control over the instances you yield, you can return null (altho avoid if possible unless you write against shitty api, but even then adapter pattern maybe?), you have more meaningful names and they can also do more than just initializing the instance you’re going to yield (by that I mean more than “setting values”)
you're on jabba 8, need 9+ for that method
tho only issue is that it does happen that they’re harder to orient around and find
my jdk is 20
check your intellij settings
Your project is set to compile to Java 8
in pom.xml set target and source to 17 in the maven-compiler plugin (or in the properties, if you declared it there)
Hello, I would like to know,
I would like to redefine the commands of tabcompletions which are proposed by default when you do tab and you have entered no argument I can't find how to do it
<properties>
<java.version>20</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
didnt change anything
And like thing is, if I were to code against some api, I wanna preserve flexibility if possible, which I mean has been proven extremely useful as your project scales, now often when you develop a 5k line spigot plugin that doesn’t matter because you barely get to experience the “scaling”
Yeah sure
I mean do you wanna see just the factory pattern or static factory method?
create a tabcompleter (can be a separate class, or the same as your COmmandExecutor, or an anonymous class) and return the list of completions.
bad example using an anon class:
getCommand("myCommand").setTabCompleter(new TabCompleter() {
@Nullable
@Override
public List<String> onTabComplete(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {
return List.of("option1", "option2");
}
});
I prefer static factory methods
Unless I have common dependencies that all instances from the class will need
Let’s say my class User has the constructor signature User(UUID id, Plugin plugin);
https://blog.jeff-media.com/common-maven-questions/#how-to-change-your-java-version check the last headline
oh yes but the sa will set the tabcompletion just for this command
what i would like
by default on a server when you hit tab (without having entered an argument) it offers you all the commands (even those you don't have access to)
I would like to be able to choose what it offers (/spawn /tpa etc...)
Then I might create a factory with the signature UserFactory(Plugin plugin) just to abstract away the need to pass the plugin instance everytime I create a user
UserFactory(Plugin){
User create(UUID){
return new User(id,plugin);
}
}
it doesnt give any errors when compiling
tab complete only shows commands you have permission for, so if you just assign proper permissions to the commands, it should already be working fine automatically
then it's working fine?
Anyway the choice between factory class vs static factory method can be hard, but its like… the factory class is better at abstracting away common dependencies, however it becomes a dependency itself at the cost of it
yes but, I don't have the possibility to define them myself?
but i hate seeing a error 24/7 on my editor
you can listen to PlayerCommandSendEvent and change the list of "known commands"
reload maven
oh intellij did it for me
These common dependencies can be other classes, a map to pool the instances perhaps, or cached values even
Oh yeah looks like they used it pretty inside the box, canonically in other means
Yeah
But that looks like it could be reduced to a static factory method
I would like to say that if possible, go with static factory method, unless you start to compromise design (that is reusability, testability and flexibility) too much
yeah
If it can fit in a static factory method, neat, you’re bing chilling
with the new version of the plugin, I can no longer add content, it is not recognized
Best practices for invalid param
Sounds like a #help-server issue
ok, but you can help me ?
Which event contains setting an item name
do you have an exemple?
// Commands available to all players
private static final List<String> COMMANDS = List.of("spawn", "tpa", "msg");
// Commands available to OPs
private static final List<String> OP_COMMANDS = List.of("ban", "kick", "op", "deop");
@EventHandler
public void onSendCommandList(PlayerCommandSendEvent event) {
// Remove all commands
event.getCommands().clear();
// Only add commands we want the player to see
event.getCommands().addAll(COMMANDS);
// Add OP commands for OPs
if(event.getPlayer().isOp()) {
event.getCommands().addAll(OP_COMMANDS);
}
}
thanks, PlayerCommandSendEvent is the event (on tab completion request?)
It's called when the list of commands is synced to the player
Which is mostly when they join
ah when the tab completion list is send to the player (join)
declaration: package: org.bukkit.inventory, interface: EntityEquipment
declaration: package: org.bukkit.entity, interface: LivingEntity
ice isn't a chestplate so it won't render
Also use the spawn method that takes a consumer
You can't
it won't render
You could use another armor stand and put the ice on the head
and then place head at chestplate level
or just use a display entity
can I update a furnace inventory and cooking time while the player is in it or will the player not receive any updates?
until he reopens it obviously
You should be able to update it
hmm, okay
Why are x and z always the same? java Random random = new Random(); int x = random.nextInt(1000); int y = 150; int z = random.nextInt(1000);
Shouldn’t be the case
exactly i don't know why its is returning same numbers each time i generate them
You sure its those values that you end up using?
Show the exact code
^
?paste
i'm trying to create random locations this is the function: ```java
public Location createRandomLocation(Player p) {
Random random = new Random();
int x = random.nextInt(1000);
int y = 150;
int z = random.nextInt(1000);
Location randomLocation = new Location(p.getWorld(), x, y, z);
y = randomLocation.getWorld().getHighestBlockYAt(randomLocation);
randomLocation.setY(y);
while(!isLocationSafe(randomLocation)) {
randomLocation = createRandomLocation(p);
}
return randomLocation;
}```
this is the isLocationSafe function: ```java
public boolean isLocationSafe(Location loc) {
int x = loc.getBlockX();
int y = loc.getBlockY();
int z = loc.getBlockZ();
Block block = loc.getWorld().getBlockAt(x, y, z);
Block below = loc.getWorld().getBlockAt(x, y - 1, z);
Block above = loc.getWorld().getBlockAt(x, y + 1, z);
return (!badBlocks.contains(below.getType()) || block.getType().isSolid() || above.getType().isSolid());
}```
(badBlocks contains lava, fire, water materials)
this are the coords that are generated, as you can see x and z are the same
you probably aslo need to check block + 2 tho
show us teh actual code you are using to get that output
i will try doing that but idk if it will change smth
no need for that
the random is created once
its impossible for random to be returning the same value for both x and z every time
show the code where you use createRandomLocation method
That doesn't matter
sure
so it gives the same output
It won't
?paste the actual code with the debugs you are using
Micro-optimisation
get his code workgin before worrying about that
Hence you often don’t wanna use it
public Map<String, Object> serialize(){
return Map.of(
"uuid",uuid,
"skill_woodcutting",woodcutting,
"skill_mining",mining,
"skill_farming",farming,
"skill_combat",combat,
"stats_heath",health,
"stats_damage",damage,
"stats_defense",defense,
"bossbar_skill",skillBossBar
);
}
public void deserialize(Map<String, Object> m){
uuid = (UUID) m.get("uuid");
woodcutting = (Woodcutting) m.get("skill_woodcutting");
mining = (Mining) m.get("skill_mining");
farming = (Farming) m.get("skill_farming");
combat = (Combat) m.get("skill_combat")
health = (Double) m.get("stats_health");
damage = (Double) m.get("stats_damage");
defense = (Double) m.get("stats_defense");
skillBossBar = (BossBar) m.get("bossbar_skill");
}
serialization and deserialization methods done. now what?
for saving player data
on PDC
what the hell are you codin
Are all of those classes config serializable
you need to get persistentdatacontainers and set this to that
U print getX() twice
You print X Y X
You didnt print X Y Z
omg im so dumb bruhhh
so the skill classes also need to be serializable?
thanks man
Yeah how else would they be serialized
oh cmon
i hope intellij could automatically do it for me
Object doesn't have serialize() method by default
i know
you need your class to extend Serializable to actually have some methods
extend?!
serializing stuff is such a pain in the ass
i thought it was implemenst ConfigurationSerializable
.
it is for Bukkit
It is if you wanna use it with bukkit Configuration api
thats what the gay discord booster told me to do
alex?
lol what now
idk but he wrote the MorePDC article in spigot
I usually use configurationserializable for my plugin data
imagine everybody call you "gay discord bosster" instead of your nickname every time 💀
how do i make it so the player has the powdered snow vision effect? like when you walk into powdered snow theres like a icy/snowy effect on your screen. How do i make the player have that ?
thats what he is
Why even bring sex into it. Not teh place for it
lol guys chill
BRUH
Entity#setFreezeTicks()
he litteraly had the LGBTQ+ flag on his pfp
no ig
ok thank youu
I'm the straight verified guy with the weird drawn pfp then
not the place for bring sex into things. This is for coding
Doesn’t mean you should be calling him nicknames that are maybe considered a bit meh
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
if you want to serialize your type for config purposes, just use configurationserializable
you will refer to me by jree fava lessons or by brony discord java teacher
he wants to store to a PDC
true
Unlike you, blue-haired liberals, i don't have pronouns
https://youtu.be/md8nInMGhFY
If one more weirdo in the comments says Shadow is "based" I'm going to lose it
you will refer to me only by my title
you are free to call me by my username btw lol
LOL
my blue hair looks fabulous
you have brown hair i'm sure
only my ass hair is dyed blue
at least you had
news:i have no idea how to load userdata when the player joins the server and save when the player leaves the server
using MorePDC
bruh you were older on your previous pfp
oh shit that's sonic the hedgehog
no1 certified crackhead
PFP is pink and IRL is blue idk what to believe anymore
PersistentDataType<?, YourSeriazableClass> dataType = new ConfigurationSerializableDataType<>(YourSerializableClass.class);
it was pink when that profile pic was made
Doctor, it's time to pack everyting up and run away
You should open it in Paint and fill tool it to blue 
hair colours change faster than... what do I compare that to
epic's underwear
java versions
nice answers
i dont know how often epic changes his underwear but I know him for a year or so now and he never mentioned that he changed underwear during that whole time
sooo
figure it out yourself
._.
if(HypixelSkillCore.getInstance().getPlayer(e.getPlayer().getUniqueId()) == null){
HypixelSkillCore.getInstance().createPlayer(e.getPlayer().getUniqueId());
e.getPlayer().sendMessage(ChatColor.GREEN + "Welcome To servername! Your SkyblockSkills Account Has Been Created");
}else{
//TODO : god please help me
}
if your skin colours changes with your hair colour, you should stop taking baths in coloured water
😉
never
your TODO is super
Yeah I don't think that's how hypixel did it
> God: ?learnj...```
UUID playerUuid = event.getPlayer().getUniqueId();
MyPlayer player = myPlugin.getPlayer(playerUuid);
if(myPlayer == null) {
player = myPlugin.createPlayer(playerUuid);
} else {
// Already have a MyPlayer object
}
its my third day of plugin development(fifth day of java learning)
what event is fired when somebody puts something in a slot of an inventory?
But honestly there could be a getOrCreatePlayer because it isn't the listener's responsibility to do it
does anybody know how to remove the little white stripe in the chat when sending a message?
InventoryClickEvent
yeah that's how LoTriangle usually does
who is he?
use InventoryEvent and just print event name
so you know for sure
too much effort
HyPixel but made by guy who codes for the 3d day
I've not closed my IDE and not open minecraft in two days
?
which stripe
wait
am i dumb or smth
isn't that cuz of new chat event
yeah i think so but idk how to remove t, and if it is possible to
making hypixel is gonna take a whole year of pure coding. its wish.com hypixel skyblock
yeah more than a year lmao
like the negative HyPixel
pure coding
hypixel is literally one of the biggest servers online right now
yeah didnt get your joke
Cuz you are coding for the 3d day
THE biggest server right now
shit it's not funny after you explain 😭
the biggest server network I would say
bad side of jokes
yeah
the is a difference between a server and a server network, right?
yes
?jd-s
lemme just check what is a namespacekey
ohhh, that's the website I've had open for the past two years, right?
next to some forum post
nobody closes it
i do, cuz i code from memory and compile in my head
But it doesn't count
Bukkit.broadcastMessage(hologramText.joinToString("\n"))
val entity = TextDisplay(EntityType.TEXT_DISPLAY, (location.world as CraftWorld).handle).apply {
text = CraftChatMessage.fromStringOrNull(hologramText.joinToString("\n"))
this.billboardConstraints = Display.BillboardConstraints.CENTER
this.backgroundColor = 0
}
Is there a reason it doesn't display on the hologram?
Anyone got an idea how to let a player interact with entities while there's another one on the head of the player (passenger)?
I just keep clicking the passenger. I tried setting a dummy passenger that is hidden by hideEntity but then when setting a passenger to this dummy entity, you don't get an update
The second image is chat for some context
in furnaces, the arrow that shows the progress, is that a float from 0 to 1 or does it work in some different way?
probably a float
Do you still need help with this?
hmm, BurnTime is the fuel burning time and the cook time is the arrow, right?
no info on javadocs?
Yeah
nah, my brain is just burning from thinking 24/7 so I'm just taking whats the nearest in the taskbar
thank god it's not some game, if it was I would probably be playing WoT or something the last 30 hours instead of trying to think
so where should i create the namespaced key and what should i do for loading the playerdata using the namespacedkey that i created
Hello, questions
getConfig()
and related functions only work for config.yml
if I want to recover the info of a config2.yml file how to do?
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
?pdc
you can go to sources
copy contents of saveDefaultConfig(), saveConfig(), reloadConfig() and getConfig()
paste it to your project
or he can just read teh wiki I already linked 😉
why did I decide that it's a good idea to try coding this random bs
Hi hello everyone.
I have seen some people mention that you should never store a bukkit Entity object, but should instead use UUID?
Say, I have a custom block that uses an entity for displaying stuff (let's say text for example)
And I want this text to be updated every tick.
I believe it would be less performant to get the entity by uuid every tick than just storing the entity directly.
I'd like to know:
What are the reasons to not store the entity object ?
Are there any better ways other than UUID ?
nope, i found out, but tysm for your desire to help me, not only this time but every time you are always very helpful 💙
yes
uuid is our best friend
Possible mem leak I think
and you'd better get it everytime
Never is the wrong word
if i use this code in main class and player join class, will they both be the same?
NamespacedKey key = new NamespacedKey(pluginInstance, "our-custom-key");
im using it for PDC
Most of the times is a better word (or term)
you don't want to use an entity object from 2022 in 2025
yes
Conclube weren't you Conclure in the past 🤣
he was
nice
alright thanks
a donator or helper perks?
What ?
I am not storing the entity object to be loaded later, I am not crazy lol.
Anyways I have seen someone mention some WeakReference or whatever.
Would that solve the possible memory leak.
well :D
Alright, I shall now learn what the frick WeakReference is and how to use it correctly.
Thank you.
It just doesn't keep reference to object, so it can be collected by gc If spigot invalidate it
^
I suppose I have to check if the object is not invalidated so I can work with it ?
Does it use optional or something ?
Na not really
what is a 👩🏻Reference<Entity> btw ?
a reference to an entity which is likely to be dropped / not tracked ?
Just that this class is specially treated
Do you know what a strong reference is to begin with?
not sure no
class A {
Object x = new Object()
}
x is a strong reference by definition
Meaning, x prevents its value from being garbage collectable
class B {
WeakReference<Object> y = new WeakReference<>(new Object());
}
y is a weak reference by definition
Meaning, y does not prevent its value from being garbage collectable
.
in his bio
ugh
It's a gradient made of multiple parts
Basically interpolation
Think of it as just making a big gradient of white -> orange -> white that's larger than the text
adventure has TextColor.lerp, otherwise idk
basically think of how a camera works in a game like super mario
setting up ConfiguratinSerializable done. how do i save the class that i use for custom player data onto PDC using DataType.CONFIGURATION_SERIALIZABLE from MorePDC
@tender shard
nvm how do i use .yml files to do that :(((((((((((((((((((((((((((( i want it so it loads all the players on server start and then save all of them on server stop
PersistentDataType<?, MyClass> type = new ConfigurationSeriazableDataType<>(MyClass.class);
// ...
somePdc.set(someKey, type, myObject);
but i already added morepdc as a depend so
myYamlConfig.set("someKey", myObject);
MyObject myObject = myYamlConfig.getSerializable("someKey", MyObject.class);
loading all players on startup is a bad idea if you have a large number of of players btw
I'd rather use the PDC or have one file per player or use a database like mysql and only load player data when they join
im not really experienced with java syntax. what is the ? for?
? means "can be anything"
PersistentDataType<P,C> where P refers to the primitive type (what it actually gets saved as) and C is the complex type, your class
you don't care about the primitive type so you can use ?
for configurationserializable, it'll be byte[] btw
because it uses a BukkitObjectOutputStream
yes i totally understad what a BukkitObjectOutputStream is
you mean to make text gradients?
hm idk, never did that. probably just some math to shift the colors somehow, idk lol
it can turn any class that implements ConfigurationSeriazable into a byte array
Cannot resolve symbol 'ConfigurationSeriazableDataType'
try again without the typo
oh got it
declaration: package: com.jeff_media.morepersistentdatatypes.datatypes.serializable, class: ConfigurationSerializableDataType
Diamond operator is not applicable for non-parameterized types
show your code
ializable<>(HypixelPlayer error is occured here
it definitely is a parameterized type
``java
ConfigurationSeriazableDataType<HypixelPlayer> type = new ConfigurationSeriazableDataType<>(HypixelPlayer.class);
Serializable*
i hate this word
Hello, did anyone made a EntityMoveEvent ?
what do you need it for?
splash particles when entering in water/lava
Cannot resolve symbol 'ConfigurationSerializableDataType'
you could keep a Set<UUID> with all players. Loop over all entities every tick. if they are in water but are not in the set, they just entered water. Add them to the set.
If they are not in water but are in the set, they just left water. remove them from the set
did you properly add MorePersistentDataTypes to your pom?
<dependency>
<groupId>com.jeff_media</groupId>
<artifactId>MorePersistentDataTypes</artifactId>
<version>2.3.1</version>
<scope>compile</scope>
</dependency>
<repository>
<id>jeff-media-public</id>
<url>https://hub.jeff-media.com/nexus/repository/jeff-media-public/</url>
</repository>
did you reload maven after adding it?
wdym?
okay thanks
done
oh why didnt you tell me earlier
i abandoned learning worldguard api bcz of that
it's definitely included in MorePersistentDataTypes 2.3.1
its fixed
how am I supposed to know if you didn't ask
yeah but old URL redirects to the new one
now when the player joins and he doesnt have a account, we save it in his PDC
even the old old link redirects lol
oh yeah maybe it only works for downloads, not uploads, i dont know
uploading is http PUT request iirc
e.getPlayer().getPersistentDataContainer().set(new NamespacedKey(HypixelSkillCore.getInstance(), e.getPlayer().getUniqueId().toString()), HypixelSkillCore.getInstance().getType(), HypixelSkillCore.getInstance().getPlayer(e.getPlayer().getUniqueId()));
too long
what should i do then
can i NOT save it in a variable and just use new NamespacedKey()
okay ill do that
Hi hello, I do not believe I know the way to spawn entity with passengers.
Is it even possible in this way ?
Or do I have to spawn all the entities first and then set them as a passengers of the root.
private NamespacedKey key = new NamespacedKey(plugin, "key");
like this?
and create a getter?
player.getPersistentDataContainer().set(plugin.getKey() , plugin.getType(), plugin.getPlayer(player.getUniqueId()));
much better
and when i use getPersistantDa...().get() it will give me the HypixelPlayer class that i saved using morepdc?
i already made the method
public void deserialize(Map<String, Object> m){
uuid = (UUID) m.get("uuid");
woodcutting = (Woodcutting) m.get("skill_woodcutting");
mining = (Mining) m.get("skill_mining");
farming = (Farming) m.get("skill_farming");
combat = (Combat) m.get("skill_combat");
health = (Double) m.get("stats_health");
damage = (Double) m.get("stats_damage");
defense = (Double) m.get("stats_defense");
skillBossBar = (BossBar) m.get("bossbar_skill");
}
and yes i made all the other classes serializable
Yes, but I wasn't sure if I can do this from within the lambda thingie
Which I just tested and I can
Kinda surprised tho
https://ibb.co/Rb7bsmR
always happens when I let buildtools build in the 1.20.1
private ConfigurationSerializableDataType<HypixelPlayer> type = new ConfigurationSerializableDataType<>(HypixelPlayer.class);
i thought you wanted to do an "animation" out of that?
non-moving gradients are easy
@tender shard now what
Yeah interpolation is what you want 
You give it a value from 0 to 1
and it will move
hello can help with on 1.19.4
((CraftWorld)b.getWorld()).getHandle().playBlockAction(new BlockPosition(b.getX(), b.getY(), b.getZ()), CraftMagicNumbers.getBlock(b), 1, this.open ? 0 : 1);
?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.
yes
Yes
yes
Can help?
?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.
you have to update it with an "offset" gradient every tick
You gotta make it move ^^
So I've been following this old Kody Simpson tutorial for JSON file storage: https://www.youtube.com/watch?v=CXQJA0VvFEY
I've copied the way the delete menu from this transfers the note ID to the confirm menu using a PlayerMenuUtility (PMU) and it works for the delete menu on my side, but for some reason in the other class that I'm using this method for, it doesn't transfer and gives me a null error when I'm trying to retrieve a variable from it
I'll post the classes in paste links
https://paste.md-5.net/noyecosoba.java -Event Teleport Confirmation
https://paste.md-5.net/ziziqakoce.java - Event List, (tries) to transfer the event id from the item to the PMU
https://paste.md-5.net/arutaviwel.java - the extended PMU
https://paste.md-5.net/camarixavi.java - Event class itself
https://paste.md-5.net/luvugesuja.java - Confirm Delete menu that I'm trying to mimic
https://paste.md-5.net/itoliqihow.java - Delete Menu that I am also mimicking
Any help is appreciated
In this episode, I show you how to store Java Objects and data from your plugin as JSON Text in a .json file and load/save from that file. I give you an example of a fully coded CRUD class to do basic operations with the data. #SpigotDevelopment #PluginDevelopment #Minecraft
Code: https://github.com/Spigot-Plugin-Development-Tutorial/json-file...
usually you want to have one color per char, e.g. colors A, B, C, D, C, B, A
next tick, you use
B, C, D, C, B, A, B
then
C, D, C, B, A, B, C
etc
Send that error
Now that error tells you what's null
So go to that method and take a look
Why would it be null
yeah for example I'd do it like this for two colors:
startColor = 0,0,0 // r,g,b
midColor = 10,10,10 // the "middle color"
endColor = startColor
then all "inbetween" colors are just midColor - startColor / numOfChars / 2 * currentOffset (or sth similar)
then you get an array of colors, e.g. for 5 chars you'd have sth like 0,0,0; 5,5,5; 10,10,10; 5,5,5; 0,0,0
and then you "move that" around by one each tick
ik it's the find event error is null, I think the eventID string is null but I don't understand why it's null because I'm using the same process the transfer the ID as the other class that does the exact same process and that one actually works
this is my example haha
Well we can't really help without the class that the findEvent method is in
my fault
I have a method to calculate the correct color for each with a 2-color gradient, you'd need to expand that to three colors, then apply the offset each tick. let's see if I can find it
https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/TextUtils.java#L157C61-L157C61
https://github.com/JEFF-Media-GbR/JeffLib/blob/00262647ede1e86b99eb63037d2dbcaee01343e5/core/src/main/java/com/jeff_media/jefflib/data/HexColor.java#L86
not sure if this helps, that's all I can contribute
Let me guess you have multiple instances of EventsManager
I honestly might, I've no clue if I do or not
maybe I can write a complete method later but first I'll visit the bathtub lol
Time to check
I don't believe I've made any EventsManager objects, and I've not instantiated it in my main class, which honestly might be a problem
I'm using that guys API and was very closely following the tutorial
coulndt you check how TAB does it
yeah, but it has an already established format and working stuf
TAB plugin gradient animation creator
How can I may do a tpask command, I don't know how to create a max time to accept the request. Don't give the code just the steps or idea. I'm new and just want to learn not having all done.
just steal the code
Save the request to a map use the scheduler to remove it from the map. When they accept check if it's in the map
okey i'll try thanks
?paste
I made this Map<UUID, Integer> requestList = new HashMap<UUID, Integer>();
Could not load 'plugins\HypixelSkillCore-1.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: Plugin cannot be null
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:149) ~[server.jar:3284a-Spigot-3892929-0ab8487]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[server.jar:3284a-Spigot-3892929-0ab8487]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[server.jar:3284a-Spigot-3892929-0ab8487]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.loadPlugins(CraftServer.java:409) ~[server.jar:3284a-Spigot-3892929-0ab8487]
at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:233) ~[server.jar:3284a-Spigot-3892929-0ab8487]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1010) ~[server.jar:3284a-Spigot-3892929-0ab8487]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:305) ~[server.jar:3284a-Spigot-3892929-0ab8487]
at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.IllegalArgumentException: Plugin cannot be null
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122) ~[server.jar:3284a-Spigot-3892929-0ab8487]
at org.bukkit.NamespacedKey.<init>(NamespacedKey.java:72) ~[server.jar:3284a-Spigot-3892929-0ab8487]
at com.amirparsa.hypixelskillcore.HypixelSkillCore.<init>(HypixelSkillCore.java:24) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78) ~[?:?]
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
can anyone tell whats the problem?
Who knows how meteor client manages to list plugins when all bukkit commands are blocked?
Have you disabled the query yet
query?
server.properties
you mean teh query port?
enable-query=false
Also this
query-plugins: true
in bukkit.yml ^^
web discord is wayyyyy better than windows discord. it uses way less ram
Yeah
Yeah I've had app discord take 3GB
discord app = 300
thanks
I know
My discord took 3GB ram
4 gb to work with
and if i run my server and my minecraft client both at 2gb, i just turned my pc into a smoker. very nice lifehack
but i run my server at 1gb
and client at 1.5 gb
lemme go ahead and fix my plugin
I know this is very basic java, but like I need someone to tell me. something weird going on and I hope im jsut doing it wrong.
Is this how you do a hashmap?
public HashMap<UUID, Integer> mana = new HashMap<>();
mana.put(player.getUniqueId(), mana);
//. ^^^ This doesn't exist apparently. Which is what I think you use to add data into a hashmap.
disabled all that and it seems Meteor can still list plugins 😦
is mana.put(...) in a code block?
you cannot just call methods outside of a code block
im just an idiot im sorry guys lol. I had another variable called mana for some reason.
oh ok
I was really confused why it wasnt working. i stared at it for 5 minutes.
and google.
if onyl google told me 😢
how can I convert "Jeb, Hero, Amogus" to List<String> with "Jeb", "Hero", "Amogus"?
if you are wondering what this site is its a log tool provided by aternos, the sponser of spigot(i think)
Would you know how to transpose the contents of one .yml file into another while retaining the UTF-8 encoding? I've tried many things but nothing seems to work. It seems that the IDE displays everything in UTF-8 except when calling the YamlConfiguration#saveToString method. However, I load the content with the UTF-8 Charset
what will be the list if string = ""?
oh got it
nvm noo ned to help
'setMaxHealth(double)' is deprecated
what should i do about this warning
Iirc getAttribute(Attribute.max health thing).setBaseValue
thanks, how can i do the opposite? List in one line
Don't use it just because you're lazy
but yes it will work
what will happen if i keep using it?
are deprecations there to make a developer's life harder?
No
Lol
they're there to say "dont use me"
They are there because that used to be the method to use
or avoid it
But now there is something new that replaces it
whats the difference between the deprecated method and the new way?
They're outdated
Deprecation is there to either tell developers that this method is gonna be, or can be removed in the future, alternatively if the choice of method needs an extra consideration, which can be due to unsafe results or byproducts.
bump
anyways let me test my plugin
i hope theres no errors this time
Mojang uses deprecation notes for methods that shouldn't be called
Is there not a different annotation for that
Maybe yeah
There is
Smh we need STANDARDS
api internal or whatever
Thats jetbrains
basically if there is a new way, dont use the deprecated version xD
and if there isnt, sometimes you might have no choice
I wonder why java does include any of these annotations in the standard lib
Not like they would increase the file size by much
All of the methods and the list in EventsManager are static
hm?
I think they want annotations that are more significant coll
Like Override, FunctionalInterface etc
Not sure tho
how do i check if this extends my custom class?
for (ClassPath.ClassInfo classInfo : classInfoList) {
cus
if(classInfo instanceof MyClass)
doesnt work
Will there be multiple hashmaps if multiple plugins access my library? meaning if 2 plugins in the same server are accessing the mana class and minipulating it. Will they be editing their own hashmap or will it just be 1 universal hashmap?
is ClassPath.ClassInfo extend from MyClass ?
ClassPath.ClassInfo is a default thing
where did you get a list of class info from
If they use the same instance of the class, they will use the same HashMap if you return the instance of it
public static List<ClassPath.ClassInfo> classesFromPackage(final String path) {
final List<ClassPath.ClassInfo> toReturn = new ArrayList<>();
try {
for(final ClassPath.ClassInfo classInfo : ClassPath.from(TestPlugin.plugin.getClass().getClassLoader()).getTopLevelClassesRecursive(path)) {
if(classInfo==null)continue;
try {
toReturn.add(classInfo);
} catch (Exception e) {
e.printStackTrace();
}
}
} catch (IOException e) {
throw new RuntimeException(e);
}
return toReturn;
}
Cannot invoke "Object.getClass()" because the return value of "org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeObject(java.util.Map)" is null
at org.bukkit.util.io.BukkitObjectInputStream.resolveObject(BukkitObjectInputStream.java:49) ~[server.jar:3284a-Spigot-3892929-0ab8487]
at java.io.ObjectInputStream.checkResolve(ObjectInputStream.java:1740) ~[?:?]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1689) ~[?:?]
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:2112) ~[?:?]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1677) ~[?:?]
at java.io.ObjectInputStream$FieldValues.<init>(ObjectInputStream.java:2554) ~[?:?]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2412) ~[?:?]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2212) ~[?:?]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1689) ~[?:?]
at java.io.ObjectInputStream$FieldValues.<init>(ObjectInputStream.java:2554) ~[?:?]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2412) ~[?:?]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2212) ~[?:?]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1689) ~[?:?]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:495) ~[?:?]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:453) ~[?:?]
at com.jeff_media.morepersistentdatatypes.datatypes.serializable.ConfigurationSerializableDataType.fromPrimitive(ConfigurationSerializableDataType.java:60) ~[?:?]
at com.jeff_media.morepersistentdatatypes.datatypes.serializable.ConfigurationSerializableDataType.fromPrimitive(ConfigurationSerializableDataType.java:26) ~[?:?]
at org.bukkit.craftbukkit.v1_17_R1.persistence.CraftPersistentDataContainer.get(Cr
had to remove bcz discord limit
?paste
please
now its totally your problem
@tender shard
just a loop from the classloader using a path
basically every class inside a package
So it's normal
They're not linked
yea they arent
can someone tell me what is the problem (someone who used morepdc)
for what unholy purpose do you need a list of class info
I mean
idk how to sovle your issue directly
im just curious
automatically registering stuff like, commands, items, other things
for commands i use
for (ClassPath.ClassInfo classInfo : classInfoList) {
Object t = classInfo.load().getConstructors()[0].newInstance();
if(t instanceof CommandExecutor) {
but it gives me an error when i do that with the ability class
You have better way to do that but if you want to do this like that, get java.lang.Class with Class#forName, you will find the path into the ClassInfo object and next you can check if the class extends from your class.
public void onPlayerJoin(PlayerJoinEvent e){
HypixelSkillCore plugin = HypixelSkillCore.getInstance();
Player player = e.getPlayer();
if(player.getPersistentDataContainer().get(plugin.getKey(), plugin.getType()) != null){
if(plugin.getPlayer(player.getUniqueId()) != null) return;
plugin.setPlayer(player.getUniqueId(), player.getPersistentDataContainer().get(plugin.getKey(), plugin.getType()));
}
if(plugin.getPlayer(player.getUniqueId()) == null){
plugin.createPlayer(player.getUniqueId());
player.getPersistentDataContainer().set(plugin.getKey() , plugin.getType(), plugin.getPlayer(player.getUniqueId()));
player.sendMessage(ChatColor.GREEN + "Welcome To IranSky! Your SkyblockSkills Account Has Been Created");
}
}
my PlayerJoinEvent class
What is that ClassInfo class?
import com.google.common.reflect.ClassPath;
bump
whats a better way then
I guess you could do classInfo.load().isAssignableFrom(MyClass.class) if you are not afraid of loading classes early
did you register your ConfigurationSerializable class?
https://paste.md-5.net/catulutuxa.java, take inspiration from this