#help-development
1 messages · Page 890 of 1
Cope
gotta do it urself
Exactly
jokes aside is this a good way to handle waves of "stuff"
public class ZombieApocalypse extends AbstractApocalypse {
public ZombieApocalypse(Plugin plugin) {
super(plugin);
}
@Override
public void start() {
super.getEventBus().subscribe(CreatureSpawnEvent.class, this::handleCreatureSpawnEvent);
}
@Override
public void update() {
}
@Override
public void end() {
super.end();
System.out.println("Ended.");
}
private void handleCreatureSpawnEvent(CreatureSpawnEvent event) {
if (event.getSpawnReason() != CreatureSpawnEvent.SpawnReason.NATURAL || event.getEntityType() != EntityType.ZOMBIE) {
return;
}
Location spawnLoc = event.getLocation();
for (int i = 0; i < 5; i++) {
if (spawnLoc.getWorld() == null) {
continue;
}
spawnLoc.getWorld().spawn(spawnLoc, Zombie.class);
}
}
}
To start an apocalypse I write
apocalypseManager.startApocalypse("zombie_apocalypse", new ZombieApocalypse(this)); // "this" is the Plugin class
I'm not sure if I should use an ID for all this but I used it anyway
you dont really have any granularity per wave
or are you talking about the overarching structure
wdym
idk why I said waves, but an apocalypse could have a wave
like certain apocalypses can stack up another
I would add some randomness. Not always spawn 6 in instead of 1 but to 1-6
oh well yeah that's just concept
Also you might add some initial velocity to the spawned ones so if you manage to see them spawning it doesn't look like a "cluster" but more spread out. Could technically also alter the Location but then you'd have to check for save locations to spawn
So what's the question? Sorry I just tuned in
just wondering if this is a good way to handle a timed state
a state meaning something that occurs over a time period
Yeah it looks reasonable to me
If you'd use that for many different events (e.g. listening to 70 different events) I'd wonder if it's better to register the listener "when needed" or to register it at the start and just return if it isn't needed. For this case it's definitely register and ignore but for many listeners I'd wonder what's better. Especially when you don't need most of the listeners for long periods of time
public abstract class AbstractApocalypse implements Apocalypse {
protected final Plugin plugin;
protected final BukkitEventBus eventBus;
protected boolean active;
protected AbstractApocalypse(Plugin plugin) {
this.plugin = plugin;
this.eventBus = new BukkitEventBus(plugin);
this.active = true;
}
@Override
public void end() {
this.active = false;
this.cleanUp();
}
protected void cleanUp() {
this.eventBus.unsubscribeAll();
}
@Override
public boolean isActive() {
return this.active;
}
protected final BukkitEventBus getEventBus() {
return this.eventBus;
}
}
/**
* A simple way to register an event without having to go through the class creation process.
* <p>
* Credit to <a href="https://github.com/IllusionTheDev">IllusionTheDev</a> for the idea.
*/
public final class BukkitEventBus implements Listener {
private final Plugin plugin;
public BukkitEventBus(Plugin plugin) {
this.plugin = plugin;
}
public <T extends Event> void subscribe(Class<T> eventClass, Consumer<T> listenerConsumer) {
this.subscribe(eventClass, listenerConsumer, EventPriority.NORMAL, true);
}
public <T extends Event> void subscribe(Class<T> eventClass, Consumer<T> listenerConsumer, EventPriority priority, boolean ignoreCancelled) {
Bukkit.getPluginManager().registerEvent(eventClass, this, priority, (listener, event) -> {
if (eventClass.isInstance(event)) {
listenerConsumer.accept(eventClass.cast(event));
}
}, this.plugin, ignoreCancelled);
}
public void unsubscribeAll() {
HandlerList.unregisterAll(this);
}
}
I cut out the docs except for the credit ofc
@flint coyoteso when I execute .end() it will execute .cleanUp()
and unregister all those listeners
Well creating listeners is reflection based an has some overhead. Therefore I'm unsure whether registering und unregistering is the way or if you should register them at the start. It probably depends on the amount of listeners you need and the percentage of time you actually need them vs. they are doing nothing when called
I'm open for opinions on this
yeah registering 1 event when needed isnt the best, much better to do something of registering 1 of every event and passing that instead
But what if you for example need 70 different events but most of the time you simply don't need them
Would you still register them at the start or would you register them as needed?
now you're really making me think lol
you could technically register them dynamically but only ever make 1 and still pass it
but the easier route is just registering all of them
That's reasonable yeah. You would still need multiple per event if the priority differs though
wouldnt most stuff not require any priority if you just ignore cancel
I feel like you guys are thinking too hard about the worst case possible
That's what developers do 😛
I gtg for dinner brb
Yeah that's mostly true but you'd still need the option
yeah
You can delegate them all to the same function as in using the same executor and then delegate them to wherever you need. But that probably doesn't change a lot
is there a way to detect if a player enters a region?
i know that makes zero sense, but imagine a like box of sorts, an invisible one, how can i detect if someone enters it, is there a class to make such a region too?
BoundingBox is what you are looking for
do you have an example by chance i can refer to? ❤️
If you register it once you will probably see a bit more benefit from the JVM optimizing the reflection
Idk how much unregistering and re-registering will affect that
You just call the bounding box constructor with 6 parameters (fromX, fromY, fromZ, toX, toY, ToZ)
and then you can do boundingBox.contains(loc.getX(), loc.getY(), loc.getZ());
You'd run that in a scheduler and check all players as needed
❤️
Yeah it depends on the timing accuracy
If it's a 1 tick scheduler might aswell use the move event
WorldGuard optimizes the regions by not checking the "irrelevant" ones.
For a long time they simply looped them all though
As it ain't easy to optimize
Don't forget to check the world. BoundingBoxes do not have worlds
Yeah that's what I'd do. Save all chunks that are contained in the region and only check the region when one of those chunks is loaded (tracking via load and unload event)
Could be that they are doing something more complex. Did not dig into their code
Only check regions that overlap the chunk an action is in
Yeah basically "enable" a region when a chunk gets loaded which has one of it's bounds within the region and "disable" once all chunks are unloaded that contain the region based on the same logic
Or preload the chunk instances and check it with a hashmap
Can always extend it within a "WorldBoundingBox" :)
Pretty easy to just make a wrapper that holds a world and a bounding box
In the getDatabases method it always returns before added is printed on line 80. How is that possible as they all have to be finished?
When I print the size to return in the getDatabaseQuests method it always prints 0
Line 88-94
if you do this I'm going to mess up that inventory Pr
Bukkit.createInventory_Y2K_AddedThis(MenuType, String Title)
no
Bukkit.y2k().createInventory(...)
Bukkit.y2k() returns a Server.Y2K instance
yeah someone Ctrl+R through bukkit, that should do
Hrmmm
Y2K.MenType.ANVIL
org.bukkit.y2k
Is there an event for when a zombie hurts a door
like the process of breaking it
not fully breaking the door
don't think so
There is https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityBreakDoorEvent.html, but I don't think one is called for the process of breaking it
yeah it's not sadly
so 21 devs die each year?
meant in*
brain moment
no
scheduler
Yeah that’s basically just a scheduler
please elaborate ❤️
?scheduling
here
Bukkit.getScheduler().runTaskTimer(myPlugin, () -> {
// Code here runs every tick
doSomething();
}, 0, 1); // 0 = initial delay, 1 = each further delay
bro beat me to it
here's another way to do it
new BukkitRunnable() {
@Override
public void run() {
// something here
}
}.runTaskTimer(this, 0, 1);
lambda expressions >>>>>
yeah
I never knew you could make a class in a method
like Ive tried it once but it didn't work because for some reason I thought I need a public or private modifier
what are you talking about intellij, I only have 7 methods
no
whats that warning for
what it says on the tin lol
For having too many methods
now how can i make this pause or stop?
@hot reefI think his method returns an ID
and the 3 interfaces I implement have... 3 total methods
which you can cancel with some methods
my way you can
new BukkitRunnable() {
@Override
public void run() {
this.cancel();
}
}.runTaskTimer(this, 0, 1);
read what was linked to you
you can do that in lambda if you just pass a variable iirc
it's all explained there
?scheduling
I found it
scheduler.runTaskTimer(plugin, task -> {
if (Bukkit.getOnlinePlayers().isEmpty()) {
task.cancel(); // <--
return;
}
Bukkit.broadcastMessage("Mooooo again!");
}, 0L, 20L * 60L);
in the examples
Hey does any1 know where i can get support on a mycommand issue
👀 what is a mycommand issue
The discussion page of the plugin
I smell wrong discord
Or perhaps a discord if they have one
I smell... ANCHOVIES!
mycommand
lmao thanks
if (player.isGliding() && !playerData.recentFlyer) {//if the player is flying
Bukkit.getScheduler().runTaskTimer(EMC_CORE.main, task -> {
playerData.score += 0.5;
playerData.scoreBoardScore.setScore((int) (100.0 - playerData.score));
playerData.scoreScheduler = task;
},50L,50L);
playerData.recentFlyer = true; //marks the player as in a state of flying
return;
}
Link me.
thats the name of the plugin
is this a good implementation?
dependency injection pls
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
basically
You will start a metric ton of new tasks if you where to run this
pass in an instance of your plugin as an argument
oh it is
lol
EMC_CORE.main
Wdym there is nothing in the discussion section
It has 84 pages
that doesn't look like a parameter, moreover a static field in a class
Static singleton for a plugin isn’t that bad tbh
trust me it isnt
oh no, not this discussion again
alright
theres like 6 things loaded in EMC_CORE
It’s already an enforced singleton
so i just have the plugin labeled "main"
A few more suggestions:
- Rename your JavaPlugin class to
EmcCoreorEMCCore - Make all fields private. Never public unless they are static and final
- Dont start a repeating task like that without cancelling the task again
- Dont name anything
main

kid named List
👍
main as field name is fine imho
public class MyListener implements Listener {
private final MyPlugin main; // I don't see any issue with this
// ...
}
I think this is not fine
public abstract field
JOML’s fancy vector stuff is all public field based
Presumably to get that bit of extra speed when doing graphics rendering
I'm really behind with mc dev lately, are noteblocks still the way to go for blocks or has 1.20+ added something for that
No
ok
hi someone can help me
i try making one scoreboard but everytime give me this error
Player p = (Player) commandSender;
User user;
String nextrank;
String nextrankcost;
try {
user = LuckPermsProvider.getPlayerAdapter(Player.class).getUser(p);
nextrank = api.getPlayerNextRank(p.getUniqueId());
nextrankcost = api.getRankCostFormatted(RankPath.getRankPath(nextrank, "default"));
} catch (IllegalArgumentException exception){
return false;
}
ScoreboardManager manager = Bukkit.getScoreboardManager();
Scoreboard scoreboard = manager.getNewScoreboard();
Objective objective = scoreboard.registerNewObjective("Cristal", DUMMY, ChatColor.BLUE + "Cristal", INTEGER);
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(p.getUniqueId());
Score score = objective.getScore(ChatColor.GOLD + "Dinheiro: " + econ.format(econ.getBalance(offlinePlayer)) + "€");
Score s2 = objective.getScore(ChatColor.AQUA + "Nivel: " + ChatColor.LIGHT_PURPLE + p.getLevel());
String prefix = user.getCachedData().getMetaData().getPrefix();
if(nextrank != null) {
Score s3 = objective.getScore(ChatColor.LIGHT_PURPLE + "Rank: " + ChatColor.BOLD + ChatColor.translateAlternateColorCodes('&', prefix));
Score s4 = objective.getScore(ChatColor.LIGHT_PURPLE + "Proximo Rank: " + ChatColor.BOLD + nextrank);
s3.setScore(3);
s4.setScore(4);
}
if (nextrankcost != null) {
Score s5 = objective.getScore(ChatColor.YELLOW + "Rank Custo: " + ChatColor.BOLD + econ.format(econ.getBalance(offlinePlayer)) + "/" + nextrankcost);
s5.setScore(5);
}
score.setScore(1);
s2.setScore(2);
//s6.setScore(6);
p.setScoreboard(scoreboard);
the code
but the scoreboard work sometime appear the error in console
Read the error it should tell you
RankDataStorage line 308
You are trying to get something from your map but it returns null
this line tells you where the error is
i already see is this part of code: nextrank = api.getPlayerNextRank(p.getUniqueId()); how can i put to detect if is null
i try this
if(nextrank != null) {
Score s3 = objective.getScore(ChatColor.LIGHT_PURPLE + "Rank: " + ChatColor.BOLD + ChatColor.translateAlternateColorCodes('&', prefix));
Score s4 = objective.getScore(ChatColor.LIGHT_PURPLE + "Proximo Rank: " + ChatColor.BOLD + nextrank);
s3.setScore(3);
s4.setScore(4);
}else{
return false;
}
but give me error
Show the error
Hi I want to create a plugin with a command that gives a 'bee hive' block. After placing it, when right-clicked, it should open a menu where players can put a bee inside. When a bee is present inside, it generates honey every x minutes, available in the storage menu of the block, accessible via right-click. The block should make honey only when the chunk is loaded.
Do i need to use NMS u think ?
In fact i don't know when do i need to use NMS or not :/ i have lot of trouble with that
You don't need nms
im trying to make it so i can use NMS with plugin using Kody Simpson's tutorial, but it keeps giving the error https://paste.md-5.net/zuhapizetu.rb
my pom is https://paste.md-5.net/acicagutoj.xml
have you ran buildtools with the --remapped flag
the dependency thats added has to be remapped?
thats what the classifier says
run buildtools for 1.17.1 with the --remapped flag
thx!
what's the best way of making a system that wait's like 2 seconds before updating the pickaxe's lore?
I was debating on just using PDC and adding to a value every block
but i wanted some input
was just going to do this originally, but it still accesses the meta every block broken
I believe you should just have a uuid on your pdc
and update a mutable object
and then like.. save it back
okay, should i make it update like this or every block?
the lore
i'm guessing this would be a bit faster but
wdym distribute?
thx
Distribute the updates over multiple ticks for all the active players
ahh
guys how do i make a system for my items
and ability
so i dont have to face eye issue
??!
Does anyone else find github workflow complicated
my code's readability is 0
I would encourage you to completely separate those two.
Create an entire system just dedicated to abilities first.
An ability should have
- A trigger
- A target
- An effect
After that you can simply bind an ability to an ItemStack via its PersistentDataContainer
Abilities should be mapped to an owner.
This can be done in a simple Map<UUID, AbilityHolder> where the AbilityHolder contains all current abilities owned by this UUID.
If an entity changes its equipment, you simply scan if the new equipment has any abilities and add it to the holder.
So most def, start by creating an AbilityManager and an abstract class Ability.
Then an AbilityHolder which contains abilities.
Triggering is the actual hard part. But you will figure that out.
I just typed that
so can u make an example
for easier to understand
cuz my english is ass
public class AbilityManager {
private final Map<UUID, AbilityHolder> holderMap;
public AbilityManager() {
this.holderMap = new HashMap<>();
}
public void initHolder(UUID playerID) {
Preconditions.checkState(!holderMap.containsKey(playerID), "Holder for player already exists.");
holderMap.put(playerID, new AbilityHolder());
}
public void removeHolder(UUID playerID) {
holderMap.remove(playerID);
}
public AbilityHolder getHolder(UUID playerID) {
return holderMap.get(playerID);
}
}
public class AbilityHolder {
private final List<Ability> abilities;
public AbilityHolder() {
this.abilities = new ArrayList<>();
}
public void addAbility(Ability ability) {
this.abilities.add(ability);
}
public void removeAbility(Ability ability) {
this.abilities.remove(ability);
}
public List<Ability> getAbilities() {
return List.copyOf(this.abilities);
}
}
So if I'm understanding this correctly, you're listening to every time the player equips/unequips armor, changes hotbar slots, etc and getting the PDC to update the AbilityHolder
But honestly thats already pretty spoony
7smile7 has inconsistent code 2024 colorized
Yes
Hm
I had that same idea for my plugin
but I think the 1.8 api was missing some events
yeah I was just going to use nbt api
That wasn't a big deal
it was the armor equip events
and the ones online are bugged
I thought about making my own but I took a break
Hm im actually wondering why only the fork has those
For the AbilityHolder would you want a .hasAbility aswell
maybe like
public boolean hasAbility(Class<¿ extends Ability> abilityClass)
Idk how I typed that wildcard
My AbilityHolder would look more like this:
public class AbilityHolder {
private final Map<Class<?>, List<Ability<?>>> abilities;
public AbilityHolder() {
this.abilities = new HashMap<>();
}
public <T, A extends Ability<T>> addAbility(A ability) {
this.abilities.computeIfAbsent(ability.getTriggerType(), k -> new ArrayList<>()).add(ability);
}
public <T, A extends Ability<T>> removeAbility(A ability) {
this.abilities.computeIfPresent(ability.getTriggerType(), (type, list) -> {
list.remove(ability);
return list.isEmpty() ? null : v;
});
}
@SuppressWarnings("unchecked")
public <T> propagateTriggerEvent(T trigger) {
this.abilities.getOrDefault(trigger.getClass(), List.of()).forEach(ability -> ((Ability<T>) ability).execute(trigger));
}
}
Not actual prod code but just the idea.
I never expose the abilities but simply forward trigger events to each ability.
Those are classes you need to write yourself...
AbilityManager
AbilityHolder
Ability
Thats the bare minimum
Is It possible to use inverse kinematics to control the shape of a block display?
Sure. You can apply any spacial transformation to block displays.
Is your current code base using a lot of static keywords
you should see the wild n wacky generics I've been doing

Illusion are you wildin again?
String keys?
they're file names
but yeah I use string keys quite often
because I can't bother making a namespaced key system
*As long as you use constants
lol no I just pick a random map from a collection n start it
I guess I could make the template name a constant
I meant for the keys. For example your "battle-island" could very well be a public static final String KEY = "battle-island" if thats important at other places
I mean yeah but
This plugin isn't standalone
it needs a game management service and that service just has uh
a list of template ids on a config
and it fetches data n stuff
Ouh i see
I need to make it more robust but in theory I can have 2 minigame server templates (Think hypixel's mini vs mega) and make my server picking strategy filter servers based on what templates they have
And I'd do that if this project's deadline wasn't like.. a week
Illusion are you going to apply at hypixel again
uH not this soon
Like maybe at the end of the year or sumn
let me cook
I have a whole minigame network and a tycoon gamemode to deliver this month
still have to do my driving school stuff too
It's useful experience that I need if I want to actually expand my skills
What do you even think caused you to get laid off last time
I didn't get laid off
I just did miserably on the interviews because I thought I was smarter than I am
And then I applied like 5 more times and they never bothered
Was it like the types of interviews where they give you coding problems with algorithm based solutions
I remember you explained the process to me
They had you review code and explain what was bad
It’s hypixel they probably did everything in each of the 5 different interviews
6 interviews is insane
One was asking about code and projects I've made and the other had actual technical questions
the full process is 7 interviews
Thats canonical levels of insane
I was a full-time intern at school, at the time
in like 40C summer weather
I'd get home, cool off for 15 mins and hop into like 2 hours of interviews
it was insane
Jesus christ
That's part of the reason why I fumbled hard
my brain was fried
I could barely remember anything about bit shifting after blowing dust off computers for 8 hours straight
I doubt you'll ever get another response too I guarentee they don't let you reapply
I asked them reapplication time and they said like
there's no cooldown
I can reapply whenever
Seem like the type of people who get flooded with apps and just deny repeats
Literally easier to get a real job paying hundreds of thousands a year
Have you just not reapplied?
Ya
Fr my thoughts. Atleast in America its not if you have no degree
Still I spent like 1-2 years just thinking ab my flaws and getting better and better
rewrote my skyblock core project, been working on minigames for a few months
luckily hypixel is not the sole employer in the world
Where I can learn more about quaternions? Block displays are making me turn crazy
I've been rewriting my minigame core
Branching out from just plugin development and writing services for things like infrastructure
Still doubt they'll even open my cv
have you tried applying elsewhere Illusion?
Yeah I've been getting jobs here and there
I had a "job" for like 2 years that ended in nothing
like a real full time job that's not some random MC server
Right now I'm just hopping between projects every month because I go there, get things done and just move on
that pays 4$/hr
MC servers work but they're unstable as hell
oh do engineers get payed shit in your country
i forget where you're from
damn that's ass
and full-time here is considered 45/week
I make more by just sitting my ass on my chair and coding for like 2 hours
you ever thought about moving country eventually or just rather do virtual work?
I've had ambitions but like
eh
That just means I have to up my game to make more money because rent will be higher
Like I don't mind just getting a crappy IT job IRL, make a low guaranteed wage and dabble in plugins on my free time for that bag
depends where you live for example in my area rent is around 1500-2000 a month but software engineers still get payed 100K a year
In my area rent is 600-800$/mo and engineers make 1k
no girlfriend because I have the social skills of a cockroach
Relatable
I've learned you don't need social skills to get a GF
as long as you're good looking
idk if I'm attractive
my GF thinks so but she is biased
generally though we are both neurodivergent in some manner so that helps too
good luck finding an IRL job
well yeah in your area its not worth it
better to work online and scrape by until you can get somethinv virtually
The closest offices are like 2 hours away
aka on the other side of the country
I have a classmate or two that have a "real job" where they're in some basement for 8 hours a day doing embedded systems in a proprietary language
yeah doubt you'll make decent money unless you A. get something online or B. move country and you kinda gotta do A to do B
for a spanish company
they probably get payed scraps I'm assuming too?
crazy how people in other countries get extorted like this
for example I want to be an emphasis in embedded system and it easily pays 100K+ here
probably about same qualifications as far as degrees go too
kinda fucked up
@river oracle u from US right
yes
is the software engineering market rly that competitive rn
but that's because the tech market is well developed
we have a couple tech companies here and they're all just like
depends where you are going
I feel like it's just those ppl who are only good at the mechanics
offices for some multinational
@quaint mantle what area are you interested in
Wdym
Software engineering
Probably back end
what part though there is a shit ton of stuff
back end is less competative than front end
if you're a Web Dev you'll get payed 60k a year and be wrung dry of all your ambitions
some markets are more saturated than others
Believe me
back end usually you can get a decent salary and job security
again though this depends on your area
in my area there is a lack of back end and embedded systems devs
But I've always wanted to make my very own IO game
good luck finding a web dev job here
Most of the people I know that have degrees are doing random BS jobs
so obviously I'd get payed more for doing embedded systems and back end 100k+ starting for 60k starting
when I was little I mained io games because of my horrible pc
or being teachers themselves
big difference just for area
the language was Chinese and it was windows xp 💀
All my programming teachers come straight out of uni with no job experience
I'm not even joking slither io would run at maybe 18fps
@quaint mantle generally though as an engineer you'll get payed well if you are actually smart and know how to code you'll be way more likely to get a job than anyone else leaving college
it requires like 1 braincell to get a CS degree
Ayo, what state?
there are kids in my embedded systems class that have been through 3 or 4 programming heavy classes that can't hold a candle to me
Dayum. Never been there before.
It'd be quite the drive from where I am currently too.
philadelphia cream cheese
I didn't realize you were in the US?
Ye
always thought you were european
Lmao
yeah anyways backend and embedded are payed well here
It's cause of my vocabulary innit?
the entire industry is short on good developers
the market is saturated just not with good candidates
@river oracle what college are you in
I'm not willing to say that I live in a small area
my sleep deprived ass read that as "minigame tech"
your college doesn't matter
anyone see anything wrong with this? It doesn't seem to be calculating correctly. The values are the same every time:
the method is suppose to increase the cost by x% every level without looping
bet your progression is an int
they seem to be all doubles
go somewhere cheap with a solid CS program especially if you have to encur debt
you sure enchantPow is a double?
nope same thing
i am 😦
first image
all of them
@quaint mantle Idk where you live but just stay in state btw idk what your situation is, but generally tips are Attend an Accredited university, ensure the CS program is atleast average and they support the degree and minimize cost
Hm
I think my dad might pay for some of it
my dad can hire ppl too at his company
College in the US is a HUGEEEEEE scammm
Do you think I'll get a referral
I got a full ride at Harvard
your degree stops mattering the second you get your first job. And the more stuff you have on github thats finished and decent the less the degree matters
yeah all my projects are mc related rn
it doesn't matter
As long as you can market WHY your projects are important you'll be fine
^^
lmfao
If only I could post imgs
get verified
yeah I thought it was obvious tho
wth, it maxes out at hella low numbers ig?
skinnynoonie was in all my packages
even though its a double
it is dw I remember you
?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
but it's not the same
have you emailed support
it doesn't have the pop up
MD should beable to fix that
playing bloons rn I need a new hobby
nah I haven't cause I ain't doing allat rn
Omg
He's making a new plugin for every enchant LOL
I just realized
That sounds familiar....
fr I use BitBucket
ohh i figured out the issue
its hitting the lowest possible double then when i do - 1 it converts it back to 1.002004008016032
so basically doo doo math
Why does the top one return a list but the bottom one return Null?
because the one at the bottom is a config section not a stringlist
getStringList btw
what to do if the modules in the project have the same paths to their main class
How does one loop through ConfigSections in a ConfigSection?
The commented out code doesnt work since I now have a config section instead of a string
getKeys(false), isConfigurationSection, ...
ConfigurationSection section = /* Your section */;
section.getKeys(false).stream()
.filter(section::isConfigurationSection)
.map(section::getConfigurationSection)
.forEach((subsection) -> {
// TODO implemnt
});
Hi, what can I do if I want to recover the maturity of a crop to the max?
wdym with "recover"?
do you mean you want to set a crop's age to max age / make it fully grown?
Would be better to use for loop for people who aren't that familiar with streams, functional interfaces, method references and lambda
ConfigurationSection section = /*Section*/;
// Possible nullcheck for section
for (String s : section.getKeys(false)) {
if (section.isConfigurationSection(s)) {
ConfigurationSection sub = section.getConfigurationSection(s);
}
}
stop skidding
me?
I agree. when people ask simple questions like "how to loop over XYZ", chances are high they won't understanding anything when someone sends them 27 lines about streams
Fair
oh btw I haven't checked out any of the links in the new learnjava command
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
the jetbrains ones seem nice
Holy that looks good, I have always been jetbrains lover:D
Heyo, I have my own custom menu thingie
I currently handle all clicks in one InventoryClickEvent and cancel all InventoryDragEvents (since they're pain) but this means that if you try to place an item but move your mouse while holding mouse button, it calls InventoryDragEvent instead.
This is bad for the user and I was wondering if there is an already-existing solution to this, or will I have to hack a FakeInventoryClickEvent together from the InventoryDragEvent
I care only about that one slot, so if user tries to drag over multiple slots, I cancel it anyways and don't care about it.
From what I've seen the DragEvent usually fires the same logic as the click event but for each slot
Is it possible in Java/Kotlin to have vararg generics in a class signature? I don't have a use case for this, just curiosity. E.g.:
class Clazz<A, B...> {
// these would be legal:
new Clazz<Int, Int>();
new Clazz<Int, Int, Int>();
new Clazz<Int, Int, Int, Int>();
}
I couldn't find any info on this and trying it in my ide is unsuccessful, maybe i'm missing something
that would make no sense, B... would mean they're all Bs?
Yeah now that I think of it lol
so it would be like ```java
class Clazz<A, B...>{
new Clazz<A, B>();
new Clazz<A, B, B>();
new Clazz<A, B, B, B>();
new Clazz<A, B, B, B, B>();
}
Interesting
no, that can't work
Why not yknow
you'd have to use an array or list or sth
ye ofc it doesnt but interesting logic he is chasing for:D
Use a collection
I wonder what the purpose is lol
List<String,Int,Int,Int,Int,Int> totally
Is that a HashMap<List<List<List<List<Integer>>>>>>
Or wait
How would so many arguments even work
its missing the value part
HashMap<List<List<List<List<Integer>>>>, List<List<List<List<Integer>>>>>
if u find use case for that then u have just next level brain
PersistentDataType<?, LinkedHashMap<String, EnumMap<Material, Set<Integer>>>> dataType =
DataType.asLinkedHashMap(DataType.STRING, DataType.asEnumMap(Material.class,DataType.asSet(DataType.INTEGER)));
LinkedHashMap<String, EnumMap<Material, Set<Integer>>> map = pdc.get(key, dataType);
is that actual code?
package index
i would just type var map = pdc.get(key, dataType); XD
But anyways loving it
Holy shit people actually have huge brain coding that
i wrote that while I was drunk one night
does anyone know why checkstyle / ktlint love having a newline at the end of every file? what's the purpose?
something to do with linux, just how linux handles sht
with some googling it was used to detect when file ends, reading multiple lines it was kinda like file separator, and if that empty line wasnt there it would handle it as a single file. So its some ancient rule just to be kept for compability
uugh that's weird lmao
Also in intellij u can switch default file ending format to lf from crlf, then im pretty sure it just automaticly adds the end of the line when creating new files
or u can change it from bottom right corner of the old ui atleast
None
not sure if there is any disadvantages of having it as lf always, so far havent had any problems
also git can autoconvert end of the lines
Git can convert CRLF to LF when pushing to GitHub, depending on your Git configuration. The core.autocrlf setting controls this behavior:
git config --global core.autocrlf true on Windows: Converts CRLF to LF on commit, and LF back to CRLF when checking out code.
git config --global core.autocrlf input on Linux/macOS: Converts CRLF to LF on commit but does not convert back when checking out.
git config --global core.autocrlf false: No automatic conversion is performed.
For cross-platform projects, it's common to normalize line endings to LF in the repository, while allowing developers on Windows to check out files with CRLF line endings locally.
Empty newline is pretty much standard no ?
it's just so pointless
Like that's just POSIX standard what
it's still pointless
For example if u do on windows System.out.println("hi") it actually does "hi\r\n"(on windows) and our school exercises has unit tests and some autograding systems so we have to use System.out.print("hi\n") so it would match the tests
System.out.println("hi") wont work
super annoying
i mean the thing is actually that when we run tests locally it wont work because its ran on windows environment, when we push to github it runs it on docker environment so there it works.
Problem with always pushing to see if it works:
- it takes ages to compile and run on github actions
- our teachers githubschool environment has some test limits how many times it can grade/run tests per month so we arent allowed to perma push to github:D So we dont hit the limit
yeah but it's not like javac would ignore a line just because it's the last line of a file
but ye stupid system, i have spent hours and hours trying to figure out why shit doesnt work and its always something to do with end of the line sht:D
its not a javac thing
¯_(ツ)_/¯
why i have this error ? https://paste.md-5.net/ronewuxari.xml
Are there any errors when filling out the pom file?
is your project on github? it's a pain to look at 3 poms in one paste and also can't see the layout etc there
oh sorry wait
what's FakeOnlinePlugin supposed to be? You don't have any module with such a name
oh
IIRC FakeOnlinePlugin is your whole project right? You don't have to depend on that
you must only specify it as <parent>, which you correctly did
so remove the dependency for FakeOnlinePlugin in all modules
i havent really looked at your whole setup yet, because I need to build all those spigot versions first lol
your NMS modules are supposed to extend PlayerGeneration from core, right?
If so, yes, your NMS modules must depend (with scope <provided>) on core
your 1.17 module looks correct
except that you should change scope to provided for FakeOnline-Core in 1.17 pom.xml
ok thenks
I again trusted auto-correction when I tried to use classes from the core module in another module
and he imported the project itself and not the main module
thenks
The compliant code in the "don't expose collections" section is slow as it creates a new object for each call, instead you could do as follows:
public class MyManager {
private final Map<UUID, PlayerData> playerData = new HashMap<>();
private final Map<UUID, PlayerData> playerDataView = Collections.unmodifiableMap(this.playerData);
public void setPlayerData(UUID uuid, PlayerData data) {
this.playerData.put(uuid, data);
}
public Map<UUID, PlayerData> getPlayerData() {
return this.playerDataView;
}
}
Same functionality, much more performant
Also one more thing to note, it is especially useful to use the this keyword as it allows the reader at a glance to notice where you're using class fields/methods and where you're using parameters/variables or statically imported methods (i.e. in the context of LWJGL development)
the problem still remains why maven cannot find artifacts although they are in the local repository
Show me your pom
how did you run buildtools
show error message
?nms
not working
it says it has multiple roottag
?paste ur pom
you just copied it without reading
you need to add it to the right place removing infomation you dont need
this will go on line 47
wait thats 1.8
your stick with obfuscated nms
need a dev for my mc server dm me willing to pay
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
whats Error: Invalid or corrupt jarfile BuildTools.jar
fatal: not in a git directory
what did you do
entered where
Did you run Buildtools in OneDrive?
lol it'd be working if you wouldn't have blindly copy/pasted everything at the end of your pom file
meh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9489 0 9489 0 0 11963 0 --:--:-- --:--:-- --:--:-- 11981
Enter the version: 1.8
Error: Invalid or corrupt jarfile BuildTools.jar
fatal: not in a git directory
here
no they're trying to use 1.8
build 1.8.8
oh ok. then it's an even worse idea to copy/paste the 1.18 remapping config into the wrong place
lol
This is for 1.8: https://blog.jeff-media.com/using-nms-classes-with-maven/
Many people are confused on how to use NMS classes when they’re new to writing Bukkit/Spigot plugins because their IDE doesn’t find those classes. Don’t worry. What is NMS? NMS refers to net.minecraft.server. This package contains all the classes that Mojang wrote for the vanilla Minecraft Server. You can use them to change the server’s...
No remapping for 1.8, L
[ERROR] Failed to execute goal on project FakeOnline-constructor: Could not resolve dependencies for project me.galtap:FakeOnline-constructor🫙1.0-SNAPSHOT: The following artifacts could not be resolved: me.galtap:FakeOnline-core🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.17🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.17.1🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.18🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.18.1🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.19🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.19.1🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.19.2🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.19.3🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.19.4🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.20.1🫙1.0-SNAPSHOT: Could not find artifact me.galtap:FakeOnline-core🫙1.0-SNAPSHOT
why that i never get that error:
i only tried to compile my plugin
Are you using Lombok
yes
Make sure it's up to date
you have to run install on the parent module
where i can check what version is the currently Lombok?
thx
can someone tell me how to create a method for adding to a location, depending on the rotation of the entity
location.add(entity.getLocation().getDirection())
I asked chatGPT, but it didn’t help
i mean, smth like this
or how can I use your method
that method you posted just ignores pitch is all
that is, for example, x is straight to calculate, z is to the right
oh yes, I need to ignore pitch
if you only want a flat plane then you zero out Y on teh Vector and normalize before adding it
hmm
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
yea def for 1.8
not 1.17
I still don’t understand, even if I add direction from the entity, then in my understanding it is added only in one direction (X for example).
Does anyone have a convenient way of creating custom events that removes having to add the event handler boilerplate to the class?
why then do you need a separate module for assembly if you need to assemble through the parent
in tutorial
it worked
does the classNotFound error refer to a build issue? When i try get class for minecraft version
this amount of boilerplate is cringe and I need like 15 events like this
Create a template in ij
I especially don't want to do that because I'm on a temp setup right now
not even enough space for a mouse
I so dont get those
Good old days gone where you just play minecraft irl. Fking youth with their electromagic.

next he'll be rambling about how he used to do electric circuits instead of redstone circuits
Is this keyboard actually comfortable to use?
a bit yeah
I'll take this positive review into account then
I think it was 3 months to get used to it and then 4 months to surpass my previous typing speed
omg what this bruh
What's your typing speed rn?
last I check was 4 months in or something at I want to say 140wpm?
Damn, nice
I'm not a crazy fast typer
the tests are pretty skewed anyway, typing speed is hardly ever an actual limiting factor
at least when I'm writing code thinking about the code makes typing much slower than actual typing speed
Sick
Same
I'm also much faster at typing off the top of my head than following a strict script on a website, recopying is an entirely different skillset imo
True
but it's hard to measure
I wonder if there's a good test for that
I still remember how I could type my ad for selling lobsters on runescape faster than bots did 15 years ago
xD
typed that thing so many thousands of times I was an actual machine at it
selling lobby 250 ea
Try writing the alphabet as fast as possible
I got 24 wpm on my first try lmao
Now 62
I ended up setting up a template in Eclipse so it's just Ctrl + Space, "bukkitEvent", and enter. Or "bukkitEventCancellable" for cancellable ones
But yeah, lots of boilerplate. Unfortunately just a consequence of the like 15+ year old event system Bukkit's implemented
The good news is Choco has volunteered to remake it!
Please let this be not a joke
The fuck I haven't lol
Please choco
So what you are doing rn is:
- Iterate through all players
- Remove the glowing effect
- Then add the glowing effect
But you expect them to not have a glowing effect after that?

Question: through which module can I build a multi-module plugin? What button
why when i'm doing a command with the interaction
user.setPrimaryGroup(config.getString("prefix stage") + azienda); nothing appen?
my "prefix stage": prefix stage: stg
my azienda: String azienda = args[0];
The parent module
Did you check the console for exceptions?
Did you add a debug message to see if this code even executes?
for what need "clean"
To clean the project from previous builds
After assembly jar, I don’t see these modules when opening via rar, is this normal?
I have no idea what your setup looks like. Are you trying to end up with a single jar in the end which has all modules shaded in?
yes
Then your module needs to depend on the other modules. After that you can shade them using the maven shade plugin as usual.
that is, build not through the parent module?
create a module of something like a constructor?
Are speaking about a multi-module maven setup?
your parent shoudl define all modules and have the shade plugin
yes
i was add
but they are still collected separately
Why do you want a multi-module setup in the first place?
I'll build my multi module as to be honest I've never actually compiled it to a jar
In that case:
Add the shade plugin in your plugin module.
Depend on each NMS module.
Your parent pom should look pretty empty with almost nothing in it.
yeah parent doesn;t even need shade
this first try create multi-module plugin. I tried to do it through a training site that your colleague posted but it didn’t work and I turned to other sources and everything is completely different there
Nah thats not it
Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...
This one
?paste
This tutorial is not correct as I understand it. Assembly does not occur through the radiator module
this is why i try find
you compile on the parent
you then use the jar from dist
oh
Yea, but to be fair. I just looked into streams and learned what they were because of it. 👍
dirt?
"dist"
yes, that dist module is teh Plugin
it's the entry point for the jar
um, alex does his plugin stuff in core
he create module in core?
His core module is my API module
how can i set the parent of an user using the LuckPerms API?
what then i can create core module and create support modules inside?
His is correct. His Core is my API and his dist is my Plugin
I do it differently. I create my basic plugin in it's own module where he creates it in core
how this looks like?
His tutorial is fine
Hey @lost matrix I'm making a template class to add new items to a shopGUI quickly (using your GUI classes), so I need to be able to change the title according to what item is being displayed.
It works with everything else like material, name, price but title is always null if I pass it like this, Do you know why?
String title = "test";
@Override
protected Inventory createInventory() {
return Bukkit.createInventory(null, 3 * 9, title);
}```
Similar to mine, just slightly different in that I don;t provide access back from my NMS modules to my plugin
then how you add them?
how plugin know what module need use
you not use reflection?
what do you mean? its shown in his tutorial
.
Yes I use a helper method ot get teh correct NMS implementation```java
/**
* Find the Class at the specific Path which implements the provided clazz.
*
* @param clazz the Class of this target
* @param path a partial path to the target Class.
* @return a new Instance or null.
*/
public static Object assignField(Class<?> clazz, String path) {
try {
final Class<?> test = Class.forName(Tools.class.getPackage().getName()
+ "." + NMSUtils.NMS_VERSION + "." + path);
// Check if we have a Class at that location.
if (clazz.isAssignableFrom(test)) { // Make sure it actually implements the Class
return test.getConstructor().newInstance(); // Return our handler
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}```
I have a full reflection wrapper
So if I call java this.nmsPlayerSkins = (Skins) Tools.assignField(Skins.class, "utils.PlayerSkins");I get back an NMS appropriate instance of that Skins class
You can dream
add some extra checks for static fields n stuff
how can i set the parent of an user using the LuckPerms APi?
setting a parent is basically just removing all group nodes and adding your proper nice one
So just go over all the nodes in the user's data and do stuff
i'm tring to do it from like 2h but i'm not understandig the way
that is literally not what the example shows
like ImIllusion said, you need to remove the existing parent group nodes and add the one you want to add
which is what the example does
can someone tell my why i cant compile spigot with maven in inetllij?
i can compile but if starting this error occours
[17:28:44] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-c198da2-4c687f2 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT)
[17:28:44] [Server thread/ERROR]: Encountered an unexpected exception
java.lang.IllegalStateException: @NotNull method org/bukkit/Bukkit.getConsoleSender must not return null
at org.bukkit.Bukkit.$$$reportNull$$$0(Bukkit.java) ~[spigot-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.Bukkit.getConsoleSender(Bukkit.java:1415) ~[spigot-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R3.command.ColouredConsoleSender.getInstance(ColouredConsoleSender.java:91) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:git-Spigot-c198da2-4c687f2]
at net.minecraft.server.players.PlayerList.<init>(PlayerList.java:162) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:git-Spigot-c198da2-4c687f2]
at net.minecraft.server.dedicated.DedicatedPlayerList.<init>(SourceFile:17) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:git-Spigot-c198da2-4c687f2]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:183) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:git-Spigot-c198da2-4c687f2]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1000) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:git-Spigot-c198da2-4c687f2]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:git-Spigot-c198da2-4c687f2]
at java.lang.Thread.run(Thread.java:1623) ~[?:?]
[17:28:44] [Server thread/ERROR]: This crash report has been saved to: C:\Users\Administrator\Desktop\crashtest\.\crash-reports\crash-2024-02-10_17.28.44-server.txt
[17:28:44] [Server thread/INFO]: Stopping server
[17:28:44] [Server thread/INFO]: Saving worlds
[17:28:44] [Server thread/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved
>
sending an air packet doesn't do as much as setting the block type
no clue why you'd have that code in the first place though
the same? If you use packets, I don't make any changes to the server. imagine a mine that resets 100000 blocks every minute, that will make a difference
what is "worldload task" ?
From what I understand, is it setting blocks in separate threads?
but if I do it with packets, I can set the blocks all at once
What
whats the reasonining behind this?
aBasically, instead of me setting AIR in a block, I send an AIR Packet to the player. The reason for this is that, if I set 100000 blocks at once every minute, the TPS will drop. And I wanted to know if setting 100000 blocks at once but with packages for a certain number of players, if the TPS will drop or not
mine plugin
Thing is sending air packets is weird
because the client sees air but still collides with the real blocks
Pretty sure there's a way to modify the chunk data but you'd need to re-send packets
not to mention you're sending twice as many packets
In fact, there will always be air. I'm just setting blocks
I need context
I want to make a mine plugin, but there were TPS drops because of it. Basically, it set AIR when calling blockbreakevent and then every minute it set all blocks to mine, but this resulted in tps drops. He wanted to do this with packets, where the mine would be just air, and just setting packets of blocks to give the impression that the player is breaking the block. I wanted to know if this way with packages I don't have TPS drops
Have you actually measured what causes the TPS drops or are you just assuming?
When the mine reset, the tps dropped
Cool so it has nothing to do with blocks being broken
It has to do with the blocks being set at once
Exactly
So, I wanted to use packets for this. Do you think it would improve?
And as I'm going to use packets to reset the mine, I'll have to use packets to break the block too
Well
There are different ways of setting blocks
You could use a workload distributed task
As seen in
?workdistro
You can also use NMS to set blocks faster
Packet mines are high complexity high reward
You basically have to reinvent everything but it scales really high
remove and place every block in every loaded chunk 20 times per tick
but NMS is better so right?
It has less complexity, decent reward
nms is "better" until you have to maintain the project for more than a year
and suddenly minecraft updates
I think at akuma we used packet mines and had like 1.5k people on a single server
were you an akuma dev?
for a bit
Illusion was everywhere
I'll do this with protocollib to make it easier
I believe the performance will be the same
Does anyone know how I could listen for economy transfer events? I tried creating a wrapper around the current economy provider and just adding my own logic but Essentials doesn't use the Vault API directly for money transfers and whatnot so my code doesn't actually do anything. The other solution I saw someone mention was to fork Vault and add the listeners I need but I don't think that would work either for the reasons I mentioned.
fun fact illusion is the best spigot dev currently in portugal, because I am currently visiting family in france
enjoy your moment in the sun illusion, I'll be back sunday
shut up magma no one misses you
HMm
don't make me come back early to kick your ass
About packets, I dislike protocollib because it requires the user to install an additional plugin. Any other good packet libs?
best approach is to probably for kit
Retrooper's packet events ig
Hmm, I'll try it later, thanks
Hmm, I'll try it later, thanks
Wtf
Why did discord double my message
oh god discord is doing discord things
discord does this constantly
Am I going crazy? My finger was nowhere near the 4 key.
Does anyone happen to know how to guard against path traversal when using java.nio.file.Path?
Using .toRealPath() is cool and all but it does not support non-existing directories (which needs to be done in my case since I want to create a directory somewhere)
Well aside from the fact that security manager is deprecated for removal (perhaps even entirely gone by now) I'd rather have something a bit less ... passive of a choice (i.e. I need something like if (x.startsWith(y)) {[...]} else {[...]} - but obviously Path#startsWith is too lax for this)
I'm not even sure this would work to be honest. I'm pretty sure there's no requirement that economy service providers actually use the API internally which means I'd only be able to reliably listen to interactions between the provider and other plugins using the Vault API. I think the only solution would be to add support for EssentialsX and other economy providers manually.
Wouldn't it just be easier to use Path#toFile().exists()?
Meh, I'll probably go with toAbsolutePath and hope it does what I hope it does (why was I using Path#toRealPath in the first place?)
and what do you hope it does?
What he hopes it does, ofc
Well that question I cannot answer
i someone can help me? i try put this in my plugin https://github.com/MrMicky-FR/FastBoard but this script only work like dependecy and cant be started in folder plugins
how can I add it to my .jar with only .java files
But as long as it does not blow up, all is good. It isn't a reliable security mechanism anyways
Either use maven or do what the maven resolver does automatically: https://repo1.maven.org/maven2/fr/mrmicky/fastboard/2.0.2/
though uh, for shading you NEED to use maven (or gradle - whatever you prefer)
(for your sanity you also need to use a build tool)
but in the github say manual
Don't.
Manual
Copy FastBoardBase.java, FastBoard.java and FastReflection.java in your plugin.
I mean... he could clone the repo, build the jar by hand and add the jar to the project as a dependency.
The build an artifact by copying the jar into his own.
What kind of error?
Cannot invoke "java.io.file.mkdirs()"
Or he can download the jar directly by calling
mvn dependency:get -DremoteRepositories=http://repo1.maven.org/maven2/ \
-DgroupId=fr.mrmicky -DartifactId=fastboard -Dversion=2.0.2 \
-Dtransitive=false
http?
but i can download .jar i cant use in plugins folder because dont have plugin.yml idk
Yes, then shade it - and the only option to do that is to use either gradle or maven
This is not a standalone plugin. Its a library.
You can also go with your own solution if you wish, but it needs to be capable of shading
