#help-development
1 messages · Page 1250 of 1
I think most skyblock plugins have perm checks on block break
true
so I would need to create a sort of hashmap for each player on what is their designated space they can use or smth?
tbh, I think it's just best to use an existing one and build an addon of sorts for it
yeah but you go back to the old limited worlds mc XD
like worldguard?
Just use world guard regions and dont allow them to leave the region
yeah lol
use it as a dependency and create the regions through script(java custom plugin)?
I can make custom commands to modify it with an API
Probably wouldnt use script but you dont need it as a dependency either since not leaving a region is built into the world guard flags
You just deny exiting
yeah but I still need to create that region in the first place
so my plugin would need to do that
its not like protecting spawn
Right, not hard to hook into it to do that
It has an api
oh that's nice, I shouldn't be surprised tho 😂
lazy dev approach I'll be going with: https://github.com/BG-Software-LLC/SuperiorSkyblock2/blob/dev/API/src/main/java/com/bgsoftware/superiorskyblock/api/SuperiorSkyblockAPI.java#L148 🤣
handles the schems for me and everything
now I just need to make sure no flaw in my code grants op 🤣
can't blame you, I'm not tho cuz I'm using custom blocks
itemsadder,slimefun,nexo,coreprotect all seem to have hooks
but yeah understand the custom plugin
good to know tho
worst case scenario I just fork it
gn o/
there are actualy 655k ways you can wear a armour in minecraft lol
are you sure about that
excluding turtle shell/elytra it'd be 157 trillion with all the armor trims and trim colors
or are you talking about one armor piece
out of curiosity why was LootTables.EMPTY removed in 1.21.2
Ask Mojang
oh was that an internal mc change? fair enough
Ok, I got the timers set. For single timer that is. But how can I add multiple timers to this?
https://paste.md-5.net/ijinisehay.java
If I need another HashMap or something in these lines, tell me because I don't know how far I can nest this
just nest a collection of bukkit runnables
what timers and how you remove them depends on implementation
Long as this is not a issue, that is what I needed to know. I can get the system working. Thanks for the answer. I working on linking hoppers/chests
That is what the timers are for
The reason its in a TimerManager because I might use it in other plugins
its fine as long as you know what you're doing
Which I do. Some people thinks I trying to copy EpicHoppers but its not really the case. It may seem like it. Just compare the features and you see that its not true. Back to the plugin
nothing is wrong with writing your own manager, using concepts that are similar doesn't mean you are copying
You correct about that
I just refuse to use their plugins even while I have a subscription going. Their devs take forever to fix issues and I don't have the time
How can I close the gui of a player?
I got it, I did not think player object has this feature
i am talking about all the ways you can make one unique armor sets without repetition of armor peice
weird question about inheritence but if i have this class
will classes that extend it also have said priority
and dont give me ?tas, i dont wanna try it out
why not
^
cause
id have to compile, setup multiple listeners
etc
get my server running
and all of that
the alternative is to go into the sources of the reflective eventhandler system and see whether it resolves inheritance or not
so if you'd like to do that instead...
md5 might but whether he appears from the thin air now or an hour later is anyone's guess
i dont know the answer but if I were to assume I think it does not inherit the priority if you override the function
I dont think listeners support inheritance
although you've annotated an abstract method so maybe
if they do support inheritance then yes priority would be the same
tas
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface EventHandler {
not meta-annotated with @Inherited
my guess is that they don't get inherited
I dont think the meta annotation changes the example
it'll depend on the reflection code
is there a way to get an events priority from the event object?
so i can just print it out
if the reflection logic that scans for the superclass' method declaration it will get inherited yeah
Set<Method> methods;
try {
Class<?> listenerClazz = listener.getClass();
methods = Sets.union(
Set.of(listenerClazz.getMethods()),
Set.of(listenerClazz.getDeclaredMethods())
);
} catch (NoClassDefFoundError e) {
plugin.getLogger().severe("Failed to register events for " + listener.getClass() + " because " + e.getMessage() + " does not exist.");
return ret;
}
well, it doesn't recursively get the private methods of the superclasses, so if the class you're extending has a private eventhandler method, that won't be registered
the method is public though
getMethods will also get inherited methods, which will have the annotation
but the issue is that getDeclaredMethods will get the methods specifically declared on that class, and that won't have the annotation
so the method will appear twice in that set union
how exactly that behaves, i have no clue
presumably then the declared one takes precedence
i mean the whole argument is pointless if listeners arent inheritable anyways
or rather
overwritable
annotations are not passed down with inheritance
they're overwritable in the sense that the method will be called on whichever listener object is registered; if its class overrides it, the overriding method will be called
well
it doesnt
i just tried
it does if i annotate it with eventhandler
no, that is different
but not if i overwrite it
the issue is that the reflective lookup sees both the un-annotated override and the annotated declaration in the superclass
yes, because annotations are not inherited
you need to get the parent class to see the base annotations
i c
and the un-annotated declaration takes precedence
no, it doesn't
annotations canbe inherited if meta-annotated with @Inherited
it only sees one method, the furthest one down the chain is the one it sees
it gets them both
no, it does not
or no, you're right, it will only see them both if the override is private
yeah you're right
didn't know
either way i don't think this inheritance thing is going to work
wait no it doesn't work on interfaces
maybe we should meta-annotate eventhandler with inherited to make it work?
@Inherited annotations won't inherit if you implement lol
i feel like i sparked something here lol
could work, but that may break existing systems
just a friendly discussion lol
@thorn isle nvm
As per oracle docs Note that this meta-annotation type has no effect if the annotated type is used to annotate anything other than a class. Note also that this meta-annotation only causes annotations to be inherited from superclasses; annotations on implemented interfaces have no effect.
great
registerEvents could be edited to check overridden methods
but again it may cause issues
i kind of doubt anyone would be relying on this behavior specifically but god only knows with plugin devs honestly
I have seen a 3 year old codebase, so relatively young
there are no bounds to the horror I saw
speaking of boundless horrors
nobody still remember who did that async entity pathfinder fork?
i've been trying to look for it but i think i might just be hallucinating the recollection of it by this point
wait no nvm
maybe, but i remember it being done by someone actually competent
I stumbled upon yatopia 💀
🤡
i think it was for modern versions rather than 1.8
i want to say spottedleaf did it in tuinity but i might be confusing it for his async light shenanigans
eyeballing the patches it doesn't seem to be tuinity
sounds like something cmarco couldve done
maybe i misremember and it really was some hideous yatopia "async everything 25x" fork
cmarco mentioned 🔥
he was the most legendary person in spigot mc
creator of bible plugin
i do remember someone using parallel streams for a bible plugin of some sort
i thought this folly
async everything is bs
but you can async some stuff
(this is a jab at folia)
i think trying to make some of the internals more thread safe would probably have been less work, api breakage, and diffs to maintain, rather than doing whatever the hell they're doing with folia
but i haven't thought much if at all about regionized ticking so maybe they know something i don't
That's my plan right now, but I have to get over my skill issue in not having energy
what'cha gonna async first
right now? pretty much nothing, gotta get my API stable first
i'm looking at the ai goals and the more i look at them the madder i get
for sure
There are plenty of paid 1.8 forks
and the newer entities with the new Brain ai system are even worse
frogs as it turns out are as expensive as villagers
first improvement I'll make is regional collision and entity lookup, should be much faster than what's going on right now
and the best part is that if I do everything right I won't even need to update this per version
nahhh i aint paying for 10 year old software 💀
b-but the async async code
i don't recall collisions taking very much time, nearby entities lookups maaaybe
last I checked every entity looked through every other entity in it's region to do collision checks
I don't know if that got improved
if you mean region as in 16 blocks cubed section, yeah, that's how it still works
bro armadillo tries to change state every tick 💀
64 chunks*
a region is 64x64 chunks
isnt it 32
im pretty sure it is 32*32
every chunk section (16x16x16 cube) has its own "entity slice"
I doubt it was 64x64 chunks
yeah that would be disastrous
@rough drift can u do async loading for exensions in plugins (helix)
but allow synced loading if requested by specific plugins
weren't you pink
i lost nitro
💀
it was free for 1 month
Loading extensions async is kinda pointless, since they only need to run at startup anyways
but I can probably do plugin initialization async based on dependency trees
entity pushing is also one of those things that i think could be done completely async, since it's just comparing bounding boxes and setting vectors
data races could happen
iirc setVelocity is already synchronized on and the bounding box is immutable
I'll probably rename it to modules & plugins
sure but do you really care about races here?
kinda
what about core and plugins
there is already a core
woe is me the chicken was pushed 0.3355 blocks instead of 0.33551 blocks
modules and plugins still confuse a lot
yeah, aabb's are immutable, so no concern there
worst that'll happen in that regard is that the reference itself is stale (iirc it gets recomputed every tick, updated to be at the entity's new position) and your mobs get pushed in slightly the wrong direction because the boxes lag behind in visibility
from there if you want to be safe you can apply the collision velocity sync via the scheduler
hell you could do it with a plugin, by setting the collisions on every entity to false and then doing them yourself async and pushing them sync next tick
with probably an exception made for players, don't want to desync those even with slight races
but then again entity-entity collisions are generally not that expensive unless you have 1000 minecarts or chickens in a single block
so even if it is low-hanging fruit it isn't particularly worthwhile
I guess
I don't really know what to work on first
so I guess I'll just work on my API lol
Is it possible to load and enable a datapack from a plugin's resources?
you could always dump it from the jar into the datapack dir on enable, and then shutdown the server with a "pls restart" message if the datapack isn't loaded yet - so it will be loaded next restart
i think paper plugins might be able to load them at runtime since they load while the registries are open
I created a new project for hibernate and I still get the error.
My Config: https://paste.md-5.net/uyicapohin.xml
org.hibernate.internal.util.config.ConfigurationException: Unable to perform unmarshalling at line number 0 and column 0 in FILE C:\Users\isuki\Desktop\server\plugins\NewTest\hibernate.cfg.xml. Message: null
wait, is that the same error
last time it was about configuration not being found at all due to missing deps
Still is
now it seems like it is about mangled format in your config tho, can you send the whole stack trace?
Yeah gimmie one sec
ah no it is still the same thing, I'll be damned
Thing is it has the depends.
yeah, it sounds like a classloading issue at this point
I was able to use this awhile back but that was like a year ago.
But Idk what todo to fix it.
simplicity is virtue
Could it be java versions. I found an stackoveflow post about the same issue Im having could be that a depend requires a older version of java.
are you passing your plugin's classloader to hibernate?
.
^ My code I initialize with
i've never used hibernate but you are meant to pass it your plugin ClassLoader somewhere so it can locate resources in your jar
Not from what I know
I've used it in the past without passing my class but I am not sure as it dosent say it's having issues with that
Okay I fixed it somehow
@Override
public void onEnable() {
saveResource(HIBERNATE_CONFIG_FILE_NAME, false);
var originalClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
try {
sessionFactory = new Configuration()
.configure(new File(instance().getDataFolder().getAbsolutePath() + "/" + HIBERNATE_CONFIG_FILE_NAME))
.buildSessionFactory();
getLogger().info("Hibernate SessionFactory initialized successfully.");
} catch (Exception e) {
getLogger().severe("Failed to initialize Hibernate: " + e.getMessage());
e.printStackTrace();
} finally {
Thread.currentThread().setContextClassLoader(originalClassLoader);
}
}
@Override
public void onDisable() {
if (sessionFactory != null)
sessionFactory.close();
}
this is how I tested it and it seems to work for me (well, it doesn't load for me as I don't have sqlite database setup but that's beside the point)
with what depends are you using
https://pastes.dev/dAofm9PzJ2 this is my pom.xml
Also what is the import on instance(0
ignore the spigot-remapping stuff, I tried it in a plugin I was working on
instance() is just a static method for the plugin's instance, a singleton
telling me to import a class lol
just change it to this
Got new error java.lang.IllegalStateException: Cannot get a connection as the driver manager is not properly initialized
kind of the same issue I believe, you got to initialize the driver
though it worked just fine for me, I just did a test
a sqlite db?
yes
add Class.forName("org.sqlite.JDBC") at the top of your onEnable, see if that fixes it
shouldn't need to do that considering setting the context classloader to the one of your plugin's should also make it load the jdbc driver when Hibernate bootstraps, but I guess it isn't happening in this scenario?
Can I also see your config
for hibernate?
I literally copied yours lol:
https://pastes.dev/UNOknDWbJE
only added the mappings for my test entities
Do I need the jspecify depend?
no, that's just nullability annotations
it'd be better if you could post your project in github at this point so I can try and change it myself
because there's no way I got it to work with my jank approach and you can't lol
https://paste.md-5.net/amoxujogex.md
So here is the error now after adding class.forname but since I haven't completed my modals yet I think thats where its giving me issues at. Although, Idk how yours dose it without the class.forName could it be your shading your using as your using diffrient stuff than I am in pom.xml
the only thing different from yours is that I don't have the createdependencyReducedPom directive, and I added the services transformers just in case, you can try adding the services transformers too and see if that changes anything
I am also using a newer version of the maven shade plugin but I doubt that's the issue
here's my pom for reference
try {
Class.forName("org.sqlite.JDBC");
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
this.getConfig().options().copyDefaults(true);
saveConfig();
saveResource(HIBERNATE_CONFIG_FILE_NAME, false);
var originalClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
try {
sessionFactory = new Configuration()
.configure(new File(this.getDataFolder().getAbsolutePath() + "/" + HIBERNATE_CONFIG_FILE_NAME))
.buildSessionFactory();
getLogger().info("Hibernate SessionFactory initialized successfully.");
} catch (Exception e) {
getLogger().severe("Failed to initialize Hibernate: " + e.getMessage());
e.printStackTrace();
} finally {
Thread.currentThread().setContextClassLoader(originalClassLoader);
}
``` my class now
Maybe he is
1.8 😭
Well it gave me an error saying it didn't find that class lmao. I use java 17
are you sure the server is running java 17 tho
it runs of my computer
how do you run it
I take that back its now java 21 due to 1.21
I didnt update my pom or project that may be why
the version you're using doesn't just change with your minecraft version, IntelliJ might use a different one from the one in your path
though that shouldn't be an issue honestly, I am using java 21 too
When I was setting up the server it requires java 21
So I though java 21 for the plugin as well
yeah, that's fine
Did they get rid of Material class in 1.21 for spigot?
Yeah
The most of the time its just an index error or outdated IDE
Maven / Gradle dependency alright? Bcs Spigot didnt get rid of anything. So a user problem c:
update intellij
and make sure you're using java 21
i'm guessing you just ran the in-ide update checker
LMAO. It usally just tells me with a download button but I did think about checking manually
well, what version are you on
install JetBrains Toolbox, update intellij from there; the in-IDE updater is terribly broken for some obscene reason
It works
You just need to do like one update at a time with it
So multiple updates may be required in a row if you do it that way
can't wait to install an autoclicker just to update
I should probably update mine too, still on ultimate 2024.3
2023 LMAo
i thought it was early 2024, turns out it's late 2023
Why players cant enter to nether even nether is enabled
Incase if they inter they cant come back
Why can i have a solution
because you need it
Wt?
Used it
i love this conversation
wdym!
It works NOW!
I have a feeling it was a problem with my IDE lmao
your IDE shouldn't have affected how the code ended up, but perhaps it was using java 8 or something even though it shouldn't have
It had to be the ide. Because I replaced the code I had before and it works fine.
Are YAMLs a good way to store player stats and data for non-small servers?
Depends on what you consider small
even without the set classloader stuff?
well, that's weird
it shouldn't work without setting the context classloader
unless your server is also running java 8
and you'd be running hibernate 5.x as hibernate 6.x depends on the newer jakarta APIs
well, glad it worked in the end
I hate using default mysql. Hence why I am using an ORM
whats wrong with default sql
I used ORM in typescript as well so I more well verse what they do compare to sql
I don't like it.
in the plugin development space people tend to avoid ORMs since it's just too much for what ends up being rather simple pieces of software
Too much typing.
Yeah, I get that.
If your doing a small plugin and storing small data use yml. But if your doing a bunch of data small or large use a db.
it also doesn't help that you end up having to relocate your dependencies, and that is always fun when things stop working as they should because of that lol
Non small meaning over 30 players I guess
How much data do you intend to manage
at 30 players I'd start using a database honestly
doesn't have to be anything fancy, sqlite would do
YAML is not really made for storing lots of data. I mean you can but I wouldn't for a decent amount of data.
- How many players?
- How much do data you intend to store?
- How often are you reading/writing data?
That's what my java professor said yesterday. Although, people have their own way.
if you are going to go for a server-shared database though I would recommend something else other than sqlite, postgres is usually a fine choice but mysql among others is also just as fine
I've used pex with thousands of players in a yaml "database", was fine even if very dumb
I don't think I've ever heard of anyone actually liking jooq, just tolerating it lol
interesting config
?paste
The data are 20 ints, 1 long, 1 String, 1 String List, 1 OfflinePlayer, for each player
50 players max, saving data to file every 30 seconds 🤷♂️
and I only read the data when players join
its saved to an instance of a memory class while they're on the server

does the input packet also tell you when the player stops pressing the key or when they stop holding it?
I found this on the packet
also why is wiki.vg/protocollib broken?
it wont load the page
ooo thx
so does this only get sent when the player first presses the key or gets sent as long as it is held?
It gets sent when the inputs change
1 means it's being pressed, 0 means it's not being pressed
oh perf
To determine whether a button was released or pushed you have to compare to the previous packet and see if a 1 turned to 0 or a 0 to 1
so it wont be 0 right after its pressed only once its unpressed on client side correct?
I'm fairly certain this is how the event works as well
thx
1 means down 0 means up
I saw in a Kody Simpson tut that ProtocolLib accessed packet data with stuff like getDoubles().read(0) but on the mc wiki page it just gives hex codes...
and I can't view the ProtocolLib wiki tables cuz their wiki.vg/ProtocolLib website is broken
you were linked to a working website 20 minutes ago
yes but it shows hex codes
.
it shows exactly the same what wiki.vg used to
those are bit masks
why not just use the API event?
that's a whole separate packet
different packets will show different fields as they are encoded differently
the protocol page in the Minecraft wiki is a direct migration of what was wiki.vg, as it shut down
cool thx (plus it looks better 😎 )
do you know if I properly did this? (I didn't want to do it right in the main file)
uh idk what the whitelist thing is about but you can make the listener its own class, yeah
is this how I do it tho? id I properly implement it?
the whitelist thing was automatically imported 🤷♀️
that is interesting
CAVE AIR?
how is cave air determined where it is?
if i build a cave myself, will empty space in the cave become CAVE_AIR?
or is CAVE AIR under a specific y
oooh you know what remember how in mc live they said blocks have location based sounds it may have to do with that
what ver are you using
latest
i think its to do with what sounds there are and iirc bats and stuff are more common to spawn in cave air
could be wrong tho
oh
yeah like what they announced in mc live
didnt watch it icl lmao
fair enough
ive seen a couple clips about the ghasters or something but i never watch them
yeah they look fun, I'm not a fan of the locator bar but atleast you can disable it on the srv
Cave air is mostly for world generation
(you can also use isAir())
ohhh
Yeah, beat me to it. You should use isAir() for air checks
no, it relies on biomes
also it is found in some structures too
how do I packet.get... them?
why aren't you just using the PlayerInputEvent?
because it only returns the first keypress
I need to be able to get keyup as well
the event is called for that as well
nope
I tried it
I only got "w" when I first pressed the key and when I held it I only got it once
you are only printing when you press it...
when you stop pressing, the corresponding key will be false
so it won't print
but it is always false?
it is true when you start pressing
how do I tell if it was let go or was just already false
it is false when you stop pressing
either the precious input is provided in the event, or you can get it from the Player itself
I don't remember which
previous*
just remember the last state
how?
boolean forward = false;
by placing it outside the event?
per player
oh like a tag
just get it from the Player..
Plater#getInput()
Player#getCurrentInput
ah
if (event.player.input.isForward() != event.inout.isForward) {
// forward input changed, the event's state is the new one
}
what is e.inout?
a typo
what are you trying to do with this anyway
oh
they meant to type input
it's pseudocode I'm typing on my phone
I guessed
thx I'l try this
we need a discord overlay for IDEs xD
you probably can get the overlay if you add it as a game
^^
though I think that's just for voice channels? Idk, I never use that
normally there is like a small version of discord overlaying the app
think steam overlay
but discord
prob
It works TY SOO MUCH
You can add your IDE to the list of recognized games on Discord
It should overlay then
don't be poor and get a second monitor
I get this error if i try to teleport to a map that doesnt exists (it isnt stored in the config file)
doesnt that make sense tho?
answer this please
use WorldLoader class
Saying that the map doesnt exost
or something like that
as stated into the link ive semnt\
You tried to get something from your config without checking if the result was null before trying to use it
so do i neeed to check if mapname is null or map?
How to use obfuscated spigot jar in my project?
compileOnly("org.spigotmc:spigot:1.20.6-R0.1-SNAPSHOT-remapped-obf")
you want obfuscateD?
ye
player.teleport(map);
sender.sendMessage(ChatColor.GREEN + "You Have Been Teleported To " + mapname);
return true;
}```
like this ElderL?
i cant read this
elder 😭
that is obfuscated
Rad what
his name is elgar
its not
it is
Do you understand what obfuscation is?
no
you want moj mappings if you want to be able to read it
mojmaps
then how i can get moj mappings
back in my day we didn't have minecraft
good ol' try every letter til it works
is it efficient to use reflection to change the players gm directly without triggering the gamemode change event?
import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import java.lang.reflect.Field;
public void setGamemodeSilentlyReflection(Player player, GameMode gameMode) {
try {
Field gamemodeField = player.getClass().getDeclaredField("gamemode");
gamemodeField.setAccessible(true);
gamemodeField.set(player, gameMode);
} catch (Exception e) {
e.printStackTrace();
}
}
i forgot the : one
no
there is no good reason to do that
and will most likely cause bugs
so how would I do it without triggering the event
again, no good reason to do that
hmm possibly 😅
It works, but i dont have this classes
moj mappings use different names
It is the new standard, so best moving over
what
because I'm trying to make a custom gm plugin and my custom gamemode needs to be in spectator mode but I also have an event checking for gm change and stores that as the players current gm. there are other ways of going abt it I just thought this could easily work
ahh i get it
does the player need to be in spectator to get them to spectate an entity?
Yeah I get whta you mean. I feel there would be better workarounds
yes
Attempted to spectate an entity while not in spectator either throws an error or just does nothing (cant remember which)
it tp's them to the entity (I tried)
any ideas as to how I could go abt it?
what's the issue with setting their gamemode to spectator again
can anyone assist me?
.
there is no problem with them being in specator
hey vcs2
ignore the event if you caused it
yeah but I need to somehow tell the event to ignore it...
when you change a player's gamemode, set a boolean field to true
then in your listener check if it's true
if it is, ignore the event and set it to false
that could work
that's the standard way of doing this (with synchronous, non-recursive events), and even bukkit does it for certain things
alr
that said rather than listening to gamemode changes, you maybe want to implement your own /gamemode command instead
actually I could also just change the order (put them in spectator then put them into my custom gamemode, the order would override it)
I would but the default one is still there and not to mention all of the other plugins like essentials
but this could work right
why are you listening to gamemode changes?
to store the players curent gm
player.getGameMode
so you want to track whether the player is in your custom game mode?
no just "ignore" the default gamemode manager and use a custom one
prob inefficient now that I think abt it
what's wrong with the default gamemode manager
you cant add custom gamemodes
the way i see it there are the default game modes and then there's the custom state where the player is in your custom game mode
and the way to do this would be to have your own /mygamemode command that sets you into that state
makes sense
and you would completely ignore gamemode change events
and if the player is in an unexpected vanilla gamemode, you set them to what they're supposed to be in
well I still need the event to check if the player changed out of the gm since I need them to be in spectator for the state to work
exactly I need the event for that...
the player can only change out of the gm with /mygamemode
you probably have some sort of a tick loop for your custom gamemode, right
currently no but that's the plan yes
check the vanilla game mode there and if it differs from what you expect, set it to what it should be
oh yes
and thats clean, nice!
would this work for the tick loop?
new BukkitRunnable(){
@Override
public void run(){
/* Your code here, will be called every tick.*/
}
}.runTaskTimer(/*your main class*/, 0L, 1L);
yes although i would probably have the logic in a named method on a proper class and have that be called from the scheduler
true
class MyGameModeManager {
public void tickPlayers() { ... }
}
Bukkit.getScheduler().runTaskTimer(this, gamemodeManager::tickPlayers, 1, 1);
ah yes
will show up much cleaner in spark/timings
it will 😂
and generally putting anything large in an anonymous class is ass
yes for sure
was the bug where causing a tree to grow with applyBonemeal wouldn't fire a StructureGrowEvent fixed
How do I check if a player has a premium account?
oh hey nice
i have the jira link in a source code comment
good job 2 year ago me
Resolution: Unresolved
jesus fucking christ
xD
or no, what
it's showing some completely different issue opened 5 hours ago
is the link invalid?
public class EntityMountEvent
Is this right one for entering boats?
searching requires me to log in and the pagination only goes to 6939 🤡
i don't have an account
this issue
something something saplings, bone meal, structuregrowevent
How can i spawn my custom entity that extends LivingEntity? (NMS)
public class Test extends LivingEntity {
public Test(Location location) {
super(EntityType.ZOMBIE, ((CraftWorld) location.getWorld()).getHandle());
}
// some logic
}
Player player = event.getPlayer();
Location location = player.getLocation();
ServerLevel level = ((CraftWorld) player.getWorld()).getHandle();
level.addFreshEntity(new Test(location));
i getting this error
wait what the hell
how to register own entity type
why are you trying to register new entities
I don't know why, but when I use the url with just the issue id, it redirects to SPIGOT-8028
uncanny
i need to know
vcs2 could u help me c:
what was your problem again
that doesn't answer my question
tptopmapPlugin
what now
I am asking because dealing with "custom" entities is a pain in the ass, unless you want to make custom goals or something, I don't recommend it
^ TpToCommand
so when i do /setmap <map> it says it got created
but when i do /tptomap <map> i get this error
?paste
paste the entire stack trace and the exception name
and let's see your /setmap command class
- You don't have to check against the command name, as that's already pre-defined when you do getCommand for registration
- you can use instanceof pattern matching on that second if statement, see https://docs.oracle.com/en/java/javase/21/language/pattern-matching-instanceof.html
- You most likely don't want to return false at the end
the big red block of text is a stack trace
it has information about the error
but you have cut off half of it in the screenshot
it says the issue here
TeleportCommand.java:30
I know but the issue is that im trying to solve it and i cant
it is saying the "maps" configuration section doesn't exist
the setmap command uses a completely different key for the map name so it's likely that it just doesn't exist
maps exists
it seems to "exist" in the default config but i'm not sure if this is valid yaml
pretty sure you can't follow a key with no value
Caused by: java.lang.IllegalStateException: This registry can't create intrusive holders
yes, that is invalid yaml
an empty section would be
maps: {}
a section with one child would be
maps:
mykey: myvalue
you also can just do String.join(" ", args) instead of using a StringBuilder btw
so to what should i change it
this is terrible
what
.
yeah, I don't know how to explain the leap in logic with these commands lol
should i just add the {}?
that will fix one of your errors but it won't make anything work
Not with that attitude
because right now you are putting your beer in the fridge and then looking for it under the sofa
You must achieve a state where your code works out of shear fear
Guys im tryingto understand but its difficult
okay so you have this line in your set command
plugin.getConfig().set("creator." + sender.getName() + ".mapname", x.toString().trim());
let's run through this
what will this concatenated string evaluate to?
calling it they dont save it
suppose the sender is named bob and the arguments are my place
ok
the setmap command uses the key creator.<player-name>.mapname and the tptomap command expects something akin to this:
mapname: x, y, z, world
maps:
mapname1: ???
mapname2: ???
is there a reason you have the player's name in the setmap command? Is it necessary for the maps to be per-player?
if not, I'd scrap that and just have a map name to location key in the yaml
i think the fundamental issue here is he has no idea what a config is or how it works
I am probably speaking chinese to the dude right now lol
it isnt necessary no
ive made another plugin where i store it
i know what a config is
what are you trying to do again? warps?
like someone uses a command to store a location and then people can use a command to teleport to that location
u just gave me a beautiful idea
a genius idea
bruh
why didnt i jsut do it before
i already made a warp plugin
inb4 they're just gonna use warps
just copy paste
lol
don't even have to, you could just use your warp plugin and add aliases to it
yes but then it becomes a warp
i want to make a difference between them
stored appartely
vsc2, why arent u a discord helper yet?
these are commands I would just ask chatgpt to generate tbh
vsc2 for helper <33333
helper isn't a role for people who help here, ironically
yeah, kind of like minecraft roles work
Our job is to kick bots
Am i a bot?
Youre telling me this as if your account is being protected by Pope Franciscus
You can also be hacked
and become a bot
I’m not sure the pope is particularly good at cybersecurity
I mean, people trust the guy with blessings, may as well trust them with the computer
he doesn't need to be good at anything
the pope is infallible
whatever he says becomes true
does anything the anti pope says become false
I know its paper
but its caused by a plugin
So i copy pasted the warp plugin but TpToMapPlugin is red in the /plugins list
what is this causing?
can't tell with half an error
?paste
what\
you have used paste before
It’s in the logs
Upgrade now in a terminal app 🥀 🥀 🥀 🥀
wdym
If I share my GitHub link, can you check the relevant parts of my code? I have a piece of code that sometimes works correctly and sometimes doesn't. When I tested it, it worked fine, but when I uploaded the plugin to the main Minecraft server, it sometimes behaves incorrectly
I'm new to Minecraft plugin development and java
which logs
latest.log
paying for terminal and unable to zoom out 
?whereami
I said i know its paper
but its caused by a spigot plugin
its not paper the problem
its the plugin
?whereami
i love the fact coll is still blue in that video
go and read the rest of the error
It will leave a file
you will in the logs folder
i dont
your server has never ran then
and its the server
Papers new performance feature: No logging
Wot
it literally doesnt exist
It’s on the server
can you change the text size of a text display?
Not minecraft dir
you can change the scale of the text display
or no nevermind
Cannot execute command 'tptomap' in plugin TeleportToPlugin v2.0 - plugin is disabled
says it on the tin
look at your logs; your plugin ran into an error when loading
Which likely means it failed to load
Then read the logs
it doesnr give me info
wdym
i know it failed to start
where would the error be
Epic i know, i knew it even without looking at the error code
just by looking at /plugins
so go and find the error
where would usually be the error
it has an error that causes it to not load, find it and you resolve it and make the plugin start
oh my fucking god
inside of the latest.log file near the very top
where plugins load
inside of your server, inside of the logs folder
you guys dont understand
continue reading it until you find the error
guys forget the error log
Forget it
and the error is in the latest.log
it is because it tells you why the plugin failed to enable
The startup error which causes this error WILL be helpful
no need to log to say to me
DEPENDS ON THE ERROR
we do not fucking know you have not given us the error
so find it and LETS SEE IT
listen to what we are saying or go and fix it on your own
No one can tell you unless you FIND the ERROR in your LOG as it will TELL US what caused the plugin to fail
nothing
ok, it was sun spots
you gave us an error whcih literally says "plugin is disabled" which means your plugin failed to start, this means near the top of your log there is SECOND error telling you why the plugin failed to start
you haven't sent us the error
there is 2 errors, you gave the later one which means nothing to us
you absolute clown
its in the log file
error in LOG
honestly cannot be fucked with this anymor
send your entire latest.log
i dont understand
there is also chat
I'm sure you are trolling now
ElgarL im not
@young knoll please help
Then send the whole log
send your latest.log
i dont get what u are guys sayin
yes you do
i dont
💀 y’all are crashing out
find the server latest.log, find the first error in there which mentions your plugin
on your server where your server.jar is, you have a logs folder, inside of that folder is a file called latest.log put that on a https://paste.md-5.net
simples
y'all still going with this lmao
there isnt any cause by line if u guys mean this
okay im done
as i mentioned before
back to the block list
we want the FULL error
send the entire log file
that is the full error
just drag and drop the file
send the entire log file
we are not talking about "caused by"
there is a separate exception message further up in your logs
it's been 50 minutes lmao
since you can't seem to find it, send the entire log and someone will try finding it for you
do you need help finding your log file?
if they cant even find a log file idk if they should be developing plugins
no fucking way
you managed to send the log
missing command in plugin.yml
woah whats that on line 112
throwing an error in onEnable causing your plugin to not load
u guys dont believe me
[21:42:41] [Server thread/ERROR]: Error occurred while enabling TeleportToPlugin v2.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.egitto.teleporttoplugin.TeleportToPlugin.getCommand(String)" is null
at TeleportToPlugin-2.0.jar/me.egitto.teleporttoplugin.commands.DelMapCommand.<init>(DelMapCommand.java:15) ~[TeleportToPlugin-2.0.jar:?]
at TeleportToPlugin-2.0.jar/me.egitto.teleporttoplugin.TeleportToPlugin.onEnable(TeleportToPlugin.java:16) ~[TeleportToPlugin-2.0.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:280) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[paper-1.21.4.jar:1.21.4-207-1a7288a]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[paper-1.21.4.jar:1.21.4-207-1a7288a]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:520) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:657) ~[paper-1.21.4.jar:1.21.4-207-1a7288a]
...
see how there is another error?
and let's see what it says @polar forge
Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.egitto.teleporttoplugin.TeleportToPlugin.getCommand(String)" is null
return value of getCommand is null
on line 15 of DelMapCommand.java
the error tells you exactly what the issue is and where it is
(usually means your command isnt in plugin.yml)