#help-development
1 messages ยท Page 365 of 1
id do it if i knew how
Yeah, those dot's were just wrong, xD. They just completely forgot about 1.8.8, :(
Only issue is that I never did that and will probably make a fool of myself by completely misunderstanding how it's supposed to be done, lmao
I'd open a ticket for it, then its upto md5 if he wasnts to fix it or not. It's not a hard fix, just one file.
?contributing else this
Yep. At least we got it figured out now. Applying the diff and building manually is not that bad, but BuildTools is all about automated builds. Cannot be that big of a deal for them to change one file to fix their awkwardly malformed doc-strings.
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
I'll make a ticket. It is unlikely to be fixed but it's worth doing as it would be nice to be able to build any version
I'd be ok with them deleting all 1.8 code. But if it's up there it shoudl build properly.
i can't compile it cause of a different issue
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: https://s3.amazonaws.com/Minecraft.Download/versions/1.8.8/minecraft_server.1.8.8.jar
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
at java.net.URL.openStream(URL.java:1092)
at com.google.common.io.Resources$UrlByteSource.openStream(Resources.java:72)
at com.google.common.io.ByteSource.read(ByteSource.java:296)
at com.google.common.io.Resources.toByteArray(Resources.java:98)
at org.spigotmc.builder.Builder.download(Builder.java:1083)
at org.spigotmc.builder.Builder.main(Builder.java:416)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
Uh oh. Looks like someone is distributing a mojang jar... (Which is not allowed)
buildtools gets them from this s3 service all the time
I looked thru the src before
Is it possible to view the size that an object takes while debugging?
with an profiler yes
There are instrumentations for that. Do you need a code solution or does an external profiler suffice?
A profiler would be good. What do you recommend (Free would be better)?
YourKit is still my favourite but its costly. The only usable free one is VisualVM in my opition.
I agree
Oh and IntelliJ Profiler. Havent used it a lot but it looks ok
That seems to be a cache issue. The URL target likely got moved permanently without a redirect. Remove your BuildTools caches (everything besides the jar). If it still occurs, try updating to the latest release. Shouldn't be a hardcoded URL tho, so likely removing caches will suffice.
Main benefit there is that you can actually directly navigate to code fragments from your timings
I think that is an Ultimate only feature
instrument package ๐
mojang moved those downloads
you gotta download the jar yourself and smack it into the appropriate folder build tools expects the jar to be at
i dont actually care enough to do that 
I was just testing their issue
weird that they just up-and-moved it though
I mean, they moved to piston meta
ye i saw
fair enough
suprised md5 hasn't fixed BT though
supporting legacy and all
just get your builds from get bukkit 
tbf if their 1.8.8 builds were out of date i would be seriously concerned
im right in saying the spigot api is just in the bundled jar now right?
yes
its just someone is saying you cannot depend on it without maven
but you could just yoink it out of there ๐
Or just download it from the maven repo 
probably because it is so far outdated it doesn't matter. I mean its no different then not being able to obtain spigot builds before 1.8 as well
you still can, but its up to you to do it yourself
update bt
Update your jar, I could even build 1.8
hello, is anyone in this server discord server an expert with databases?
i have a few questions.
i know a bit
?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 was reading up the mysql manual just now, regarding indexes, and according to the manual, if i create some sort of composite index, for example, i create an index on a hypothetical (colA, colB, colC), it states that it should have optimized queries on colA, (colA, colB), (colA, colB, colC). Does it not optimize queries for the just colB?
or (colB, colC)?
i see.
At least in mysql. Other databases might handle this differently.
alright, appreciate the clarification!
Hi, how can i check if someone is clicking into an item with another item like for upgrades?
thanks
Also check out InventoryClickEvent#getCurrentItem. Probably easier instead of getting the itemOnCursor from the player.
get Current Item do the same thing as item on cursor?
I'm wanting to see what plugins on my server have a specific Dependent whats the best way to get all the plugins and make a list of the plugins by name who have a specific dependent
A few ticks after onEnable()
for(Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
List<String> dependencies = plugin.getDescription().getDepend();
}
well this will be a command but ye
how do I make a item have the enchanted glint
Add an enchantment then add the hide enchants item flag
like this? I have this code but the bucket doesn't have the glint
bucket.addUnsafeEnchantment(Enchantment.ARROW_INFINITE, 1);
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);```
Did you apply the ItemMeta on the ItemStack after modifying it?
You did override the enchantments with adding the ItemMeta on the ItemStack
oooh
So either get the ItemMeta after calling bucket.addUnsafeEnchantment
Or add the enchantments to the ItemMeta (which i would suggest)
Does anyone happen to know if there is a library to randomly access chunks of an unloaded world?
How do I add paper to use this?
I'm using gradle
I tried this in the build.gradle but it doesnt work
?whereami
Hi, im doing an upgrade but how can i check after clicking on top of an armor with a specific item? https://sourceb.in/29Gc74VbTi
How can you check what exactly?
im checking if the player with an Prismarine clicks into an armor piece
quick question: when hitting this entity, how can the loation be null even tho i spawned it? https://pastebin.com/xZUQqqab
Get the type of the cursor item and check if its == to a Material.
Get the type of the clicked item and check if its one of the armor Materials
whats called the clicked item?
You didnt spawn anything. You just tell a player that something has spawned but there is actually nothing on the server.
private static final Set<Material> ARMOR = Set.of(
Material.LEATHER_HELMET,
Material.LEATHER_CHESTPLATE,
Material.LEATHER_LEGGINGS,
Material.LEATHER_BOOTS,
Material.IRON_HELMET
// ... and so on ...
);
public static boolean isArmor(Material material) {
return ARMOR.contains(material);
}
What are you even trying to do?
spawning npc
yes but how can i check if the player click with the prismarine into the armor piece?
Check the cursor and afterwards the clicked item. I dont know what else to tell you...
EnumSet ๐ฅบ
Dont
i know what consequence it has, wondering when they're finally gonna change Material to be a class
soon
https://sourceb.in/fjcBkLZhGo you mean like this?
Nope. Now you are checking the cursor twice
and then what i need to check if not the cursor?
InventoryClickEvent#getCurrentItem()?
the PR was rebased onto 1.19.3 yesterday I think
so ๐
cope 
Yes
How do i spawn a tipped arrow with the World#spawnArrow method?
It takes a Arrow class as the parameter
You cant do that with any spigot classes
because theyre interfaces
The deprecation looks like a warning. Similar to getPlayer(String)
It has no alternative approach in the deprecation which means you should just use it for now.
But how do I get a TippedArrow class?
Like we said already, we cannot construct spigot interfaces
TippedArrow.class
that doesnt let me choose the effect
Huh?
public void spawnTippedArrow(Location location, Vector direction, float speed, float spread) {
World world = location.getWorld();
TippedArrow arrow = world.spawnArrow(location, direction, speed, spread, TippedArrow.class);
arrow.addCustomEffect(...);
}
ah thanks, ill try that
*For custom effects on arrows. I assumed thats what you wanted.
If you want just vanilla tipped arrows then you should just set the potion data of an Arrow
What are custom effects?
if you set teh potion type to instant it shoudl become an Arrow of Harming
Something you cant obtain ingame
TippedArrow arrow = player.getWorld().spawnArrow(..., TippedArrow.class);
arrow.setBasePotionData(new PotionData(PotionType.INSTANT_DAMAGE));
This is what i have so far
ill try it
Well then you should use a normal Arrow
Arrow arrow = world.spawnArrow(location, direction, speed, spread);
arrow.setBasePotionData(new PotionData(PotionType.INSTANT_DAMAGE));
thusday
\๐
Is there a way to set this arrow to be sent from a player?
Player#launchProjectile
@dry yacht When you are back, as I expected its rejected https://hub.spigotmc.org/jira/browse/SPIGOT-7263
Not surprising at all
elgarls name is steve?!
but how did that pass unnoticed
No clue. it's not in 1.8 nor 1.8.3. Only 1.8.8 suffers
ahh
just have to never build javadocs for 1.8.8
good
i made gigantic code
and it seems to work
but it looks so sus
parses Turing's machine data into classes
essentially deserializes data from file
yeah I mean if you want you can def put that for loop structure in a function
i hate those guard statements
data is different for each input stream retrieval
xD
doesnt give me the option for spread and speed unfortunately
well you could probably still condense it using templates, bt idk if that would help readablility
and that's not even the main problem
now i need to cleanup heap
memory
with destructor method
or just fix the offending comment
not all that hard to do, and just build the javadocs lol
yes you coudl do that yoruself, but BT pulls from Git for every build so local changes are lost
thats alot of make_error_code
1.8.8 is not going to update
so its a non-issue
It was mainly just for simplicity so everyone BT would work without error
rather than just one version failing
id probably work with lambdas but idk how those work in cpp
Nearly same as in java, but you can also pass in non final variable
Anyone know why .orbs is red?
why do you have eco.eco
its my economy
well its not public
This is on a new class
yea
thats what i tought lol
Do i just make it public instead of static?
Would that work?
both
Aight
also it's static, you should access it through the class, not an instance reference
well normally you should use a getter
well normally we would first need to know the purpose of this hashmap
uh
so
orbs is a custom economy i made
and eco.eco is the economy so .orbs will add to the economy
is there only ever one map of orbs?
What i think i have to do is to tell the other class to use the .orbs because i dont think it can find the .orbs
if eco.eco is the class that implements Economy, then what's eco lol
another class cannot find a variable thats private so yeah
buildtools runs just fine?
eco is my eco and the other eco is the economy im using
whut
its hard to explain
well then its also hard to code
its just when building javadocs for 1.8.8
I already coded it i just need to access the orbs in my new class
How do i make it not private?
remove the private prefix?
and replace it with public ofc
oh didnt read you were talking about javadocs
wait whatcu mean with private prefix?
?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.
private static String string;
public static String string;
private and public would be the prefix
hello , am i doing anything wrong?
it keep spamming this :
java.lang.IllegalStateException: Not scheduled yet
at org.bukkit.scheduler.BukkitRunnable.getTaskId(BukkitRunnable.java:134) ~[server2.jar:1.8.8-R0.1-SNAPSHOT]
at dev.muntder.addon.skypvpaddon.sumo.core.arena.ArenaCountdownRunnable.run(ArenaCountdownRunnable.java:34)
guys how i can create a button to use like a command?
eco is the wrong class then
Are you calling that run method somewhere?
That would be why no not runTimer I'm talking about the run method
you do cancel() although your thing isnt scheduled
This?
please just look at some basic java tutorial
I already watched alot
show the declaration of "orbs"
decloration?
Where the orbs variable is created/defined
The class is named "economies"
that's a weird class name. it should be Uppercase. Anyway, you can access the orbs field using "economies.orbs"
?conventions
might need some code
It works fine just these numbers thats a bit yeah
Is this a code error or do i have to add a code to fix this?
we are gonna need some code to tell you the error
Did you to string the entire map
its showwing the uuid and its value
most likely this
Ah aight
so what do you expect it to show instead? just the number?
uuid
skip to string
just format it correctly
not uuid.toString()
Yeah so when i break a block the 0.0 gets to 1.0 wich works fine
Oh thanks yall lemme try
Call orbs.get(uuid)
use getOrDefault cuz ((Double) null).doubleValue() will throw
Ohh aight
Wait so what should i add inside the ()?
getOrDefault()
you have to understand what happens
i think i need to rewrite this
even though it works
memory management would kill me
you have a map<uuid -> Double>, if you're calling get() on that map and there isnt an entry bound to that uuid, it will return null
So i think it needs to check the players orbs, because whenever someone joins it checks that players too asweell
but because you compare the result with some double, it will call Double::doubleValue() on the result to go from a Double -> double primitive
ooo yea
if its null it will throw a nullpointer ex
?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.
so you could use map.getOrDefault(someUUid, 0) >= whatever
Wait so i replace the orbs with that?
map is a placeholder
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. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
you should probably learn some java about methods
and for later: dont abuse the static keyword
exposing collections to other classes in this case
static has feelings too, don't abuse it
ill abuse you
?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.
heeheehee flashbacks to when i wrote this https://paste.helpch.at/tudojoyona.java
you don't know the difference between classes and instances and also nothing about visibility, you should just read one of these java tutorials
or even better, a proper book about java
kinda fun how the learnjava command has been used three times now
4
people blind
hmm im wondering, internally int.class is just a Class<Integer> right?
or (some method that returns int).getReturnType()
I guess
yes
wait no
or yes
i forgor lmao
probably returns Integer.TYPE
but Integer.TYPE is a Class<Integer>???
whats int.class for then if Class<int> cannot exist
for nothing
so ig i can remove int.class in my map
no, int.class is int.class
int.class: int
Integer.class: class java.lang.Integer
Integer.TYPE: int
but the question is what must i keep in my map so looking up a value based on the return type of a method works (whether thats a method that returns an int or Integer shouldnt matter)
i have no clue what Method#getReturnType returns when its an int or Integer return type
the .map shows "cannot reselve symbol "map"
lol
wdym
๐คฆ
if it returns an int, it returns an int, if it returns an Integer, it returns an Integer ๐
I might of missunderstood because i tought he told me to use .map
im trying to avoid inserting both Integer.class and int.class
and you thought that you will magically have a reference called "map" that comes out of nowhere?
why don't you just learn basic java now pls
feels like my classmates in college
I tought so because he told me to use it?
Oh okay
What is my map name?
take a guess
how do you call it
ok its dumb and wants me to say it doesnt work
bruh
oh shi im stupid
What do you mean about "someUUid"?
hm alr
well what are you wanting to store in the map
So just UUID should work?
who is their
players
player.getUniqueId()
ok stupid
ty ty
never int.class cuz it doesnt exist
is it feasible to use NMS to programmatically overlay textures onto a player's skin? i know getting a player's skin returns in hash format, could you simply add or overwrite parts of this hash to make the player's skin appear as if they were wearing, like, jewellery?
Do i put this inside the ()?
it is, it really is

HashMaps isnt basic
it is
ok int.class is just syntaxical sugar for Integer.TYPE
hashmaps are SUPER basic
what ur asking is not api related tho
anyone here got that you've been told to learn java thread
hashmaps are one of the first things you learn about when learning about collections and dictionaries
okay but where do i put this so i can learn from it?
you're not gonna learn forcing yourself to make a spigot plugin if you dont know the basics of java yet
its just suffering
Map.put(player.getUniqueId(), value)
Map.get(player.getUniqueId())
Well, I learnt java trough spigot lol
you can do that but you probably at least knew some basic java first
im talking the very start
yea a lot of people here have.
I bet that you guys at least knew that if you do Map<String,String> myMap = new HashMap<>();, that "myMap" is the variable name, before you made a spigot plugin, right?
as in you've never touched java in your life before
yeah
Tru
because this dude doesn't and refuses to learn
and what a private/public prefix is
i didnt know what a hashmap was
i just watched a few videos and knew the basics from there
yeah but thats fine, you learn what objects do by looking them up
"data scientists" will call it a "dict" lol
this guy didnt know what a variable name was
then i just started making shit
I knew that it was just confusing that he said map. when i tought he would of put orbs but he didnt
fuck data scientists
you should be able to decipher what he means if you are making a plugin
but anyway, do you guys think this is feasible to do
why is js impl defined in a ts file lol
if you already have a resource pack you can probably fake them having a specific hex leather armor that shows it
Anyone know if its possible to change the 1.0 to 1?
do you want to round. or just remove the decimal
Round would be great
Math.round(input) should do it
issue is i have 36 different types of jewellery, and if we assume they should all fit on a chestplate it would imply making about 1.5 million textures since im not aware of any texture overlaying mechanics
thanks
theres a solid 16 million hex colours for leather armor so it could work
๐
does Math.round work, otherwise DecimalFormat
you just have to fake the armor being there to the server
String.format
i had issues with String.format displaying weird characters in game
yeah but wouldnt the resource pack need all those models?
that [?] character or smth
Why do you save orbs as float anyway
the format would be "%.0f"
alternatively, String.format() also works where you use %d instead of %.1f
just the armor you want it to appear from
and its data ofc
I used DecimalFormat but then the orbs (map) gave me an error
๐
Omg
lol
collective?
good CHRIST
me 2 years ago
?learnjava
easier to use String.format tbh mfnalex is right
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.
mf stop being stubborn
okay
you need a DecimalFormat object
you can also just cast it to an int, depends on what you want.
google it
read this
might help
So yall should i use DecimalFormat or String.format?
You should read link above
i remember when @young knoll said that he told someone to learn java then 6 months later they came back to say thankyou
why cant everyone be like that
but for all that is holy learn at least the basics
i wanted to say thank you to that guy that got banned
easiest?
you cant just slap together classes and hope it works
imo, String.format, but thats only because i use that more
I like how he is literally ignoring everyone
String.format("This is a very cool number: %.0f", input);
this is how it works.
unless you havent got a clue what you're doing
Ty ty
Just watch him yeet entire string inside of format
waiting for the "how do i remove t he "this is a very cool number""
we shall see
i have a question for you man
what are you making a plugin for right now
are you planning to make something for serious usage?
but yall im getting an error
THERE IT IS
remove the dot then
the map
gg
why the dot
so yall i got another error
xD
I AM
okay so ur Map is not in the same class i guess?
well that not the syntax of the format method
it is
well
that too ;D
bro...
in any case I dont think shouting at each other will help
you've been ignoring all the advice you've been given to learn java because you only want to be spoonfed what to do
you remove pretty much all of what help you got gave
you are not learning that way
we are not your tutor
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
so yall im using the orbs to show their orbs currency
hello
if you want to learn java then pay someone or teach it yourself
Nothing will help, as this guy is constantly avoiding and ignoring suggestions to go and actually learn smth about programming language he is working in
i have been reading up on databases a lot lately, and there is a lot to it, it seems.
oh man just wait til you find out you actually have to persist that data or its all gonna go away when you shut the server down
hmm would it make sense to use System.err here or is that only for errors?
System.err is for the error STD stream of your process.
I read the suggestions and none of them is the issue
dunno how that helps me
then what is
we are telling you to learn java
use this,getLogger.warn(); in your plugin.
use loggers
it will solve like 90% of ur issues
its a standalone lib without logger lol
you dont seem to understand that your unwillingness to learn basic java first IS the issue
the issue is that we are not syntax parsers, all these things you have stumbled upon are just java syntax issues, which you can only solve by learning the language
I will go learn it once i finished this "basic" code
Not really, it's same as cerr in cpp, some consoles might color it in red
well its not basic enough if you stumble over it like you do now
if we help you figure out this one plugin you will not have learned anything and you will continue to ask questions
go learn the basics first
you're wanting to do a small currency plugin i take it right?
thats the most basic of basic plugins
So its "basic" to solve this?
depends.
of course it depends im exaggerating slightly
but for purely having currency thats basic as hell
Hes being ironic
not really.
why isnt it? its just storing a number with a player value and persisting that data
thats what i mean with basic currency
it is not as simple as you imagine it, though.
if you wanna be able to do anything with that currency you're laying features on top of that
oh yeah, i forgot about spigot persistence api.
Bro i already made the freaking currency and value and all that im just tryna get this value into the scoreboard
then yeah, it is pretty simple.
THATS VERY "basic"
it is lol
i was thinking of a database just now.
check the syntax of that method: https://docs.oracle.com/javase/7/docs/api/java/lang/String.html
i have been thinking about databases quite a bit lately.
you're literally just misusing the format method
its 1 map call
and the map call thats failing for one reason or another
help me with my reflective pojo mapper :(
Yea the orbs is the map
why the map call is failing i cant tell without seeing the rest of the code
if you want to call a map in another class you need an instance of that class or the map to have a static getter if it is static
show some code?
Hi, im trying to get a file from my plugin in the resource folder, but when i use my method i get this error: java.lang.IllegalArgumentException: URI is not hierarchical this is my method to get the file: java public File getFileFromResource(String fileName){ ClassLoader classLoader = me.CarsCupcake.SkyblockRemake.Main.class.getClassLoader(); URL resource = classLoader.getResource(fileName); if (resource == null) return null; else { try{ return new File(resource.toURI()); }catch(Exception e){ e.printStackTrace(); } } return null; }
And this is my argument for fileName: "schematics/test.schem"
its just a gist rn from months ago https://gist.github.com/FourteenBrush/43bf9fe001e6bb697fa0e1823e9c31bc
JavaPlugin#getResource
Bro i already did it
you want to call a map in another class
i use this as you see in code
orbs is in another class
did you make your method static by any chance
it returns URL
you dont
oh wait my bad its this one
yeah
But this is already in another class
try using "./schematics/test.schem"
file not found
get an instance of the class
oh wait
if you say idk you already know the response
sorry i use classload hehe
its public static so he should be able to do <class>.orbs
its an ugly method but it works
you're trying to load it from the class loader, that means you're trying to get it from /inside/ the jar
is that right?
yes
ok
you forgot generics.
just making sure
or templates.
the generics dont need to be specified in the new HashMap<>() part
try just / in front, not ./
yea right
its in here
do /schematics/test.schem
because thats not the syntax
ill try
9xx2 you are so dense it's unreal
with no dot in front
you got given an example, you removed that example
you're misusing the method and complaining it's not working right away
there's several steps of what you did wrong
String.format("This is a very cool number: %.0f", input); this is what you got given
you removed the entire string in it
are you accessing a static member from an instance object?
the string is what determins the format
lower case class name
ok.
we have all said to learn java atleast twice each
why are you guys trying to help somebody who very clearly has no idea how to write Java
just stop
Caused by: java.lang.IllegalArgumentException: file not found! /schematics/test.schem
first letter of a class name in java is upper case, by naming convention, probably.
in your case you probably want to use String.format("orbs: %.1f", economies.orbs.get(uuid))
so just make em uppercase.
they dont know java and refuse to learn it
thats the most ill spoonfeed you
so what were you trying to do? get the plugins/your plugin/schedmatics/<some file> file?
You can't really get file instance from inside of jar
try using getResourceAsStream instead, get it as an InputStream, and then you can copy it out of the jar and get an actual File object
in here is a file that i want to load
JavaPlugin.getResource should already return an input stream
they're using ClassLoader#getResource
ahhh\
which returns URI
cant you just do File f = new File(plugin.getDataFolder(), "schematics/somefile")?
it's in the jar
wait
data folder is not the jar
mess with JavaPlugin#getResource
you need to get it as an inputstream, copy it, then get the file
JavaPlugin.getResource("schematics/somefile") would also work
there are still people who havent blocked him? lol
idk im enjoying calling him stupid
InputStream inputStream = Files.newFileInputStream(plugin.getResource("schematics/x.y"));
Path filePath = Paths.get("output.txt");
File file = Files.copy(inputStream, filePath, StandardCopyOption.REPLACE_EXISTING).toFile();``` or smth
Isnt strings for messages?
brotha
dont brotha me
Dude i know??
hmm ill give this a try
"its for messages" ๐ฟ
๐ฟ
no
its for if you wanna send something
๐ฟ ๐ฟ ๐ฟ ๐ฟ ๐ฟ
go troll somewhere else
i am just quietly lurking and spectating.
none of us are going to spoonfeed you all the code you want
is there still no option to completely hide messages from blocked people?
with bd yes
ive literally already spoonfed it and he still dont know
I still always see this annoying "2 blocked messages" shit
betterdiscord plugin can do that
holy moly smokes getting help in ohio fr
you'd probably be the one crashing the dangerous chemical train bro
?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. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
I didnt bro they told me to add a string and i did it
tbh if alex blocks you, you really fucked up smth hard
bruh
String.format("your string here", your, replacements, here);
is how that method works
sometimes finding a person this dense is very entertaining
Thannks ma boi
you were told that, but you refused to do taht
waiting for the "whats X mean"
Thats not the first time i hear that i gotta tell ya lol
that should be telling
that you are in fact super duper dense
you should try opening up to other ideas sometime
it's very freeing
dms
oh my lord
I FUCKING KNEW IT
?
I am too busy to help in DMs right now, I believe you have the brainpower to solve this yourself
Believe in yourself
I help you for 105โฌ per hour
hell naw bruh
honestly thats a bargain
alex expensive asf
hire me and i will basically code this plugin up for you, 2000 dollars.
get out your moms credit card
trust me, it will be one of the most optimised plugins lol.
i want to see first
i wonder how long this will continue lmao.
i wanna see what he dmd simple now
he's already annoying everyone for 1.5 hours now
got a pretty clear idea of what
but just gotta be sure
honestly its funny as fuck
asking him to check dms got me giggling
Files.newFileInputStream is not existing, should i just use the return from JavaPlugin#getResource() ?
you guys really put up with some messed up stuff, for the amount of expertise i sometimes see some of the members have.
heh
dont worry im gone now ๐
and files class existing
but not the method
he enjoys that when we talk to him
just ignore
i mean the method is not existing and in my project i dont have a files class
did you use the right import
Bro how does that even make sense?
java.nio.file.Files
everyone loves attention
fr
yeah thats probably the wrong one
its not
it not ? bru
isnt
nvm.
nio
ye i use the one from nio
kinda surprised cuz i have it on 1.17
i think files were already introduced in java 8
so, i have been reading up and watching tutorials on the mysql database over the last few hours, and there seems to be a lot to learn here.
well, its whole new language
its not just a new language.
its different for every database.
not syntax wise, but like how it works.
and optimisations.
wdym ?
each database uses its own kind of indexing and data structures probably.
that method doesn't exist
anyway, i have been using sqlite in my main project and, would the sql syntax i write for sqlite run the same as it would in mysql?
there are some smalls differences syntax wise
can't really tell you what on top of my head
most of the stuff is interoperable between both
but as Goksi said there is certain minor stuff
that is different
like BLOB's for example I think
the most important for me is the optimisations and indexes.
i am super sensitive about the runtime complexity and performance of my code.
not sure if sqlite has indexes ๐ค
it does.
TIL about indexes lmao
if you dont write good indexes, you probably should use a plain text file, probably. Won't make much difference, performance wise, i assume.
is what it appears to be.
lmao
its not really taught in school is what i have noticed as well.
or even in universities perhaps.
there is many DB related things not taught
yeah i was referring to uni
probably because it is so different for each database.
bruh i thought you said that class didnt exist
like, creating functions on MySQL ๐
we actually learned that
just look at the inputstream methods
oh that is very good you learned that then
but i really don't like its syntax
nono its the method, and copy returns a long which tells you how many bites where copyed
create function x
begin
end
there is two ways to create functions for mysql
you can create a function via a query
or you can create a static function from the backend side
in the program code?
no, its more like plugins
doesn't need to be code specifically
i just get the sha1 with mc-packs.net, though im sure theres also a direct sha1 converter without having to upload a pack to some service
functions are not really nice to use though in mysql, they might prevent the indexes from being used and make the queries perform slower.
there is also view thingy, i never understood what that is used for
thers another one which returns a Path
create view x
depends. They are more handy to aggregate data into another table for example which doesn't matter for indexes
ye
then mc-packs.net will be fine
perhaps just shortcut for query
but this method i just for coping from 1 path to another path
so ResultSet in java is basically a view ?
you could consider it one yes
you literally explained better in 2 sentences then my professor lmao
doesnt it copy the physical file?
actually you can also use sha1-online.com to convert your link to sha1, with mc-packs.net you'd need to use the mcpacks link for server.properties
could be
?
better way to put it
a view is obtained from a resultset and is a virtual table
the fields in a virtual table can be fields from one or more real tables in a database
But yeah as I said, it is just a way to look at the same data but in different ways
Thanks ๐
seems kind of inefficient, write something in the program to do that kind of thing?
what for
very handy for using to generate graphs and charts dynamically ๐
why
You dont need the hash of the link, you need the hash of the resourcepack
What the best option for displaying timestamps into seconds, hours, etc without messing a lot ?
you need to specify the charset or whatever.
doesn't that hash the link?
If you want to manually assemble a String then you can use
long stamp = System.currentTimeMillis();
Instant instant = Instant.ofEpochMilli(stamp);
int h = instant.get(ChronoField.HOUR_OF_DAY);
int m = instant.get(ChronoField.MINUTE_OF_HOUR);
int s = instant.get(ChronoField.SECOND_OF_MINUTE);
Otherwise you need a DateTimeFormatter to format the Instant
Use a command such as sha -1 * to compute sha-1 checksums (provided you are on a system that supports sha, but that should be the case under linux)
oh right, really thanks, if im not wrong luckperms uses Instant too
Using guavas hashing utility:
File resourcePack = ...;
String hash = Files.hash(resourcePack, Hashing.sha1()).toString();
Cant you use MessageDigest too?
that is a lot of lines tho 
answering to?
you and the message digest
Welp minecraft expects an sha1 hash tho
Any reason why java didnt already implement a good time parser, so then you can parse time better. Instead of harcoding for parsing time formats like: 1h, 20w, 50s, etc
What are you expecting to do?
oh right
Now everything makes sense for me
Then call .asBytes() instead of .toString()
Minecraft already has this feature built in
That can be modified by spigot files ๐คฆโโ๏ธ
How can I stop only INVISIBLE item frames from being destroyed if they are not attached to a block?
oh wait i remember it used to be atleast on 1.8, maybe was pruned on nwer versions
or if they are in a block
probably want to make my errors a lil better
I want to install adventure api but I am facing such an error,
did you add adventure's repo
yes
nah, should be on maven central
<repositories>
<repository>
<id>sonatype-oss-snapshots1</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
Uhm, then invalidate caches, restart your IDE and if that doesn't work install eclipse
that's not their repo
i did try this
Did you reload the maven project?
That is for snapshot builds
You want regular builds though
As per https://mvnrepository.com/artifact/net.kyori/adventure-platform-bukkit 4.2.0 is available on central, the default repository
How can I stop only INVISIBLE item frames from being destroyed if they are not attached to a block or if they are in another block?
I'd doubt so
sorry , i wasn't home i just came back , its still the same error
once the countdown hit 0 , it spam the error
how do i disable offline mode
I don't know - you should know how to use your IDE
Suggestions are open, i want to get recommendations if possible
#help-server this is only for programming/coding related
I wont recommend coding anything without first learning the lang where you are cooding, you will have lot of issues if not what i tell u is from bad personal experiences i used to have
wifi symbol in the maven tab
Hee? No, server properties
oh LMAO,people isnt really poiting to what they need
He never looks at context
no because you dont really give good contexts, also and mainly when helping
Yesterday i was asking about a time issue because it was getting negative the time value, and they where saying me to use a HashMap when i was using Redis as Cache ๐
Send the entire stack trace
?paste
Please send full stack trace there - thanks
oky
Thanks ๐
Windows decided to switch my keyboard layout so I couldn't find ?
I'm not getting this, I always thought that returned value of server.dispatchCommand(this, command)
represents whether result of onCommand for certain CommandListener successful or not.
However it seems that Spigot do nothing with result of execute so my question is why
public abstract boolean execute(@NotNull CommandSender var1, @NotNull String var2, @NotNull String[] var3); returns bool?
what would the issue behind that even be?
That should be 01:00:00 to match the time format
but yeah looks fine
and that, yeah
oh right i just realize that
I ask because i want to know if its good to be used or can a be a better way for displaying cooldown/times
perfect
declaration: package: org.bukkit, interface: Server
Instead of using the bukkit scheduler to run, use the run methods directly on your bukkit runnable
new BukkitRunnable?
ok
See it's not exactly the same as running correctly or not. Doesn't check that just checks for the target
ye but still why does CommandExecutor.onCommand returns bool? how this bool is interpreted by spigot?
Yes
@gleaming grove https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/command/CommandExecutor.html#:~:text=true if a valid command%2C otherwise false
declaration: package: org.bukkit.command, interface: CommandExecutor
Is that the answer you were looking for?
if you return false Spigot will show an error message for that command
Does it? I have test that and doesnt return any error message
The error isn't with the execution of the command itself it just checks if it's a valid command so if it was registered before
return true = command ran fine and no error.
return false = an error occured adn display error message
It does
Which message?
I learned it the hard way
Yes i know how it works, but never seen spigot giving you an issue message, maybe doesnt happen while using BukkitCommand class
the error goes to whomever issued the command
it is dependent on how you coded the return for your command
so how can I trigger command with code and obtain onCommand(CommandSender sender, Command command, String label, String[] args) result? As we discuss before server.DispatchCommand() returns only information if command was found or not
The one defined in your plugin.yml or the default one which is something like Usage: /<command>
OHH right, now makes sense
if you code your command to always return true
then the bool returned isn't always helpful you know ๐
yeah i prefer better using voids throwing custom command exception! ๐
And then on my command parser cacthing them
?pdc
its for me
ohh lmao
How can I stop only INVISIBLE item frames from being destroyed if they are not attached to a block or if they are in another block?