#I'm trying to make a flag system for an anticheat.
1 messages · Page 1 of 1 (latest)
Hey, @steady shore!
Please remember to /close this post once your question has been answered!
what you posted isn't even a question
it's more or less valid, english, words slapped together
you failed to get the point across as to what is your problem, and context of the problem
If i have an item, and it flies but sometimes it also walks, where is the center of gravity for pipe inside a cave of unknown density in absolute quantity
this is basically how your question looks to everyone else
I need to save values in a player that holds a certain value and I need to have multiple of them
When a player joins, it will make a flag count
which would be 0
and once a player gets flagged
it will add 1
sounds like a very simple problem
make a class Player, add a boolean with any name (the flag)
stamp out as many Player objects in an Array/ArrayList/whatever collection suits you
then, you can make a method that takes in a collection (array/arraylist/whatever) of Player objects, and filters to only get the players with the flag on
this filtering is a simple for loop, or, even easier, use filter with Stream
i dont own the player class
its a game
which i making a mod for
oh, Minecraft mod?
most work with dependency injection
so first, figure out which DI framework your particular solution works
2nd, cry because DI is terrible
DI fixes unexisting problem and makes code unreadable
minecraft plugin
im just gonna probably nest hashmaps
then learn the tool your plugin project usess
its not like i am a complete java noob
this is the one thing i havent been able to do
i never said im an expert
and im not even in highschool yet
so my english isn't pitch perfect for asking questions to clear intellectuals like you
The things u ask are covered in any minecradt guide video
I'm not intellectual
idfk
Also if u wanna work with minecraft plugins theres Servers for these especially i think
but i feel like its more general java
its not really
like
bukkit based
other than the fact that its a bukkit plugin
And the fact ure working with classes from them
but my problem would be the same if i just replaced the Player with another key
Make a hashmap
<UUID, Reason>
Reason can be a string or a enum
Or if you want it to stay with the player even the server restarts
You can use mysql
Key uuid | String and in that case the easiest way to just enum.toString and put it in mysql
i need to save an amount of flags
Ok say it all in one time what do you need
i fixed it