#help-development
1 messages · Page 1150 of 1
you suck
i need plugin help pls
Wharrido
what?
i need help to make a command /timer disable to disable the timer that tere is no actionbar any more
i got the /timer disable i just need to know how to disable the action bar now
if (disabled) return@task
What Here now
}
}```
whats that mean
what is that
read
?
read
so im not allowd to use ``````
Hi, i Can help for config data shaving
bro keeps spamming
Is this kotlin?
do you have a problem
*💀 *
ok mr 💀
*💀 *
whai _Rolyn is typing he he he
Mhhh I don't know how to write it in kotlin so I'll just give you the idea:
- have a boolean set to false in your object
- When having the command /timer disable, set this boolean to True
- In your loop, check if the boolean is True. If this is the case just stop the Timer
- When stopping the timer, send an emptu action bar to the players
bro hes helping you
why is ppl like this
?
please
i wanne dis a ble it for to send a other action bar
I don't understand
he wants you to make the code for him
disable*
You want to make the action bar like "Timer is disabled" ?
waht
no i got a timer and a count down and i need to disabel the action bar from the timer that the countdown actionbar dont fliker like that 1 second there is the timer and other second the countdown
yeah he definitely
what?
and idk how to do so i need help for it
I'm sorry but I really do not understand what you want
basically he wants you to do the code
ol thanks anyways
he's doing nothing to solve his problem
bro i dont
whatever
I think he's just having trouble explaining what he wants and also parts of his code
What you're doing frsvn is really not helping the situation
yee right
@agile anvil you know a DC server where i can get help?
or some 1?
bro
waht is you problem
It won't change anything. This server is meant for help
@frail hull ⬆️
Just try to explain clearly what you have, what you do and what you want to achieve
Figuring out this will maybe allow you to solve your problem by yourself
If you have trouble with english, try using a translator
:)
What's the best way to get the NMS version string? It seems Bukkit.getServer().getClass().getPackage().getName() no longer contains the NMS version
It still does on Spigot
Anyways Paper should have a guide for that
Here it is #1077385604012179486 message
Do also keep this in mind #1077385604012179486 message
Ah I didn't realize that was a paper thing, thanks :)
if I change the damage of a player's hand and pick up a sword will the damage add up or is sword+hand damage the total damage that changes through attributes?
Is the player's damage from the attribute affected by the weapon or is it pure damage from the hand?
wasn't that the case for OBC only? I thought Spigot had gotten rid of the version in the package for NMS classes
in like 1.17 yea
[19:32:42 ERROR]: [XinCraft] Plugin XinCraft v1.0 has failed to register events for cl
ass dev.tommyjs.xincraft.listener.ArrowPickupListener because org/bukkit/event/player/PlayerPickupArrowEvent does not exist.
yet intellij shows it exists?
very confused
well what version are you compiling for and what version are you running it on?
Run the clean goal for maven then recompile
yes that method should return the obc package
Assuming obc means org bukkit craftbukkit
Hey! How do i make it so i can use & anywhere i want instead of §?
ChatColor
there is a method that allows translation from ‘&’
or just use raw colorcodes
I meant on making a plugin
ChatColor.translateAlternateColorCodes
if you are making a plugin, dont use color codes like that to begin with
Wanna tell him what he should use instead. Reading that without context and solution can be confusing
Is there a way to create a world using random uuid as name but have chunk loader from a different saved world?
Yeah but just saying no is stupid
Dont use A instead read about XYZ
if you are incapable of researching in regards to programming then its not for you
Okay so you saying comments on deprecated instead use xyz is stupid as well
because you could search
well you could
True be nice and communicate is a bad behaviour for developers
Good that you cant communicate and be nice
I am not always nice that is true 🙂
🤷♂️ can someone help me with a world management system for my minigame?
While it is true people can just shove info into your face just because, it is also equally true that you don't need to sit and wait for answers when they are at your fingertips most of the time as well
I have the worlds for arena saved. but how do i create new world on the go using that same world
store in a directory. Use the overworld(main world) as your lobby. Copy the arena world to the server directory, then use the api methods to load the world
when you are done with it, you will do the same process again but create a new directory for the arena world when copying, unload the old arena, load the new one
rinse and repeat
oh, when you unload the old one, you can delete that arena directory
since its not needed anymore
So like
Request for a new game -> create a world named with that game's uuid -> load world -> do game -> unload world -> delete world.
typically you should always have one already loaded and ready to go
so that your players are not waiting on it
to not have lag, you should have all the worlds you want to use loaded
with nothing inside them loaded till its needed
^
I see
because you can unload spawn chunks and have them take basically nothing
What if someone placed some blocks during game? I would have to refresh world right
probably something like having a schematic or something that you overlay and remove other blocks from
I see thank you
refresh world for what? to restore the world?
if so, you just delete the world and load up a new copy and not worry about trying to restore the world
I probably need to profile amount of lag caused while creating and deleting worlds
if you’re so worried about that, just go with slimeworldmanager or something
would there be any reason why I cant spawn entities during onEnable
ah i had to load the chunk first to spawn the entities
that means spawn chunks must be disabled right?
There’s a gamerule for them now
I believe there’s also World#keepSpawnInMemory or something
wait I read something about postworldload
is onEnable called after world load
is that configurable
spawn chunks are enabled but they must not have loaded before I spawn my entity
yes, in your plugin.yml
either post world or on startup
i believe you can also forceload a chunk using getEntities on it as it will load any entities in it resulting in the chunk being loaded (iirc, not completely sure)
but setting your plugin to post world would probably be the best
just checked, it unfortunately only loads the entities
but you can check if a chunks loaded either with Chunk#isLoaded or Chunk#load (which returns a boolean returning if it loaded)
How can i use api mineskin to get texture value and sygnature because i only found how to save image to file
You have to use the generate/upload endpoint, but it will yield you a body with a bunch of information, of which includes a data.texture object holding value and signature
so at startup I spawn an armor stand with a custom name and cache the object. later on I asyncly run stands.get(line).setCustomName("test");. it does not actually update the custom name for some reason
What object are you caching? The ArmorStand?
yeah
I tried without it running async
it updates the custom name the first and second time I run it
but not anymore?
very confused
Think of Bukkit's Entity objects as wrappers around a snapshot of an entity. If you're getting an instance of one from somewhere, it's referencing that entity at that current point in time, but it might not reference it later.
The reason people tell you not to hold reference to a Player is because while you might do Bukkit.getPlayer(UUID), if the player leaves and rejoins, that's not the same player
The same is true with entities being unloaded and loaded again
oh shit
that would make sense
because I'm unloading the entity when changing worlds which changes my stats which is what im trying to display on the armor stand
The best way to work around that is to hold their UUIDs and use Bukkit#getEntity(UUID) instead
genius
Or a WeakReference to that ArmorStand entity and fallback to getEntity() when that reference is lost
Should work then 🙂
weakreference?
Yeah. It will hold a reference (just like you would in a field) but it's not a hard reference, so it can still be garbage collected
thank you so much
should I use weakreference as it would reduce the performance time if I always call getEntity
WeakReference would be ideal I think, but it's not the end of the world if you don't. Bukkit#getEntity() is a Map lookup so you're not going to kill your server by calling it
I would still call it once in scope and hold in a local variable though, obviously
Don't need to call it 3 times while in the same method
I'll try weakreference and see if I can figure it out, otherwise use the latter method
thank you a lot I appreciate it
o/
ah shit Bukkit.getEntity doesn't seem to exist on 1.8.8
may have to loop through world.getentities
Can I somehow set player permissions in luckperms with the vault dependency?
Yeah Bukkit#getEntity(UUID) was added later, potentially in 1.9 or 1.10?
choco can't use that because they use 1.7 at work
We can add our own methods though 😔
idk about that
I am going to send for code review
Also, TECHNICALLY we have latest features!
seeing is believing
Slowly but surely
email me the hypixel source code
Woo Hygot
Ah you're a visual learner
// we use weakreference here as the armor stand entity differs if its unloaded. if the weak reference is garbage
// collected, we can regain the armor stand through Bukkit.getEntity(UUID)
private final Map<UUID, WeakReference<ArmorStand>> stands;
public Hologram(Location location) {
this.location = location;
this.stands = new LinkedHashMap<>();
}```
it's spooktober (i'm scared of hypixel source code)
public void setLine(int line, String text) {
ArmorStand stand = new ArrayList<>(this.stands.values()).get(line).get();
if (stand == null) {
// if the reference has expired AKA the chunk reloaded and the entity changed,
// we can regain the entity through Bukkit.getEntity(UUID)
stand = location.getWorld().getEntitiesByClass(ArmorStand.class).stream()
.filter(armorStand -> armorStand.getUniqueId().equals(
new ArrayList<>(this.stands.keySet()).get(line)))
.findFirst().orElse(null);
if (stand == null) {
return;
}
stands.put(stand.getUniqueId(), new WeakReference<>(stand));
}
stand.setCustomName(Utilities.parse(text).trim());
}```
You know what? I'm impressed you actually managed to figure it out correctly. Usually I tell people "Yeah you can do <insert thing here>" and they follow up with like a dozen questions about how to do it
👏 Good job. Looks good
does it actually look good or is the whole
stand = location.getWorld().getEntitiesByClass(ArmorStand.class).stream()
.filter(armorStand -> armorStand.getUniqueId().equals(
new ArrayList<>(this.stands.keySet()).get(line)))
.findFirst().orElse(null);```
specifically `new ArrayList<>(this.stands.keySet()).get(line)))` cooked
gm is gChocom
HypixelPlayer is a cool class
Yeah that line is a bit crazy lol. Something wrong with just filter(armorStand -> stands.containsKey(armorStand.getUniqueId()))?
Or I guess technically that's not the same
also net.hypixel.hynet.network.protocol.Packet is cool if hypixel still has hynet
Hynet?
Why do you even know so much about hypixel stuff
think about viaversion
Highnet*
lolol
Actually yeah just make a variable, that's probably what you want. I also wouldn't worry too much about doing a defensive copy of your list, unless you're doing some async stuff. But even then, a lock is probably safer
Ohhhh, I see what you're doing lol. That's certainly a creative way to go about it. You're using a LinkedHashMap to retain insertion order. Eh.
I kinda just thought new ArrayList<>(this.stands.keySet()).get(line))) is the only way to go about getting a specific index in a hashmap
linkedhashmap to retain insert order
yeah
private static record Line(UUID armorStandUUID, WeakReference<ArmorStand> armorStand) { }
private final List<Line> lines = new ArrayList<>();
I'd probably do something like that instead
And if you desperately need to get an armor stand from a UUID, you could have, in addition to that list, a Map<UUID, Line>
Also if you don't have records because you're using Java 8, you can have a simple data class, that works fine too
curious does hypixel run java 8
yeah Hynet is in the HypixelDev user/organization on github, it’s just private
did hypixel leak anything new?
It's complicated lol
they don't really have to run on java 8 if they want to no?
Java 17 is compatible with them versions, just update a few dependencies and you’re good
newer java versions are generally much faster
wouldn't I need to use LinkedHashMap again and at that point I'm basically just at the beginning
wait, i think they talked about it somewhere
about uuid i think
they use newer java version for sure
Well, no, that Map would just be for reference if you wanted to get a Line from a UUID. You don't care about order there. The order would be defined by the List
Because ArrayLists retain order. They're arrays
Basically that post was about bringing the UUID method from later versions into their own utils
pretty sure
wait a sec, array list and weak references, how do they work? do they leave gaps in the array?
oh, nvm then
hang on sorry I'm a bit confused so, if I need to get an armorstand by uuid, I have a map in addition to a list, but wouldn't I then be having two line objects that I need to pray are the same
oh nvm, the weak reference keeps its place instead
private static record Line(UUID armorStandUUID, WeakReference<ArmorStand> armorStand) { }
private final List<Line> lines = new ArrayList<>();
private final Map<UUID, Line> linesByUUID = new HashMap<>();
public Hologram() {
// whatever
}
public void addLine(ArmorStand armorStand) {
Line line = new Line(armorStand.getUniqueId(), new WeakReference<>(armorStand));
this.lines.add(line);
this.linesByUUID.put(line.armorStandUUID(), line);
}```
If you wanted to ensure the two collections remain the same, you could use a lock
i would prefer a remove() method over weak reference
this way i can wipe the armor stands as well
I would prefer u suck
never used lock but nothings stopping me
no u
Locks aren't terribly difficult, but they're kinda hard to wrap your head around at first. If you're wanting to do any thread-safe class, you generally want to either use a lock or some other thread-safe approach
One sec
I have an example, actually
This class, at least to my understanding, is thread-safe
leaked hypixel code
Any time I read from data, I acquire a read lock. Any time I write to data, I acquire a write lock
oh wait, this is client
The locks are a totally separate issue though lol. I think the biggest thing that you should look to change is replacing your LinkedHashMap with a proper List so you can random access rather than having to wrap a collection in an array list instead
Yeah this is a mod lol. Not Hypixel code
yeah, dissapointed
i was wondering for a second why you needed locks for scoreboards
but in the client it makes sense
i'd love to peruse hypixel code
but alas
i have mineplex code to learn what not to do from
package net.hypixel.hynet.protocol.v47.play.server;
are you coming up with these?
no
Why do you guys have hypixel or mineplex code randomly lying around
why do you not?
Where tf would I find it
correct
if they weren't taken down
it wasn't a massive leak
hang on I found a problem
Hynet doesn't exist, at least as far as I'm aware. I've never seen that package before
If I can't get the line as the reference is expired, and I need to get it from the uuid map, how do I know the uuid if the reference expired
Damn
pretty sure the WeakReference object remains @fading drift
Aha
the object it stores gets removed
Well the UUID is constant. If you're adding a line to your hologram, the armour stand exists in the world so you can get its UUID and insert it into the Map
this is hard to explain but
public void setLine(int line, String text) {
ArmorStand stand = lines.get(line).getArmorStand().get();
if (stand == null) {
// if the reference has expired AKA the chunk reloaded and the entity changed,
// we can regain the entity through Bukkit.getEntity(UUID)
stand = location.getWorld().getEntitiesByClass(ArmorStand.class).stream()
.filter(armorStand -> armorStand.getUniqueId().equals(
linesByUuid.get().getUuid())
)
.findFirst().orElse(null);```
linesByUuid.get().getUuid()
how would I use get(uuid) if I cant use stand.getuniqueid as stand is null
does that make sense
Well that's why I held a Line object in the List which contains both the UUID and the reference to the armour stand
Line has your UUID that you want
oh im silly
Can I somehow set player permissions in luckperms with the vault dependency?
Yeah :D
You could maybe clean up your filter if you really want with a method reference
private static record Line(UUID armorStandUUID, WeakReference<ArmorStand> armorStand) {
public boolean matches(ArmorStand armorStand) {
return armorStand.getUniqueId().equals(armorStandUUID);
}
}
// Later
Line line = lines.get(lineIndex);
stand = location.getWorld().getEntitiesByClass(ArmorStand.class).stream()
.filter(line::matches)
.findFirst().orElse(null);
and then I would remove line(index) and add it again with the new weak reference
no
ill setArmorStand
Yeah you would need a setter in that Line object
So I guess a record wouldn't work lol
there used to be a skywars one up a couple years ago but seems like it’s gone
public void setLine(int line, String text) {
ArmorStand stand = lines.get(line).getArmorStand().get();
if (stand == null) {
// if the reference has expired AKA the chunk reloaded and the entity changed,
// we can regain the entity through Bukkit.getEntity(UUID)
stand = location.getWorld().getEntitiesByClass(ArmorStand.class).stream()
.filter(armorStand -> armorStand.getUniqueId().equals(
lines.get(line).getUuid())
)
.findFirst().orElse(null);
if (stand == null) {
return;
}
lines.get(line).setArmorStand(new WeakReference<>(stand));
}
stand.setCustomName(Utilities.parse(text).trim());
}```
though you could definitely put lines.get(line) in a variable
yeah I'm silly I dont even need the map
is there any way I can just make a world in memory and have it load world from existing world?
And then yeah if you really want to go above and beyond you can look at the example I sent regarding read/write locks (specifically ReadWriteReentrantLock for convenience), but that's only if you care about the thread-safety of your object
do I even need to bother about locks if I don't use the map? even if I'm running all of this async
I really dont feel like dealing with copying world files then deleting it later
If you're accessing your object from multiple threads, then you should make it thread-safe
sorry I definitely have not wrapped my head around locks
If it's just one thread, it's fine
🤷♂️ I never try making stuff thread safe but most of my code is immutable
I am creating the hologram object in main thread but running setLine on async thread
You could also avoid locks entirely and opt for a synchronized method. Some people say "always prefer synchronized over locks" but it's up to you
I kind of don't mind the explicitness of locks
why are you running setline async?
considering the guy before me decided to just run this awful awful method 6 times every 100 ticks and I don't want to rewrite it at the moment I'll probably stay async
its doing database lookups to get player statistics and setting the line which I don't want running on main thread
what does the hologram do
o
Why don't make it update when a player tries viewing it
I think what you should do in that situation specifically is run the lookup on an off thread, but the actual entity update should be done on the main thread. Async entity updates can always be awkward and sometimes just outright don't work
Spigot will occasionally throw exceptions to catch you doing async work on world state
so I'm using runTaskTimerAsynchronously to run the method that calls setLine. should I just wrap setLine arround a runnable with runtasklater
Can I somehow set player permissions in luckperms with the vault dependency???
am I cooked or correct 💀
Ideally you'd end up using a CompletableFuture. Those things are handy :)
sometimes I ask questions and I'm not sure if I'm on the money or wildy wrong
I thought completeablefuture was just for running stuff async
tbh
It is used for alot of stuff which I dont remember
I just remember using it for my database calls and it fixed everything
CompletableFuture.supplyAsync(() -> {
// Do your database lookup here, this is async
return "Wow! Super awesome database value!";
}).thenAcceptAsync(value -> System.out.println(value), task -> Bukkit.getScheduler().runTask(plugin, task));
except when you run too many and run out of threads in a pterodactyl container
Then use Bukkit's scheduler in the futures, which you can do
interesting
Is there any easy way to handle worlds in minigames?
handle worlds how
I really dont want to go with copying and creating new world then deleting it after game is done
do it in code
what do u mean do it in code :o
Why not?
You could reboot your server (which you should do when a minigame is done) and pull the world from some git repository or a separate directory or something
use java and bukkit api to unload the world, delete directory, copy template world into directory, load it using bukkit api, profiy
shits so good thats what I did
works like a charm
it did but was worth it
Alr then :)
guy before me had one world and used schematics to paste maps 500 blocks apart
so buggy and laggy
nah bro 💀
I mean tbh I've been rewriting my minigame code for like 2 and a half weeks now so
kinda a hassle
the only mini game I coded before was Among us
But it was coded in Minestom which handled worlds VERY differently 🤷♂️
Infact worlds did not even exist.
it really isn't
you just copy the source world folder, load that new world, unload, delete
yeah tbh this code is so fucked I'm not bothering today until I fully rework it. just gonna pray it stays thread safe tbh
for (int i = 0; i < 10; i++) {
if (players.size() <= i) {
continue;
}
UUID uuid = players.get(i);
User user = users.loadUser(uuid).join();
LeaderboardPosition position = new LeaderboardPosition(i + 1, getPlayerSync(uuid).getName(), user.getCachedData().getMetaData().getPrefix(), result.get(uuid));
board.add(position);
if (hologram) {
if (holograms.get(type) == null) {
continue;
}
holograms.get(type).setLine(i + 2, "&e" + position.getPosition() + ". " + position.getPrefix() + position.getUsername() + " &e- " + position.getScore());
}
}```
private PlayerData getPlayerSync(UUID uuid) {
FindIterable<Document> result = collection.find(Filters.eq("uuid", uuid.toString()));
Document first = result.first();
if (first == null) {
return null;
} else {
Document stats = (Document) getValueOrDefault(first.get("stats"), new Document());
Stats global = decodeStats((Document) getValueOrDefault(stats.get("overall"), new Document()));
Stats solos = decodeStats((Document) getValueOrDefault(stats.get("solos"), new Document()));
Stats doubles = decodeStats((Document) getValueOrDefault(stats.get("doubles"), new Document()));
Stats threes = decodeStats((Document) getValueOrDefault(stats.get("threes"), new Document()));
Stats fours = decodeStats((Document) getValueOrDefault(stats.get("fours"), new Document()));
Stats ranked = decodeStats((Document) getValueOrDefault(stats.get("ranked"), new Document()));
RankColor rankColor = RankColor.WHITE;
StyleColor styleColor = StyleColor.BLUE;```
public static World createWorld(String worldName, Game game) throws IOException {
//we must get the world files first.
File templateWorld = new File(PillarsOfFortune.getInstance().getDataFolder(), "worlds/" + worldName);
File newWorld = new File("/" + game.getUuid().toString());
FileChannel templateChannel = new FileInputStream(templateWorld).getChannel();
FileChannel newWorldChannel = new FileOutputStream(newWorld).getChannel();
newWorldChannel.transferFrom(templateChannel, 0, templateChannel.size());
//I hope everything went as per PLAN!
World world = Bukkit.createWorld(new WorldCreator(game.getUuid().toString()));
world.setAutoSave(false); //WE DO NOT WANT TO SAVE
//holy I need to error handle this thing soo bad.
return world;
}``` this code should work if I did it correctly right
it requires some testing.
// copy preset world to matches directory
String matchDirectory = BridgeMatchManager.MATCHES_DIRECTORY + File.separator + "match-" + id;
try {
// todo: map presets
FileUtils.copyDirectory(new File(BridgeMatchManager.MATCHES_PRESET_DIRECTORY + File.separator + map.getName()),
new File(matchDirectory));
} catch (IOException e) {
throw new RuntimeException(e);
}
WorldCreator creator = new WorldCreator(matchDirectory);
creator.environment(World.Environment.NORMAL);
creator.type(WorldType.FLAT);
creator.generatorSettings("2;0;1;");
creator.generateStructures(false);
world = creator.createWorld();
if (world == null) {
throw new RuntimeException("Failed to create world");
}
// initialise world settings
world.setGameRuleValue("randomTickSpeed", "0");
world.setGameRuleValue("doMobSpawning", "false");```
this is mine
thank you for sharing src :)
ofc
I should take sometime and make my own minigame lib for my own needs
I wrote one for bridge and I still need to add support for 2v2, 3v3 etc but my plan is to abstract it so I can write any mini game for minecraft easily
Any thoughts on this project?
https://github.com/PassengersTrain/RedPvPCore
I got slapped with access denieds
new File("/" + ...)
You're creating the directory in your root partition
Can I somehow set player permissions in luckperms with the vault dependency????!?!?
you just.. use the regular luckperms api?
why
cuz dependencies = bad
If you are going to be using LuckPerms on the server, then why would you not use its api?
Permission plugins are on almost every single server.
and who told you that?
I did
just use the vault api
why not soft depend it then
if its there use it if not fall back to vault permissions
Why are you wanting to ADD a permission anyway?
setting up permissions is generally not the plugins job, thats the server owner/admin
cuz
well
set
permissions
I suppose
also thats exactly what I said
none of that makes any sense. Did you just spam words?
chatgpt be like
no
but I see your point
anyways, how common is recycling old code
also
wdyt of charging per byte of source code
💀
smh dont skull me like that
how much should I sell source code for
don't
You price teh contract not the code
wdym
what if i do 😎
me when the plugins code is $5 but the dev obfuscates it so now it's $50
how does that work
obfuscating your code?
how does obfuscating code increase the value tenfold
shouldnt it like decrease it or sum
nope, it's designed to make it unreadable
so like...
doesnt that devalue the code?..
what
no
You obfuscate your code in order to make it a bitch and a half for other people to read, beyond that not sure what else you’re obfuscating for
so it becomes harder to use it then
no?
only harder to pirate
it's when you need to boost your ego and think your code is something special that's never been written before
I mean you obfuscate when compiling so no
Obfuscation either increases or decreases
bro I dont get it
The only time I ever see a point of obfuscation is when protecting a Tradmark/Copyright. You have to make a minimum effort
Increase if they use like the super long method names and string manipulation like the liI for example
would that be selling a phone vs selling a phone that only has terminal on it
Decrease sometimes too by reducing method names and stuff
No lol
The product works, you just don’t get to see what makes it work
That’s the point
some people think that
Not for you
But if you want to hide how it works from other people, that’s when you’d typically obfuscate
"no i must obsfucate my plugin i dont want people decompiling my plugin and stealing my code"
doesnt obfuscating the code also make it effectively unusable
customer wants product so they pay you for it. if they obfuscate you can go back to them asking them for new shit and spend more money
Obfuscation is literally just a mask
it doesn't touch the actual logic
The point of obfuscation is to just make it harder to reverse engineer the JAR
the amount of people that come here for this reason is crazy
It doesn’t prevent it from reverse engineering
it's for making it unreadable
But it it makes it harder
you can still edit it its just harder
so basically decompile protection
OH
OHHHH
Not protection
I finally got it
It makes it harder
It crashes the decompiler and stuff
obsfucation isnt security
no way thats real?
some of them can do that
not really
not allowed to be used on spigot resources but ye
only crazy obfuscation
Not crash decompiler but make it like give up lmao
deobfuscating also isn’t hard it’s just very time consuming
^^
okay so if your source in jar is obfuscated that makes the unobfuscated source more valuable, right?
don't obfuscate
Yep, the point of it is to try and discourage reverse engineering
worked on a project that deobfuscated lunar client once and it took months and never finished
But there’s no point in obfuscation
damn
source code is defined as the preferred form for making changes, so it's not the decompiled or obfuscated code.
You know these days, have a solid open source project is more valuable than anything for money
why
It’s great to use on your resume, to build upon, etc
yea
hm
projects like lunar client use obfuscation so they can protect their code from getting stolen to reduce their competition in the market as they can more easily add unique features and stay ahead of the game
And also you should keep in mind you aren’t gonna make shit out of my plugins or it’s gonna be so hard for you to make a living lol
You’re better off using it as an exemplary project in your resume to find other jobs
or a side project for a bit of extra income
how well
Yes that’s because he made a ton
what are auxilors
enough to live off
or is that someone's nick
anything eco
jesus
auxilor is a person
alr
Enough to live off is still very low tho
eg eco enchants
It’s hard
so plugins market has way too much supply and not enough demand so its not worth it to try earn money here?
premium spigot plugins
Pretty much
ah I forget there’s a marketplace
gotcha
And anything that isn’t “cool” or “unique” is pretty much gonna die
valid
Like why would anyone want to use another color chat plugin when millions exist
the only way you make a lot on premium plugins is something unique and adding 9000 features
Just make plugins because it’s fun and you enjoy practicing the craft
^
Would it be smarter to store an item in hashmap and clone it?
than what
Oh right, add the item to the player's inventory upon respawn?
these do different things
what are you ultimately trying to accomplish
add an item on respawn?
Hello dear all,
I hope this is the right place to ask. I've tried programmatically generating different kind of trees in a Spigot Plugin.
I made some research and I found that L-system generation should be the best option : https://en.wikipedia.org/wiki/L-system
I coded something which is supposed to be a coherent implementation. The problem is that the result is absolutely horrible, some pure garbage.
(If you don't believe me then just see this : || https://i.imgur.com/iBMkHfb.jpeg || )
Right now I'm not sure if :
- The l-system might not be applicable to Minecraft due to scale and block-based coordinates ?
- My implementation is incorrect/bugged ?
- The rules I feed to l-system are incorrect
So I was wondering : have any of you ever tried to do generate trees ?
If so, did you use l-system ? Did it work well ?
Or did you use something else ?
That's why all my plugins are free :p
and I deny all sponsorship requests
dont you want to be sponsored by gamer supps
It's usually server hosts
the choco flavour
I always appreciate people reaching out to sponsor VeinMiner but out of principle I've only ever said no
get sponsored by lunchly 
oh god I never responded to that sponsorship offer on spigotmc 💀
oh no what are you gonna do
eepy emily
Sponsored by SpigotMC? 
Emily, brought to you by SpigotMC
?paste
I’m still contemplating whether or not I want to release the disc golf plugin for free or not
I wish I could publish prem plugins
I made my plugins free because I preferred larger reach over money. Vein Miner likely wouldn't have nearly as many people using it if it were premium
I also felt kind of shitty selling a plugin where I didn't come up with the concept
@slate siren
yep
yukaridaki elemanin yazdigini oku
isine yarayacak birsey varsa
kullan
free diyor
english only
Ah okay sorry
I’ve never seen any other disc golf plugin so maybe my cause is valid for premium
nopee there's no need
👍
I mean yeah go for it :)
Nothing stopping you
Except for the fact it’s not done kek
There's also nothing stopping you from selling something someone else came up with, so long as you're the one that wrote the code
Me not selling VeinMiner was a personal moral choice lol
That was another thing, if posting as a premium resource would it be advised against to release the source with it?
Hey!
How can I send a plugin message from BungeeCord to Spigot without any players involved?
I mean you can release the source for a premium plugin. Few plugins do it but I wish more did
You can't, because BungeeCord makes use of the plugin messaging channel which requires a player to actually send the message through
If you want communication between servers without plugin messaging, you need to use Redis or some other in-memory database/message broker
Can I just pass the message through a random online player?
Sure
Perfect, thank you
But Spigot to BungeeCord allows sending a plugin message without any players involved, right?
I was wanting to release the source whether free or premium, I would just love to make a couple bucks if possible cuz this is a really large project I’m putting a lot of time into, I suppose it does come down to what I want so perhaps I’ll think more about it when it’s actually closer to being finished
what a lot of people do is charge for support
you can compile it for free but you get no support
+1 on that model
Patreon sub in order to get the discord link kek
How does Bukkit.getServer().sendPluginMessage(); work then?
It broadcasts a plugin message to all online players. Player#sendPluginMessage() gets used internally
Which just sends the custom payload packet to the player
I'm not sure the technicals behind how the proxy handles that, but I believe BungeeCord intercepts outgoing messages along the bungeecord channel
Oh, I see
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-server</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>```
Does anyone know why im unable to import GameProfile or dont you need it for EntityPlayer anymore? (Tried PlayerProfile/CraftPlayerProfile. Didnt work.,)
spigot-server?
no way that is resolving
PlayerProfile is a part of teh Spigot API.
GameProfile is mojang libraries
AuthLib I believe
So ig I gotta add that too? Since when do I have to add everything manually.. that wasnt the case back then..
why do you want to use GameProfile?
spawn npcs
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>3.5.41</version>
<scope>provided</scope>
</dependency>```
thats an old version, IF you insist on using game profile
if you follow the nms page you get all nms and remapped for easy names
Im pretty sure I used the remapped version when installing it manually via cmd
stilll cant import game profiles...
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-server</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.21</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>6.0.54</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier> <!-- Important! -->
</dependency>
</dependencies>```
also tried removing everything but the mojang remapping, still no gameprofile..
sounds like gpt garbage
it only is because I installed it locally from the jar build tools made. but now I followed the tutorial. also added <build> but that message would be too long.
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>6.0.54</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier> <!-- Important! -->
</dependency>
</dependencies>```
well i manually added all the dependencies thats why it looks so aids, tried to add everything so i could maybe import it..
you can;t manually add dependencies when using Maven
go back and follow the tutorial EXACTLY as written
all that junk in your pom is rubbish
mvn install:install-file?
alright
Bruh.. just had to restart itellij, but after removing my garbage it worked, tyvm! 🙂
Ok.. sorry.. now I cant import EntityPlayer altough I was able to import it before.. Any idea?
ServerPlayer
whats that, is it a is it a matrixstack?
am i able to apply the same methods/code from a fabric mod in the MatrixStack to that?
Ty again..
what's the easiest way of clearing a yml config file
File#delete 👍
ok better question
I honestly don't remember how do you instantiate a FileConfiguration
because I can just create a new one instead
A FileConfiguration? Or a YamlConfiguration?
File can be anything, Yaml is specifically for YAML
I don't think File is instantiable
file is the api
It may be abstract if I'm remembering correctly
yaml is an impl of file
YamlConfiguration.loadConfiguration() is what you're looking for probably
I have this weird setup where I have a setting that makes a file clone another file's config and I just sort of wanted to clear the cloned fields if that is set but without going through the hassle of manually doing each one
was just going to wipe the file and write the two fields that do not clone
do you have the original
yeah
could loop it
it's basically linking files together
I just want to make them vanish from the config file because I can already tell people will try to edit a file that is cloned without noticing it
it's fine I'm just going to do it manually
it's not that many fields
when creating bytebuffers, is it smart to allocate them at the size of the packet, or should i just have 1 buffer thats really large. Whats better allocating too much or creating bytebuffers all the time depending on size?
Just create them based on size and you should use the netty ByteBuf instead of ByteBuffer
Buffer what you need, usually
can someone here code me a plugin
?services
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/
What's the plugin I want some $$
get a job
For the past 4 days I have literally said "x day of real work complete"
I forgot today actually
so go and do overtime
do 7 more hours
That's a tomorrow activity
10-5 or 9-5
just dont clock out
The paperwork / payroll lady is dating my father...
so thats how you got the job
how much they paying you
14
us?
yea\
dayum thats not minimum wage
Texas minimum wage is 7.25 iirc
solid like 2k a month if you get the 40 a week
That's like 1.7k after taxes kek
i was gonna say whats ur min to be taxed but you make double minimum wage so that adds up
do people usually charge plugins by hour or by commission
you can make up to £12,570 without it being taxed afaik here
I was wondering if it’d worth it to setup a sort of portfolio for plugin development to make even like $50 a week
like how hard is it to actually get customers
wow mbn lol
It's not hard to get customers, it's hard to get the payments lol
you have to look in the right place to find people
More or less, a lot of times you may end up doing all the work and they backout or they just dont pay you
theres 2 types of people you find, people that want something huge for about 3$ or people that know how big it is and know its gonna cost a bit
yeah surely they’re supposed to pay beforehand
right
people also have higher chance of commissioning you if they know who you are
Most people probably do 50% upfront, 50% on completion
like alex (author of chest sort, angel chest and loads others) probably gets a lot of commissions because his plugins are big and known so they trust him
making it all work out is hard, you have to do free stuff and get a name for yourself and build a portfolio then know where to find people or post for people to find you
I found a plugin for weather and thirst and it looks like a mod. How is this possible water drops over the food icon and a balloon in the center
1.204
where did you find the plugin?
Not spigot site but my friend was checks it in hosting
i'd ask your friend then
its a texture pack
its displayed on the action bar and uses positive and negative space
or well resource pack sorry
If you want check here is (not sure maybe has virus)
Did they take the exact same textures from tough as nails
This is why i use escrow services
I've found that people pay the correct amount in time about 99% of the time
Out of like 500+ projects only 2-3 have gone unpaid
can someone help me with this? i'm creating a class that extends CraftPlayer and implements Player, but i can't cast Player to my class because i cant cast CraftPlayer to my class
public abstract class SkyblockPlayer extends CraftPlayer implements Player {
private final Player player;
private final ManaSkill manaSkill = new ManaSkill();
private final LifeSkill lifeSkill = new LifeSkill();
private final DefenseSkill defenseSkill = new DefenseSkill();
private final CritDamage critDamage = new CritDamage();
private final CritChance critChance = new CritChance();
private final SpeedSkill speedSkill = new SpeedSkill();
private final skyblock_builtins skybBuiltins = new skyblock_builtins();
public SkyblockPlayer(@NotNull org.bukkit.entity.Player player) {
super((CraftServer) Bukkit.getServer(),(ServerPlayer) player);
this.player = player;
}
That's my code
Use proxy
How can i make it to implement Player?
Use some sort of manager to map UUID to your custom class
For skyblock player
What
Do you know the proxy pattern?
What are u talking about?
implementing player sounds more of a convenience thing than an intended mechanic
inb4 "I want to add methods"
inb4 : Player by player kotlin ppl
Kotlin
MyPlayerManager.getPlayer(<bukkit player>).someCustomThing() is usually what you’d do
Waitt
I can do
MyCustomClass customPlayer = new MyCustomClass.getPlayer(player);
And then customPlayer.myCustomThing
thanks
Kotlin
Decompiled java code: 😃
Decompiled kotlin code: 💀
static ew
might be ok if you have a main class singleton
tbf so much of my code at work is so scattered I haven't felt the need to use a player manager for the past few months
pseudo and sudo are two different things
Can I sudo shutdown myself
lol
you should sudo shutdown now! ⚡ 🦹♂️
mfs that use the minecraft namespace in pdc be like
Ah yes that’s how you future proof against plugin name changes
Big brain
What
is there a way to set beacon colors?
without the blocks
Nvm the god Choco solved it
No
Yuh
EDIT2: After trying endlessly, it seems as though I can't get this to work. I believe this is due to the fact that the field "g" is being cleared every time #F() is called which is essentially the beacon's update method that gets called every tick. The tile entity searches for coloured glass above it every tick and recalculates. Therefore, this cannot be done without direct modification to the server (which I may or may not attempt to do at one point in time to create a PR. We'll see after 1.13).
No
:)
is that still the case today I wonder
Yeah only the client needs to decide that
You can hide stained glass panes in the beam
So it's possible with packets
Since they are thin enough
No, there are no packets to communicate that
Shit
It's client logic
Okay
Best you can do is send a client-sided block change using glass panes
Oh yeah
And i can
change it to
Because i wanted to do smth like this
but animated
Yeah, block changes is all you can do
Okay okay
At least though glass panes, if not connected, will be hidden inside the beam
That's a good one
Anyone know when rolyn typically gets online kek
And i cant do them liike um
how do i say dat
umm
so the player can pass through
like they don't exist
Can't really do that unfortunately
😭
If you send a change to tell the client they are air
Then they won’t provide color anymore either
Yeah I was gonna say, then it's not a glass pane lol
Lol
Unfortunately air is not glass
Sad day
how should I go about writing a duel system
just have a map of uuid and like an duel invite object
Yeah pretty much
should I use a runnable to remove the object after it expires or just keep an Instant where its checked on accepting the duel
I really want to avoid running something every x ticks I really don't like it in a plugin
I guess it's up to you tbh. If you want a message to be sent when the invitation expires you'll have to schedule a task. Though you could schedule just a single task to run at a later time. It doesn't have to be repeating
true
you mean runTaskLater(plugin, object::remove, time)?
Pretty much
Yeah you might want to make some objects lol
I mean that could probably just be one object, I guess
yo hey is it safe to make map inside of maps?
Shall I share my invite system?
like Map<Smth, Map<Smth, String>>
yeah that'd be great as a reference
It's safe. It's just usually indicative of something that needs a better design
Oh okay thanks
I love maps in maps in maps in maps
Bruh
thanks
Could prolly figure some better way for accepting invites, I was being lazy and just accept the first one found
Sad Multimap sounds
code complexity plugin?
Why sad D:
Because you didn't use one!
damn my match system is 315% complex
I got a class for this
Not standard library!
I've never used a multimap kek
Whatttttttttttttttt
I did once
it still places blocks but it calculates the color too
It's literally just a Map<K, C extends Collection<V>>
plzplzplzplzplz
It’s just a map with a collection but John Google deals with things for you
put() adds to the collection, remove() removes from it, get() returns the values as a collection, or an empty one if there are none
should I avoid static references in a plugin
Well that's written in the skyblock project (currently on backburner while I work on disc golf)
for example if I had my duel invites static what would be the harm
So perhaps I will change it later
Well I will need an invite service for the disc golf rounds too so
Maybe I just rewrite it but better
Sigh I am just stuck on the maths right now... I hate it
tankz
public void placeGlass(Block beaconBlock, Color color) {
List<GlassColor> glassColors = GlassColorCache.calculateGlassColors(color);
for (int index = 0; index < 4; index++) {
final int y = beaconBlock.getY() + index + 1;
final Material glass = index >= glassColors.size() ? Material.AIR : glassColors.get(index).getType();
final Block glassBlock = beaconBlock.getWorld().getBlockAt(beaconBlock.getX(), y, beaconBlock.getZ());
glassBlock.setType(glass);
}
}
It isn't perfect because you don't have the full color space
oh okay okay thankz
But you can update glass quite fast, IIRC my client handled ~a color change every 3 ticks
you wouldn't be able to check the pdc because there's no meta anyways
getItemMeta creates meta if it doesn’t exist
Yes it also clones it if it exists so be careful!!! Ya gotta set it back and get ItemMeta isn't super cheap
luckily it's a highly flexible system that is very close to the model adopted by vanilla
So I was wondering, if you have multiple vault economies on one server and all of them vault registered if a third party plugin hooks, how do you control which it should interact with? baffles me. (Never mind ~ its impossible to have independent support for each using vault) so need to find a way around this 😦
I never worked with vault, but when your plugin can interact with all of the economies, you could write an api for the other plugin
Typically economy plugins have their own api to interact with them. If you are a developer instead of using multiple plugins why not just create your own economy plugin instead to replace those 3
I did make my own :p that's the point just if I want to use a third party plugin how would I control which economy it uses if vault is that limited
Ah yeah you would see if it has its own api to interact with or you could use reflection and try to force inject into it lol
Actually nvm you would hook into vault main and not its api
So on that line you would do that and where it specifies the economy.class you would replace with the economy plugins class instead and you would then be able to interact with that specific plugin through vault
Or should be able to anyways
Vault isn't really limited in that sense, it just makes good use of the service provider API
It's been ages since I last used Java (and even longer since I made mc plugins.) I'm using Eclipse (sorry :P), but I'm pretty much open to doing anything. I'm looking for a tutorial for getting a enviorenment up for PaperSpigot 1.8.8 :)
?whereami
?1.8
Too old! (Click the link to get the exact time)
also
Paper (formerly known as PaperSpigot) is not affiliated with Spigot
Boomer version btw*
oh sorry guys
even if you go to Paper you'll be told 1.8 is unsupported anyway
it isn't that much different from using the API today, so you can probably make do with the current documentation, excluding all the paperweight sehanigans
I mean, the API is extremely different lol
it is, but the gist of it is still the same
I guess so
A lot of servers (and mine) still use it for PvP. There are valid use cases for that version IMO
err, excluding things like bootstrapping and commands I guess
That pvp can be remade using plugins, there isn't really a good purpose
Thing is, if you are running 1.8 you should not be using either paper or spigot. Both pieces of software have known exploits for that version
well shit
Idk what the common 1.8 fork is people run, but it is 100% not stock paper or spigot
what exploits?
pandaspigot I think was the popular fork nowadays?
I mean, mostly crash exploits I'd guess
e.g. clients crashing the entire server with some malformed input or funky actions
there are, but the developer community wants to move on, because even if there is activity in these versions, it is not worthwhile to entertain the idea of making an exception out of it
the fact that these crash exploits exist as well doesn't make that situation any better
you'll probably find support in whatever 1.8.8 fork is actively maintained nowadays, I wouldn't be able to tell you which one that is since I am not part of these communities though
Fair enough. I'll go try to find some info somewhere else. Thanks for letting me know about the state of developing for mc
pandaspigot seems fairly relevant still so I'd look in that direction, if anything
Thank you!
Does anyone know why I get this error? pom.xml contains the specialsource remapper. Idk if its because something is wrong with my plugin building or something else.
Caused by: java.lang.NoSuchMethodError: 'net.minecraft.server.level.ServerPlayer org.bukkit.craftbukkit.v1_21_R1.entity.CraftPlayer.getHandle()
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>2.0.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.21.1-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.21.1-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.21.1-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.21.-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>```
Looks like there's a typo in remappedDependencies
Also make sure you're actually using maven to compile your plugin
And not Artifacts
that was it! thanks, ran it via mvn clean package and found it..
how to stop arrow pickup in 1.8 where arrowpickupevent doesn’t exist
I was wondering why I was getting 40 fps
animated?
