#help-development
1 messages · Page 773 of 1
int first = 1010;
int second = 0011;
int result = (first << 4) | second;
printf("%d", result);
You would do something similar to this. This is the basic way to concatenate two binary numbers
meh
We shift the first set of binary numbers to the left we so we have room to set the second. And then you get your result and do it again for the third. And then you compare with bitwise operator the resulting binary if the are the same
thank you for explanation xD
I could use this somewhere where i have to be super efficient
I try to teach people how to do bitwise and bitshifting stuff lol
I've learned some of it in university
But I kinda forgot xD
It's an interesting topic though
bytes and bits :D
Copyright 2020 Frostalf xD
This compresses hex or rgb colors into 8bit colors and back
But it uses bitshifting to do it
Ansi 8bit colors to be specific
noice
Since most consoles implement ansi
I made this because someone needed it. Feel free to use it. It is licensed mit after all 
oh hi frosty
why does this fire like every ~ 2 seconds, when it should fire every second (20 ticks) ?
BukkitTask task = new BukkitRunnable() {
@Override
public void run() { }
}.runTaskTimerAsynchronously(essentials, 0L, timeSeconds * 20L);
is it because it's async?
No
once
I've got a class for it
and in it I have a method which creates the runnable and starts it
let me check, i fixed it
if player.getInventory().getItemInMainHand(); is not null then what does it become if player isn't holding anytihng in their hand?
AIR?
yeah pretty much kinda most of the time
7smile stop spoon feeding smh
use Material::isAir
I still remember I had to do null checks for this not awhile ago did they change this recently? xD
for future compat since it can be different types of air
Probably half a decade ago
do you think they will ever add fog
and stuff like that
that'd be epicc
i mean like in inv, u have normal Material.AIR
but like, in the future it might be changed
who knows
so isAir and null check ftw
nicenice
Ohhh itemMeta, i was casting to itemstack loll
That looks cool?
But that gets the damage right? So
hmm
Damage and durability are two different things?
it probably just var damage = itemMeta instanceof Damageable damageable : damageable.getDamage() : -1;
or sth
lol
Ohh I see thanks
How would I iterate over this?
to also get the enchantment level
entrySet()
when is it not?
don't say air. that doesn't have itemmeta so it can't be "not Damageable"
myea, currently its implemented such that all item types except air do implement it, which is why its a bit weird, but I assume it may be due to future compat or sth that someone decided to pr a segregated interface for durability, in case some item stacks or types disallow it 
all ItemMeta are also Repairable and BlockDataMeta which is yikes
Minecraft Plugin.
How do I load an ini file?
you shouldn't
use yaml or json if you really hate yaml
how can i launch the player up in the air based on their yaw and pitch? do i have to use sin and cos?
Thank you.
I'll use YAML.
player.setVelocity(new Vector(Math.sin(player.getLocation().getYaw()), 5, Math.cos(player.getLocation().getYaw())));
im pretty sure this will work
I think there are enums now for each enchant. Get the enum, then the name from that
Wasn't it namespacedkeys
since OfflinePlayer is @NotNull ed how do I check if the OfflinePlayer was found
and no im not checking if the player played before, I'm just willing to get his UUID from Mojang API
player.setVelocity(new Vector(
-Math.sin(Math.toRadians(player.getLocation().getYaw())) * 30,
2,
-Math.cos(Math.toRadians(player.getLocation().getYaw())) * 30
));```
this is still not workin
you can just getDirection
oh didnt know that
how can i detect taking damage by drowning
The entity damage event and then check if the cause is drowning, probably
Can I rotate a falling block?
No, but you can use a block display entity instead
(Unless you're supporting some archaic versions like > 1.19)
It’s always found
You can check if the player is online by doing #getPlayer (returns null if not online), and you can use #hasPlayedBefore
Aren't players cached
If thry have been on the server sure
But like if he wants to get some random ass player who hasn’t it fetches
uhhh
I'm using display entities right now, but thought of switching to falling blocks as I want to support 1.8 - 1.20.
Why do you feel the need to support 12 versions...
One of them is like 9 years old
My guess is that only a fraction would play on those
Just stick to latest smh
You'd either degrade the quality of your plugin by using outdated features just to support old versions
Or you'd have to use modules to support the old versions and not break quality for newer versions (not sure about this one, haven't used modules)
At first I thought that my plugin should have support for the latest versions, but since my plugin is a "Hub plugin" and a hub usually has support for 1.8 to 1.20 as you can have several server parts with different versions of the game.
So it's just something I came up with, or is it the case that usually servers only have support for the latest versions?
I wouldn't say servers only support latest version, maybe a few latest versions (unless it's those weird 1.8 pvp servers that are still somehow alive)
(For example Wynncraft is slowly dropping the lowest version)
I guess your plugin being a "Hub plugin" would justify multi-version support.
But in that case... enjoy working with 1.8 API
I know I wouldn't
Okey, will think about it Thanks 🙂
I can honestly say I've never worked with 1.8. I stopped at 1.7 and came back around 1.12 (ish)
Yeah kind of a weird jump for you. Just know you were missed when you were mia lol
private void join(Player player, int id){
switch (id){
case 1: Bukkit.dispatchCommand(player, "server skyblock"); break;
}
}```
why does this give unknown command /help
1.7 sucks ass
everything pre 1.18 sucks 🙂
It is because of 1.7 where holograms were born
Cause the server is not bungee
Use plugin messaging channels to transfer plebs between servers
how can i execute bungee commands from spigot server
?pmc
I would opt for the messaging channels instead, yeah
is there any available api
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Could always make them do a rejoin if you just want to be weird and break security
Ye kicking em is a good idea
I think mojang has a packet for it
Where it kicks and automatically makes them join at new address
i checked that but that wasnt an api
i want something to install on bungee and the server so those plugins can communicate and i wouldnt have to do the boring stuff
It’s literally the api
Technically dont really need a plugin on bungee to make them connect to other servers
I think he means he wants to issue server commands for bungee, which you can;t so via spigot
he has to use PMC
but im looking for something like this: SomeAPI.connectPlayer("server", "player")
I see
Plugin message channel supports one sided requests. Dont need a plugin on the bungee for this if you really dont need it or want it
An easy way to work with the "BungeeCord Plugin Messaging Channel" (https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/) - GitHub - leonardosnt/BungeeChannelApi:...
Idek what it is
But it showed up on google 👌🏻
Lol but you linked it anyways
Well
I looked slightly at it and it had a connect and seemed to use plugin messages
private void sendConnectMessage(Player player, String server){
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF(server);
player.sendPluginMessage(IranSkyLobby.getPlugin(), "BungeeCord", out.toByteArray());
}
like this?
Yep, just be sure to register an outgoing message channel in your onEnable()
oh alright
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord"); You can just copy paste that at the start of onEnable()
i did
Then you should be good to go 👍
'newDataOutput()' is declared in unstable class 'com.google.common.io.ByteStreams' marked with @Beta
wait what?
You must be on an old version of the server or something because that API's been stable for quite some time now
You can suppress that warning
im on 1.16.5
Yeah Guava was a bit dated then
Unless you have some old dependency
We only bumped Guava in newer versions because there were some API breaks iirc that we wanted to avoid
Either way, that API is safe to use. It's stable so the Beta annotation can be ignored
Yes?
Oh, no. They're not logged in at that point
That's like the handshake packet
You cant sent spawn from that event as the player hasnt even logged in yet
yoooooooo
Use the join one if you need to set spawn

thatnks @worldly ingot @rotund ravine @young knoll
I mean... kind of. You can put them in a Map<UUID, Location>, then wait for the PlayerSpawnLoactionEvent and read them from the map again
At login player isnt quite fully on the server yet
But at that point you can as well just only listen to the PlayerSpawnLoactionEvent
Or use that event
Only reason you'd use the async one is if you desperately need to fetch a location from a database or something :p
That way you can block the login until the location's available
I have a function that parses it from the config, fancy stuff xD Feel free to use it, I dont mind
also here's the cached regex
is there a way to make the enchantment table temporarily deterministic / locked so that i can test the enchant event easier?
Try changing the offers in the PrepareItemEnchantEvent. Not sure if changes are reflected. Javadocs are vague on this.
they are, but i also need to test that event so this aint gonna help lol
Just register a new method with a lower prio
oh just be like 'youre this now'
yea thatd work
actually
can you give event handlers numeric priority values? iirc logger has numbers that represent the log levels but idk if that'D work for event handler
Event handlers use the lowest to highest for priorirty
It's a namespaced key yeah but I can't find the right function that gives me just the name if I use getKey().toString() I get something like Enchantment[minecraft:efficiency,DIG_SPEED.. .. ...] and I want efficiency, not DIG_SPEED - I get that from getName().
what is org.bukkit.conversations
yea but so do logs. I'm asking if, similar to the logger, i can give it a number instead of a priority to have more than 5 priorities on the same event type
.getKey.getKey?
Don’t think so
Atleast not natively
I'll try it
I mean i know how to do it non natively but i really dont want to do that lol
I mean this completely depends on a users language settings
Are we talking about enchantments
Yes, the names are different depending on your user
That worked thanks
So if I switched to chinese enchantment name would be in chinese?
if no name and no localized name is set then it switches
the client generates the item names from the item metadata
Gotta use translatable components for that
But not server side
is that a class i can use
I think so
isn't there a fixed id for these things?
why would it have to change when the users language changes
The Namespacedkey should be
declaration: package: org.bukkit, interface: Translatable
getKey() is the Namespacedkey
The user gets sent the translatable component, not a name.
And this component gets traslated on the client.
I do wish that alex didn't PR a Translatable interface to Bukkit because I was planning on having one in BungeeChat, but I've kinda gotta roll with the punches now
mfn?
but I do plan on improving translatability Bukkit-wide after I get components merged in
Yeah
guess this is what happens if more than one person works on a project lol
*competent
u dont want me to mess with spigot code lol
I mean the Translatable interface is fine in Bukkit, I was just hoping to target it in BungeeChat and ultimately Spigot
:p I'll probably end up creating one in BungeeChat anyways and having the Bukkit one extend it
probs will work
honestly the main reason i dont try to do prs is cuz of the stupid way it works
source code is impossible to get cuz its just three repositories of patches on top of nms
I wanna be able to do new TranslatableComponent(material), or new TranslatableComponent(enchantment), just instead of having to invoke getTranslationKey() each time
Very noice
tbqh maybe I should do that now
It would end up in the same BungeeChat patch anyways
its the amount of health per dragon scale :kekw:
It’s uhh
Some kind of weird black magic you can apply to players health
I think it lets you give the player say 100 health but still only 10 hearts
Rather than 50
Oh damn nicee
I also wanted to ask, how can you limit the golden hearts to 2? when a player eats an enchanted golden apples they get like 6 or 8
Is there an event where I catch that kind of stuff
There’s the potion effect event
You can limit absorption level to 1
However max absorption is also an attribute now
I guess limiting the absorption level to 1 is enough?
Should be
How can I do it with an attribute? I haven't used that before
setAttributeModifiers?
@worldly ingot which pool would i occupy for the craftbukkit impl of something like this?
For CFs in general
How does create world async work
Which thread pool you mean? I'm unsure. Maybe a better question for Zocker. I'd say create it just with the default CompletableFuture thread pool for the time being, then leave a comment once you create the PR and ping Zocker for input
It just throws all the IO on another thread, syncs back with the main thread for world registration and the WorldLoadEvent, then completes the future on the main thread as well.
Thats the plan at least
i mean
minecraft really needs its worlds multi threaded
just sync ticks if one starts lagging
sin
ce when coll and smile discord helper!?!!!!!!!!????
dunno a while
i do try to help out when i can but more often than not i run into walls myself 😅
2 days for me, yesterday for coll
Ah
I’ve gotten my world creation to 4ms so I’m content :p
I would assume they help
We eat sand
There we go, https://github.com/SpigotMC/BungeeCord/pull/3558
Was quick and simple
I only just PR'd it
is there a tutorial or smth for how to contribute to spigot?
Oh I definitely have some checkstyle errors though oops lol
on this event, how to change the potion effect? I understand I have to use setOverride(true) but what do I do from there? there are no set() functions?
I want to set the absorption level to 1
I'm building a plugin with gradle, but when I build it it stays at an old version of the code and doesn't change the code inside the plugin. Does anyone know how I can fix it?
How do you build this plugin?
are you using reload in the server?
The READMEs for each project are rather informative
do u mean like bukkit and spigot?
Spigot's README leaves a bit to be desired but you'll likely be targeting Bukkit and CraftBukkit anyways
Yes
yep, i've restarted it, I've used serverUtils, I've used reload
kthx
you should be restarting it, and are you sure you actually replaced it? Also, might want to check you are copying the appropriate jar from the build directory
if anything else, just do a clean build
also probably make sure you hit save too
What am i missing? I built bukkit and applied the patches in CB... Has been a while
just curious are you using intelliJ?
yep
did you use the big green play button?
mh mh
I guess you'd have to cancel it and then apply a new effect
ohh why didn't I think of that, that should work
i don't find the button
@young knoll do you use IntelliJ?
nop
no idea :p
wonder where all the intelliJ people are at
I use intellij but with maven :P
Hi i use intellij gradle
wooo
someone could really use your help XD
I'm building a plugin with gradle, but when I build it it stays at an old version of the code and doesn't change the code inside the plugin. How can I fix this?
Run the clean task and make sure your updating the jar
It's the second time that i'm using gradle, how can I do it?
Right side of ur screen should be a gradle panel inside tasks and build should be clean
I don't use IntelliJ but you may have to refresh your caches
Forgot to add the decompiled folder from BuildTools
Mmm that helps as well
what do u use then?

There’s a few ways
I am not the one in need of the help 🙂
u must get along with geol then
i hate discord pings
Well we must have you switch to the superior IDE of course
never, netbeans has not done me wrong XD
Im forced to use IJU atm
Good
Are you fr
yep
i mean i doubt hes imaginary
Doesn’t md5 also use netbeans?
yes
Anyone know if the Actions Field in the PlayerInfoPacket change? When I tried to set it like I used to in previous versions, I get a Index out of bounds for length. Im on version 1.20.2, and I know how you remove the player changed, so im wondering if adding the player changed too. (This is using protocolLib btw)
I did but it's still the same
hm. gl with nms lol
yo what is uuuuuuuuupppppppppppppppppppppppppppppppooooopoopppppppopopppppppppp
huh i have a VCS issue lol
does anyone know how IJ differentiates between the name of a commit and it's explanation? there only seems to be one text field
Visual Code Studio
is the re visual studo code built into intellij
is that a theme
what did you do yesterday
well the explanation should be the commit message
Should be more than one
Well
i dont see it
i want to know where the commit's title is if thats the description or, where the commit's description is if that'S the title
like
github desktop for example
it's just a commit message
GitHub will word split at some character count
but that's just gh, not a git thing
i have the problem that the users of my plugin need to remove the old config.yml in order to get the new config.yml if they for example get a newer .jar of my plugin. There are methods to add variables that are missing but how do I add the comments? Maybe I am creating the config file wrong with saveDefaultConfig()?
alternatively you can use newlines too
Pretty sure you can set the comments for an entry
setComments(String path, List<String> comments)
setInlineComments(String path, List<String> comments)
declaration: package: org.bukkit.configuration.file, class: YamlConfigurationOptions
hey
regardless of which enchanted apple i eat (golden apple or enchanted golden apple) the amplifier is always 1. how can i detect the ..level of it?
enchanted golden apple log
1 is the amplifier
how to get the level of it
Well yeah amplifier is basically the level
is it
It should be
Amplifier is by how much you amplify it
Afaik there's some nuance to it, like it might return 0 when the level is 1, or something else related to off-by-one errors
Just play around with it
👀
The naming is a bit ambigious. It makes sense for amplifier to return 0, because amplifier is technically the amount by which you amplify the level (if level is 1, then the amplifier is 0, because 1 + 0 = 1)
goes from 0 -> ...
I used to run into a lot of off-by-one errors with it
me too
Guess that's why
Enchant levels for example are not 0 indexed
If they had named them amplifiers, they'd probably have been 0 indexed
? XD
effect clear @a doesnt help
suiciding doesnt help
how to get rid of these effects?
bug? XD
does relogging help
No
Im trying a server restart now
didnt work
im eternally cursed with resistance and fire resistance
Just, clear those or drink some milk
effect clear @a doesnt help
suiciding doesnt help
drink milk sir
sounds like a client bug to me
That means you have to have something constantly giving you those effects
Do you listen to the potion change event?
Or your client is really fucked
Because if they were client side relogging would have fixed it
Do you listen to the PotionEffectChangeEvent or have a scheduled task?
I only listen to EntityPotionEffectEvent
Code pls
I wish I could I changed some things since then but that's basically it what I have right now
You are cancelling the event
Well. Always cancelling means you never lose them
That also cancels effects expiring
also by default, what are the values of absorption? in these two fields?
I'm fairly new to Spigot but the programmer in me does not enjoy this, like this is only 10 commands is there no better way?
```@Override
public void onEnable() {
// Plugin startup logic
//Commands
this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
this.getCommand("ExampleCommand").setExecutor(new AbilityCommand());
}```
You could create a Map<String, Supplier<CommandExecutor>> to loop through
Or you could just use a framework like ACF/Cloud
I would suggest you looking at one of the many command frameworks.
Hmm that is true
I see
Okay I'll look into the frameworks thank you all
Ok I dont understand. When I eat the golden apple, it works - no potion effect is removed, but when I eat the enchanted one, it doesn't remove the effect and it doesn't set it to absorption 1, it stays at default..?
Add some debug lines
Also I doubt the removePotionEffect in that event works
Since the event is called before the effect is applied to the player
So do I do some runTaskLater or use other event?
Just cancel the event
okok
But only when you actually need to
for some reason I can't get this to work and yet when i eat the enchanted golden apple, it outputs the effect and the amplifier to the console.. exactly the same as my if statement
I'm not cancelling the event anywhere
thats only for the header
some consider it as part of comments
should have put equals when comparing objects
yeah I am you are right
But i means comment in the files
not on top or on the bottom
I sent the 2 methods for that
.
Hello all. Im setting upp a whaterfall/spigot network and want to make a portal to move between my lobby word and other servers on my network (and back again to the lobby world). I have tried to google this some time now but I only get instructions on how to use citizens for that. I want an old fashion portal for this. Do I need a plugin for that?
Yes
@young knoll Ah. I see... Can you point me to a good tutorlial on what and how?
@young knoll Thank you so much!
why am I getting CancelledPacketHandleException?
whenever the player leaves
I really don
't know what's causing it
Hello, I have a questio, can you create craft on we plugin ?
as in quits?
can we create a custom craft with our plugin
its depends how the quit happens
Yes a plugin can create crafting recipes
by a kick
if you don't exit the normal way, it won't send the packet, so you just get an exception and that is how you also know the player left 🙂
its normal
how ^^ ?
Bukkit.addRecipe
thanks
when does this exception occur?
you obviously need to cancel your tasks
which ones?
whatever tasks AlixSystem is generating lol
what I meant is
what exactly does this error mean?
trying to send a packet to a player that's offline?
it means you sent a packet from not the main thread
need to sync back for some things
like, player quiting for example
but packets have external netty threads
so why would sending them asynchronously be a problem?
they still at some point have to sync back to main thread, they are not autonomous
so wait
what exactly is the problem?
Sending async packets is fine as long as he doesn't quit?
the problem is the main thread sees the player left, the thread where the packet is being sent from doesn't see this and tries to send a packet to a connection that doesn't exist anymore
can I just check for Channel#isClosed?
possibly
but as I said, at some point you have to come back to main thread to check things
how to get player maximum food level
is it constant? is it possible to change it? like health
Ok VERyniceE
for development is it better to use the latest version?
Okay thank you 🙂
what? I thought you are supposed to use the oldest
but then you can't complain about not having certain features though
Nah, I'm making a plugin and I was wondering if it's better to use the latest version
it really depends
typically you should keep your dependencies updated whenever possible
ofc but if I'm selling the plugin it should support most versions right?
You can sell a plugin that supports only the latest version. Though you'll lose potential buyers
No it should support the latest versions you lose about 5% of the server base when you sont support legacy
you could support 1.13+ and upwards . its gonna be hard but support only the latest version is best for you .
1.7.10
Alright thank you
personal preference on this, but do note that the more versions you support the more maintaining you will have to do
I use 1.8 atm hahha
Not to mention more nms and reflection
if you want a good range, generally supporting the most recent 3 versions is typically sufficient
that will yield, on average over half the server population
I support back to 1.8 but I require Java 11+
well my older plugins do
newer (private) are always for current version only
If I am making a custom plugin, how can i let my client test it on their own server without them being able to steal it afterwards without paying?
I work through fiverr
Or alternatively you could just record you testing it how they want and forward them the video
you allow them to "test" it on your server.
yea, would also suggest just inviting them to a server you control
when they are happy they pay and you give them teh plugin
I assume player.openInventory(player.getEnderChest())
That's why I said "I assume"
That's all I could find
Not sure about the details
?tas
yeah
Nice!
who knows how to block the worldguard event with your own event (when breaking a block, it is necessary that, despite the cancel, it can break a certain block)
you'd have to check what event priority level world guard uses, but I'd assume you can do some hacky shit by setting your event priority to lower than theirs
Godzilla tried to decipher this message and died
you can be a real naughty boy and do changes on EventPriority Monitor
No^
in worldguard?))
Oooo
Do not ever
or just uninstall world guard if you're going to ignore it
If you want to bypass WG protection and break a block just do it yourself 1 tick later in your own code so you have no event
that's probably the simplest solution
if so, how do dev create custom flags if worldguard blocks any events?
I'm confused what you want to do
why use world guard if you're going to ignore it?
if you want to ignore it, why not just do what ElgarL said
I want to make it so that you can place a certain block in a certain region, but so that in this region an ordinary player can only break his placed block
so this mean need block protect region flag
Then manage all your own placement/break when in that region
Does someone know why I'm getting this error: https://hastebin.com/share/licovebeza.ruby
Version 1.20.1
And I'm using rmapped-mojang obfucations
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
Okay thx
hello how can i put maybe with discordsrv a channel that gets being updated with the amount of players that are connected somthing like 8/24 players on
Which of the Jar files is now the right one to use then?
When I get a StructureSearchResult what is the Location relative to? Like is it a corner of the structure, the center or something else.
It's the same one you get with /locate afaik
Which i think is just whatever part of the structure it hits first?
hm. Still trying to figure out a good way to find a structure in a chunk to check if a player is inside its BB without having to use NMS or record all this information during world gen. (Since then I can only find them generated after my plugin is installed)
Hey now I'm getting a new error when creating a Custom Mob
Error: https://hastebin.com/share/esocomonur.ruby
Code
public class Mice extends Silverfish {
public Mice(Location loc, Location point) {
super(EntityType.SILVERFISH, ((CraftWorld) Bukkit.getWorld("world")).getHandle());
this.setNoAi(true);
this.setPosRaw(loc.getX(), loc.getY(), loc.getZ());
this.goalSelector.addGoal(1, new MicePathfindingGoal(this, point.getX(), point.getY(), point.getZ()));
((CraftWorld) Bukkit.getWorld("world")).getHandle().addFreshEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM);
}
}
Spawn code:
new Mice(new Location(Bukkit.getWorld("world"), 9, -11, 526), new Location(Bukkit.getWorld("world"), -3, -11, 526));
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
With treasure chests it was the chest's actual location
I really need to finish the APi for that :p
no clue about the others
Might just be where the structure is "spawned" so it might depend on each structure
unless someone at mojank has standards
I am starting to think about exploring reading the MCA files directly to discover existing structures on first run then just hook the structure gen event.
also there's no Y level in that findStructure thing
I have no clue how you managed to do it
but try recompiling your plugin
Okay
Dont add the entitiy to the world in its constructor.
Also dont tinker with the goals in your constructor. Overwrite the registerGoals method instead.
is it possible to make a custom potion effect with a custom picture ?
I don't think that'd be possible you could reskin something with a texture pack for example luck, but the icon's are within texture packs and can't add more afaik
while it is bad practice it still shouldn't crash the jvm
damn
Best you can do is override ones that aren’t used
Luck is actually the perfect one here
Im seeing something that could cause this com.rylinaux.plugman...
I mean this is how I learned it to do it
I'm also seeing paper
Delete plugman from your server and never use it.
And dont reload your server. The reload command is as error prone as Plugman.
I have learned to test my plugins on paper after my normal testing. Because something their versions of stuff acts in funny weird ways.
How should I add then entity then and register the goal?
Add the entity using the instance you create
Register the goals by override the method mentioned earlier
You register the goals by overwriting the registerGoals method and you add the entitiy
after it is fully constructed.
But more importantly: Plugman into the trash and dont touch the reload command.
Does anyone know how i fix this error in mcp?
When i am trying to launch it says: Unrecognized options: -Xincgc
oh no
incremental garbage collection. Isnt that really fking old?
Why are you using MCP
The client isnt, but it is for an older verison
Are you on eclipse or intellij?
I want to use intellij but i feel like if i use intellij i am getting some errors im not getting in eclipse, so therefor i am using eclipse
Alright then go into your run configurations and check in the arguments if you have this jvm flag enabled.
If so, remove it.
where should the jvm falg be?
I found something else as well
Wait i think i found the error, at arguments it says "-Xincgc -Xmx1024M -Xms1024M", what should i change it to if it isnt correct?
Just delete the -Xincgc flag
So i should start from the beginning again? becuase i cant edit it now
Why not?
Becuase you run a decompile.bat and there will be created a folder with minecraft server and client that you can use
Shouldnt it be something like -Xmx or what it is called that i replace with?
Those are already there
Why are you asking questions about MCP on the Discord for Spigot / Bungeecord stuff? Just asking.
If i use this: -Xmx1024M -Xms1024M
It says:
Error: could not find or load main class Start
Casued by: java.lang.ClassNotFOundExeption: Start
Idk where i should do it then, there isnt a mcp discord (i cant find one)
Well, then the jar is broken
Oh thanks, i will restart it and see if it works, thanks for the help
Not sure why your even using MCP, its very old and there are a lot better methods.
there are alternatives to mcp?
And if you just want to explore the source code there are many many options now.
does every plugin automatically get a folder like this?
Nope
no only when you want to create a file
so do i have to make one
Only if they create it or save the default config file
yeah you're gonna have to create it
should this work?
private void makeDataFolder() {
File file = new File(Main.main.getDataFolder() + "/TranslationsX");
if (!file.exists()) {
file.mkdir();
}
}
^
like that?
Since plugins are single threaded is there any advantage to using sql over sqlite?
You can run stuff on other threads
And you very much should regardless of which sql type you are using
Wouldn't multithreading break stuff? Iirc I had to use bukkitrunnables because other threads interfered with the main thread.
Using other threads is fine as long as you do it properly
But in case of multithreading, it could cause concurrent modifications for sqlite, so I should use sql?
It should be fine
Presumably the other threads would just block while the database is locked
isn't that in most db that it waits for one instruction before executing the next?
Concurrent reads should be fine
yesa
And I figured writes would just block
as it should
Nice
i wonder if the jdbc wrapper honours the defaults
wtf the github repo is gone?
github down as usual
Hi, ive searched everywhere how to customize the tablist with headers and footers and how to customize the name of the players.
Ive only found this for header and footer:
player.setPlayerListHeader("");
player.setPlayerListFooter("");
Both of them are in my player join event but they dont work. Any alternatives around?
Wdym they don’t work
Stackoverflow seems to be down too lol
Thread safety
first one is thread safe
Ahaha looks like a kotlin object
important esp if that singleton is accessed concurrently in multiple threads
Companion object 💪🏻
It’s pretty much the same thing
Does anyone have a source for making custom guis? I've seen it on some servers but I'm not sure what to look for.
Setting it in a holder class will just create the object the first time that class is done smth with explained simply
What type of guis
If you mean fancy textures
They either use items with custom model data
Or a custom font in the inventory name
Can I rotate a falling block that is a passenger on an armor stand?
wdym
Go for it
so that static class doesn't exist until it's used?
it isn't loaded
second one is too fwiw
man, just initialize it statically
the second one just uses JVM unique initialization lock for class loading
Fwiw?
For what it’s worth
for what its worth
myeaaa
not gonna do something I dont understand
Just do the second one 
nah
“Second one is too for what it’s worth”
enum singleton :>
Seems fine to me
heard of that but idk seems kinda dumb since enums have some restrictions
sorta the point of it
i think the second one is a bit nicer since u dont need to null check every time
this one is clearly better
yeah but
Both are correct, one just looks nicer, and less complex
githubs back
idk
no real reason for this
Yes it does
it does
ok well idk why it works
and the first one looks like you just had a stroke
or read some code on stack overflow and got scared
These type
First one has explicit thread safety
It's unnecessary
second one is fine too
Yeah
both can be used
on multi-thread environments
Fuck me nty
hi im tryna use opencsv in my bot but get this error, is there a way to fix this https://hastebin.com/share/isipitoqar.less
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Lol
Take Math.random() for example
That’s done with custom fonts in the inventory name
i just googled java singleton thread safe
Is there any resource or documentation for this?
no, but I'm serious
there's absolutely no reason
to do this abomination
Not really, maybe some YouTube videos
i found a reason
then it's bullshit
nope
Alright, I'll have a look. Thank you
man I don
't really care what you think
you wanna code like this I don't care, your choice
It's unnecessary
What reason
and looks like shit
even java itself shows it
not telling u
Then leave kindly thank you.
Just ignore him
^
ok
My girlfriend is also a secret
@young knoll Coll.. keeping ur relationship a secret from her friends and parents isn’t a healthy seceret
oo shi since when?
does any1 know
Look up shading
very helpful thank you
Ahahaha
can i get a bit more context
@young knoll look at this
Look it up in relation to gradle or maven
Whichever tool you use
am very confused
?
im using maven
Then yeah check out the maven shade plugin
like intellij plugin?
maven plugin
It’s for ur build tool
?shading
is that all?
Pretty much
so if i pasted that in it will work
Idk
relocate it to somewhere inside of your plugin package
huhh
Inside ur own package
like org.transl.translationsx ?
Ye
this
No
errr
Yeah
You want to move the dependency to inside your package
Not move your package to your package
how do i do that
Getting off explaining by saying I am a gradle user is nice
pattern is the the package pattern of the dependency
shadedPattern is the package pattern of the where the shaded dependency will be
include and exclude should be self explanatory
i dont hav ean include
Just ignore it then
You could have one if you want to but ^^
so like this?
oh
You need to move opencsv to your plugin package
Pattern = before
Shaded pattern = after yeees
can i remove <excludes>
Yes if you don't have anything to exclude
and this looks right?
Suure
am i able to use clean package install as maven cmd line
Yes
to make it clear what the dependency is I recommend org.transl.translationsx.shaded.opencsv
You can just tell it to put it there
do i use the -shaded jar
middle one
Yeah that's one large lib
Big boy
if this doesnt work i cry
It will probably break in a second cause the lib uses some dumb native code thst doesn’t like relocation
Is this a spigot plugin?
a discord bot
hello how can i put maybe with discordsrv a channel that gets being updated with the amount of players that are connected somthing like 8/24 players on
for the discord hackathon
Oh
use bungee
Don’t ask here unless u want to code
Oh well if it breaks try simply removing the relocation. Some libs use some stupid native code that doesn’t work with that
i get this now lol
oh if it's a discord bot you don't need to relocate
i did 5 hours ago, no answer, is why im asking here
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Well asking in the wrong place won't get you answers faster
huh
so then
wait huh
so then what do i do
Gotta add spme exclude stuff
yeah im using it as a bungeecord plugin?
how i said i did asked in help-server
Then keep relocation
im getting this error https://hastebin.com/share/bavudiwoje.less
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
so open csv is signed it looks like
anyone know what packets I need to change a players skin?
you should be able to strip the signature with a filter
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
Put that in shade config ^^
Have a look at the protocol
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
code : ```java
package pl.playgroundhc.survival.commands.tests;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import java.sql.*;
public class dbtest implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {
if (command.getName().equalsIgnoreCase("dbtest")){
String url = "jdbc:mysql:mysql.titanaxe.com:3306/srv272320";
String uname = "srv272320";
String pass = "pass";
Player p = (Player) commandSender;
try {
Connection connection = DriverManager.getConnection(url,uname,pass);
Statement statement = connection.createStatement();
statement.execute("INSERT INTO deathtable (uuid, deaths) VALUES (?, ?)" + p.getUniqueId() + 1);
connection.close();
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
return false;
}
}```
yes
and string concat in SQL Query 💀
Oofers
ok, but why it not work?
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
am i stupid (yes) or what am i missing, how can a list have something one line and then nothing the next?
YES THAT THEME
is that eclipse dark theme
yuh
Clearing and then adding it back again is a pointless operation
error: Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql:mysql.titanaxe.com:3306/srv272320
there you have it
?
you're also concating bs to the sql statement
how do u guys store data needed by plugin?
Depends on my needs tbh
i want to save how many times a player have used ability

Checkstyle, yeah