#help-development
1 messages ยท Page 2194 of 1
np
you could also listen to BlockPhysicsEvent and cancel it everytime
but if you can just use farmland, you should rather do that ๐
Oh wait, I didn't realise. I get this https://paste.md-5.net/idavebowos.cs.
It does not work btw lol :>
never heard of that, what is it?
Thanks i will try that! :D
how can i make a firework explode as soon as its summoned meta.setPower(0); wont work the firework still flys for about a second
hm then I also don't know. it looks like it's shading properly. are you sure you're using the "shaded" .jar and not the original one? if you have more than one .jar in the target folder, use the one with the largest file isze
but that doesn't allow to use cnsumers, does it?
Just implement it in a class that also implements the Listener (and delegate)
Yeah, I'm doing that. You did see the maven console error I sent above though?
and then check for it in the event executor
I didnt see any error, only a few warnings
Warnings, my bad
those shouldn't do anything bad though
hm but it's weird. ยดwhat class exactly is missing?
fun call
guys I need help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
here's help
so I made a protection enchant (diff from vanilla) but after a certain point it does not even add the defense
like it lets me add it on the armor
It is the java.lang.NoSuchMethodError: 'void org.apache.commons.io.FileUtils.copyToFile(java.io.InputStream, java.io.File)' that is the problem
oooh
I see
the problem is that you are shading apache commons twice for some reason
anyone can help pls?
and you are using a newer version than the shaded version
Ohhh...
you can try to relocate apache commons
interface EventExecutorListener<E Event> extends Listener,Consumer<E>{
static <E Event> void register(Plugin plugin, Class<E> eventType, EventExecutorListener<E> callback){
plugin.getServer().getPluginManager().registerEvent(eventType,callback,normal,(event,listener) -> callback.accept((E) event),plugin);
}
}
@vale ember
since IIRC spigot includes an old verison of it too
Or sth
Add this inside your maven shade plugin's <configuration>:
<relocations>
<relocation>
<pattern>de.jeff_media.jefflib</pattern>
<shadedPattern>com.jeff_media.stackresize.libraries.com.jeff_media.jefflib</shadedPattern>
</relocation>
</relocations>
and replace the pattern with the apache commons package and the shadedPattern witrh something inside your package
yeah like this
everything after that will only become worse lol
something inside your package is the package where I use the method or the main package for my project?
you can actually use anything you want
if your main class is called me.sniskus.someplugin.Main, then I'd use "me.sniskus.someplugin.libraries.commons" or sth
btw sniskus is a funny name lol
I do it like this most of the time
How can i cancel seeds automaticly being broken with BlockPhysicsEvent?
Because i want it to be grown on another block then farmland, but it breaks itself every time after a few seconds
I know, I've heard that before lol. I have no clue where it came from tho ๐ Also, this good? https://paste.md-5.net/jiyogicova.xml
Listen to BlockPhysicsEvent. Check if the block's getType is your plant. Check if the getChangedType is Material.AIR. if yes, cancel
Thank you so much! I will try that :D
looks good to me except that your formatting is cursed lol
I mean wtf ๐
do Ctrl+Alt+L pls ๐
I know lol, it looks fine in the IDE lol.
oh wait you're on exlipse
Yeah lol
weird lol
Mhm
yeah anyway that looks good to me
it's probably fucked on the paste site because you mixed tabs and spaces
That seems like a logical explanation yes. I usually tab stuff, but sometimes it gets wonky so I just move them with spaces :>
Also
Umm
Still
It does not work
๐
huh
does the error message now at least mention the "relocated" class name?
@EventHandler
public void blockPhysics(BlockPhysicsEvent e) {
if (e.getBlock().getType() == Material.CROPS) {
if (e.getChangedType() == Material.AIR) {
e.setCancelled(true);
}
}
if (e.getBlock().getType() == Material.POTATO) {
if (e.getChangedType() == Material.AIR) {
e.setCancelled(true);
}
}
}```
This is my code and it still drops the seeds
That is the stack trace
Material.CROPS? Isn't it Material.WHEAT?
thanks
I also use crops for the placing of the seed so it should works
print out the e.getBlock().getType() using System.out.println(...) and see if it actually gets called for your event
oh wait
are you using legacy materials?
did you set "api-version" in your plugin.yml?
I didnt set an api version because im on 1.12.2
Guys are there any free economy plugins for 1.18+? I'm currently using gringotts and it's spamming my console like hell
hm cancelling the event should work though
I've always just used EssentialsX
Idk if you missed it, I'm not trying to be annoying, but here is the stack trace I get: https://paste.md-5.net/kaceqogigi.cs. Also, ignore the plugin name lol, the client I am developing it for requested that name :>
mfnalex
change mvn:commons-io:commons-io:2.5
whats the dependency version thing
for commona
commons
I hope im doing this right
yeah I've seen that but I really have no idea, sorry
Oh, well you tried. Thank you so much!
bro have u seen this?
||๐||
can someone help me with finding an event for if a target is activated (shot)
what type of runnable would i use to run something every x seconds
@EventHandler
public void blockPhysics(BlockPhysicsEvent e) {
if (e.getBlock().getType() == Material.CROPS) {
e.setCancelled(true);
}
if (e.getBlock().getType() == Material.POTATO) {
e.setCancelled(true);
}
}```
I fixed it! Just removed the check for getChangedType
Thank you so much mfnalex for your help! :D
pls help
Oh no now it doesnt grow the seeds ๐
oh weird
normally the changed type should have been air
ProjectileHitEvent?
and then check if the hit block was a button @knotty gale
but you cant set the material to target block
Yep they now dont break anymore but they also dont grow haha
anyone doing anticheat developing thing idk?
oh yeah yo uhave to somehow check if the event is trying to "remove" the crop using the new block
as said, maybe just print out all the fields of the event to see what's going on
Yes im going to try that now
what exactly are you trying to do? all ive read from you was you wanted an event which fires when a target (in my eyes a button for example) is activated
u know what the target block is?
I wanna check if arrow hits that
compare the blocks or their locations
I dont get it
The seed does break with this
if (e.getBlock().getType() == Material.CROPS && e.getChangedType() == Material.AIR) {
e.setCancelled(true);
}```
But it doesnt break with this
```java
if (e.getBlock().getType() == Material.CROPS) {
e.setCancelled(true);
}
But then it also doesnt grow
Caused by: java.lang.NoSuchMethodError: 'void main.Callbacks.onInventoryCloseTransmuteSmithing
```im using my method for quite a while and idk what could cause that? happend during reloads
affected method:
public static void onInventoryCloseTransmuteSmithing(InventoryCloseEvent event)
{
if (event.getInventory().getType() == InventoryType.ANVIL)
{
if (event.getInventory().getItem(1) != null)
{
ItemWrapper item = new ItemWrapper(event.getInventory().getItem(1), null);
if (!item.getOriginalMaterial().equals(""))
{
item.getItemStack().setType(Material.valueOf(item.getOriginalMaterial().toUpperCase()));
event.getInventory().setItem(1, item.getItemStack());
}
}
}
}
any idea?
cause its like months ago i wrote that and it happend once within months
did i forget a null check?
?paste
when are you learning to use early returns
donโt name packages main
ok
?main and this
- UpperCamelCase class names
how do i cancel a bukkitscheduler .cancel() doesnt work it has an integer? and theres no method to get the id of the scheduler
i guess ill just trial and error the problem
You get the id when you schedule it
so i need to save the id?
Probably caused by you changing jar during reload
also how do i get the id
well that's complete bullshit imho
?scheduling
yes.. ive read that
or you just cancel it within the lambda
nothing wrong in naming the main class Main. It doesn't have any disadvantage
So you haven't read it
i have
so its not an actual oversight but rather my updating the plugin file while reloading?
scheduler.runTask(plugin, task -> {
if (true) {
task.cancel();
return;
}
// do your stuff
})```
That would be my guess. Though try recreating the issue after a full restart
its hard
cause the error did occur at 17:01:21
and ive issued the command /rl
at 17:01:22
sooo
Sounds like that was the cause then
That doesn't have to be the cause
Anyways just restart and you'll avoid random issues
well in this case ill just ignore the issue for now since it never happend on the live server in months
but if it happens again ill check deeper
I want to create a plugin whit a list in a custum .yml file of strings. I want that a admin can change the messages in the list by a command. I can read from the list that works fine. But now I want to write to it the tutorial that I was folowing stoped. I have tried get information form mulipel internet resourses but I can not get it working. I have tried to get it working: CustomConfig.get().getStringList("the name of the list").add(The word that must be added); Then I have tried to save it and reload it: Customconfig.save(); and customconfig.reload(); Does anywone know how to write to a yml file?
you have to re set it
I have library for custom configs, you could simply copy paste some stuff out of it
Use setStringList
well im used to calling the entry point main xD
and also, java itself is also using the main function as entry point by default
var a = getStingList(); a.add(); setStringlist(a)
exactly, there's nothing wrong in using it
the whole forums post ranting about how someone has the opinion that you'll go to hell if you name sth "Main" is upper bullshit at best imho
xD
same goes for how u set the scopes
int foo{
...
}
int foo
{
...
}
```all the same XD
Main is more an issue when you have 50 different Main classes
well, u dont call main
like 10 classes main
u call the main entry point main
not everything
Yeah but multiple plugins
Yeah still messier than just naming the main class to something else
This reminds me, I actually had a sort of use-case for block scopes, which I literally don't think I've ever felt compelled to use lol
actually no. by always naming the entry point main in every plugin ull always know where to start looking
Or, you know, your plugin's name
So it's unique. Not to mention that your plugin's class isn't actually the entry point
The server's Main class is
and its merely being loaded by a classloader and its events hooked into the servers callbacks
i know
no plugin needs more than one though?
am I missing sth?
how do i spawn a single particle this .spawnParticle(Particle.FIREWORKS_SPARK, as.getLocation(), 1); makes the particles fly around everywhere even though i didnt add an offset
CustomConfig.get().setStringList("nameOfList).add(VariableThatHasToBeAdded). When I try that he gives a error about setStringList?
in the end bukkits plugin programming has little to do with "normal" application programming
the plugins are more like dlls
than executables
xD
You're trying to call add on void. That won't work. setStringList has two params one being the path and the other being the String list
Add your thing to the list then set the list
are you talking about that calling sth Main will be bad if you provide an API?
because for this interfaces exist
how would i use Bukkit.broadcastmessage om >1 args
wym
how would i broadcast several args
Bukkit.broadcastMessage(Joiner.on(" ").join(args));
assuming args is a list or array
args is whatever /command a b is
yeah, that would do it
I understand that I must add the string to the list and than add the list to the file but I do not understand where I can call setStringList?
You can call it anywhere after you added your string to the list
Must it be a specific list or can it be a list that i have recently created?
It's the list you want in the config
So I can create a list. Add the things that I want in the config and than call the method addStringList(path, list) and than it wil work? If I typ the addStringList in the class that I am in working it turns red.
Bukkit.broadcastMessage(ChatColor.GOLD + "[" + ChatColor.RED + "BROADCAST" + ChatColor.GOLD + "] " + ChatColor.WHITE + Joiner.on(" ").join(args));
with joiner being smth from goodle>?
yep
ok
@EventHandler
public void blockPhysics(BlockPhysicsEvent e) {
if (e.getBlock().getType() == Material.CROPS) {
e.setCancelled(true);
}
if (e.getBlock().getType() == Material.POTATO) {
e.setCancelled(true);
}
}```
Now my seeds wont break itself on top of another block, but they also dont grow anymore, someone know how i can fix that?
Im on 1.12.2 btw thats why i use crops instead of wheat
Why is it you're cancelling physics, exactly?
Because i want my seeds to grow on top of another block, and with physics it breaks itself after a few seconds
vscode bruh
how can I create a clickable message that makes the player execute a command on click?
here is my code but it doesnt seem to work properly
it shows the message but when i click nothing happens
TextComponent text = new TextComponent("&7[&eClick here to show reports GUI&7]");
text.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("").create()));
text.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/playerReports"));
MinilofeReportsPlugin.sendPlayerMessage(player, text.getText());
public static void sendPlayerMessage(CommandSender sender, String message) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&8[&cMinilofeReports&8] &7" + message));
}
note: this plugin is in spigot 1.8.8
You're not sending the TextComponent
You're converting it back to a string removing all hover and click actions
Use player.spigot().sendMessage()
when i send the textcomponent it just send this
when I was learning spigot, I was learning on a server where it seemed the jar they used, had all of the NMS classes variables public instead of private, does anyone know how to replicate this?
Don't call toString on it
player.spigot().sendMessage(text)
okay
^^
olivo if you know lmao
You can do that with patches if you want
like this is the message i want to send + [clickable part]
You just combine multiple TextComponents
okeh
how do i stop ConsoleSrnder using commands which have player in them
not all the NMS classes are in the spigot repo though, should I just copy them from minecraft-server?
You get everything you need with BuildTools
buildtools didnt copy the entire class
so I am using an argument to set a global variable to a player using
if(Bukkit.getPlayer(args[0]) != null) {
``` but now how would I set the variable
when I control click them, it sends me to an uneditable minecraft-server repo that spigot shades
Oh and you will need your modified jar to be on the server for your plugin to work
Build Tools does in fact decompile the entire server
using something like ```java
(variabel) = (player)
Thatโs how patches are applied and then recompiled to the spigot jar
it didn't when I tried, ive got most of the packets missing
is there a way to fix it?
without deleting the entire thing
ConsoleSender*
If you want to make a patch that changes the accessibility of every NMS field, method, and class to public, itโs completely possible
do player = bukkit getplayer; if player != null
?learnjava lol
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
thx
honestly should just make the API patches you need and upstream that tho
yeah, but how do I resolve the issue of missing classes
should I just copy them from minecraft-server
You can check the sender and return if they aren't player
how
Use instanceof
TextComponent text = new TextComponent(ChatColor.translateAlternateColorCodes('&', "&7[&eClick here to show reports GUI&7]"));
text.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("").create()));
text.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/playerReports"));
player.spigot().sendMessage(new TextComponent(ChatColor.translateAlternateColorCodes('&', "&8[&cMinilofeReports&8] &c" + reported.getName() + " &7was reported by &e" + reporter.getName() + " &7for &a" + reportReason + " " ) + text));
sender instanceof ConsoleSender
Don't combine them like it's a string. Use add (I think it was called
im wondering how to fix this stupid thing?
these are the only packets that buildtools generated, the rest are accessed from the uncloneable minecraft-server jar, meaning I can't edit them https://gyazo.com/1f4875f6d318481845c8ba9e798dd3c1
if (sender instanceof ConsoleSender) {
return false;
}
this?
I mean you donโt even need to make a patch
that will tell if its the console who executes
You can literally copy the class content & change the visibility with the ASM library
probably easier than manually setting things to public
will it stop ut erroring it out
yes, but can I copy the missing NMS classes from minecraft-server to that package?
because i use playerentity
since buildtools didnt create them
?
I can write you a quick Java executable to public everything in a jar when I get home if you want
BaseComponent#addExtra
thank you
Accesstranformers from Forge and Accesswideners from Fabric. They are quite neat
how do i set t he default value of a database
its alright, I can do that, I just need to know its safe to copy/paste classes from minecraft-server into that jar and have them still work since buildtools didnt create them
I guess, lol? I donโt know BuildTools in larticular
alr
Ill try it first
try it, yeah
whats an easy packet to send lmao
out chat maybe?
So why do you need all fields to be public? @dense geyser
i tried to beat java but nah
I mean they're usually not public for a reason
I don't want to reflection them all
๐ no need for reflection
yeah, but stupid reasons usually
would this stop a n err
sender.sendMessage(ChatColor.RED + "Ea");
return true;
```
though really you should just improve the API instead
Not really
why cant i type
Visibility is in Java for a reason
maybe your keyboard is wasted
i hate enums from now on
get a new keyboard that's not drunk
yes
oh then I ca nunderstand the hate
do not abuse enums and then you will love them :3
doesnt work either cuz values() is null grr
yeah you are doing this "cycling dependency" thing again
that can't possibly work
would this throw an err https://paste.md-5.net/isuxovujiw.java
any way i can abuse that?
?paste
or maybe just storing a string instead of a gamemove and converting it when i actually need it
looks like it would work
lets go performance
okie
sure you could do that but I wonder why?!
i'll https://tryitands.ee
I'll send you an example of how it should be done
mye it works
Would error in a command block
Why donโt you just have a map of game mode to game mode of winFrom lol
f*ck command blocks
Just check if the sender is a player before casting
It's really that simple
Or a simple .winsFrom() method which uses a switch internally
made a util to get and set skull textures, I'm not accustomed working with reflection so i wanna know if it's good enf?
I mean itโs not the best but thatโs how itโs done
public enum RPS {
ROCK, PAPER, SCISSOR;
public boolean beats(RPS other) {
switch (this) {
case ROCK:
return other == SCISSOR;
case PAPER:
return other == ROCK;
case SCISSOR:
return other == PAPER;
}
throw new IllegalArgumentException();
}
}
from*
exactly that
run spigot locally
or paper
or whatever
I explained what you needed to do earlier
mmh thats something too but i just tried to avoid a switch ๐
So this
lets use java16 switch kekw
why you trying to avoid a switch?
there's no other way. in the moment you want to pass e.g. "PAPER" in the constructor for "SCISSOR", "PAPER" wasn't created yet
so PAPER would have to created while creating SCISSOR which won't work because SCISSOR will refer to ROCK and ROCK refers to PAPER again
or whatever
you know what I mean
can anyone help me test
why wont this work?
But Spigot Wets the Paper
i cant open mc it lags too much
paper creates scissors which creates rock which referers to paper?
because you cannot access an enum that wasn't fully initialized yet
yeah i know but you know realms im trying to get plugins in there but it needs to go in singleplayer first and from there i upload the world including the plugins
ah ok
ye.. x)
yeah paper wont be fully initialized
Head back to #help-server or my DMs and I'll help you.
https://paste.md-5.net/qutabafoxa.cs alex can u have a look at this?
i love those switches but rust is even better
what's wrong with that?
it works but i'm not used to using reflection normally
i'd call it "winsAgainst"
just wanna know if i did anything stupid
?paste
it looks fine to me. but if you're on 1.18 you could have simply used PlayerProfile instead of using GameProfiles and using reflectino
older v support D:
yeah then it's fine
https://paste.md-5.net/medeneqoju.java would anyone know why this does not work? im not that familliar with Adventure
tryna send a message looking like this "<color:#737373>Primary Point set to <color:#113aab>{location}</color></color>"
what isn't working? looks good to me
its just not sending it.
what method do you call to send it?
isnt it "bad" to get the field every time?
i saw ppl on forums said to cache the field
public static void tell(CommandSender sender, Component... messages) {
Audience audience = toAudience(sender);
for (Component message : messages) {
audience.sendMessage(message);
}
}
this one
yes that's actually not a good idea, you're right
that could be improved
hm that should work fine
let me check my message api's code
https://github.com/JEFF-Media-GbR/Oyster-Message/blob/9cb30f7ff01071cfc429fe6487da1644833ca1de/src/main/java/com/jeff_media/oyster/message/Message.java#L84 I also just use sendMessage(component) on the audience sender and it's working fine :/
what the heck then
What you have looks good, maybe fry MiniMessage.get() or whatever it is?
Add a debug and ensure thatโs being called
seems to work 
And also print out the component
do not fry the minimessage pls, minidigger would be upset
LOL
@young vine wonโt even know, he could be drinking right now
anyways I meant get() or whatever the default MiniMessage instance is
minidigger once told me I got issues because I sent a pic of me having 0.69โฐ BAC but in his bio he says that he himself is probably drunk right now, soooooooooo I guess he has issues too
not yet, getting dressed to leave the house rn tho ๐
the difference is that I drink with people when something is worth drinking for
like breathing
Ah really?
Forget all the time that people still use outdated versions for some reason
Is it always better to use the latest version?
why does this not work it makes 0 sense ArrayList<Particle> particles = new ArrayList<>(Arrays.asList(Particle.values())); if (!particles.contains("FIREWORKS_SPARK")) { Bukkit.broadcastMessage("why does this not work"); } its broadcasting why does this not work but FIREWORKS_SPARK is a particle
Unless you have a very solid reason: Yes
Because a Particle is not a String
And you are checking it a String is in a List of particles. Which is never the case.
Whenever I create a server in the latest version, my computer starts to burn...
Although the system is good
why not just streaming the values and checking for none match
but then if i do
if (!particles.contains(Particle.valueOf("FIREWORK")) {
Bukkit.broadcastMessage("particle doesnt exist");
}``` it gives me an internal error... why wouldnt it broadcast particle doesnt exist
you shouldnt use enumsets for spigot stuff
Why not juse do particles.contains(Particle.FIREWORK)
*Material
particle is configurable in config
IIRC md announced that "most" enums will soon be no longer enums
The rest wont be data driven in the forseeable future
oh god
ur trying to get an enum entry that does not exist
Oh really. I missed that.
hence the error
but not sure about which exactly he meant
yes but read the if statement
yea. but that will still throw an error
but why if it doesnt exist it should broadcast the messgae
because FIREWORK is not in the arraylist which is the particle enum
When I create a high version server, my computer gets very hot, does anyone have any advice?
ArrayList<Particle> particles = new ArrayList<>(Arrays.asList(Particle.values()));
if (!particles.contains(Particle.FIREWORKS_SPARK) {
Bukkit.broadcastMessage("particle does exist");
}
wont work it needs to be a string
pour some petrol inside your PC to cool it down
its configurable
Ok what are you trying to do anyways?
1.16.3 is 1_16_R2 right?
just check if a particle exists or not
yes
So you want to check if a specific String is mappable to a Particle?
is it safe to create and modify itemstacks async?
and maybe even create an inventory and populate it async?
it would work
fun toParticleOrElse(input: String, defaultParticle: Particle = Particle.FLAME): Particle {
return try {
Particle.valueOf(input)
} catch (exception: Exception) {
defaultParticle
}
}
Do something like this
why would you
"safe" depends on the usecase
return try aaa
but there is no reason to create itemstacks async
wait kotlin
neither inventories
i think it works in java too
uh alright ill try it ty
Which Spigot Version Are You Guys Using?
latest
1.17.1 ๐ฅบ
I mean ik kt you can also
fun toParticleOrElse(input: String, defaultParticle: Particle = Particle.FLAME): Particle {
return runCatching { Particle.valueOf(input) }.getOrElse { defaultParticle }
}
Then I should use too
if you can you should always use latest
isnt it true that older versions always consume more memory?

server jar then i mean
latest. and I support 1.16+
or you guys were talking about api version?
more like the opposite
in general, newer versions tend to consumer more memory as chunks grew etc
which makes sense because they also have more features
But like to said When I try to use 1.16+ version my laptop getting hotter.
wait i do create itemstacks async in my plugin where i store inventories as a byte[] converted to base 64
and it works
I already told you to pour a liter of petrol into your computer to fix this
In general newer versions consume more meory if you dont know how to properly utilize them.
But if performance is such a huge concern to you then you can also just write your own server with Minestom. Thousands of concurrent players if you want to,
Yeah I saw it but Can't I fix it without that
๐
well obviously new versions are heavier. since they have more features, larger chunks (e.g. 1.17 adding Y below 0) etc
i dont need the features as im just testing stuff so im staying at this version x)
thanks guys I will try somethng
this works in kotlin?
why is try catch an expression but not variable assignment
thats the one thing i prefer java over kotlin for
Hello!
Looking at the compilation and build of Spigot core, I began to question the need for mappings from Spigot, because Mojang already provide them themselves. After checking the Spigot mappings and Mojang mappings I noticed that the Spigot elements are mostly just renamed, but what prevents you from using the Mojang names, why do you need your own mappings?
a variable assignment is a statement
BT?
?bt
omg
I also wondered about this
you can do this in java
but not kotlin
kotlin is just a big pile of shit, pretending to better than java while it actually doesn't add anything useful
๐
reject kotlin switch to rust
the only thing that's useful in kotlin is the ? operator
And let
rust is just a big pile of shit pretending to be better than cpp while it actually doesn#t add anything useful 
rust is nullsafe brr
i mean theres definitely some use cases for kotlin
I had to deal with kotlin way too many times writing android apps and everytime I have to use it I want to kill myself
๐
I never understood the purpose for that
that's why i wrote my android apps in java
let variable = "sus"
And elvis aka :?
i personally wouldnt use kotlin for something such as making a server, but for something like modding where it doesnt need to be as strucutred its good for efficiently making features
yesss
thats just for println!({:?}, variable)
I'm thinking of removing this and refactoring the patches in the fork, as much as the license allows.
Waiting for the mapping to be provided at least for RC1 is already unbearable.
Is it worth doing?
that's just ugly. java is strictly typed for a reason ๐ฆ
I doubt it
let variable: &str = "sus"
Oh and safe cast is nice: as?
i seriously cant believe people use var and val in java
some people think that "less code" = "better code"
oh i didnt know about as?
its a weird kotlin thing
i love the rust enums
you see python is much better than java because you dont have to type as much stuff out
for things that java cant do
For example this saves me some lines of instance checking and casting
@EventHandler
fun onAdd(event: EntityAddToWorldEvent) {
(event.entity as? LivingEntity)?.let(mobLimitationListener::registerMobAppearance)
}
java can also do that, you just have to do it a bit differently ๐
Do you think it's worth sitting around waiting for the release?
extension functions in kotlin are neat
rust enums constants need to be constructed and they can have different numbers of params
oh yes, I love how the function is so funny. and that I have to check the end of the line to see what type the event is
does anyone have a "placeholder item" class, basically a class that can take in itemstacks with placeholder values in the name and lore and return an item with replaced placeholders?
Why dont you just use PlaceholderAPI for this?
enum Sus {
Sus,
VerySus(level: u32),
Broke(yes: bool),
}``` doesnt make any sense but ye
it's for an itemstack
let sus_level = Sus::VerySus(32)
Why dont you just use PlaceholderAPI for this ItemStack?
anyways lets stop talking bout rust
if you talk too much about rust, conclure will appear
I want something that actaully replaces the text of the itemstack, does placeholderapi do that?
nah imajin will
Sure. Then use it for an ItemStack. By either fetching outgoing packets or by replacing the text when the ItemStack is created.
oh my bad
conclure is a good boy
I always confuse them because they have the same color
๐
ah ok i thought there was a better way
okay so reminder to myself:
conclure is the dude who banned me
imajin is the dude who always mentions rust
adelemphii is the person who had birthday recently
optic fusion is the dude who kicks everyone not using english
Maybe there is. What ways did you think about?
cloning and modifying the stack every time feels hacky
well not hacky
but inefficeint
Istn forteen the guy who always mentions rust?
hm actually this was the first time I experienced it
i may have to do this a few hundred times in a tick, every time a player joins
For me its #3 now
Ok. Why?
They both mention rust quite a bit
to create inventories for their menu
guys pls help me with database
?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!
i'd rather create the inventories once than create it every time it's opened since it may be opened alot by every player
my screen is soo small that it looks like spamming when i do the ?ask
well 13 inch but still
how do i make a database and connect to it from my spigot plugin
?db
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
just google it bro
You dont make a database. First of all: Did you work a lot with Files so far?
you cant be serious....
no
stop ninja'ing me ๐ฅท
if u want to create a database in your plugin use sqlite otherwise require people to use mysql or smth
Ok. Next question: What is the reason you want to use a Database instead of saving data in Files?
cuz yml files are shit for storing data
ye
you have people being touchy and trying to edit it
i do not think files are good for storing data for huge servers
or am i wrong
that getConnection methods looks like its supposed to stay opened
not using hikari :c
if u want to target huge servers use mysql
to support multiple servers o na networkl
sqlite connection can stay open
oh i use h2
this is going to be a plugin for only my use on one server
It didn't fixed .-.
If you are writing a plugin for huge servers then you should know which database to
use and why.
Dont touch databases if you didnt tinker with easier ways of persisting data first.
I would highly recommend you to use Files to store your data for now. Working
with databases can lead to very frustrating issues,.
your plugin is fundamentally flawed
:/
any explenation about which databases to use? aaaaa
i just thought h2 and mysql would succeed
Currently i only use two DBs: Postgres for SQL and MongoDB for noSQL
It work fine with purpur
mwoa fine
I still can't get over the fact that they called it Mongo, a german insulting word for disabled people
like why in hell would they name it like that lmao
ok. but what will i do if i need to convert to database in the future after working with files? and also not having anyone lose their data
I wanted to implement rope like swinging but for players, where's a good starting place?
same in dutch lol
I refuse to use MongoDB until they choose a different name lol
then write some code to migrate it
MonkeDB
ohh that simple?
๐
lmfao
what
you didnt even put this in your plugin
Write an application for migration
ok thank you
?
i thought this was valid java?
you are missing exception throwing iirc
its tellin that close is undefined for type Object
wut
understanding physics
well yeah apart that
in the Scanner class its just public void close() {}
writing some code to implement those physics
bruh
๐
vscode weird
Is that not a good starting place? You need to be more concrete-
Should be this.close() then
wont that just clal the same method
Scanner.this.close();
guys/gals pls vote: https://www.spigotmc.org/threads/api-announcements.559191/#post-4421752
Only works in a static context. Otherwise its ambiguous. Use Scanner.this.close()
Scanner is final
lmao shit
scanners are final, scammers are idiots
do you actually
do I actually what?
lol that would be a pretty close minded decision XD. Its prob. a joke.
do you actually not use Mongo because of the name
refuse to use it until they change name
no I never used it because I never needed it
Bukkit.getScheduler().scheduleSyncRepeatingTask(Game.instance(), () -> {
resolve(player.getLocation(), block.getLocation(), 6);
}, 0, 1)
void resolveStick(Location a, Location b, double maxLength) {
Vector vector = b.toVector().subtract(a.toVector());
double length = vector.length();
if(length > maxLength) {
vector.normalize();
vector.multiply(maxLength);
b.setX(a.getX() + vector.getX());
b.setY(a.getY() + vector.getY());
b.setZ(a.getZ() + vector.getZ());
}
}
ok good
thought we were going to have a problem here
still they should choose a different name
Mongo has like really bad Java support
at least the API is weird to me
like tf is BSON?
Binary Json. The actual format the DB stores its data in.
disgusting
And the Java support is pretty good.
I mean I also wouldn't create an open source project called NiggerDB so why is MongoDB fine? makes no sense to me. the people who made it probably didnt know that is has an insulting meaning in many languages
Supposed to
do you have a public repo that you use it
They have an exclusive java API
I've only seen it on old tutorial wikis
that's so besides the point though, many words mean insulting things in other languages
Only non disclosable ones.
appereantly
like negro in Spanish is an insult in Italian
its closed after the while lol
well tbh I can't think of any others though. MySQL is not a bad word any language. Neither is YAML or JSON or anything else I can think of
many words, not database/storage engine names lol
lets just use dat files
let's save everything in NBT
.bin#
๐
RIP mongodb doesn't even allow people to open issues on github
issue: rename the damn thing to monkedb lol
you can only send pull requests but no issues
yeah that's what I wanted to do lol
๐
if they don't allow people to create issues, they don't deserve any collaboration from the community anyway
so yeah fuck mongodb
I know but it makes no sense
there are no "steps to reproduce" in my case
and "Affects Version" is every version
and it's also not a bug
that name will always remind me of monke now
even urban dictionary knows that it's an insult so the argument "we cannot take every language into account" isn't even valid
mongolian database
There should be Craft Bukkit? or I should use spigot
spigot
okkay
craftbukkit should (almost) never be used by anyone
i always forget to specify the --rev and then i have to do the whole thing again aa
the only reason to ever run craftbukkit is to check whether a bugs exists in spigot but not in craftbukkit
why would you need --rev ? just build the latest
nobody should run craftbukkit over spigot
any idea how to implement uhc spawning platforms
when you report a bug on spigot's jira, you also have to specify whether this bug occurs when using craftbukkit
list of lcoations
Who creates craftbukkit?
the person who ran buildtools
oh, I did read that backwards ;P
Spigot is maintaining CraftBukkit
mb
Hm but someone makes org.bukkit.craftbukkit
Ohh ok
So if spigot maintains craftbukkit why is craftbukkit standalone still a thing?
Implementation of bukkit
the implementation of the bukkit api
craftspigot kekw
What do you think Guys How Many Gb Should I set for my server
6 thousand
Mine runs with 512mb lol
alex
download more ram ๐
lmao
depends on the version
1.17.1
do you know how can i clear the java console
I used to run 256MB 1.8 servers lol
I have 16 gb and still allocate 512mb
1GB?
if you do player.getLocation().setY() it should change the player Yright?
okay
lol how many players did you have? -3?
don't say anything about 1.8 or some people will spam death threats
only If it's for a local testing environment
1.8 is really lightweight
4
No. getLocation is a copy of the actual location
then why does it sometimes work
i'd always give every MC server at least like 4 GB
I am confus
It never will
anyways
I had to manage between Browser, IDE, Minecraft Client and Server
5 ver kanks
Use player.teleoort
entity.setLocation(entity.getLocation().add(0, 1, 0))
And very old. Ancient.
รงok deฤil mi
yeah but doesn't this cause a bit of jitter when rotating
Ik but it's also really light to run
jitter?
ne sunucusu
like the server warping back your camera due to latency
yeah it's almost old enough to buy alcohol in my country
No real reason to use 1.8 unless you are kid that likes to mutilate its left mouse button by clicking real fast
can someone pin that
say you rotate left by 90deg if the server has been constantly tp'ing you without changing your rot, it does not look as smooth does it?
knk iลte yazdฤฑฤฤฑm kodlarฤฑ denemek iรงin 1.17.1 versiyon test amaรงlฤฑ sunucu
uhh idk
ping conclure lol
nah
So is Minestom. Which supports 1.18 clients and can hold several hundred percent more concurrent users than 1.8
playin valorant
I do it for the right button whenever I play 1.8, I rely on just yeeting ppl off lmfao, no pvp

This is an English only server
no turkish here pls
Minestom is awesome tbh i played around with it for a while and it's fun but it's not comppete yet
or you want a VERY lightweight version to run multiple servers
I'd imagin in the next 2 years what minestom can do will be amazing tho
You can give 3
sorry guys โค๏ธ
If you want lightweight go Minestom
Yeah it needs a bit more time to mature. But ive done some really cool things with it. And i love to se 0.01ms tick times ๐
thanks
i will probably take a look at minestom when my exames are finished
learning somethin new
I graduated 3 days ago
what are you studying
Problem with Minestom is: You need to write absolutely everything on your own and the eco system is still young
Until somebody implements a good server engine in Golang. :sip:
gz
accountancy / informatics stuff
buts its last year highschool lol im going to do software development next year
Minestom was initially written in Go because of the coroutines. They scrapped that after some months.
There's the vanilla reimplementation
:sadge:
I wouldnt want to write addons in Go to be honest...
Same
Writing minecraft related stuff in a language other than java is possibly a mistake.
yes
But It would be delightful to modify a golang server and adapt it to your needs
at least for me :P
Have you seen the Bedrock edition server written in php
PocketMine?
Yeah that's it
php. ew.
Forgot the name
Isn't php a web dev language?
The devs of this probably
Yes. And its not even good at what its supposed to do.
it's mostly a backend oriented programming language
afaik
^^
like, I rather just use node or go tbh
god no
Using JavaScript in the backend should be punishable by law. I have not seen a single
non-tiny project that didnt evolve into an absolute mess.
What do you recommend?
Everything else
go is pretty epic
rust kekw
yeah, but I'd get beaten if I use golang as some people don't even know how to code in it, let alone code properly.
But golang is so easy to pick up
using java would be like being a masochist idk
auto click
is there a way to change the material of an item without messing with its meta?
jesus my discord is laggy
and I don't know why people is afraid of it
how to clear the java console, everything the system and i texted
random tag
you don't even need to mess with it's meta tf?
isnt there a setType(Material) method
bruh why would you want to clear the console
in ItemStack1
accidentally
ah cool
cant i
Java Robot
In all honesty: Im a fan of the classic Java backend (SpringBoot, Micronaut or Quarkus)
Python has something going for it with Flask or Django (Would only use for small to medium projects)
C++ is an option if you write code in the embedded eco system.
Ruby is a bit outdated but has its benefits.
But for enterprise or bigger applications i will always push for JVM languages like Java/Kotlin
no i want to clear it for second
i heard somewhere that System.out.flush() clears the console
idk if that works with mc tho
they probably prevent you from doing that
if you have linux terminal just ctrl L lol
Shouldnt this just push every data from the stream to the terminal?
iirc there's a special unix character for it
only works on unix tho
yeah i was confused too im skeptical that it works but idk it might lol
any idea how to use BlockPopulator?
I wish someday Java gets deprecated and replaced with Kotlin
There's a Unix character that clears console and it's lightning fast
yeah nvm im pretty sure that wont work
what that char is
is there something as an Enum#get(index)?
You can use this to preserve the previous character
System.out.println("\b");
/b or \b
I do not remember
Enun#values()[index]
prob \b because then it special char
owh right
In 100 years maybe. Kotlin is still too young to replace Java. Its just not standardised enough.
Java has enterprise specifications and standards like Jakarta EE. Kotlin is still too hipster for the big world.
java will not die just because kotlin now exists
I'm fine only with happening one day :')
is that right?
\033c
what are you trying to do?
well?
Jedis is the worst redis java API i know.
a simple test of subscriber
why
then ig, idk https://tryitands.ee/ ?
i was asking if that is recommended
What's a good one then?
I wanna try working with redis to have my plugins works better multiserver
The API design is quirky and it lacks a ton of features that other APIs have.
Redisson > Lettuce >> Jedis
LMAO
heh
can someone halp me setup jeff media updae checker
Interesting, I use Jedis. I had to manage and create some alternatives for the data structures some libraries like redisson already provide
its in the wiki
stop pinging people
ooh is it
its not even his plugin
did you read this wiki
ask mfnalex if you really need
oh isn't it
yeah did you even take a look at it
a quick glance will tell you that he provided all the setup information
it won't however tell you WHAT TO IMPORT
if you don't know how to even copy paste code then idk you probably should learn a bit of coding
erm
yeah you should probably
Is there any way to put an uodate checker for v1 of my plugin?
๐
after adding in pom.xml it adds errs to that and makes the build fail
In this article, you'll learn about packages and how to use them to create modular code in Java.
maven you mean
Learn some Java tbh
what IDE are you using
intellij
is your project a maven project
did you add the repo and the dependency to your pom
yessir
whats not working then?
reloaded changes?
What's the maven error
ctrl shift O or navigate to the maven tab
how does one reload
1 step ahead