#help-development
1 messages ยท Page 197 of 1
i do not have a ide open
@fluid river 
gif mine now!
And i gotta edit it still because its only using one workload 
Finally! Only took me 4 hours
Delay moment
sin + cos at your help
Deduction?!? too
depends on your system
heheh ๐
and axis to rotate
Now gimme your math to java learning!
depends
I tried learning some preciously but not good
taking math into programming "convertion"
basically 2 + 2 = 4


find determinant of 3x3 matrix given as double[][]
1 subject to another
What did you mean by this
isn't that just a 2d array?
yeah 2d array
Can be represented as one
are you proud of me teacher ๐
A 2d array is less strict than a matrix
?
what you mean by matrix?
and what is that about?
A matrix as by the mathematical definition
show error
just by adding itemInMainHand
thanks man i were about to watch the whole series to figure out
Thats a square matrix
i mean its my entire console
But yeah
it just filled with errors
but its mostly 22:40:44] [Server thread/ERROR]: Could not pass event ProjectileHitEvent to Coreplugin v1.0 org.bukkit.event.EventException: null at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callProjectileHitEvent(CraftEventFactory.java:1283) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.world.entity.projectile.IProjectile.preOnHit(IProjectile.java:157) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.world.entity.projectile.EntityArrow.k(EntityArrow.java:232) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.world.entity.projectile.EntityTippedArrow.k(EntityTippedArrow.java:112) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.level.WorldServer.a(WorldServer.java:827) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.world.level.World.a(World.java:658) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.level.WorldServer.lambda$9(WorldServer.java:422) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.world.level.entity.EntityTickList.a(SourceFile:54) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.level.WorldServer.a(WorldServer.java:402) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1290) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:394) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1197) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1013) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:293) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at java.lang.Thread.run(Thread.java:1589) [?:?] Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.contains(Object)" because the return value of "org.bukkit.inventory.meta.ItemMeta.getLore()" is null at mission.coreplugin.events.telebowevents.onBowShoot(telebowevents.java:22) ~[?:?] at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] ... 18 more
you have no lore on the bow
So that is a Multiplayer array some sort?
that's causing the error
isnt it supposed to add a lore
oh
but item you use rn has null lore
List<String> newLore = meta.getLore() == null? new ArrayList<String>() : meta.getLore();```
try this
i'm not part of the high mind math society idk shet for real about math
but why the lines
where should i add this in the code
Which lines?
and whats the last bit
The []?
i mean dots
instead of line where i declare newLore
To denote all the elements
matrix can have any size
Like a sequence
1, 2, 3, โฆ, n - 2, n - 1, n
[a21, a22, a23]
[a31, a32, a33]```
^ for a square matrix of order 3
omge ty
yez
2x2 matrix determinant is a11 * a22 - a12 * a21
thats to denote the elements diagonally
and for 3x3 hard formula with 4 triangles and 2 lines
Like A_11, A_22 all the way to A_nn
No
oops
hehe
cuz each matrix in mafs have a determinant
which is used to solve linear algebra equations
like move vector from one coordinate system X Y Z
to another X2 Y2 Z2
This means that u have a matrix by n rows and m columns
And finding it's coordinates in this new system
brain pain
lack of crucial information
Its just notational to denote a general matrix
Just like if you were to use the sum formula of an arithmetic progression
alos matrixes help solve Systems of Linear Algebraic Equations
go to university
half year and you are at high level
knowing linear algebra
i'm just having fun
for working with vectors and coordinates systems
I'm so unfamiliar with the subjects
you need matrixes
which are part of linear algebra
for finding derivative or integral you need calculus
i did barely any Math study for 9 grade
when i did an event
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callProjectileHitEvent(CraftEventFactory.java:1283) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
at net.minecraft.world.entity.projectile.IProjectile.preOnHit(IProjectile.java:157) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
at net.minecraft.world.entity.projectile.EntityArrow.k(EntityArrow.java:232) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
at net.minecraft.world.entity.projectile.EntityTippedArrow.k(EntityTippedArrow.java:112) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
at net.minecraft.server.level.WorldServer.a(WorldServer.java:827) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
at net.minecraft.world.level.World.a(World.java:658) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
at net.minecraft.server.level.WorldServer.lambda$9(WorldServer.java:422) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
at net.minecraft.world.level.entity.EntityTickList.a(SourceFile:54) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
at net.minecraft.server.level.WorldServer.a(WorldServer.java:402) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1290) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:394) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1197) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1013) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:293) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
at java.lang.Thread.run(Thread.java:1589) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.contains(Object)" because the return value of "org.bukkit.inventory.meta.ItemMeta.getLore()" is null
at mission.coreplugin.events.telebowevents.onBowShoot(telebowevents.java:22) ~[?:?]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
... 18 more```
because of my systematic brain
ez pass
i'm on second university year
envy
i wish i had some real study omfg
if (event.getEntity() instanceof Arrow) {
if (((Arrow) event.getEntity()).getShooter() instanceof Player player) {
ItemStack itemInMainHand = player.getInventory().getItemInMainHand();
if (itemInMainHand.getItemMeta().getLore().contains(ChatColor.LIGHT_PURPLE + "RARE! " + ChatColor.BLUE + "MegaLongBow III")) {
Arrow arrow = (Arrow) event.getEntity();
arrow.setVelocity(arrow.getVelocity().normalize().multiply(3));
}
}
}
}
}``` this is me code idk how to make it not null and stuff when i shoot with a bow that has a lore
i paided some dude for teaching me some algbra online
from fiverr funny enough
if (itemInMainHand.getItemMeta().getLore() == null) return;
before your contains check
bruh use pattern matching please
how?
everybody should know
if (!(event.getEntity() instanceof Arrow arrow)) return;
// now you can use arrow variable```
whats the problem with this
well Everybody should know how to land on the moon ๐
That is just called implicit else pattern
that's what you should use
but
Pattern matching is new
which
it works for the other thing
Or well
why doesnt it work for this one
Kinda
yeah since java 13 i guess
๐คจ
if i'm not dumb
How can I modify file configuration with async scheduler?
May I get any sample code?
ok
I don't really get the point of modifying the FileConfiguration object asunc
so i fixed the errors in my code
its all in memory
honestly modifying a FileConfiguration object async is going to be less performant than modifying one sync
FileConfiguration is all memory there is no reason to use async for editing and retrieving from it
if your using FileConfiguration as data storage I'd suggest an alternative like SQLite or other databases
then the correct manner would be to edit those async as queries would halt the main thread
Thats not the issue
The issue is if you save and load it concurrently
Which is rarely the case
But if it is, you probably wanna ensure your design is safe against memory reordering effects etc
imo you should really only be loading configs on startup I see no reason to be doing it more than once
I don't necessarily think it was built with data storage in mind anyways
No not really
Just a measly glorified lhm with type safe getters and a sink and source functionality
noted
๐ what have you been doing
Ummm... so I can't use FileConfiguration async. Is it right?
Ah...
Or well, you can probably solve your problem in a better way
I heard better way to save data is using db
Myeah
that is the purpose of a db afterall
Um...
I hope it stores data well
So I tried to use sqlite in the past
But many people said it's not smart way to save huge amount of data
so
if your saving tons of data no SQLite is not the way SQLite is for storing smaller to medium sized amounts of data for large data you'd be looking at things like PostGress, MYSQL, MongoDB etc
what type of data are you storing though would be the main question
Before i added the checks if (((Arrow) event.getEntity()).getShooter() instanceof Player player) { ItemStack itemInMainHand = player.getInventory().getItemInMainHand(); if (itemInMainHand.getItemMeta().getLore().contains(ChatColor.LIGHT_PURPLE + "RARE! " + ChatColor.BLUE + "MegaLongBow III")) { no matter what item i was holding and stuff the bow would always fire at full power no matter the item of course i didnt want this to be for all items so i added the checks above and now it doesnt work.
Im making dialog and quest plugin now
as in doesnt work it doesnt insta fire the bow
for a quest plugin? you should be fine with SQLite or MYSQL unlses you expect it to be used on servers with thousands of players
So I need to save player data which contains dialog read and completed quest etc
generally I'd leave it up to the server owner and support multiple DBs
I'm having a new problem...
if your making this for yourself I'd say gage where you are at in terms of players etc and determine whats best for you based on your servers playercount
Before i added the checks
ItemStack itemInMainHand = player.getInventory().getItemInMainHand();
if (itemInMainHand.getItemMeta().getLore().contains(ChatColor.LIGHT_PURPLE + "RARE! " + ChatColor.BLUE + "MegaLongBow III")) {```
no matter what item i was holding and stuff the bow would always fire at full power no matter the item of course i didnt want this to be for all items so i added the checks above and now it doesnt work. so maybe i copy pasted the thing wrong
or something
becuse now my thing is broken
Oh I got it
But is there big difference using between db and fule confuguration?
breh
im getting Could not pass event EntityShootBowEvent to Coreplugin v1.0
org.bukkit.event.EventException: null
wtf
whyyy
there is a massive difference
Databases are built for storing data thats their whole purpose
FileConfiguration is meant for config of your plugin and smaller scale things
((Arrow)
why?
(event.getShooter() instanceof Player)
Checks for the Shooter
also you can add AND as &&
ok
idk the answer to that myself
i just put it there and no more error
also
now im not having anymore errors
but
the thing doesnt do like it supposed to
like it builds and stuff
it just doesnt multiply the velocity by 3 anymoer
it just does nothing
public void mlbbowshoot(EntityShootBowEvent event) {
if (event.getEntity() instanceof Arrow arrow) {
if (((Arrow) event.getEntity()).getShooter() instanceof Player player) {
ItemStack itemInMainHand = player.getInventory().getItemInMainHand();
if (itemInMainHand.getItemMeta().getLore().contains(ChatColor.LIGHT_PURPLE + "RARE! " + ChatColor.BLUE + "MegaLongBow III")) {
arrow.setVelocity(arrow.getVelocity().normalize().multiply(3));
}
}
}
}
}```
idek what the problem is
i mean the code SEEMS fine
but it isnt
4 line seems very uncleaned and cursed
if (((Arrow) event.getEntity()).getShooter() instanceof Player player) {
event.getProjectile() instaceof arrow
how would you re word if (((Arrow) event.getEntity()).getShooter() instanceof Player player) {
but what about player?
Check if Shooter is player first
why is it red
ok pup
?basics
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.
-_-
please learn java before coding with spigot it'll save you so much time
even if its just the very basics
please do it for yourself
i know i wanted to say the same but i would try...
when i type
i'm allow to spoon feed?
event.getEntity().getShooter and i pres tab it auto does (((Arrow)
no don't they will just come back
please if your going to do anything teach them java
well copying isn't learning
i guess
you need to remember the stuff and meaning
my past with learning
so much source reading
still look up stuff
I learned java through spigot purely through reading source code
granted I already had basic programming experience in python
Not having the docs
chez
hell
I didn't know how to read docs at the time
I just knew how to wield the most powerful tool on earth
Check if Shooter is Player
Check if Projectile is arrow
cast after check
see
else error
should also probably check if shooter is null
why do u escape everything normally with \\
but to escape ' you need single backslash
I realized my error ๐ this is why I quit coding minigames
char singleQuote = '\'';
\\ life
dont let me do that
see to get the event.getShooter
i need
()
event.getEntity()
at the end of the method
stop
let me explain
so
when i type
event.getEntity()).getSh and press tab right
if (!(arrow.getShooter() instanceof Player player) return;```
it auto does
if(((Arrow) event.getEntity()).getShooter())
for some reason
it just wants arrow

if(event.getEntity() instanceof Arrow) {
if(((Arrow) event.getEntity()).getShooter())```
cringe
int boolToInt(boolean bool) {
return bool == true? 1 : 0;
}```
it just has to add (((arow)
Why does it do that though
like why does it have to add
the arrow thing
im just genuinly confused at whats happening
oh wait
im just special
i can just do
C++ variables?
arrow.getShooter()
take NukerFall free JAVA TUTORIAL LESSONS
will java tutorial lessons make me not sped in general>?
@quaint mantle do you understand the basic computing?
I like to think i do why?
and logic states
copy + paste -> shut up -> learn java
@EventHandler
public void onArrowShoot(EntityShootBowEvent event) {
if (!(event.getEntity() instanceof Arrow arrow)) return;
if (!(arrow.getShooter() instanceof Player player)) return;
var mainHand = player.getInventory().getItemInMainHand();
if (!mainHand.hasItemMeta() || mainHand.getItemMeta().getLore() == null) return;
if (mainHand.getItemMeta().getLore().contains(ChatColor.LIGHT_PURPLE + "RARE! " + ChatColor.BLUE + "MegaLongBow III")) {
player.sendMessage("ITS WORKING");
arrow.setVelocity(arrow.getVelocity().normalize().multiply(3));
}
}
int* arrayOfTenInts = (int*) malloc(10 * sizeof(int));```
c++ makes me die inside a little
doesnt work
to say i'm a noob to it
~MyClass {
free(myThings);
}```
"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.
im typing
It doesnt multiplly the velocity of the arrow like its supposed to
and instead it just
normal arrow
are you sure all checks are passed
print a debug message when shooting
like how its supposed to here
.
declaration: package: org.bukkit.event.entity, class: EntityShootBowEvent
?spigotdoc
you can not set force to event
only get it
and force is from 0.1 to 1.0 afair
not connected to actual arrow velocity
i mean partly connected
it worked before though
what
i guess you messed up the lore part
"Whats PDC?"
whats pdc
LMAO
LMAO
yes
idk what it stands for
they are
but i know what it is
PersistentDataContainer
Persistent Data Container good sir
arent those like really complex
no
๐จ hopefully not
how do you use them
itemMeta.getPersistentDataContainer().set(key, PersistentDataType.BYTE, (byte) 1);
wht the link for the docs
if (!itemMeta.getPersistentDataContainer().has(key, PersistentDataType.BYTE)) return;
where byte value represents level of enchantment
or you can switch to int
if level 127 is not good enough for you
?jd-s
declaration: package: org.bukkit.persistence, interface: PersistentDataContainer
byte level = itemMeta.getPersistentDataContainer().get(key, PersistentDataType.BYTE);
the problem isnt the lore...
i made the lore hi
like
litterally same hting
and it didnt work
whats? PersistentDataType<T,Z>
set(NamespacedKey key, PersistentDataType<T,Z> type, Z value)
also confusion
this is confusion
i think im going to go to bed
see you guys
ty for the help
man poor soul scared away

good rest!
take care
@fluid river explain PersistentDataContainer?
Nbt moment?
Its where you store a non vanilla nbt in an item, block, or entity
I literally showed you earlier
Works perfectly fine for me
Wdym?
They bit off more than they could chew you could say
Generics
value
^
T is the java value Z is what its turned into
Z is just going to be a byte array though
atleast in terms of PDC as far as I've seen is all translated into byte arrays
Im using mojang-remap to see function names of nms objects, but the fields/classes are becoming invalid when I use them in a plugin depending on the first:
CorePlugin:FakeSnowballEntity extends net.minecraft.....Entity
GamemodePlugin:Hookshot extends Core.FakeSnowballEntity <-- functions like kill() become obfuscated again
anyone else run into this issue? do I need to add something to the specialsource-maven-plugin?
how would i cancel a Runnable?
public class WorkloadRunnable implements Runnable {
private static final double MAX_MILLIS_PER_TICK = 2.5;
private static final int MAX_NANO_PER_TICK = (int) (MAX_MILLIS_PER_TICK * 1E6);
private final Deque<Workload> workloadDeque = new ArrayDeque<>();
public void addWorkLoad(Workload workload) {
this.workloadDeque.add(workload);
}
@Override
public void run() {
long stopTime = System.nanoTime() + MAX_NANO_PER_TICK;
Workload nextLoad;
while (System.nanoTime() <= stopTime && (nextLoad = this.workloadDeque.poll()) != null) {
nextLoad.compute();
if (workloadDeque.isEmpty()); // cancel runnable
}
}
}```
or will it automatically do it?
i not smart
Hmm what does source code mean and can i recrate a plugin using its source code?
*recreate
Source code is the actual code for the plugin, src code. Yes, if you have the source code you can edit, amend etc etc the plugin
Ok
hm ok
I have the ZIP file so how do i actually open it xD
The person is being sus
hm
Yeahhh
XD
Sure...
I srsly wanna know
If you dunno what src code is and you dunno how to even open it in ide then you got no business coding and amending it lol
Uh
Source code is the code
i know what src means but i got confused with the thing
Not compiled by pc
no Like ik what src short form means but i got confused with the source part of the full form of source code
๐
Lamb source okay
..
Yes fine
Lol
We know
know what?
It self explanatory
Whos code are you decompiling ๐ณ
uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Idk
Whos lamb source you got
urs
No your intention is to big funny haha person 
Just tell me pls
Java decompiler
Lol jdgui
Alr then
ive been rickrolled tooo many times
Kinda is
hm
But sadly not gud
Alright im off to find leaked plugins XD
This guy
I cant code and im broke so tf am i supposed to do
Do you like hxh
Decompiling
Just get gud
Yes it is ig?
@dense fjord you asked for help and when it was given you "felt like it was a rickroll"
go away then
Ive been rickrolled too many times so im just carefull
Hxh???
Bruh
Sus
I used to
The anime
Whats ur fav anime ?
But never watched it
My pf is vtuber Amelia watson
Ah i want tht plugin so bad but im broke
I'm a practice deductionist
is there any staff that could kick him?
Where is the fruity drink?
Ima just leave ig
@dense fjord don't listen
he is hypixel player
To that's dood
He is nice
Lol
Deductionist?
Yea
trying to make a server
He is
Wtf that
penis deobfuscator
Im so confused
Deducing different things
Basically it
You can make sense of things about people and objects
1.5.2??
xdd
for (int i = 0; i < STARTING_VARIABLES.length; i++) {
String[] split = STARTING_VARIABLES[i].replace("||", "@@").split("@@");
String name = split[0] + spliter + uuid;
VariableAPI.getVariableorCreate(name, split[1]);
}```
```java
public static Variable getVariableorCreate(String name, Object value) {
return new Variable(name, (VariableSave.getJson().get("storage." + name) != null ? VariableSave.getJson().get("storage." + name) : value));
}```
i've debugged and the first code puts the spliter in between
but second one removes it
๐คทโโ๏ธ

halp
it shouldn't be removing it at all
stupid java
I've seen people that are using a custom build in gradle or maven which not only compiles the plugin it also runs minecraft with minecraft server.
Im wondering how should i do someth similar like that?
You can define a task that runs a jar file
but the setup should be a bit difficult isnt it?
damn
ty
i must stop using maven in 2022
why? Maven is the best
Arguably not
Just build stuff with shell scripts ๐
next thing we know we are back in the dark ages or using the windows text editor to code
god I love coding in the text editor
Hey, do player attributes exist in 1.8 ?
I think there is no
No, you used nms back then
Yes, but I'd like to give a specific percentage of strength to a player and I don't know how ๐
Literal throwback
#help-development message
Maybe don't use legacy versions of the game
after enchating
Idk if you can do that without nms
lol
I'm too comfy
I found this
thatโs easy
then set the name
just set the display name on ItemMeta
the colors is just extra characters in the name which are interpreted
Utilities.nameItem(newItem, ChatColor.RESET + this.name);
i have this here
this is added when the item is created tho
not refreshed after enchanting an item
then use an enchant listener or something
would chatcolor.reset work
just say you dont know ๐
just did
I just find it a fancier way of saying "I dont know and I dont wanna google it rn"
splendid
what's toy
this shall be the most ambitious project i have ever embarked on
Is it better to store the config in variables and update when the config is reloaded or get it directly using config.get()?
you can just use config.get("key")
I would always just get them from the config freshly
Hmm, okay. I was told once I shouldn't do that
dont store them in your variables, it makes custom reload methods hell
depends
Allows you to get the old data after the reload tho
if you need to get the value multiple times in the method, you'd better store it to variable
its old data tho
the config is a HashMap, its not much more work than anything else
why would i even need old data
There may be cases
the reason its old data is that it shouldnt be used anymore
For example if the new data is invalid you can set it back to the old
doing too much
if new data is invalid i just stop the plugin
or send message omg you dumb nibba you have to manually fix what you did
ye. cant have these server owners thinking they can just fuck with configs without knowing what theyre doing
theyd get used to that and stuff
Eh makes sense
Because pre-missions is a possible meaning too
Eh lol
Hmm, I just remembered my old idea of making a server side modding core using texturepacks, I wonder if thats possible
everythings possible, just gotta know how much work it would be
is there a way to use reflection to achieve enum#valueOf
why would you wanna use reflection instead of the perfectly working enum#valueOf()?
because it aint working lol
Cannot resolve method 'valueOf' in 'Material'
yet I can clearly see Material.STICK and stuff
wdym
then somethings broken... enums have that by default
Material has valueOf
thats java, not that exact enum
oh this is a sealed interface
yeah I thought ti was
looks the exact same
so how do I commit valueOf on a sealed interface
why do you want to use reflection?
because there seems to be no mentally sane way to obtain the STICK for example from Material
my bad
yet I can access it with Material.STICK
Material.STICK, Material.valueOf("STICK"), both valid
well not on a sealed interface apparently
you say youre not using bukkit?
You are not explaining yourself very well
wdym im asking how to achieve something like enum#valueOf from a sealed interface
Why reflection at all when you have the Enum itself?
I wanna use PlayerInteractEntityEvent to get rightclicked entity.
But It doesn't works ๐ฆ
Is there any problem on this Listener?
public class dialogEvent implements Listener {
private final main plugin;
public dialogEvent(main plugin) {
this.plugin = plugin;
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
public void OnInteract(PlayerInteractEntityEvent e) {
System.out.println("A");
}
}
What?
what would you use the stick for
@EventHandler you forgot
fuck
you
even
lmao
omg
๐
aha
sorry... ๐
yeah but what is the config option for
and I build a menu using Material.STICK
what are you trying to ultimately achieve
building a menu from a config
then Material.valueOf("config.get"material")
bro
true
what
alright, and since youre not using bukkit, as you said, what are you using
why not?> its a part of Material
Tru no @Eventhandler
because
There
this is a sealed interface that has nothing to do with bukkit's Material
welp, I'm out cuz Ive never heard of that
Yeah I'm out. You are not explaining your issue at all
if the api youre using has no way to get the materials, youre gonna have to find someone who knows the api
I have explained about 5 times im
- not using an enum
- not using bukkit
- I need to do something similar to
enum#valueOfwith a sealed interface
seems comprehensible to me
this is a bukkit/spigot/paper thing afaik
You say you want to use valueOf to get a Material, but you can;t use Material Enum so you want to use reflection because its some sealed interface. It's all incomprehensible
most people here dont know many other apis
Ask other questions here
hes doesnt have the Material Enum
cuz its not bukkit
Then he can;t get a Material end of
I dont think thats how it works cheif
and I think the way to get you that material is between you, google and god
๐ true
You can't get a Material if you don;t have the Material Enum
but I quite simply can
then do it
I can do Material.STICK and it gives me a stick material
but my issue is
Material["STICK"] for example
Then you are lying and you DO have the Material Enum
its not an enum doe its a sealed interface
if you cna use Material.STICK you have access to the Enum
so the syntax Material.STICK shouldnt work for an interface
if youre about to tell us you have bukkit as a dependency ima yeet you in the sky
I dont
its just
I do Material.WHATEVER and I get the item I want
fromNamespaceId is actually a scam
oh I think its cause it extends Materials
I didnt notice that lul
anyhow
that was probably the issue
actually
I cant use it
thats unfortunate
bro ๐ why is it removing "::" from the string
Cuz
i must be dumb or something
for (int i = 0; i < STARTING_VARIABLES.length; i++) {
String[] split = STARTING_VARIABLES[i].replace("||", "@@").split("@@");
String name = split[0] + "::" + uuid;
VariableAPI.getVariableorCreate(name, split[1]);
Bukkit.broadcastMessage(name);
}```
broadcasts with the correct name
public static Variable getVariableorCreate(String name, Object value) {
return new Variable(name, (VariableSave.getJson().get("storage." + name) != null ? VariableSave.getJson().get("storage." + name) : value));
}``` and this removes the "::"
so the name is correct for the first time, but then "::" get's removed
alright well Material.fromNamespaceId("minecraft:" + this.item_type.toLowerCase()) works
I was hoping to like
not do that
because minecraft: is ugly
but its fine
what does the "name" do in Variable?
is that the thing youre outputting?
honestly I cant see what youre broadcasting or what youre trying to reach
i found the problem, it was just me being dumb
forgot to add the "::" in some places
which lead to that
thanks tho
did you get it sorted yet?
how can I store a list of (locations matched to strings) matched to players
you mean a map?
I think they mean a map
you use a map
but it would get reset when the server reboots
oh you want it to persist
use a yml config
or a database
depending on your needs
whichever one is easier :/
the good thing about yml here is that Location is already ConfigurationSerializable
which means you can just do YamlConfiguration#set(Path, Location) and deserialize it easily
like on config.yml?
yeah, you can make other yml files aswell tho
in case you dont want that data in the config.yml
need a tutorial?
https://www.spigotmc.org/threads/saving-playerdata-on-yml-file.262290/
would this work well?
and I'm guessing I would just copy paste that into a new java class
should work, youre gonna have to test it yourself
sounds good
are hashcodes always unique? is it safe to store the hashcode when all I need is to compare equality?
its what is used for passwords. A Hash method which produces duplicates is usually not seen as safe
not sure if the standard Hash method in java is safe
but you shouldnt have problems
So with this, I would call create every time a player joins the server? By what I'm reading that's what I'm supposed to do? I just want confirmation
basically a hashcode should be an algorithm that is derived from the internal values
where 2 equal inputs make the same hashcode
and 2 different inputs always make different hashcodes
So yeah you can store hashcodes for equality
but if the hashcode method changes for your given option then it invalidates all inputs
thanks
^
it should work but it isn't ideal
Asking us for advice regarding copypasting an answer from spigot isn't really something I'd recommend
Like it's fine to research your problems and all
But researching, coming to a conclusion and asking us to comment on that conclusion just invalidates all your research
true
anyone know a good forum post or something that talks about how to get player input using signs?
or using anvil renaming
hi guys
I don't, though if you know a plugin that has the feature, you could try looking for their source code. That's usually how I figure out how to do something
Hypixel does it ๐ can't get the source code
there was an api for that
never used protocolLib but I noticed its not preinstalled... how do I install it?
just dump into plugins folder?
I think i found that out nvm
yes it works now
though intellij doesnt seem to think so lol
but maven agrees
If you use intellij and just changed a maven file there should be a reload button on the right top ish of the text editor, which causes intellij to update it's stuff
I tried using this: https://www.spigotmc.org/threads/signmenu-1-16-5-get-player-sign-input.249381/
probably unreadable ๐ฉ anyway
it uses protocollib, you need to install the protocollib plugin
i thought u just needed it locally. huh
Believe hypixel builds a lot on nms so yea
@quaint mantle you can just use Player#openSign these days actually
um
probs didnt use latest dev build
but as I mentioned it's better to use the player open sign method
worked ty
Reload command goes brr
fr
Caused by: java.lang.ClassCastException: class org.bukkit.configuration.MemorySection cannot be cast to class java.util.Map (org.bukkit.configuration.MemorySection is in unnamed module of loader java.net.URLClassLoader @18769467; java.util.Map is in module java.base of loader 'bootstrap')
idk how to make it work
how does the config look like
so it should be etting bedLocations to a map
and pConfig is {playerUUID}.yml
?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.
is there any event or way to check if the dragon egg teleported?
like on right/left click
I would like to make a system where my player's data (life, speed, etc via my custom system) are stored in my mongodb database, can updating it every time it changes make lag if for example the player changes a lot of times his stats what would be the best?
Hi guys, Can I create worldborder per player in one world?( on 1.19.2)
Maybe this (https://github.com/yannicklamprecht/WorldBorderAPI) will help you?
oh yea I hadn't thought about it, thanks!
Oh I will check it thank you
boy oh boy do I have the thing for you
Is This API support version 1.19.2?
Judging by this commit, yes. Try it.
Oh, I didn't saw it sry
TimeProfiler being a thhing that compares System.nanoTime()?
Pretty much
public class TimeProfiler {
private final GraphingDatabase database;
private final String profileId;
private final long startNanos;
private final Map<String, String> fields = new ConcurrentHashMap<>();
public TimeProfiler(UniversityPlugin plugin, String profileId) {
this.database = plugin.getDatabaseManager().getGraphingDatabase();
this.profileId = profileId;
this.startNanos = System.nanoTime();
}
public TimeProfiler addField(String name, Object value) {
fields.put(name, value == null ? "null" : value.toString());
return this;
}
public void outcome(String name, Object value) {
outcome(name, value, TimeUnit.MICROSECONDS);
}
public void outcome(String name, Object value, TimeUnit unit) {
addField(name, value);
finish(unit);
}
public void finish(TimeUnit measurementUnit) {
long endNanos = System.nanoTime();
long difference = endNanos - startNanos;
long time = measurementUnit.convert(difference, TimeUnit.NANOSECONDS);
Point point = Point.measurement(profileId)
.time(System.currentTimeMillis(), WritePrecision.MS)
.addField("time", time);
fields.forEach(point::addField);
database.write(point);
}
}
String.valueOf(value) :)
ah its writing stuff to ya graphing db
I hate the java 8 forEach I'm doig but it's much simpler
basically I can run a mongodb stress-test and have graphs for it all
and I use it everywhere
oh yeah I had to do that last year at school
where we had a trello board
each person made a lil game
with no shared codebase
we all just made individual programs and mashed it all together
we had to make a bank account class
i was the guy on the pc and did all the stuff
so basic things
found my webdev teacher smh
i have only one repo on my gh acc for school too
if i want to use paper as a dependency do i have to use paper as my server jar?
everyone who reacted likes watching gay men kissing
I do problem?
I want to add an other plugin to my plugin to use their classes. I use intelliJ and I added the jar to my libraries, But I can't use the classes. Can someone help me adding a jar file as a dependency?
use proper dep manager like maven or gradle
are you using maven or gradle
Use something like maven to help manage your dependencies most good plugins that want to be added to have apis in a maven repo
It depends.
Yes
If you use Paper API from that dependency then you have to run paper on the server.
I'm using maven, but I only have a jar file from github ๐
Your going to need the paper jar think about it paper stuff wouldn't be in spgito server
Then yes you need Paper on the server.
Install it to your m2 than depend on it like yoh would anything else
Hey everyone !
I'm trying to check if a player is using a monster egg, but I'm now using spigot 1.17...
First (and single) time I did it was in 1.8 and I used this to check the type:
if (!(event.getItem().getType() == Material.MONSTER_EGG))
return;
Now, MONSTER_EGG is deprecated (it's nos LEGACY_MONSTER_EGG) and all eggs have a different type...
How can I do it without using a deprecated material please ?
event.getitem().gettype().tostring().contains("EGG") i think

got you ||