#help-development
1 messages · Page 1007 of 1
-
Should I have relational data (one ServerNamePlayer Object) with all the data tied to it
or -
should I have a data object for each system that stores data?
-
option seems better because then I can load only the players bans in and stop loading the data if he is banned instead of loading the full thing everytime
okay
in this case you might wanna have a class which handles the bans
but have you tried giving it a capture of ?????????
I once needed to cast something because T is not the same as T apparently
what is t anyway
A generic type
type erasure >:(
i know what it is lol
At the end of the day, we all are just objects
[object Object]
You can have multiple rp’s on a server without conflict correct?
For the most part yes. There are some cases where depending on what the pack does, that it can cause some interference with other packs.
I’m just looking for custom models on some blocks
Should be fine with just that then.
How does the pathing work in relation to code? I’ve never messed with rp’s before if you’ve got a resource I can go off
blocks or items
blocks don't support custom models
Oh hmm
and you don't set the model directly
Well the idea was models for elevator blocks based on what player used for crafting them
Hmmm I’ll have to figure a good movement emulator of sorts to fit a proper elevator
Sucks I can’t just do it with blocks
Anyways thanks!
do itemdisplays have their own holograms? or do i have to do passengers thing
I mean you can set a custom name on them
it won't be as flexible as a proper text display however
why is my data appended in a wrong order?
instead of common, uncommon, epic its uncommon, common, epic
there are no ordering guarantees
Depends what it is
why are you trying to disable auto-saving?
because it is a temp world
yea?
ah
u might need to look in the nms
I can tell you how I did it if you want (system)
did you need nms?
nope
can i see?
what exactly
how to avoid that error
I don't even disable auto-saving
where can i find the api for 1.20.4?
i can only find a download for the 1.20.6 dependency
I just unload the whole world at the end and erase it from disk
uhm, but this error happens every x time
every 5 minutes actually
well I think
are you trying to disable auto-saving so that this exception wouldn't ever happen?
No, i disabled auto save before knowing this error happened
I recommend you to figure out what is causing the exception instead of trying to disable auto-save
can you successfully join your temp world?
yea, i can join it
I prefer to delete them on startup
Because deleting them on shutdown won’t work if the server crashes
or if some players are still in the world
uuh
it is indicating NoSuchFileException, but I don't know why, since the error isn't caused by your code
can i try this?
Oh, true
are you doing a recursive copy of your original world directory and correctly register the world to the server?
I think so
I haven't seen your code so I can't really find the cause
what do you need?
to see i mean
which one of these two should i use?
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&8[&9☽&8] &7Discord: &9&nlink"));
p.sendMessage("§8[§9☽§8] §7Discord: §9§nlink");
Top one
I think the error was I was reloading the server lol
mb
I mean ideally you’d use the enum constants but yeah
is that the ChatColor.GRAY things?
Yes
ye, darn it - got sniped
does anyone have inventory types mapped into ids on different server versions?
?xy
sending packet
inventory id required
inventory id change depending on version
me sad
I just wanna send anvil
but it break
somewhere like 1.20-1.20.2
Why can't you createInventory and openInventory
1.20.3
well
I'm doing some uncanny stuff
and I cannot let the player invoke any player events
so I cancel every packet except keep alives
so I gotta do the gui stuff myself
and everything
I remember having issues with using the api for anvil inventories
I don’t remember what it was tho
my main problem is that I'd need to invoke it sync
and this fires an event, doesn't it?
and needs to be sync
Is it now fixed?
a lot
when i restarted yea
like casting the inventory
not working
or AnvilPrepareEvent not activating for virtual inventories
stuff like that
ye
Nice
md
uh....why can't events fire?
uh
basically
I stop all events from firing
even join and stuff
except async pre login
so that when a player joins and isn't logged in
(since it's a login plugin)
player can't join if you stop the packet of joining
he doesn't miss out on stuff
and this creates problems with other plugins
so if I delay the join event
until he logs in
no problems occur
I don't do that
you can't delay the join for very long
I just stop the events
if you do so they disconnect
can you talk in complete sentences
no
this isn't twitter
just gotta replace the HandlerList
it's almost as if it was designed to be easily replaced
very comprehensive design I must admit
ok even if you remove events, you can't delay certain events. Join is one of those, if that event or packet is delayed for too long the player will disconnect
no
alright, whatever continue with your weird login plugin
the id doesn't change for each version
I can't even map it since it doesn't show what versions they were
it does change very often
that makes no sense
in 1.20.3 when crafter was added
bruh where does this confidence come from?
You haven't ever probably looked at this
and yet you speak with full confidence
to a guy that just spent 4 hours reading this stuff
I been around since practically the beginning of MC
so I spent more then 4 hours on this
only 4 hours?
I assume none of you read through inventory type id version changes
for any longer than that
it's a cursed mindset
I am not saying id's never change, just it doesn't make sense they change every version. You only need to know the versions where an inventory type was added as well as the organizing versions. Just look at the MC wiki for all the versions list and changes to find the relevant versions you will need
I haven't claimed they change every version
from what I can see you don't even understand what I say
you said they change often
Just look at the MC wiki for all the versions list and changes to find the relevant versions you will need
go on
honestly I don't even understand what you're trying to ask
show me
they want to know all versions where the inventory type id's change in the protocol
so they can map them
but they don't know how to figure out what those versions are
says the guy
I guess reading the change log on the MC wiki between versions is not good enough like I suggested
Unfortunately NMS is far beyond my expertise so can't help you there
so I'm going to sleep
and just so you know
I'm not going to curse you
and will simply ignore you from now on
I'm not entirely sure why one would ignore frostalf though
since you've only ever been ignorant of the things I say and well
I don't understand how it is you can't read the inventory types from the change logs
like this
like do you not know what is or is not an inventory type?
goodnight
the versions are not mentioned
the changes could've been applied later
what did you look at?
and not all mapped
frostalf is not talking about the wiki.vg wiki
they are talking about the different wiki (https://minecraft.wiki/ methinks)
.
yeah I am not talking about the protocol wiki
yep this wiki, and then just look through the versions list
and the changes
find all the ones that introduce a new inventory as well as any versions were re-organizing/optimizing took place
then use wiki.vg to find the relevent protocol versions that match those versions
You probably can use NMS to extract the data for the current minecraft version
quite possibly, but that would require decompiling all the relevant versions, which eventually would be done I suppose
At worst you'll do it by creating a bunch of dummy packets and sending them down a dummy pipeline - then dissect those packets.
Is it a bunch of unnecessary work? Sure. But would it work? I think?
Well I sure hope they aren't trying to write viaversion v2
I find it kinda funny the person that allegedly spent hours tryna figure out different ids in different versions also failed to do so on the source of information that presents that
who knows, they are set on making this offline login plugin of theirs pretty elaborate for what it needs to be unnecessarily
I mean they are opting for the most difficult solution when there is far easier ones XD
I mean last time I've talked to them they were writing some kind of elaborate firewall - so my assumption is that they won't allow connections with the "wrong" protocol version.
That being said it could very well be possible that this is a fully new project
I understand wanting to block stuff, but like you can just make an auth void world and just have them stand on a single block
if they are able to do anything, like what are they going to do there?
XD
unfortunately it makes little sense to have a firewall built into the server that it is supposed to protect
pretty sure this was talked about like a month ago
you'd think that a firewall would be before the machine altogether to prevent the kernel from even initiating a tcp connection
but oh well
ideally yes
but even if you have a software firewall, it needs to be separate from the application you are trying to protect XD
I'd guess they probably used the wrong word when describing the plugin but instead they want to do some anti-bot plugin.
In which case the inventory things are probably needed for some kind of captcha?
Though you probably can do that as a proxy plugin but who knows?
Anyways, I urgently need to go to bed. It's way past my bedtime - no wonder I'm feeling so tired right now
why doesnt this work?
Inventory inv = Bukkit.createInventory(this, 9, "Server Selector");
Cannot resolve method 'createInventory(ManaCore, int, String)'
Yeah player
ok thanks
is their any way to change the display name of a potion effect?
if i use experimental data packages in my spigot server i got some issues ?
Resource pack lang file
The 1.21 one?
What
i mean
i dont want to completly change it i only wanna change it to simulate a custom potion effect
1.19.4 isnt supporting
Then no
Data driven potion effects will happen one day 😩
CSS animations will happen for entity transformations one day
🙏
Just imagine being able to slowly animate an entity (such as block display) by using the same css rule you would use to animate a text
Ew css
sadness
#1241879754265727006 {
display: none;
}
I'll just make as I didn't see that
if i use experimental data packages in my spigot server i got some issues ?
And answering to that, yes, you might get some issues by using experimental data packages
That's why they are tagged as "experimental"
i mean
spigot is supporting edp ?
Spigot is a (fork?) of Bukkit, which at the same time is an (extension?) to Minecraft
So I think so
?paste
btw if i code a plugin for 1.20
can i use this plugin in my 1.19.4 with edp server?
i wanna use camels and i wanna do something with camel features
Yooo
I'm trying to run a Kotlin Multipatform app, but I get this error
JDK 17
Is the JDK related to the issue?
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
fun main() = application {
Window(
onCloseRequest = ::exitApplication,
title = "ExampleProject",
) {
App()
}
}
It depends on the API the plugin uses
If the plugin you coded for 1.20 uses API which was introduced in 1.20, it won't work.
If your plugin relies on NMS or Reflection (two ways of doing the same), it won't work
On what device are u trying to run it
Desktop
That is an Android app
But in the multiplatform setup I selected all apps, including desktop
I mean
I'm trying to run the desktopMain sub-project
if its a desktop app why are you using andriodx classes
It's what the Kotlin Multiplatform setup give me
So u have solution
Yes
can we change hologram sizes ?
idk how works holograms maybe with armor stands ?
but i saw hologram in some server
they are huge
I created a library that registers a listener in it. However, in my plugin that uses the library, the listener is registered twice. Once because of the library, and again because it is using the library. How do I fix this?
Yes you can change the sizes.
but this feature works for 1.19.4 ?
or 1.20+?
Display Entities were added in 1.19.4
is there a new entitytype name for primedtnt for 1.20.6?
declaration: package: org.bukkit.entity, interface: TNTPrimed
I would imagine some servers are still using armor stands for their holograms
however in either case holograms are resizable whether its the armorstands or display entities
I should probably make a new plugin to mess with display entities though as I haven't done that yet
I messed with ItemDisplays, but I've yet to overlay them with an Interaction passenger
You can’t resize the name of armorstands
i cant really figure out why its not working though
Pretty sure its just TNT now but could be wrong
It is.
TNT is only ever an entity when its primed, so the primed part is redundant
yeah but when i use tnt i just get an error
Did you just update to 1.20.6? It causes major issues with imports for me but i got it fixed
i think so because i was using 1.20.4 before
Yep
1.20.4 -> 1.20.6 was a disaster to fix but ill share the thread I posted
Hope this helps man
Also i ended up using jdk 21 instead of 22 i think. Id have to double check
Should probably stick with Java 21 as it's an LTS release.
I have a pretty involved development question that would be alot to type out. It involves somehow attaching a custom Enum to a damage event for an entity. So later I can retrieve that Enum on death. The Enum stores the special weapon type a player was using. For example i have a kit that when you drop a sword it launches other players away with a gust of wind. Right now i just call victim.damage(1,killer) (which triggers a damage event) and then in the damage event i grab the killer i atached and store it in a lastDamagedBy field for the victim. So my issue here is that I need to also store my Enum for “GUST_SWORD” somewhere. I could just make a another field for lastDamagedByWeapon and for the victim and save it there but I am trying to make this work with all LivingEntity types and I really dont want to have to create container for every single LivingEntity aswell just to store a field for the lastPlayerToDamage and lastDamagedByWeapon.
Sorry for the wall of text. But basically I am down to hop in a call if someone can help me or if you prefer to type it out thats cool with me aswell
use PDC
Can you attach that to events?
just attach a tag to the entity's pdc and read it on death
Ive only used it for items
Oh yo I recognize you from spigotmc you helped me with something else haha
So in the gust of wind method for every entity it hits I can just attach a PDC to it and say the player who attacked them and the weapon they used?
correct
Damn see i knew there was a better way
yeah trying to work around the event would be a pain in the ass tbh
I was legit thinking of creating a container for every livingentity on the server
Could i also attach a time of the attack in the PDC, then check it with the current time on death to see if its within say 10 seconds i count it as the players kill?
using a hashmap, the performance wouldnt be as bad as you think
yeah absolutely
Yo md_5 is typing
Yeah I considered this and using the uuid of the entity as the keys but the PDC sounds easier as far as storing and retrieving
just keep in mind if the player hits the enemy then runs away, it will stay in the pdc
so you could have a timeout value or smth
Cause i was like well would i store the UUID on entity spawn or when they first get attacked by someone to conserve space
Yeah thats what i was saying with the time of attack being stored
So when they die i can check if its within like 10 seconds
Dang dude so helpful god i couldnt sleep last night i was going in circles trying to figure this out
Lol it’s like that sometimes
Is there a better way to do a timeout value than what im thinking? Like make a delayed runnable after 10s just remove it? But i guess another player could attack within those 10s and it would remove the new entry assuming im using the same key value for every attack
The PDC is like a hashmap right? Or does it make a new entry for every time you put something in it
Yeah it’s just a fancy hashmap pretty much
Sweet
I would just keep a time value for last hit then check if it’s within bounds on death
No need for a runnable
Shoulda been using this all along thanks
Along the same topic, when i use entity.damage() i believe it ignores armor/enchantments/etc. Is there a way to have it not? Or a diff method?
Yes i know but i want to inflict damage with this wind spell
But i also want higher levels of armor to protect against it better
Then no, the damage you apply ignores all defences
((CraftPlayer)player).getHandle().d(DamageSource.GENERIC, 5f);
I found this on an old thread from 2016, they said it accounts for armor and stuff but figured youd all know more
Using nms
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
All the damage calcs are on the wiki, if you wanna just calculate it yourself then apply it that could provide for some flexibility
Sorry not sure I know what you are talking about with this
The code snippet you sent is unmapped nms
He just sent the site to find the equivalent mapping
this one? https://minecraft.fandom.com/wiki/Damage
ah okay im new to nms what is do you mean by "equivalent mapping"
Yep
So spigot has mappings for nms classes which basically just give more reasonable names for internal mojang classes
Nms will have still like e.df().j or some shit
also for the PDC thing, would it be fine to use like 4PDCs per entity for each variable? or better to use one PDC and put one string in and deconstruct it?
ohhhh
are pics not allowed in this server i cant upload
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
i see doing that now sorry
guess i mustve verified it on a different discord already
this is what im talking about with the PDCs ^^
oh very interesting
Img isnt loading for some reason
i think that may be better than using comma seperation for my fields dunno
Can someone point me to the code where the serverside packet compressor is?
The netty handler
Should be named like "minecraft-compressor"
!verify vanabyte
A private message has been sent to your SpigotMC.org account for verification!
okay sweet im verified. this is what i was talking about @drowsy helm
but like Elgar said theres a list type
I wouldnt use a list for that
not just for 2
Regardless of size, they arent the same variable. List would make sense if it were multiple players or smth
are these temporary things?
if so, just stick with a normal hashmap and a task
not sure why pdc would need to be introduced for such things
yes temporary that will be updated pretty often, everytime they are attacked
yeah, pdc is designed for persistent data, not temporary
and everything about it is not ideal for such things
you are better off making a player wrapper, hashmap and some task
i have that for my players already and it works fine. im trying to come up with a better system for all LivingEntities
it works fine, but some how its not good enough?
for players, i dont want to create a wrapper for every single entity
seems you are looking for a problem that doesn't exist =/
bruh
why not?
and it wouldn't need to be for every single entity, you can have one for players and one for living entities, don't think you need more then that
well yes but still thats alot of living entities
you can distinguish the entity easily of what it is by evaluating properly
constantly spawning and despawning
sure, not sure what the issue is
idk just trying to be a smart programmer haha that seemed like it would clog up the garbage collector
if your GC is tailored properly it shouldn't be an issue
like 50 players in a survival world with maybe 20 living entities spawned around them at a time. thats around 1000 instances
It sounds like your data only needs to persist for 10 seconds. No point in PDC at al
so i was saying, maybe i should only create an instance if the player attacks the entity in the first place, instead of on spawn
you can absolutely use PDC if you want, however because it is persistent it gets saved every so often and since your data isn't permanent this is actually not optimal and you are just causing more work for the server
but my issue with that is what if they deliver a single kill blow and the death event happens before the damage event, and i dont have a wrapper set up yet
temporary data should only remain in memory this way it can just vanish with ease 🙂
that makes perfect sense i appreciate you saving me the headache of learning that
i use PDC for the special weapons players carry, those are more persistent at least
maybe changing a couple times per session
that is more appropriate use of it I agree
so what do you think, wrapper that gets created on attack or on entity spawn?
or hashmap
Well I don't know what data your keeping track of, but the handiness of a wrapper is you can store that data on the object this way when you fetch said entity or player from the list, you can just call the relavant method on the object instead of having like 2 or so hashmaps or lists
if you are keeping track of damage, the wrapper only needs to exist as long as the entity is alive or the player is on the server
oh yikes you're doing damage tracking in pdc
entities disappear when chunks go away, so this means the wrapper can go away too
EntityRemoveFromWorldEvent or something
not sure if a despawn event happens for a chunk unload
might be paper only
but good news with the wrapper you could easily just check your entities locations with that of the chunk that unloaded
so not like overly difficult in that type of check
Store the entity id on the wrapper
exactly
Periodically check if the entity is not null and its chunk is loaded and it's not dead
Or just use events to make sure that's always the case, both options work
But yeah not only should you make a wrapper for the entity, but also for the entry :)
I wrote this at work like 12 hours ago
Yeah thats what i was thinking
oop is great haha
this is a dumb question, but how do you forceably remove an instance in java?
not really possible
when it comes to optimizing, you need to learn only optimize stuff that is known good practice in code, like some cleaning up. But for other stuff like bogging down GC don't start optimizing without first doing some profiling. If the GC is tailored well enough and same with the JVM, you really shouldn't be encountering issues until you have like hundred thousand or so living entities
You just remove every reference to it and the GC will do stuff
ah okay gotcha
the only way you can force remove something and its not really guaranteed is nulling out
there needs to be no reference, but nulling out something helps sometimes not be a reference anymore
but if you are having to do that, probably should look into that design flaw
I personally null out stuff I know I am not going to use anymore but that is just a habit from using other languages and not something you really should have to do
so i create my player wrapper on join like this, when I make a new instance I add them to a static <UUID, Fighter> hashmap so i can retrieve the instances wherever in my code. When I call fighterLeftServer(), I dont actually remove them from the hashmap (just upload their stats to database and stuff) but you guys are basically saying i should remove them from the hash?
this is unrelated to the damage tracking i already have this done
why do you not use IJ new ui
Because I'm used to and like the old UI
i hate the old ui ngl
Check pins, argument 2
The map shouldn't be static either
not sure why you would keep them in the hash unless you expect them to come back relatively soon, but even if they do rejoin depending how your wrapper is coded the player object from before is not the same as the new one that gets created. I see you are nott directly saving the player object but still good to be aware about. But if they really left then remove them from the memory lol
sounds like a you problem
🤷
i suppose i could just make it a FighterManager instance something like that. i wrote this years ago i swear im getting better with the static abuse lol
be careful with making maps static
they don't quite work the same when you do it that way lol
There's also the thing of having a single point of entry
yeah i prob should cause i also store alot of other managers for them within their Fighter instance. and i guess if i dont remove the fighter from the hashmap these would probably all stay in memory too
When you have a manager class and encapsulate the map you get the benefit of being able to do input validation and all that good stuff
private static should be fine tho right?
like in general
yes yes i know haha i used to be a static abuser
not sure why you would make it a private static
kind of defeats the purpose of making a map static
kotlin object thing
well I don't use kotlin
i was just asking if it's fine to do
also i just remembered objects are singletons so nvm ig
In this case the whole damage tracker would look a bit like this
looks a lot better, is this kotlin?
It is
I thought so with all those fun's
I am not having fun
lol
yeah i just have something like this
object PlayerUtil {
private val nameTagEntitiesMap: MutableMap<UUID, TextDisplay> = mutableMapOf()
var Player.nameTagDisplay: TextDisplay
get() = nameTagEntitiesMap[this.uniqueId]!!
set(value) {
nameTagEntitiesMap[this.uniqueId] = value
}
}
and i was assuming that the map would be static then
that's still dumb and should be a manager / tracker class
man i wish i understood that better alot of syntax i dont know but ill take your word for it and try to implement something similar. thank you
I think I have a slightly inferior java version
i have several extension props and funs there
no its not you its me
i have refused to take the time to learn optimized syntaxs i just kinda cave man it
but im getting there
the static abuse hurdle was a big one to get over
yeah thats way more readable for me
do you have anything for doing the chunk unloading checking?
no 
ive honestly never had to deal with that, is there a direct method for every entity
ah okay simple enough
asn just to clarify lol
it would be a bad idea to attach a register ChunkUnloadEvent listener to every entity wrapper
yes
one listener then delegate to entity wrappers? Or just directly remove the entity
It's overall "a bad idea" to register and unregister listeners in runtime
yeah i have them all onEnable
gotcha
if you want to do it still, it can be done
it doesn't have a huge performance impact from what i saw
don't you have a phase game engine, how are you handling listeners then?
yeah i think im going to attach a movement listener to every entity and make it do 6 nested for loops on every event
static abuse go brr
In this case it's fine but I also clean up after myself
sorry just to clarify but when the chunk unloads or the entity dies, we do the tracker shit if necessary then when we know the entity is forsure gone we just do the remove() method from the hashmap right
that should be okay for garbage collector
Pretty much yeah
sweet
is there some way i can save a place on discord to come back to later. i guess i could just type a message and find it again
perfect
Just search for those 3 words
got my very own hashindex for a discord
you should see mine o_o
thanks for all the help you guys are the best!
copy message link?
yo @wet breach I got a proposition
o.o
you can create a thread
if left inactive for too long it disappears though
I wanna make a compat plugin for modelengine on bedrock
Like sure geyser can translate the armorstands and shit but bedrock has a native system for that
as far as I know, but I haven't messed with bedrock
Problem is, geyser's api is dogshit and doesn't give you context of anything if you're running a proxy
Just taking a closer look at this, is your register() method just something you pass the event into from an outside Listener class? Or is the “register” a special keyword for something
So we need a proxy plugin and some communication
it's just a method name, nothing special
and I just cba
I can provide a bunch of code
I am not sure how bedrock plugins work and what you could pass along
or what would need to be necessary o.O
It's a spigot plugin
o.O
I can guide the project
I just could use a little help :)
I can try helping, but as I said bedrock is the one thing I have practically not touched lmao.
Also so do you have have one static instance of your PlayerDamageTracker that you would use all over your plugin? It wouldnt make sense to keep recreating new instances right
Given this is in my minigame core I have one per game instance
But for other plugins yeah just a single instance
Oh oh i see thats interesting
So i could actually have one per world if i have two worlds
Youve given me some ideas
Yeah but if the entity crosses a portal then all their data is lost
Yeah, just a thought cause im working on a minigame and it would be better to have it seperate
Not like actual overworld and nether
I meant moreso like gamemodes
Hello everyone :D, i have a question, do you have a good guide on how to add custom enchantments (1.20+) without any dependencies (ofc if it's possible) .
Idk if it's still the same
https://www.youtube.com/watch?v=EVDUIivW7MQ
But that's how you do it
In this episode, I show you how to make custom enchantments in Spigot 1.14. There are a lot of different steps involved, so you need to pay attention closely. I demonstrate how to make two separate enchants, the glow enchant and the hemorrhage enchant.You will find no other resource that can help you do this, so a lot of hard work was put into ...
It's changed in 1.20
I found nothing so I pass to the persistent data container and the lore for my custom enchants
is it possible to change the block state ou the block data of a block ? and if yes how because I try to change it but nothing change :/
yes, but as I was saying, when I do that, the block data doesn't change, it remains a CraftBlockData and not my CustomBlockData.
What are you trying to achieve?
make a custom block
afaik mfnalex made a lib for that
Does someone have a good simple anti piracy system that compliant with spigotmc rules?
For example a command where a developer of the plugin can see what user downloaded the plugin or disable the plugin if it's pirated
hey I will want to make a invsee command with the off hand and the armor but I have a issue. there a lot of event that change the inventory moreover the inventory is update one tick later after the action is made that is produce some duplication bug. can somebody know how to make a good invsee without these issue.
Im not sure if obfuscation ist allowed, if its not, they'd just remove your safety.
im starting to get useless error messages in some of my plugins. console is empty . i have tried surrounding with try execption but it still doesnt show the errors.
console should never be empty when you get an error
how do i fix the remapper throwing "Unsupported class file major version 65" during compile? My net.md-5:specialsource-maven-plugin is using 1.2.5 and im using java 21
Are you sure it's the remapper
pretty sure
[ERROR] Failed to execute goal net.md-5:specialsource-maven-plugin:1.2.5:remap (remap-obf) on project Aurum: Error creating remapped jar: Unsupported class file major version 65 -> [Help 1]
well it is
Update special source to 2.0.3 and try again
that worked, ty
can anyone help
Looks like you have something removing the error from the console
our guess is as good as yours if you don't have logs
Remove whatever that is and try again
That looks like you generated that error
however, you can't duel yourself
will try dueling others
still the same error
what does that mean?
you didn't return true at the end of yoru command?
Returning false should print the usage message not an error
eventually he'll check his variables and see something is null
i was trying to add this sender.sendMessage(String.format("You have %s", BettingSystem.econ.format(BettingSystem.econ.getBalance((OfflinePlayer) sender))));
see ur console bro
you didn't read the issue did you
throw new RuntimeException(e);
you are just hiding the actual error behind another
i added that AFTER it wasnt printing errors
with/without doesnt work
look in your server logs, there WILL be a stacktrace
remove the try/catch and see what the actual error is
paper
also, that code is not the code that threw your first error
your error was in a command
not setup an eco
yeah at least give the relevant code lol
i also have added try catch to the command
remove it too?3
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
why u throw another Exception, just print it
idk i just selected the code with Intellij and clicked surround
why
line 47 return true, as it was yoru command and you processed it
i dont have 2 minecraft accounts
and i need 2 for duels
actually, ALl return true
ok will try that
what else am i supposed to do
Have a second account
i wanted to buy another one (discount motivated me).
xD
rly?
i only have paypal
I just bought a second one via PayPal…
line 74, the whole for loop is pointless, You already know they are ignoring with the contains check. No need to loop every entry
let me guess you have card added on that paypal
Hmmpff I don’t really know, maybe maybe not…
wdym
you check if the config contains the UUID
then you loop over every entry to find it, and do nothign with it
this one?
literally java if (plugin.ignoresConfig.contains("Ignores." + target.getUniqueId())) { Chat.sendMessage(player, plugin.languageConfig.getString("duel.commands.ignore.player-is-ignoring-requests")); return false; }
yes
Objects.equals is redundant
don;t need for loop at all
delete teh loop, just send message and return after .contains check
i think you misunderstood the storing path
no
if (plugin.ignoresConfig.contains("Ignores." + target.getUniqueId())) {
im just checking here if that target player is ignoring any player
ah ok
then im checking if one of the players is the one that is sending request
you have a sub list for specific players?
i have a list
then still don;t loop just do another contains on the list
if (plugin.ignoresConfig.getStringList("Ignores." + target.getUniqueId()).contains...
if (plugin.ignoresConfig.getStringList("Ignores."+target.getUniqueId()).contains())
ye
thanks
no
what no
if (plugin.ignoresConfig.getStringList("Ignores." + target.getUniqueId()).contains(player.getUniqueId().toString()) {```
yes
ok wait
hi guys how do i get the object EntityType from a mobs name string?
i mean instead of doing EntityType.ZOMBIE i have a string containing "zombie"
you don;t from its name
do you want me to remove try catch from command too?
shouldn't as it may be unreliable
string matching and customs etc
EntityType.ZOMBIE.getName()
do you have the entity itself?
iirc
removed that from it too
still same thing
no errors in console
EntityType.fromString("zombie")
last time i checked, bit I'm not on pc so not sure
i do get this is still a thing?
The modern approach would be to use the entity registry
so?
So i would do that
ok how
me ignoring everything that says deprecated be like lmfao
theres no try catch
already removed it
EntityType type = Registry.ENTITY_TYPE.match(name);
then its impossible for you to not have an error. Test on Spigot
That's bad
bruh ok
does runTask have spigot?
Are you using the /reload command?
hell no
ik, but it depends on what i use, sometimes the old way is just as good, i try to use the latest, but sometimes I just can't be bothered
The only sometimes acceptable use case of deprecated methods is the getOfflinePlayer method
i only have deprecated stuff when dealing with paper normally
I don't deal with paper normally
it's nice, but hell at the same time
That's how I wrote kotlin
basically half of everything is deprecated lmao
i feel sorry for u haha
do u know when entity registry got added?
Fuck I screenshotted it a second too late
how do i download 1.20.6 spigot?
You run buildtools
download buildtools, put the jar in a folder
Illegal to download, Run buildtools
double click the jar
Attempting to build Minecraft with details: VersionInfo(minecraftVersion=1.20.4,
and set version to 1.20.6 and then hit compile
--rev 1.20.6
If you're on windows, theres even a UI
we got the gui now
im on linux
it should work on any platform
as long as you know how to open jars on that platform
unless it's headless
headless?
Is it possible to execute commands in only one world?
like with dispatchcommand
this one?
sounds like an xz thing
yea, that's why
Unless... /execute
if you want to make a command that runs in chosen worlds just check if a player is in the specific world by name
Or I think you can dispatch commands as an entity
but that works with dimensions
How much can that affect the performance?
i have to loop through all players
are you running it every second?
Wtf are you even doing
No, not every second
Most of the time there is 0 reason to dispatch commands
remember people doing something like this in skript
command execute->
for each player
check if in a specific world
do command stuff
I mean, i ahve a reason
Tell us the reason
to use commands from other plugins
Such as?
mythicmobs
do i have to run this with sudo?
Does it not have an api
API's exist for a reason
No
💀
lol
Either api or nothing
i'll check i guess
you dont
check your buildtools log for where it failed
from the command error, it looks like the maven build
This is going into my important things folder
its like my server's logs when i havent restarted it for 34 days
yes it will be a long log. see wher it starts to erro, or paste it
delete that
I did not read the conv so it might have already been suggested, but try from an empty repo with just the buildtools
Its not allowed to distribute this
WHY
rip
mojang code
i mean paper distributes its jar without a problem
I told you before, its illegal
Mojang things
removed it .-.
paper use paperclip
whats that
@charred blaze Just use paper then
it performs the server patches at runtime with binary patches
It runs spigot plugins fine
i was using paper
which puts it in a legal grayzone
builds teh server on your computer when it needs it
Is that, why the redistribution is allowed?
the jar they distribute technically doesnt contain minecraft code so its a grayzone
Yes, test on Spigot as WE are Spigot here and you are showing an erro that is not in your console, which is impossible
Why doesnt he just show the exception?
They basically just distribute buildtools on drugs
he says he gets no exception in his logs
Man now i had to startup my VM just to delete it :(
just in chat
Then its not an exception from the server
WE are Spigot
I'm betting its his enviroment as he runs his server use a runTask plugin, so he's not seeing the error channel
Yes Comrade
WE?
yeps WE
union of socialist spigot republics

All hail the Spigots!

Turn on debug mode in server.properties to see the full error.
it was java
I don;t think he's even seeing teh error stream
THANKS
THANKSS
ill try it
I shoudl have told you to look in your actual servers latest.log, not just a screenshot of yoru console
yep. debug mode worked
i have sent actual logs to here
why isnt this enabled by default
Cool, but whats the error
Is it even possible to ban player's by UUID?
Thats how everyban works
The username can change
No, I mean using Spigot API.
the UUID cant
yes
I can't get the addBan to co-operate with me.
that's so silly
var banEntry = banList.addBan(bannedId, "Reason", null, whoBanned);
You know, something like.
what is this
Well, it only shows more exceptions in specific places, but after the brig API was merged, it became more useful. I’m wondering if maybe exceptions there should be shown always regardless since it’s happening way more often now.
Right, but then I get this:
Depracated!
😠
so what
@SuppresWarning("deprecation")
Yes
oh true
But the T won't accept anything I try to throw at it.
🤔
I don't remember the exact details
It’s absolutely hilarious that you wrote this code and it will compile. It’s nothing you did, just the atrociousness of making a method have a return type generic that is not based on any parameters.
@Deprecated(forRemoval = true)
Which is the APIs fault, not your
Class generics are annoying
What? Generics are fine. But they are used incorrectly for the getBanList method
Because it takes an enum, which cannot have a generic parameter and returns something with one
Nah, I'm saying class generics are annoying. Some of the time javadocs do not tell you anything about them so you end up having no idea what to do
And because it's class specific it's even more dificult to spot
Well, let me know if you have any ideas how to get it working.
Ah the stuff that is fixed in the fork.
They shouldn’t have to, the parameter should force you to use the correct one
It doesn’t in this case, because it’s an enum
Yet this one fails miserably
Because the parameter is an enum
And in this case the javadocs really should describe a bit more on how to use those methods
If it was like this https://jd.papermc.io/paper/1.20.6/io/papermc/paper/ban/BanListType.html, then the parameter has its own generic param, and it won’t compile if you do things incorrectly.
But you can’t do that with an enum https://hub.spigotmc.org/javadocs/spigot/org/bukkit/BanList.Type.html
That's kind of helpful. But I'm still not sure what type the actual profile thing should be, ie. the entry which represent the banned user.
I can't find any mention of it in the docs.
Obviously it doesn't accept UUID.
Are you trying to ban a player ?
PlayerProfile
Thank you, I will test that out.
e.g:
void banMyPlayer(Player player) {
ProfileBanList list = player.getServer().getBanList(BanListType.PROFILE);
list.addBan(player.getPlayerProfile(), "Hacking", Duration.ofDays(20), null);
}
Godamnit.
I had:
BanList<ProfileBanList> banList = server.getBanList(BanList.Type.PROFILE);
And it required
ProfileBanList banList = server.getBanList(BanList.Type.PROFILE);
where is the difference here
ah
I pasted the same thing twice by accident at first.
edited
Well, it seems to not error out now. Thank you very much @civic sluice
And the rest of you as well.
Yeah, the code I posted only works on Paper, like Machine already mentioned.
What do you mean? Why wouldn't it work on Spigot?
on spigot you shoudl just need to cast the returned BanList
It uses generic constants instead of the enum spigot uses.
why is econ null?
do you have an economy plugin?
yes. vault
I wrote this yesterday:
https://www.starandserpent.com/draw/
then how do i check?
how do i check if there is a provider
with rsp == null
oh ok
nice