#development
1 messages · Page 107 of 1
@night ice Hey
Do you know how to add scoreboard that can be configured through config.yml
Scoreboard:
Title: 'TITLE'
- '1 line'
- '2 line'
- '3 line'
- www.wded.com
like that
nah, haven't worked with scoreboards yet!
but there should be people who have worked with them here
so you know the plugin.yml has the libraries feature?
does it go for the same with bungee.yml?
Check the code of bungee
import React from "react"
import { BrowserRouter, Route, Switch } from 'react-router-dom'
import HomePage from "./pages/HomePage";
import LightAccessPage from "./pages/LightAccessPage";
function App(){
return (
<BrowserRouter>
<Switch>
<Route path="/" component={HomePage} exact />
<Route path="/lap" component={LightAccessPage} exact />
</Switch>
</BrowserRouter>
)
}
export default App``` Why is CSS from HomePage applying to LightAccessPage?
Probably cause the path?
How can i see if the player closed his inventory and not the code?
have a variable that you set to true if you closed the menu then on close event check if that is true or not and also set it back to false if it is true
I'm curious, how would you go and do a packet system on java, using sockets I guess?
example: #development message
You bass buffers of data(byte buffers) through one socket to the other
You can see how minecraft takes those buffers and creates what it needs.
In each packet
You need a way to know what you’re receiving with something like an op code pretty much just giving your packet an id
As the first byte of the buffer
I mainly get it but what do you mean with through one socket
like I send the buffered byte on the socket?
You have two sockets. Client and server. They pass byte buffers between eachother
oooh now I get it more
Very useless for a plugin
so basically I send a buffered byte with the data on it (like int to byte or so?
) and an id so I can identify it?
pov: Conclure wants to make his own proxy
You have bytebuffer in java which you can think of as a smart byte array. If you wanted to pass through say a “packet” with an id and an integer. You can set the first byte to the id. Then the next 4 will hold that integer
Then you send that from your client socket to your server socket. And if the first byte received on the server is that id then you know how to disperse its bytes
I now get it better, so in resume, data to byte + id + send socket = receiver socket, read 1st byte if(firstbyte.equals(id)) {disperse}
Yea pretty much id(usually a byte) -> data(anything you want your packet to hold) -> send to server
ok then
if (first == WHATEVER) {
val i = readint
time to learn bytes and some random lambdas to make my life easier
Lmao yea it’s some good shit to know.
Just learn to make a simple client to server msger
yeah that stuff is actually really cool
That’s a good introduction to networking
There’s tons of resources out there for it as well
i did a sporadic deep-dive into packets and stuff when I wanted to make a packet interceptor for my proxy lol
turns out the plugin was super outdated so I had to upgrade it to the new version of the packet parsing API lol
any articles or docs? lmao
noop
example?
Wtf who’s star 2
just looking at the source code that already existed
me
him ^
Thought I was speaking to the og star
no, no!
LMAOOOO
Lmaooo
ever since the semester started he has taken up the mantle
It’s conclure I see
kekw
Idk just search up any java networking tutorial. Or byte buffer examples. Just fw byte buffers in a psvm and learn how it’s used
ghello my firends
final int[] ints = new Random().ints(0, 27).distinct().limit(6).toArray();
this line is red underlined
what's the problem?
probably because toArray returns an Object[]
😮
toIntArray is a thing I believe
what? xd
int[]::new
yeah that's the one
Identifier expected
so pretty much ik what to do, thx @lyric gyro
This isn’t conclure
what
oh wtf it used to be
Conclure would never make his own sockets in a mc plugin
oh
I'm not making then into a mc plugin
Lmaoooo
^^ + ic
kekw
now I have a lil problem
half of my mind wants to mention the person that made the example I linked on the question
but my common sense say no no
What’s your goal even?
:help_me:
doing some communication between client and a server, is for a mod
well that piece of the code is underlined
new int[0]
image
when I want to barry to work it doesnt
and when I dont want to it to work it does
help me
point is that until Tier 2 you cannot send images
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
FINALLY
he will be always be the og one
I'm not here for that
I want to import PAPI to my plugin using maven, but I have honestly no clue what I am doing. This is my current pom.xml https://paste.helpch.at/ugeputojeq.xml, it is located under src. To no ones surprise it does not work, and as I said I have no clue what I am doing. No guide or tutorial that I found, gave me much help. Does any one know how to fix it?
does it throw any errs?
Not that I can see
Though is it automatically loaded with the plugin? Or do I have to enable it under onEnable()?
ohhh what
This is my entire console output: https://paste.helpch.at/mevakarofe.md
but when building the plugin
Ohh
also update to 1.17 lmao
I know lmao, I just stole the .jar from my server network lmao
Though no
It prints no errors when building
1.- WHAT
2.- weird x100000
aaaaaaaaaaaaaargh
I don't know what I'm doing with this, no one told me. The guys on youtube was like "Create your pom.xml, then it works"
lol
so I got a string like this "/lmao", how would I remove the / from it?
d;jdk string#substring
public String substring(int beginIndex)
throws IndexOutOfBoundsException```
Returns a string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string.
Examples:
beginIndex - the beginning index, inclusive.
IndexOutOfBoundsException - if beginIndex is negative or larger than the length of this String object.
the specified substring.
String#substring(1)
nice, thanks
Or you could do str = str.replaceAll("[^a-zA-Z0-9\\s+]", " "); to remove all special characters, also StringBuilders
Also, eclipse says there is an error with this pom.xml but there are no formatting errors in the file? Only in the package explorer there appears to be an error...
ew eclipse
Ik lol, but I started with it and haven't bothered to change lol
Still help me tho? lol
Intellij is really useful for coding
Yeah, I wish I had gone with it. But I have so many projects and stuff I can't be bothered to
How would i get the bitcoin value from this site? (in code) https://bitvavo.com/nl/bitcoin/koers
Can someone please help me, why does this show me errors? There are no errors in the file, but my IDE keeps telling me there is. I just wanna do Java again 😦 https://paste.helpch.at/nixirocohe.xml
what are them aaaa
Wat are you saying, me no understand? :V
what errors is "ew eclipse" giving you?
This: https://ibb.co/nDgKVQn
It is just red and tells me compiler error when I build it
I see no error
Look the icon of the pom.xml?
It has a red bit, and an X
Aka error
Also I get this: https://paste.helpch.at/rekugusuya.sql
your plugin.yml is wrong
Make sure what jar contain plugin.yml in resource folder
Doesn't it Zhenaxel? Is it wrong folder? Idk what I'm doing...
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
Or that, yes
Is that incorrect: https://ibb.co/nDgKVQn ?
It should be here (I'm on phone, can't upload photo in imgur, ill send image on dm)
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
When they break it to a stone block
b.setType(Material.STONE);
Doesnt work
but gets to the next line
Any idea?
What?
do you want people not to be able to destroy the block of stone?
public void onBlockBreak(BlockBreakEvent e) {
Player player = (Player) e.getPlayer();
Block b = (Block) e.getBlock();
if (b.getType() == Material.IRON_ORE) {
player.getInventory().addItem(new ItemStack(Material.IRON_INGOT));
b.setType(Material.STONE);
player.sendMessage(ChatColor.BLUE + "Fields> " + ChatColor.YELLOW + "You have mined 1 Iron Ore");
if (!(b.getType() == Material.IRON_ORE)) {
return;
}
}
}
}```
Like that
e.setCancelled(true);
b.setType..
No
I just want it to replace the block
I like how it adds the item of itemstack
Ohh i got it
thank you
How can I convert Minecraft world time to rt seconds?
time % 1000 * 3600 / 10000?
Do I have to remove player onLeave from BossBar via bossBar.removePlayer(p)?
if (b.getType() == Material.IRON_ORE) {
player.getInventory().addItem(new ItemStack(Material.IRON_INGOT));
e.setCancelled(true);
b.setType(Material.STONE);
player.sendMessage(ChatColor.BLUE + "Fields> " + ChatColor.YELLOW + "You have mined 1 Iron Ore");
//runable here after this line for 1 minute
b.setType(Material.Iron_ORE)
if (!(b.getType() == Material.IRON_ORE)) {
return;
}
}
}
}```
How do I do a runnable
in PlaceholderExpansion#getPlaceholders, does that have to be in the %identifier_placeholder% format or placeholder?
first
ty
i had a really bad time finding that one out
👀
literal hours
what is the method even used for?
tab completion
o
i think there is for ecloud expansions, idk about internal
Hm?
I mean I didn't know about that, and the method documentation says nothing about the format, I was returning the placeholder "value" that comes after the identifier because it seemed sensible
That didn't work lol
I have a lifesteal plugin and I'm trying to make it so they cant go over 40 hearts.
But I don't have a way to do so.
Your dms are closed
my bad!
why do interfaces extend other interfaces instead of implements? just curious how that design decision came to be/why it makes sense
a normal class implements the interface while an interface extends it if I'm not wrong
In its most common form, an interface is a group of related methods with empty bodies
yeah ik
classes implement interfaces and extend abstract classes
but interfaces extend other interfaces instead of implementing them
Because once implemented, the methods of an interface should be overrided, and since on interfaces you can't have implementations, you are enable to implement an interface by another interface
Anyone know whats wrong with this code? It's supposed to generate something that looks like the json on the left, but it generates what's on the right:
https://images-ext-2.discordapp.net/external/ynT88Jmh__5cstj4YwNhIGWhbjjMw8VVC_GD2h5zQGc/https/upload.skyslycer.de/idea64_mQMwoRypD4.png?width=673&height=274
https://media.discordapp.net/attachments/891512729645490216/920302596072284230/unknown.png?width=1440&height=343
(code not by me, screenshot from our dev)
try a normal array
Hello excuse me. Where can I see Deluxe Chat updates after registering my spigot account?
when did u purchase the plugin
in the past
I bought it today a couple of hours ago
u will have to update for the database to update then, which has to be done manually
u can check when its updated the /buyercheck command
once its updated u can do /spigot check to get the role
any recommendations to use for making a website for my server?
Ghost
Thanks ill check it out
Can anyone, preferably with Eclipse experience, tell me why this is printing an error and how to fix it please: https://paste.helpch.at/tovohuwehu.xml. IDE view: https://ibb.co/1Tq2fQP
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>helix/src/main/resources/</directory>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
idk much about maven but try removing the targetPath entirely (never seen that one) and remove helix/ from the directory
Noop, I updated it to: https://paste.helpch.at/ofezimawik.xml. It prints the same error. Any other idea what it might be?
I tried follow this btw, https://bukkit.org/threads/tutorial-setting-up-maven.204521/, which is why the targetPath was there. I know it is old but idk Maven
mm how are you building the plugin exactly? what's the process you follow to get yourself a jar file?
Export -> Selecting "helix" -> Finish
please don't delete the message just to ping me
it's annoying and i'll see the message anyway
i'm not going anywhere
Sorry, some ppls just go away for hours cuz I don't ping & want me to ping. But I respect that, won't ping more
you want to build with maven, which that is not doing, that's specific to eclipse and it "ignores" maven, they are two separate processes, you want to stick to one only (ideally maven)
idk eclipse's maven integration but from a terminal/cmd line, inside the project dir, you can run mvn clean package so it actually uses maven and the pom config file
googling "eclipse maven" will likely yield a dozen tutorials on how to use its integration properly
Quick suggestion is to switch to IJ since it's a lot easier to understand
I mean I would, I tried a while ago. But I'm so used to eclipse, idk even how to export with IJ lol
usually you don't use these export features from IDEs
you stick with maven and gradle for that
and by usually I mean you should never use them lol
it's fine for things when you're starting sure
but when you need to add libraries, dependencies and all these fancy things, you ditch them and switch to a proper build tool anyone can use and reproduce regardless of IDE
Yeah I've always been coding bukkit and spigot stuff. This is my first time working with an API and Maven, so yeah...
Also, I ran a clean verify for my project, and it is telling me I'm using a JRE instead of a JDK. So Imma try fix that
hello I can't link my discord account with spigot because I had already done it in an account that is now banned, can someone help me?
What's your old account name / ID
the account is now a "Deleted user" and now has no id
The only thing I know is the id of my spigot
If anyone was trying to solve the issue I sent, I finally managed to get it solved. Thanks for your help!
@night ice Hey can u please help me with this
Actually you could ask it here openly, anyone would eventually help 😃
are you creating a new instance of your plugin with new PluginClass()?
yes
dont do that
Dependency Injection
Dependency Injection is a way of providing objects with the objects they need ("dependencies"). This is usually done with a constructor, but can also be done for individual methods
Read more here: https://en.m.wikipedia.org/wiki/Dependency_injection
Dependency Injection in Java:
https://paste.helpch.at/yijawupoju.java
Dependency Injection in Kotlin:
https://paste.helpch.at/esogakutod.kt
import React from "react"
import { BrowserRouter, Route, Switch } from 'react-router-dom'
import HomePage from "./pages/HomePage";
import LightAccessPage from "./pages/LightAccessPage";
function App(){
return (
<BrowserRouter>
<Switch>
<Route path="/" component={HomePage} exact />
<Route path="/lap" component={LightAccessPage} exact />
</Switch>
</BrowserRouter>
)
}
export default App``` Why is CSS from HomePage applying to LightAccessPage?
so close to using colors 
fixed the coloyurs :))
colOwOrs
is <Route path="/" component={HomePage} exact /> the same as <Route path="/"> <HomePage /> </Route>?
Hi guys, I use JavaPlugin#getConfig in many classes which means lot of DI
I want to ask what is best way to design code to don't repeat this in almost every class?
private final Practice plugin;
public Class(Practice plugin) {
this.plugin = plugin;
}
private void voidMethod(Player player) {
**FileConfiguration config = plugin.getConfig();**
//player.sendMessage(config.getString("PATH"));
}
You could make a interface and have the getconfig in it
Okay so basically create interface, have getConfig in it and in classes just implement the interface, right?
Yeah thats What i do But i dont really think it matters when your talking about performance
Just like yo mama
thx
Okay, thanks
Okay, I'm dumb, how to get plugin in interface 🤔
I usually do a message class
In your Main plugin instance you can do a static getInstance and retrieve it from the interface
well people say making static instance for accessing plugin is bad
Or you could just have a method within the class
public Class(Practice plugin) {
this.plugin = plugin;
}
private void voidMethod(Player player) {
//player.sendMessage(getConfig.getString("PATH"));
}
public FileConfiguration getConfig() {
return plugin.getConfig();
}
}
I'm asking how to avoid that
Like my problem is repeating it in almost every class
Actually calling a reference is not a duplication
But it's annoying
@cinder forum then try something like this...
Another problem with the current method you using is... In case we change the key of a message in future... We may need to lookup on every class and change it... So it actually creates a havoc there
I think if you want to use a config without calling static interfaces you have to go with the approch with a different config class you can call static like @night ice said
alr, thx
I will try to avoid static there...actually
I worded that wrong i meant having a bridge between the config file and the command ,that accesses the config without a static value ,but you can get the bridge static.
ooo..yeah...the ConfigurationHandler in my case
Yeah would prevent any problems that comes with a static instance but ive used static plugin instances before and it has rarely caused any problems. Its bad practice but its easier
Don't ask me why its bad...i donno too...but, if i can initialize it with needing a member object or atleast a variable for its own...i usually do non-static....
even my utility files are non-static...i just initialize them on JavaPlugin#onEnable() and get a getter from there...
If anybody here is free, i am ready to hear why static are bad... out on the web its all just arguments..didn't find anything reasonable
I remember someone telling me that it can cause memory leaks when sometimes the variable is not initialized and just crash without saving data correctly or handling the onDisable.
But i really think its overblown and it would work 99.9% of the time
Logically i don't think this is the cause...yeah...static variables and methods are live till the execution ends...but is it really that?
Idk i just heard it from someone but idk tbh
If anyone knows...like...feel free to share 😃
Hey guys I need help with scoreboard, i want to manage scoreboard lines from config
config.yml-
scoreboard:
title: '&c&lTITLE'
lines:
- 'line 1'
- 'line 2'
- 'line 3'
And?
Hey, need a quick help on bounding box...
34.0 90.0 34.0 -- -6.0 50.0 -6.0
This is the max and min of the bounding box
and its saying this location is not inside the bounding box
x=13.485806371152478,y=70.0,z=15.6606373887297,pitch=0.0,yaw=0.0}
public boolean isInside(Location location){
return this.boundingBox.contains(location.getX(), location.getY(),location.getY());
}
IG i found
nvm
Does anyone know if there's an easy way to create an API jar from your original jar file? Same structure, but with empty method bodies (returning null, 0, etc.)
Hi, i must be being really stupid but im having a bit of an issue using the bukkit libraries, im geting an error with the imports but have the spigot 1.18.1 jar file in my libraries, am i forgetting something?
so im getting errors such as
package org.bukkit.command does not exist```
how are you importing it?
in project structure, under Libraries then i select the jar file
.tile:hover{
border: 2px solid white;
}``` Can anyone explain what in the fuckery is going on here lol
Y are you not using maven/gradle?
Inspect element, there is probably other classes overriding it
blockformevent maybe
can't remember how to use the bot 
declaration: package: org.bukkit.event.block, class: BlockFormEvent
oh?
it doesn't look deprecated
I'm going to presume it's a problem elsewhere in your code
Send us any code you got if you can't find the issue
I'd used it in the past for catching concrete formation and it worked, I presume it works fine for obsidian/stone/cobblestone generation too
lmao
😮
yeah the event definitely is dispatched for all those 3 cases (obs/cobble/stone)
and other block formation cases too, not just those
Can somebody help me? I can't link my spigot profile because I already have it in a "Deleted user" account that has no id
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
whatever code you have that relates to this event
registering it, the new class
what mc version you on?
I'm guessing you're missthinking of what this event fires on
Ya, somebody asked how you were testing it but removed it
I did, buy Yarin already stated it above and someone else already showed the only possible things that can fire the event.
this
I'm having a feeling it's not being registered
yeah it definitely works, I just tested it and it works lol
I'mma go ahead and blame it on 1.8
yikes the formatting
Yarin, please type /ver ingame or in the console, and send us what you get back.
ohh 1.8
craftbukkit???
ye
Hello, what is the cobblestone generation event? been looking around but didn't find anything :(
blockformevent was in 1.8, but didn't work for cobble yet
might not be possible in your version though
I wish you good luck
version 1.8 was so far right I never even read it 😂
why would you do that 
doesn't paper already have it?
hey i can’t dm funnycube
ok, @ him in #off-topic I guess and wait for him to respond
ah np
it worked, thanks
i’m not able to dm funnycube…(sorry i didn’t know where to send this)
And?
oh my bad thought that message didn’t send
So how would I go about doing a multi-project gradle config, like:
###Root Project/
build.gradle.kts
settings.gradle.kts
git repo stuff
Module 1/
gradle stuff
Module 2/
gradle stuff
I think this is posible, so like I can set general repositories and per project set dependencies and make them depend in each other (or so?)
project(":[module_name]")
Something like
implementation(project(":library"))
will allow you to depend on the module :library
(that is for gradle kotlin dsl)
it is similar for groovy but just different syntax
how would i get the player's inventory but also get the main hand separately?
huh?
so you want the inventory without the item in thr players main hand?
gethelditemslot, then loop through the itemstack array and remove the item at that slot, something like that
well i basically want the inventory without the main item in an array/list
i might be able to just do PlayerInventory#setItemInMainHand and set that to air then after getting the inventory set the main hand back to the original item
¯_(ツ)_/¯
Wdym get it seperately lmao
Is there no getItemInHand
Just don’t act on that slot when you do shit with your whole inventory
yes there is
d;spigot PlayerInventory#getItemInMainHand
um
bot?
i mentioned itemInMainHand so i assumed thats what they were talking about 🤷
But the former is gonna get yeeted probablt

~~any ideas why intelij might be doing this?
ive cleared caches and restarted multiple times
https://cdn.discordapp.com/attachments/615715892365623299/920888116108201984/unknown.png
https://cdn.discordapp.com/attachments/615715892365623299/920888799184187432/Screen_Recording_2021-12-15_at_9.01.59_PM.mov ~~
fixed after clearing caches for the 5th time
I hate when shit like that happens lol. You do the same thing multiple times and after one of those times it magically works.
Hey people
I'm planning to make a POS (point of sale) system as a project (Wanna recreate the store's system from where I work for memz)
How should I go about it, and with what programming languages/libraries
Like I'm thinking node.js with react, but I don't know much about react, and node.js is familiar, but I don't have experience with the libraries in there
I kinda wanna do Python but that's mehhh I guess
Hello wondering if anyone can give me a hand when i ran build tools i ran into [WARNING] The requested profile "remapped" could not be activated because it does not exist.
the command i did was java -jar BuildTools.jar --rev 1.18 --remapped any help would be appreciated
Make sure you have the latest jar
Anyone know any good api for holograms for 1.18
holographic display maybe?
or do you want a library that you can build inside your plugin?
need something like non-dependent on others...something like a lib
yeah some what simillar
yeah nah. Idk any. but if you were to go with an external dependency maybe look at decent holograms. is pretty nice.
hmm..most prolly, i won't go external...my friend has a lib which he is currently writing...would wait for that
i would be impressed if those windows xp machines could handle an entire V8 engine
how do i order a hashmap from highest value to lowest?
hashmaps are unordered, hence the name
you can use a linkedhashmap if you want order
then it depends on if you're sorting by highest key or value
No only software
I think
ah you're not actually running it
All I do is win!
Its a fun project
i mean i guess it comes down to what backend preference you like
could be cool to do a pub/sub thing with Redis or similar
i mean if you want lightweight on the actual terminal, you'd want something pretty chill like Redis or Webhooks
mmm that would be a fun Rust project actually
wonder if LLVM supports compiling for Windows NT
thank you!
never use mysql, use mariadb
and mariadb and postgres are relational, mongo is not
so that influences your design pretty heavily
my hashmap returns this: string=double, how would i remove everything after the = in a string?
cool
string#substring
or just split by = and get first part
whatever you want
java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because "this.protocolManager" is null
Why does this happen?
I have ProtocolLib both as a depend and as a maven dependency
private ProtocolManager protocolManager;
public static CaughtIn4K instance;
@Override
public void onEnable() {
instance = this;
this.protocolManager = ProtocolLibrary.getProtocolManager();
PacketAdapter packetAdapter = new PacketAdapter(CaughtIn4K.getInstance(),
ListenerPriority.NORMAL,
PacketType.Play.Client.CHAT) {
@Override
public void onPacketReceiving(PacketEvent event) {
PacketContainer packet = event.getPacket();
String message = packet.getStrings().read(0);
System.out.println(message);
}
};
protocolManager.addPacketListener(packetAdapter);
i don't even know what this means
he probably ran map#tostring or something instead of getting the key
ProtocolLibrary.getProtocolManager(); is giving you null
yeah but why
yes
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
i expected that to be the issue, though it didnt say that on the protocollib readme
yeah you're shading in your own ProtocolLib as of now, so it obviously can't get a manager as it was never registered
a good rule of thumb is that you never want to shade other plugins that will exist at runtime
I think mongo
Because its more dynamic which i like
But on the other hand sql is relational
yeah PoS sounds like a really good place to be relational
Ye
Popos
But i do like mongo a lot
I am trying to make a hashmap that is orderd by doubles, i am using linkedhashmap rn but it seems to only order it as it was put in to it, how would i make it automaticly order by the value of the doubles in the hashmap?
al.put("dash", parseDouble(CryptoAPI.getCrypto("dash")));
al.put("litecoin", parseDouble(CryptoAPI.getCrypto("litecoin")));
al.put("bitcoin-cash", parseDouble(CryptoAPI.getCrypto("bitcoin-cash")));
al.put("maker", parseDouble(CryptoAPI.getCrypto("maker")));
al.put("ethereum", parseDouble(CryptoAPI.getCrypto("ethereum")));```
u should use a tree map instead
pretty sure that orders by the default ordering of the keys or you can give it a way to order when you make the map.
ah. you need it by values
nvm
i mean, override the put method, have it sort every time?
or try to configure a treemap in such a way yeah
also. pretty sure you can find an algorithm to sort maps based on values out there. stack overflow must be full of those
oh absolutely
i tried this:
al.put("dash", parseDouble(CryptoAPI.getCrypto("dash")));
al.put("litecoin", parseDouble(CryptoAPI.getCrypto("litecoin")));
al.put("bitcoin-cash", parseDouble(CryptoAPI.getCrypto("bitcoin-cash")));
al.put("maker", parseDouble(CryptoAPI.getCrypto("maker")));
al.put("ethereum", parseDouble(CryptoAPI.getCrypto("ethereum")));
for (String k : al.keySet()) {
nl.put(Collections.max(al.entrySet(), Map.Entry.comparingByValue()).getKey(), al.get(k));
al.remove(k);
}```
But `for (String k : al.keySet())` gives a null error in the console but i wouldnt know why https://paste.helpch.at/apazozudir.rb
Anyone that knows how to fix it?
that is not how you do a sorting algorithm
wouldnt it work?
no, you can't edit something while you're iterating over it
Map<K,V> topTen =
map.entrySet().stream()
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
.limit(10)
.collect(Collectors.toMap(
Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));```
this is by far your best bet
but thats top 10
change the variable name and remove the limit(10)
yes
I deadass want to do react with node.js
But I don't know much react
And haven't used node.js as much as other languages
LinkedHashMap<String, Double> cryptoCurrencies =
map.entrySet().stream()
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
.collect(Collectors.toMap(
Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));```
legit just that
that's fucked lol
ty
for a server backend or a client frontend?
Both
Java, C#, Rust, C++
for both
lol
Python, even
Flask is pretty cool
JS is just fucked man
even PHP is better than it now
PHP 7 and Laravel is actually not the worst
Might go flask then lol
🤮
I shared your opinion until very recently Yugi
I agree
But a friend of mine showed me his Laravel code, and I also looked at Ptero panel, and it's really not that bad
PHP 5 is still absolute dogshit for sure
Ngl express js is nice
But PHP 7 with a nice package manager, kinda cute
Why use php 5 then
And next js
well you don't for new projects lol
Altho js but yes ts is possible
I just kinda hate JS
I mean js is quite fine imo
I mean no, not really actually imo
PHP is still absolute dogshit for sure
Just press delete on the old ones
Eh
have you looked at Ptero's code?
Go and Laravel
kinda cute together
Star
So was js, but lesser
Why u no like js
what's there to like
it's a shitty language that people molded into a monstrosity because it was the only one all the browsers supported
The weak typing isn’t that bad
I might go flask then
like, it REALLY is
I mean I can’t relate to your hatred towards weak typing
Fluttee
dude all it does is cause problems
I hate working with Python and JS for that reason alone
React/Kotlin
Vue?
I mean python does kinda have some explicit typing
Python isn't usually so bad, but doing numpy shit is a pain
Like you have to convert shit if you want to concatenate altho string interpolation
Just really makes you miss the nicety of Java and its methods

I like Python
I dunno, I'm kinda ironic because I am using Django both at my work and for a server I work with out of my own volition
But that's just cause I don't like any of the other MVC offerings
I do still hate the weak typing
I never understood django
I feel its hard to learn on your own
Like I"m sure if someone explains shit to me I'd understand
I never understood who thought it'd be a good idea to write a library in python for the tasks django is suited for - why python
I never understood how you people learn so many languages.
it is just really easy to do
and lots of support and stuff
it is really easy to jump off a cliff and die
i dunno, if given time, I'd probably use a different framework
but this was kind of a rushed job and I needed something I already knew
should I do that though
no
should people use python for stuff like this?
god no
I mean python is fine imo
I mean python isn't that bad for it actually
Yuh
it really doesn't do that much
Like sure, weak typing can be a pain in the ass
most of the processing is on the actual server, so like uWSGI and Nginx
But python has some nice features fr
yeah it is definitely my go to scripting language
very quick and easy
and although the weak typing is a pain a lot of the time, sometimes you just kinda mash things together in a super weird way that would totally not work in any other language, and it just works
Ya
Lolol
Honestly its hard to choose a language/library now
😂
I'm defo not gonna use django
Probably flask because its basic as fuck
I've recently been using Next and it's amazing
Yuh it’s like walking on beautiful clouds
The new version's compile time is insane thanks to Rust
nuxt is nice too but damn next is good
Can somebody help me? I can't link my spigot profile because I already have it in a "Deleted user" account that has no id
public void hideUs(Player player) {
String name = "us";
org.bukkit.scoreboard.Scoreboard scoreboard = Bukkit.getServer().getScoreboardManager().getMainScoreboard();
team = scoreboard.getTeam(name) == null ? scoreboard.registerNewTeam(name) : scoreboard.getTeam(name);
team.setOption(Option.NAME_TAG_VISIBILITY, OptionStatus.NEVER);
team.addEntry(player.getName());
}
Where... DId... I... Mess?!
(It doest does what I "code")
Guess you need to make a new Spigot account. .-.
you are allowed to swear btw
Sometimes I do not like to, but when I am really angry like now, I can't really control myself.
It just makes me angry that there are no errors, and the code doesn't work. I even tried to do by searching on YouTube, and even from HelpChat (yes, we are talking about this channel), and no valid code.
Life of development for you
W... What...?
Are you just trying to hide nametags
Da.
Because I am lazy to do player nametags be colored.
And that's how we agreed with the other dev. c.c
(yes, we are hiding nametags from every server)
(not including team-moded minigames like BedWars or KitPvP (wait thats not a minigame xd))
What does that even mean
yo. can someone link me the essentials javadocs? I remember they existed but can't remember where to find them. googling doesn't help
Just delete it blitz
This is not working for some reason. Some classes aren't showing up
I'm missing net.minecraft.world.level.BaseSpawner
delete what?
We want to disable the player plates (nametags). The only place where players can see other players is the tablist.
ah. very helpful.
good for you
It adds many unnecessary commands for me, so I never use it.
Make a new team and add all the players to the same team.
The actual problem: the team is never registered, and I do not know why
And I am stuck with this like... 1-2 hours...
And ik its not that many, but its almost midnight
And ofc I need to go to school tomorrow.
team = scoreboard.getTeam(name) == null ? scoreboard.registerNewTeam(name) : scoreboard.getTeam(name); - this is the line that should register the team, but it doesn't works for some reaosn.
Very nice. I made a useless crap.
To be honest: it doesn't matter how I name the team. It is just never created.
c.c
Even tho I call the event somewhrere else in the PlayerJoinEvent void
hmm
I realised the scoreboard is not even edited.
The lobby scoreboard and the nameplate hider is in the same class, and the scoreboard was not edited.
I swear I am gonna explode if the restart was required.
wdym by this?
Reload did not made any changes, even with the fact, it needs to.
So I restarted the server.
reload 🤮
It is an easier way to do, since the server is hosted on a local machine atm, and there are only two plugins. The core I am messing up with, and an API, that is a Data Center for the whole network.
c.c
There are no changes even after the restart. WTF is going on...?
I mean a restart takes like 4 seconds being generously slow
unless you're using spigot and not paper which uh yeah consider using paper
Okay I just realized that my IDE cannot even export JARs due to something being missing, so it is time to reinstall my IDE.
I always used Spigot... .-.
🥴
But as you wish.
I actually hate this slow speed.
Guess I will also need to get a better processor.
no idea, never messed with player nametags
👍
I realized what the error was...
The user...
...of Windows...
Learn a lesson: reinstalling Windows never makes you the true abality to rename yourself.
ALWAYS use the same name you used before..
Or don't use Windows 😌
I would use Linux, but it always crashes, so I use Windows 7 instead.
Anyway, the error is fixed.
:kek:
How can i return or use to return /test command [name] ? --> [name] thats what i need to return
What the fuck lol
Fun fact: I lost an entire project due to Ubuntu's stupidness of being a useless terminal
The project was never started again. :p
Oh well yeah Ubuntu isn't the greatest
But what does "being a stupid terminal" mean lol
Ubuntu is godlike
Absolutely incorrect
giving the user the power to do stuff xD
There is nothing good about snap packages
depends exactly which sub distro
and him not knowing how to do it
And besides, why use Ubuntu when you could use Arch?
Arch is hard to install
Not the derivatives
like which
EndeavourOS, Manjaro
Both extremely easy graphical installers and they come with some nice defaults like a pretty desktop environment and Yay
Yay is just really good, I don't think I could go back to apt for a daily driver
yay!!!
Exactly!
idk. I am on popos
Yeah popos is pretty cool, they're even looking at moving away from Ubuntu as a base
are they? idk. I know that the popshop is recommendig flatpaks over .deb. idk if that's good or not but I've noticed those are usually more updated
popshop lol
Yeah they're making their own desktop environment and everything
If Pop! Became an Arch derivative I would very much consider using it, just for the nice look and feel
Though I am pretty comfy with my XFCE setup so maybe not lol
man. I love pop xD
why linux is better for programming? 😄
pretty sure you'll find tons of videos on youtube giving you different opinions. I don't just use it for programming. I use it as a daily driver
some gaming as well
windows is staying for the few games I Can't run on linux at all
I’d just like to interject for a moment.
What you’re referring to as Linux, is in fact, GNU/Linux, or as I’ve recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.
Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.
There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine’s resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux!
And that's changing quickly! BattlEye support is already starting!
we don't give a shit emily!
Whats your opinion on linux vs windows why linux is for you?
problem is not even with that xD. Can't run csgo for some reason. used to be able too but at a lower framerate
Oh lol
because it runs on my laptop
It compelety turned into a useless terminal. Anything I typed was instantly removed
without crashing
No matter the time I waited, login panel never revealed itself.
And the extreme amount of crashing was already ####ing annoying
It's much more lightweight and working with C stuff is basically impossible on Windows. There's so much really nice stuff about the terminal and file system and everything
It crashed like every hour or half-hour.
Sounds like someone fucked their desktop environment
yeah idk what you installed lol. xD you probably did some stuff thinking you know what you're doing and just messed shit up
Who needs an OS thats crashes that common?!
yeah exactly! who needs windows
I have literally never had a crash on Linux
Like you must be doing some real scuffed shit
Would you recommend linux for knew programmer like me?
only had one and it was my fault lol
Oh yeah, Linux is great for everyone. Start off slow with a dual boot so you have both, and ease yourself into it
star did you see that pop is on rasbery pi now!
Lots of command line stuff is vital for programmers
With updating drivers, and not having absolutely no icons on the desktop???
Damn, interesting
There is a problem i have onlu 240gb ssd
What drivers were you using lol
The ones the OS required
yeah. update 21.10 which launched a few days ago added support for raspberry pi
Like you must've done something pretty bad to fuck your DE that hard
Ah
You were using the shitty Noevaeu drivers
hello star i love you
Probably yes
But for graphic I used the NIVIDA one.
Probably the problem is woth my processor.
It just... Sucks...
hey.
so im still a little new to the idea of an API for my plugin. But if i want to make an API for my plugin while hiding all the actual plugin code, how would that be done?
I assume you would just not include the stuff you dont want people seeing, but then wouldnt it just give errors since its trying to use code it doesnt have access to?
Or would that not happen?
Hi everyone I need help please
material: head-extended_clip
slot: 12
display_name: '&r'
How Can I get a texture
of another page example:
https: //minesk... .com /2b8f1e7ed5f44fdbba44a3601510c167"}"]}}
how Can I get that's skull
have you tried google?
Look up "How to set custom model data for minecraft heads with spigot via URL"
but How Can I put yo:
@wise steeple
Can u help me?
is this deluxemenus?
if so #general-plugins
i was so confused lol
have an API jar file which is the public one, purely interfaces; you can have it as a separate module or another project altogether but it obviously makes more sense if it's in the same project as another module
that api is then implemented by (and shaded in) your plugin
awesome, thank you
Is there any reason why i shouldnt have this in the top of my main class?
public final NamespacedKey entityTypeKey = new NamespacedKey(this, "bs.entityType");
Like, im gonna use that key multiple times
So i wanna make it, and store it somewhere
Any reason why i shouoldnt store it in the main class
no particular reason ig
I mean, public mutable things are always not what you want to see
how is it mutable
uhh how come theres no RED_STAINED_CLAY but there is RED_SHULKER_BOX, RED_WOOL, etc
or am i missing something?
you're missing 1.13+ API
i am
im using 1.17.1 paper
😌
the server owner upgraded because i showed them viabackwards/rewind
lol
oh wait i misread your question
there is no such thing as stained clay no more
it's terracotta
lmao
smh
D:
um
how do i get the java Byte class in kotlin?
specifically Class<Byte>
Byte or byte?
interesting
"Beautiful patterns" what a joke lol
everything is on java 16
Update gradle to the latest, change the gradle sdk to the latest in your project settings
make sure intellij is set to use the gradle version in gradle-wrapper.properties
(by default it's set to use gradle wrapper version or smth like that - idk what that means but its easier to manage from gradle-wrapper.properties)
dont use gradle
i use maven
why does everyone always asume i use gradle lol
because gradle good
Ok
Anyway
all the project stuff is 16
should i install 17 and try form there?
welp
it still doesnt work
gradle
no
😠
everything uses maven
ive seen like 3 things that use gradle
and i tried shading in gradle and it was way too confusing
also false lulw
btw
if i want to sort a list with each of the items in the list having a boolean variable, and the true ones come first before the false?
|| xy: showing owned kits before unowned kits ||
i rarely see anyone have a gradle repository
the only thing i can think of is having another loop to make the new list
but im wondering if theres something that can make it easier
unless their interchangeable
lel
¯_(ツ)_/¯
gradle is a build tool
sigh there is no such thing as "gradle repo"
gradle uses maven repositories
there are no such things as gradle repos/dependencies
this^ but gradle also uses its own module file which is not pom (in the actual maven repo)
silent would you like to learn why gradle is better than maven?
🥲
bet
also would just like to quickly mention that gradle is widely used in the larger java community, it's just not overly popular in the spigot community (although it is gaining popularity with things like paper switching to it)
i see
why is gson on both maven and gradle
what kind of monster is this
This is not an officially supported Google product
so unrelated to all that
i have a problem
[19:56:14] [Server thread/ERROR]: Could not load 'plugins\BetterSpawners-1.0-SNAPSHOT-shaded.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:170) ~[server.jar:3096a-Spigot-9fb885e-af1a232]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:144) ~[server.jar:3096a-Spigot-9fb885e-af1a232]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:381) ~[server.jar:3096a-Spigot-9fb885e-af1a232]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:224) ~[server.jar:3096a-Spigot-9fb885e-af1a232]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:928) ~[server.jar:3096a-Spigot-9fb885e-af1a232]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[server.jar:3096a-Spigot-9fb885e-af1a232]
at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 7 more
plugin.yml isnt being put in the right spot
show build file
maven
so pom?
im assuming by build file you meant build.gradle?
but im still using maven for the moment
yes
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use

made a little comparison for you silent
24 lines vs 70
that's an identical config to yours
anyway you might have to configure a resource dir for maven manually or something
try just doing a clean build first
ok
didnt work
u ran the clean task?
yea
look into this then
would it be easier to transfer to gradle or do that?
yes
Last time i tried it didnt work
Elaborate.. I am a very stupid person
if you be stupid my help won't be effective
so you can't be stupid
let's try and transfer and we'll see
lol alright

okay
