#help-development
1 messages · Page 1673 of 1
its a normal plugin.
Wich is working but they can expand features on there own if they use the Abstract Class. Compile it and put the .jar into the config folder
Yes but the it seems like cfgn.getMaterialsConfig() returns null
Material.valueOf?
uh okey
didn't read it correctly sorry
oh btw it didn't write in the config file, 1 sec lemme get the code for that
Like Spigot handles the normal plugin 😄
Abstract Class onEnable gets called and youre good to go 😄
And the class you use it in
?paste
You know what i mean ? 😄
it's not possible to make a /evaluate command, right? I mean that is it possible to get the args from /evaluate and use it like /evaluate Sout("smth"); (too lazy to write sout btw) and smth will get printed basically get the args and execute it as code i don't think it's possible because you need to import but is there a way to automatically import? Maybe looking through the spigot api and importing the class that's getting mentioned
idk
spam sheeesh
Just had an extra bracket. Sorry to have you explain scope.
No it’s fine
I was so confused for a minute because I knew it wasn't supposed to be there so I tried to find out why it was there
then it made like 20 errors when i removed it, but then just saved the program after removing it and poof 0 errors
Is there a way to check if a sound is allready playing? (1.12.2)
I looked into the docs, but i can only find things like playSound() and stopSound()
how can i modify this message? I've seen a couple of servers do this
en_us.json
Hey there guys; this Predicate doesn't seem to be working as I'm still catching myself with the rayTrace. Any help?
final Predicate<Entity> filter = (hit) -> !hit.equals(p);
How does Spigot load all plugins and start them ?
Spigot loops through all jars in the plugins folder, it then loads them with a urlclassloader derivative which is also known as the plugin class loader that loads something like the plugin loader which then reflectively instantiates your main class and then gets that instance and call the instance methods on it accordingly iirc.
i guess this is something
wait
Its more than this...
Its complicated 😂
that was a good explanation thank you
but still
there is no adventage of using player objects
but there are adventages of using uuids
not really huge ones
but uuids win imo
when they go offline u cant access them
you are calling an equals function. Presumably no new memory is allocated for this
love UUIDs
exception is offlineplayer
you could even just do an instance comparison
why all that just to not use uuids
plus uuids look more clean idk
maybe its becuz im used to using them
legit
But now the question im initially here 😂
Extra Folder.
People use my Abstract Class to create there own class.
i read the jar and execute the methods
UUIDs are superiour
if you want to optimize this, using uuids is not the way
how can i tell what end gateway a player walks through?
as player instances are shared you can just compare their instances
What’s the question?
UUID is good if you want to keep data even after the player is offline
it is not. comparing a uuid here is more line of code written for little to know benefit
Like maybe fetch data on APPLE, then you simply can’t put the player as a key because it isn’t loaded yet
However Player works very fine
How can i read in a .jar file and use a class which inherits my abstract class and execute it
you do realize that post is about storing data
Uh well you need a ClassLoader
well yeah
but there are related stuff, at least in my end
Both do the thing you want to do
sure, that still does not mean uuids are the best for every job. E.g. in this case regarding a ray trace predicate, they most certainly aren't
I will have a look into... EcoEnchants HUGGEEE 😂
🤷 you know more than me so im taking your words
anyone know why this isn't setting anything?
getMaterialsConfig().set("announceAdvancementsMaterialEnabledConfig", "LIME_STAINED_GLASS_PANE");
here's the whole class:
https://paste.md-5.net/bupohiregu.cpp
Hmm yeah it’s of decent size
Maybe take a look at spring some day and you’ll understand (:
worst part hex xD the dude isn't even here anymore lol
i just understood it by reading the code from PlaceHolderAPI
That’s good
Wouldn’t be of your favor if both my examples are too complicated for you
Hopefully i can use it 😂 hard one but i i think im able to...
true 😄
Sure, good luck
yeah lol
Thanks ^^
Otherwise im reading in a .java file and run a runtime compiler at it 😂
:/
anyone?
lol do u have getConfig.save()
public void saveMaterialsConfig() {
try {
materials.save(materialsFile);
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', "&aSUCCESS &8» &7Config file &bmaterials.yml &7has been saved!"));
} catch(IOException e) {
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', "&cERROR &8» &7Could not save config file &bmaterials.yml&7!"));
}
}```
HMM
villager_huh.mp3
I'm revising the land protection logic for one of the plugins I'm working on and I just found that I don't have a blanket statement blocking PlayerInteractEvent for players that don't have permission to build in protected land. Can anyone think of any reason I shouldn't just make a blanket logic for that event and cancel it outright?
doesnt that include eating etc.
might be unwise cancelling all without checking the actual action
otherwise players cannot feed themselves
how can i take a custom item from another class
it always takes ItemStack constructor i dont know what to type as parameter type
Is there documentation to everything that falls under PlayerInteractEvent? I'm looking here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html
declaration: package: org.bukkit.event.player, class: PlayerInteractEvent
^ lol
Represents an event that is called when a player interacts with an object or air, potentially fired once for each hand.
literally, anything involving a left or a right click
and a a middle click maybe
and also maybe pressure plates etc.
Hm gotcha
So you think a blacklist of actions involving this event would be better than whitelisting actions?
Looks like projectiles can't be fired either. Such a hard functional decision.
i still need help btw
package Items;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Item;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
public class HandCluffs {
private ItemStack kelepce;
public ItemStack getKelepce() {
return kelepce;
}
public void setKelepce(ItemStack kelepce) {
this.kelepce = kelepce;
}
public HandCluffs(ItemStack kelepce) {
}
public void handcluffs(){
ItemStack kelepce = new ItemStack(Material.TRIPWIRE);
ItemMeta meta_kelepce = kelepce.getItemMeta();
meta_kelepce.setDisplayName(ChatColor.GRAY + "Kelepçeler");
ArrayList<String> lore = new ArrayList<>();
lore.add(ChatColor.DARK_BLUE + "Polislere Özgüdür");
lore.add(ChatColor.DARK_BLUE + "Kişileri Kelepçeleyip Soymaya Yarayabilir.");
meta_kelepce.setLore(lore);
meta_kelepce.addEnchant(Enchantment.PROTECTION_FALL, 1, true);
kelepce.setItemMeta(meta_kelepce);
}
}
this is the class of custom item
?paste
why do peoply copy imports im wondering
public HandCluffs(ItemStack kelepce) {
}
``` what is the purpose of this empty constructor
cause too lazy to copy certain part and easier to do CTRL+A
what do i need to type
you need to type into google java tutorials
pls hulp
yea
ok, can you tell me why?
ok, please, go ahead
why
because
why would i get help from java tutorials when there is a help like here
this person gets it
what makes you think i have the time to explain to you, a noone why your code doesnt work?
your constructor shouldn't even work because you call getMaterialsConfig() before actually setting materials
so uh what do i do
Is it possible to make a fireball instant explode after summoning?
do you know what a guide is? is literally a person that said "oh man i feel bad for dumb people, im gonna make a tutorial so they can read and learn"
if i copy and paste the guide here
will you read it then?
not here to teach you java, you should understand what is meant by "constructor" if you want help
lucas do you know what being nice is
-i know
Yes everyone here knows
wait they both @lean gull and @kindred valley dont wanna read the docs?
this is pure gold
are you sure about dat
it is like somebody asking how to write an english novel when they do not understand english
You're coding java, without understanding java
how do i do strike through text?
if fact, people here is so nice, that they made a command so you dont have to waste time READING useless docs
?learnjava
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.
alright if you're not gonna help please just don't waste both our times talking
we're helping you
you're not. stop talking. shut
but what you want is spoonfeed, not help ^^
aha
yea i have a bunch of things to get done... anyways, do you know what a guide is?
!is this chat for help?
you should read one
lmao
xd
h u s h
lets change my name to read the docks
yes, this is the chat for help, but nobody can help you when you don't understand the language
ok just don't spoonfeed him anymore, he will get bored and go learn java eventually
what do you need to know
yes and then if you wont help dont chat anymore.
ah /nick went brr
nothing from you, h u s h
constructors
it is a fact of nobody will help you here
😳
im offering my help and dedication
no ur offering to troll, h u s h
are you still talking?
yes
what do you need help with
h u s h
if you don't want to spend the time learning the language yourself, then why should we help you
don't ask for help if you don't accept it
he literally offered help
i dont want help from you bro dont you get it really
i don't accept trolls, h u s h
are you really that dumb? you ask for help and when you get it you dont want it? isint this banneable?
i am having a little fun, yes :p
this
of course i get it, but you cant cherrypick help here because nobody is going to help you
alright, then your little opinions you can be quiet
(that is with saying "h u s h")
🤡
ironic coming from you
goodnight yall
gn
im the one that knows why your code doesnt work
good luck, you only make your own life harder by not following the advice we have already said
and i do not care, ***h u s h ***
you do
hush?
otherwise you wouldnt ask for help
lmao im the only one willing to help you
im quite literally
clearly not, h u s h
the only one
willing to spend more than 5 minutes with you
why? cuz i have an insane patience with people like you
not asking for spoonfeeding, asking for geninue help with no trolls
im offering
help
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.
you cant get well constructors by reading them
5 different reasons why you should hush:
1: hush
you should know it
thats 1 reason, maybe you should learn math before java
quik mafs
i think 2+2 is four bro
nah fam
constructors are a fundamental part of the java language, if you cant even be bothered to read into them then you will not be able to understand any of the help anyone can even remotely attempt to provide
can i make a command to make someone install my virus n get free vbucks
no :c
yea
type in the onEnable
new URL("https://tryitands.ee")
i forgor the url
sadge
while(true){bukkit.stop}
error
KEKA
i took course with constructors
i forgor the url
you sure?
and still just know the purpose of it
and the closing of the string
here let me google it
mayebee
yea bro look, google did its thing and told me the answer!
the constructor of a class is called when you create a new instance of it, and can have optional arguments required which you must give when creating a new instance of the class
yes i know this purpose
so i will ask you the same question again,
lmao you are just bored AF
go play outside
forget about math
java
what's outside
just go play outside
huh
dis aint my code?
so?
why dont you learn python? is literally the simplest language
xd
I would argue lua is easier but barely used
it makes a thing in a place, don't like it? try a different one in a different time ™️
bill wurtz

go to python and type
while(True):
print("I SUCK")
that's hella slow
rimshot
to call it from another class
and i did this.kelepce = kelepce;
you are still not answering
what exactly do you mean by 'call it from another class'
i will create object on another class by calling this constructor
heres an example i made for you, so you can understand
// Create a Main class
public class Main {
int x; // Create a class attribute
// Create a class constructor for the Main class
public Main() {
x = 5; // Set the initial value for the class attribute x
}
public static void main(String[] args) {
Main myObj = new Main(); // Create an object of class Main (This will call the constructor)
System.out.println(myObj.x); // Print the value of x
}
}
// Outputs 5```
right, but why are you requiring an ItemStack instance
bro i cant even imagine what your parents think of you
so can anybody help?
it must be so sad so see your kid beeing like you
they're nice people, unlike you
:p
do they work?
i dunno
or they also bed all day for money?
no bro like imagine you are just chilling and you see your kid refusing to learn when 6 people is telling him a decent way of learing
andd he's back
imma go make cool bow stuff
tell me when someone reasonable and helpful and nice comes
oh look if you block them
i guess elgar is somewhat nice
an idiot
?paste
ah
aka you
any ideas how to get feedback of a command executed as plugin?
a command executed as plugin?
example?
?paste
What do you mean by feedback? You can listen for the server executing a command.
and i pasted my code then
");```
constructor
nice
and
private ItemStack kelepce = new ItemStack(Material.TRIPWIRE);
ItemMeta meta_kelepce = kelepce.getItemMeta();
meta_kelepce.setDisplayName(ChatColor.GRAY + "Kelepçeler");
ArrayList<String> lore = new ArrayList<>();
lore.add(ChatColor.DARK_BLUE + "Polislere Özgüdür");
lore.add(ChatColor.DARK_BLUE + "Kişileri Kelepçeleyip Soymaya Yarayabilir.");
meta_kelepce.setLore(lore);
meta_kelepce.addEnchant(Enchantment.PROTECTION_FALL, 1, true);
kelepce.setItemMeta(meta_kelepce);
yes
????
i wanted to ask this part
You need to move all the getMaterialsConfig().set( into the try section and not the exception catch. Then delete the createNewFile() and just getMaterialsConfig().save()
Before you do getMaterialsConfig() create a new YamlConfiguration.
how do i make a block blast proof ?
how do i need to identify this part of code on class
do you understand the basic structure of java?
yes
no you dont
Depends. Do you want to make a specific material blast proof or a block at a specific location
or a block within a certain region (BoundingBox) etc
?learnjava
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.
i did it
can you see a difference between your code structure and
public class Hello
{
/* Author: www.w3schools.in
Date: 2018-04-28
Description:
Writes the words "Hello Java" on the screen */
public static void main(String[] args)
{
System.out.println("Hello Java");
}
}```
kelepce*
did you send the link?
to the ?paste
i saw it send for a second and it disappeared
material
dude what is this
Listen for the EntityExplodeEvent and BlockExplodeEvent and remove every block from the blocks list which
is of a certain type.
Java Program Structure - It is necessary to know the exact structure of the Java program, and this lesson has detailed description about it.
???
How can i get hit position in EntityDamageByEntityEvent
sorry, what?
???
i know the structure
what a blessing lmao
can you send your code again please
ty
wrong
XDD
how do i make a functuin that executes once every second ?
make a scheduler
you should declare your private variables outside of the constructor
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
and then assign them in the constructor
For one material:
@EventHandler
public void onExplode(final EntityExplodeEvent event) {
event.blockList().removeIf(block -> block.getType() == Material.STONE);
}
For multiple materials:
private static final EnumSet<Material> EXPLOSION_RESISTANT_MATS = EnumSet.of(
Material.STONE,
Material.GRASS_BLOCK,
Material.COBBLESTONE
);
@EventHandler
public void onExplode(final EntityExplodeEvent event) {
event.blockList().removeIf(block -> EXPLOSION_RESISTANT_MATS.contains(block.getType()));
}
Your current code will not add those entries to a config as they only get added with an exception
ohhh im dum dum
With a scheduler
alright thanks
?scheduling
bro..
what is this
What version are you on?
1.8
why did you close the {
[21:34:49 ERROR]: Error occurred while enabling Gamerules v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.file.FileConfiguration.set(String, Object)" because the return value of "ConfigManager.getPresetConfig()" is null
at ConfigManager.<init>(ConfigManager.java:53) ~[Gamerules.jar:?]
at Main.loadConfigManager(Main.java:20) ~[Gamerules.jar:?]
at Main.onEnable(Main.java:14) ~[Gamerules.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.17.1.jar:git-Paper-224]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.17.1.jar:git-Paper-224]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.17.1.jar:git-Paper-224]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:535) ~[patched_1.17.1.jar:git-Paper-224]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:449) ~[patched_1.17.1.jar:git-Paper-224]
at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:654) ~[patched_1.17.1.jar:git-Paper-224]
at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:306) ~[patched_1.17.1.jar:git-Paper-224]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1141) ~[patched_1.17.1.jar:git-Paper-224]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[patched_1.17.1.jar:git-Paper-224]```
event.getEntity().getLocation() ?
Then you cant. Unless you know a rly good ray marching algorithm.
what
why
the code is not like that
did you close it
Update
learn oop please
no all pvp servers are on 1.8
1.8 sucks
its not my code you nob
sorry guys
thank you
@lost matrix how are you not a discord mod yet
we cant stay here?
I am using a PlayerInteractEvent to prevent boats from being placed in land. I am tempted to use something like
if(e.getBlock().getType().toString().contains("BOAT"));```
However, is there any way I could use *instanceof* for a cleaner solution? It feels hacky to cast this to a string.
use public/private modifiers
initialize the item in a constructor
okay i think ill just rewrite it
ur setting the item equal to the item too
cant use modifiers in constructor
what version
Writing for MC 16.X
private static final ItemStack name;
public HandCuffs(){
this.name = ...;
}
ah
i forgot static
why static
I feel like I should be able to do something like event.getItem().getData() instanceof Boat, but I know that's wrong lol
^ i think thats what you want
idk what its meant to do though because i dont speak that language
door is deprecated tho u can try
cast it to blockdata i think
i mean
uh
event.getBlock().getBlockData() instanceof Door
Doesn't getData() return type of blockdata?
I forgot to replace my example, but I'm trying to do this with boats, not doors 🤦
ohh
Yeah that's where I'm stuck too, but casting that to a string at all makes it feel kind of hacky
try playerinteractentityevent
still need help btw
It tells you what's wrong. ConfigManager.getPresetConfig() is null.
How would I make a player glow client side? Do I have to manually mess with packets, or is there a method to add client side effects?
idk what's wrong with it
https://paste.md-5.net/isigufiyug.cpp
if u can tell me what's wrong with it pls tell me ok thanx
Ohh that's a good idea, lemme try that
how do i call one function after some time has passed ?
?scheduling
Anyone?
Oh God I don't have to use NMS do I
whats wrong with nms
It seems more like an unreliable hack than anything
its just tricky
NMS isnt an unreliable hack, its actually super reliable afaik
its just tricky to do stuff w/ if you dont know what ur doing
which is why i just dont use NMS
because i cba
Fair enough
declaration: package: org.bukkit.entity, interface: Entity
does this not work ?
I mean it it server wide
but if you need it for only specific clients, look at what the method does
Well, it's close! I have two teams (red and blue respectively) and I'm trying to make their teammates see their other teammates, but not the opposing team.
add each to a Team, set all invisible, then set a Team.Option
to see invisible team mates
Everyone should still be visible, but teammates should be glowing
use different scoreboards for each team
glowing isn't part of the scoreboard tho
but rather part of the entity shared flags
which would default players not on the scoreboard to a glowing colour of white
instead of no glow
You set teh team color not glow
but how does that solve "only my teammates glow for me"
soryr, you do use glow
that would leave the enemy glowing
they glow with the team color
if they have different scoreboards they shoudl only see glowing teams that are on their scoreboard.
Well, I'll give it a shot
I guess its possible the other team could simply glow white
.setGlowing(true);
as thats the default
the team (if the color is set), is the glow colour
for everyone xD
Yeah, my way won't work 😦
the packet way is also pain
as glowing is updated every time the player flags updates (which includes sprinting, sneaking, swimming etc)
so you would probably have to dive as deep as a packet listener
Great
Oh I'm not
I'm really grateful that y'all are helping lol
Is there a basic tutorial of how to mess with packet listeners? I'm still knew to plugin development in general (not programming though!) so I'm not really sure how to mess with stuff like this
https://www.spigotmc.org/resources/api-glowapi.19422/ there is this
might be able to help you
it seems to be able to also does what you want
Yea, but I don't want to add a whole library for a small feature
I'll save it for a last resort though
👍 good luck on the NMS deep dive. It is rather fun down there
Thanks lol. I'll need the good luck 😨
I think this problem can be solved with a simple packet listener and a Predicate<Player>
No need for nms
Hm
Yes should be possible,
well "not add a whole library" kind of murders "simple packet listener" heh
Oh. F then
and if you are fine with throwing protocol lib in there, consider if you trust you or inventivetalent more xD
My servers always look like this:
ProtocolLib
OneMonolithPlugin
The one and only spigot stack
We are currently using protocol lib for other features, so maybe that'll make my life a bit easier
oh if you are using protocol lib it should be rather easy then
If i knew how to reliably inject a handler into the netty pipeline i would drop Plib too
(also dig the "imma ask on paper discord as well, the spigot plebs won't know")
XD
Haha, it's not like that at all. I'm asking everywhere in case I get ignored/can't find an answer
It’s very simple just implement channelinboundhandler
Reflect to grab your channel
Then you have read and write
Keep it in a Player, Handler map
You got a source for that? I would also have to rebuild the packets from the bytes i suppose.
Player p = e.getPlayer();
UUID dUUID = p.getUniqueId();
UUID uuid = e.getPlayer().getUniqueId();
Class clasS = Main.getClassManager().getClass(uuid);
if (clasS.equals(Class.PRIEST)) {
Action action = e.getAction();
if ((action.equals(Action.RIGHT_CLICK_AIR) || action.equals(Action.RIGHT_CLICK_BLOCK)) && p.getInventory().getItemInHand().equals(Material.DIAMOND_SWORD ))```
This is not getting through when I add equals(Material.diamond_sword)
even tho im holding a sword, any clue?
java: package jdk.tools.jmod does not exist
When does this happen?
You compare an ItemStack to a Material.
Grab the Material from the ItemStack and compare it using ==
When you try to import this package from a jre
you can make the predicate a consumer its for cancelling packets
Oh thank you. This doesnt look too bad
you need to reflect as well
so then you can have systems like thsi for example
public class RangeA {
public RangeA(Player damager, PacketHandler handler) {
handler.onSend(damager, PacketPlayInUseEntity.class, (p) -> {
final PacketPlayInUseEntity packet = ((PacketPlayInUseEntity) p);
final Entity damaged = packet.a(((CraftWorld) damager.getWorld()).getHandle());
if (damaged instanceof EntityPlayer && packet.a() == PacketPlayInUseEntity.EnumEntityUseAction.ATTACK) {
}
return false;
});
}
}```
How do I do that in the code 7smile?
lul. Calling a generic "Type" 😄
It’s very old lol
But this looks very good. Dont mind if i grab this.
ItemStack Sword = new ItemStack(Material.DIAMOND_SWORD);
Player p = e.getPlayer();
UUID dUUID = p.getUniqueId();
UUID uuid = e.getPlayer().getUniqueId();
Class clasS = Main.getClassManager().getClass(uuid);
if (clasS.equals(Class.PRIEST)) {
Action action = e.getAction();
if ((action.equals(Action.RIGHT_CLICK_AIR) || action.equals(Action.RIGHT_CLICK_BLOCK)) && p.getInventory().getItemInHand() == Sword && ``` Like this?
Nope. Also pls dont use single character variables like p or e
Hmm alright but not sure how to do it then
Get the material from the ItemStack and compare it with the target Material
And only use == for primitives and enums.
Kotlin makes the system much easier. Can have player extensions so you don’t need to pass handler anywhere
Just java rips
I like verbosity 😄
Lombok (:
Gross
Yes and this. ^^
Lombok extensions are a meme
Idk why ppl hate on lombok that much.
I don’t like it
why
Clutters code, you shouldn’t really have that many setters anyways
What 😂
I don’t like getWhatever
I’m more about whatever()
so you're a weirdo
Because I don’t use lombok?
because you dont use get
Then you must love records
I use to then I realized Lombok for noobs?
Lol not in that sense but lomboks a nono for me. I’m not a fan of annotations
how may one not be a fan of annotations
i just use lombok because its faster than typing it all out
I like interfaces
intellij always gives me errors when I try to auto-generate
@quaint mantle I’d rather my code look pretty. The have @Getter before everythint because I was too lazy
Where should I get the type from the itemstack to then compare in the if statement? xd
is it the gettype or?
Let’s see the only good thing is requiredargs and val lol
Annotation on annotation!!!
10 annotations on one line so pretty 😍
This saves me a whole proxy class and a lot of logic:
@Builder
public class CoolClass<T> {
private final Predicate<T> filter;
private final Supplier<T> supplier;
private final Consumer<T> consumer;
public void applyIfPossible() {
final T value = this.supplier.get();
if (this.filter.test(value)) {
this.consumer.accept(value);
}
}
}
final CoolClass<Player> cool = CoolClass.<Player>builder()
.supplier(() -> Bukkit.getPlayer(playerID))
.filter(player -> player != null && player.hasPermission("imcool"))
.consumer(player -> player.sendMessage("You are Cool"))
.build();
cool.applyIfPossible();
And i dont find that this is cluttered
did you just recreate java streams
Idk. I just threw random stuff together so it looks convincing XD
hey guys, is there any reason to use - or _ for separating words inside configuration nodes instead of just using spaces?
I feel spaces look a lot cleaner & are easier to write, but most configs i've seen do not use them
Using spaces in a yml path is not advised. It can and will lead to issues.
ConfigEntryKey
or
config-entry-key
what kind?
Complete failure to parse the file
I've used yaml files pretty extensively with spaces, and even modified them from my plugin without issues
even with lists of elements and such
and its odd that yaml doesn't complain if using spaces
if it could be problematic
Optional.ofNullable(Bukkit.getPlayer(playerID))
.filter(player -> player != null && player.hasPermission("imcool"))
.ifPresent(player -> player.sendMessage("You are cool"));
isn't that basically the same as your class ? xD
Thats a bad habbit. You should prevent spaces in any path
Kind if. But the class above could be called at a later point and not have the Player object within.
Runnable cool = () -> {
Optional.ofNullable(Bukkit.getPlayer(playerID))
.filter(player -> player != null && player.hasPermission("imcool"))
.ifPresent(player -> player.sendMessage("You are cool"));
};
``` xD
-.-
tho I guess this is actually more code and less generalized
than yours
so I see the appeal
Is it possible to create an invisible arrow?
Ive extended EntityTippedArrow and called this.setInvisible(true); in the constructor.
well, https://tryitands.ee/
but i think you have to use packets to destroy it for the player
Ive done that but its not invisible
Id rather just create my own ray traced projectile then.
yes yes
tbh, i would help, but I have 0 knowledge of packets :D
on*
did u register the command in ur onEnable?
Ill try this and see if it leads to the projectile being visible for the first tick...
tick after. not sure if you can destroy it in the first tick
how would you do that
i mean you could listen to the sent packets
you mean like
disabling commands?
vanilla commands*
oh well we have 2 different conversations
ah
i was talking to 2Hex xd
but disabling a vanilla command is possible
just need to make a commands.yml file
and
you know
that
if you make the same cmd as a vanilla cmd
is the command there if you type /help?
y worked.
cool
👍
the https://tryitands.ee works!
Failure
hey there guys, I've been pouring over the javadoc for Predicates and can't understand it at all
a predicate is a functional interface
which takes a boolean and tests it against an object
iirc
Yeah it's a functional interface according to the doc
my main issue is that I'm making code that isn't erroring but its also not working, and I'm having trouble with the whole troubleshooting process
it's a (T) -> boolean functional interface
meaning it takes a generic type and returns a boolean
This filter(Predicate<String> filter) {
if (filter.test(this.name)) {
this.list.add(this.name);
}
return this;
}
bad code example but you should get it
myClass.filter(s -> s.equals("Yes")).someThing()
it's filter.test btw
this
method call overhead
and also object instantiation overhead
and garbage collection overhead
final RayTraceResult result = world.rayTraceEntities(start, direction, distance, 1.0, filter);
Entity LookingAt = result.getHitEntity();```
So using that example, this code should run as intended and ignore the player?
-> !Player::equals
hope this works or imma look like a fool
you can't invert the value of a method reference
i so wish i was good enough at java to recognize that right away lmao
someone pr that
as it doesn't reference the method's return value, but instead the method's handle
no I was referring to imaginedev's example
oh lol my bad
I don't know if that would work or not but it looks fine
what you can do is
oh nvm
I thought there was a Objects::notEquals lmao
It;s throwing an error at me, The target type of this expression must be a functional interface. Maybe it needs to contain smth?
yeah fair
Is that a compile error?
I believe so.
can you send the full error?
I'm on Eclipse, so I haven't compiled it yet, but it typically shows it before it happens.
To my knowledge, The target type of this expression must be a functional interface is the full error. But I can send the code too. Very new to this IDE and Spigot as a whole so forgive my ignorance.
final RayTraceResult result = world.rayTraceEntities(start, direction, distance, 1.0, filter);
Entity LookingAt = result.getHitEntity();```
Error has ** around it.
par it and add the ! to the front
thats what i said!
just do !p.equals(hit) :p it's not that much code
so like !(p::equals) ?
will try this and report back, v2.1 time
?
Also lambdas invoke dynamic as u already know which is pog
worse
I actually know very little about lambdas, the course I was in never covered them. How can I use them effectively?
Predicate<String> predicate = Predicate.not(String::isEmpty);
it's more characters and an additional method call
bruh
just do the explicit parameter pass for fuck's sake
Think of them as anonymous instantiations of interfaces that have a single abstract method
You can check out
Runnable,
Function,
Consumer,
Callable,
BiConsumer,
AutoClosable and Closable,
BiFunction and so on
Lambda is yes
All of them have a single abstract method and is an interface
Closeable isn't really meant to be a functional interface tho
Indeed
But it does not break the contract of one
As of now
Probably won’t in the future also
Now consider these two effectively equivalent
Runnable r = () -> {
System.out.println("maowcraft");
};
and
Runnable r2 = new Runnable() {
@Override public void run() {
System.out.println("maowcraft");
}
};
@atomic gyro
why am I an example
Why not (:
your nickname is maowcraft 🤨
Still suits you 😏
better than mine 3 years ago lol
Thats a china reference. mao dynasty.
technically it's 6 years old but the last time I changed my username to Maowcraft was 3 years ago since I changed it to Maow_ last year
Ok Maow_
Yeah 4 letter names r popular 🥲
Mine is "Gestankbratwurst"
Dont try to translate it into english. It makes no sense.
public class AssLexer {
}
.ASS, gotta make the internals fit the name 😉
can you parse my ass
Will do sir
.ass*
Sure
i, as a german, wonder how you got to that name
public class AssParser {
}
thank you
lmao smile
I have honestly no idea. My old me apparently found this name real funny
lol
and yes my nickname is maowcraft but that doesn't mean I consented to the nickname change
i mean mine was "IchLebeNicht"
Yeah Maooooow apologies
followed by "RunterGebuggt"
F
"DerKuhleJunge_" best name i ever had
My brothers acc is "AffeMitWaffe"
affect MIT waffle
i know that name from somewhere.
isnt it a popular name ?
1997, colorized: Maow breaking into MIT to affect their waffles.
"ichzuenddichan" lmao
lul
seems like a nice guy
It seems useful, I'll have to take a deeper dive into it. Thanks.
here's a question @ivory sleet
can I reverify with a different Spigot account? :p
if you want banned
I'll just delete the old one lmao
Yeah apparently alts are no go
But you could donate and change name if that’s what your intention was
I'm not giving Spigot my money
Ok
That’s ok, to be fair I wish name changes were free like at least one
they do it all for free :/
give us your soul to change your Xbox Live username
sorry
gamer tag
bc XD GAMER
SO QUIRKY AND HIP
ugh
Yeah well donations are just a way to support spigot merely
Guys I've gotta thank y'all, it finally works at least a little bit. I've been trying to make this plugin for like 2 days and it finally didn't remove me from the game :)
Still works thru walls but that's an obstacle for another time lol
how come I can't give a dollar then
i pay you $10 if you code a full MMORPG plugin for me thanks
complete with an entire storyline as well please thanks
Only you know that?
yeah, voice actors too
their minimum donation price is $10
deal 🧢
Hello Everybody Where Can I Find A Coach For Plugin Development
?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/
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. Create a thread in case the help channel you are using is already in use!
Which Category Should I Post Under? I Do Not See A For Dev Coaching
?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/
try offering developers
It would be something along developer hiring
But Will That Require Payments?
Necessarily not?
Ok So If I Post I Can Find A Coach For Free Java Dev Help?
dude just google tutorials lol
^
I Do Not Like Tutorials I Learn By Doing
Problem is that there’s a lot bad practices one may teach you, especially if you’re using something unprofessional like spigot services section
that's why everything I make is a static singleton, you don't have to be afraid of taking away the wrong lessons if you know you are
I Just Want To Develop Servers Not Get A Professional Job Or AnyThing Like That

I Will Post There Thank You All
Alright best of luck
at least he's already doing camel case text like a pro
🥲 former C# programmer?
that hit too close to home
that and the default bracket formatting for unity projects is triggering me big time
why waste an entire line on opening a bracket
why use lines at all
Readability!!! Solidify those scopes!!!
read my ass

if your source code isn't 1 line and 10000 columns then you're doing it wrong
we already have indentation for readability, are we programming for the blind?
it looks like a high school essay trying to fill space for a character count
Precisely
bet you the people who came up with it are paid by the line
Lol
it looks like it says what it wants you to do
Is it possible to establish communications beteen plugin and ESP32 over ethernet ?
is it better to have one task timer that loops thru a bunch of mobs or have a bunch of mobs have their on task timer (it's for specific movements done with teleportation)
are you spawning a mob inside a listener for mob spawning?
question, Is there any kind of version incompatibilities from 1.13 to 1.17? Do I need any kind of version checks? (For example, if I supported 1.12 and below, and also 1.13+ i'd have to add support for legacy material names, sounds, etc) Is there anything present in the newer version this has to be done as well, if any?
I mean each version has additional blocks/mobs so you would have to check for those if you're supporting past versions.
so if I wanted to support 1.13 through 1.17, which version would I build against? The oldest version I'm supporting?
Up to you. I build with 1.16.5 and support down to 1.8.8 (Plugin I am referencing hasn't been updated yet. I'm lazy ;))
Or I build with 1.8.8 and support up to 1.17.1
Interesting. Well thanks for your help, I appreciate it(:
np
is there a better way of creating empty scores (placeholders), except java objective.getScore("").setScore(0); objective.getScore(" ").setScore(1); objective.getScore(" ").setScore(2); objective.getScore(" ").setScore(3);
does that apply to empty strings tho?
let's try
adding a space looks just awful
and idk if 15 spaces are too much chars
oh i see
why are you setting scores?
yea
to make it bigger/longer basically?
make what bigger?
so increase the top line width
ah
didnt had the word in mind
You can just use colors and add blank lines
a team per line using ChatColor.values as teh key
guess i'll go with this?
String s = "";
for (int i = 15; i > 0; i--)
if (i != 10) {
objective.getScore(s).setScore(i);
s += " ";
}
objective.getScore("§cYour Deaths: " + getConfig().getInt(p.getUniqueId() + ".deaths") + "§r").setScore(10);```
written quickly, out of mind
or in my mind?
whatever
yea
i was dumb
i still hope, minecraft someday gives us a way to remove those dumb scores on the far right
just annoying for my death counter
and other integer-stuff
and the reason is? :o
you can set them all to zero so they can be ignored
wdym
so you create 15 teams "TEAM_" + ChatColor.values()[line].toString()
Then you can set specific lines
Hello little friends. Im having an issue with texts in prompts of the conversation api.
bascially, what i want: prefix: \n\n§5§lHyvoidKronos getPromptText: \n\n §fType the task
with 2 spaces i actually got 3
with 1 space i got only 1 space
omg that gif is so fckn cute
getPromptText with 2\n and 2 spaces
instantly saved

full code here
was it you doing the scoreboard stuff above?
that is not the full code
yea i guess?
it is
m8 just
looks interesting. thanks!
?paste
btw: is there still no way to remove specific games from discord's richpresence?
I wish
I would only have intelliJ whitelisted
i dont want minecraft to show there
^
it always be in highest priority somehow

