#help-development
1 messages Ā· Page 1499 of 1
can someone help? my command is sending the usage whenever i execute it
else if (cmd.getName().equalsIgnoreCase("chatcolor")) {
player.sendMessage("yee");
}```all my other commands are like this and they work perfectly fine
you are returning false
u talkin to me?
Firstly, <java.version>1.8</java.version> you're telling it you're using Java 8, You should change that to 16
Yes, it returns the usage message if your command returns false.
but after it, it returns true
yes, if you're wanting to use 1.17
you are returning false
else if (cmd.getName().equalsIgnoreCase("chatcolor")) {
player.sendMessage("yee");
}
return true;
}```
you are returning false somewhere
Cannot resolve org.spigotmc:spigot:1.17-R0.1-SNAPSHOT
i'm returning false if the sender is not a player
then you will never see the usage string
@jagged monolith i get this
...but i do...
Have you ran BuildTools
one or the other
i'm confused, i don't return false in this class and i stil get the usage?
oh
then you're either seeing things or you're not seeing the part where you're returning false
send the class over pastebin or something
steals
yes, this shouldn't print the usage string
make sure you're properly restarting the server and shit
i just do /stop and then click enter in the cmd prompt so it goes bye-bye
i don't know what that means but make sure you restart the server properly and modify the jar while the server is offline, not online
i do modify it when it's offline and i'm not sure how you restart it properly
well, then you are seeing things
also i'm allowed to edit the classes when it's online just not build it, right?
yes
delete everything and start over
uh no thank you
assign a separate command executor for each command
this if else spaghetti is illegible
so all you want me to do is remove "else"?
how can i
?bt
no, I want you to create a separate command executor for each command
currently you are using one command executor for all of your commands
They are all different commands, they should all be in different classes
i am using intellij
so you need to use a million if/else/equals shits to test which command is actually happening
which makes the whole thing ass to read and debug
Have you used buildtools before?
ok this might take some time, i'll be back when i do that
doing that will probably fix your issue as well
any way to delete chunks in a world to force the server to regenerate them?
or if not, it'll make it much easier to debug
No
š¤¦
Read the post, it tells you what to do if you've not used buildtools before and explain how to use it.
i just realised why this is not working
you're probably not assigning an executor to it
i forgot to put the setExecutor in the main class
Even if you "fix" it, still put each command in it's own class.
yes, this ^^
ok
i built the jar what do i do now
Now try building the plugin
you sell it for rubies
:|
Does the plugin build now?
wait a sec
to where
ur plugins folder??
i think they're talking about the built spigot jar from bt
ohh - well then just make a new folder for ur server and run it
he built it for nms
š¤·
he can just delete the jar
the actual thing that was achieved was that in the process of building the jar, the spigot artifact was installed locally in your local maven repository
so, you don't need the jar, you can throw it away
but, your maven project should now be able to locate the spigot artifact, as now it is installed locally
spigot can't publicly distribute the artifact, as it contains mojang code, namely nms, and that would be illegal
its a shame they can't tho
cause like mojang must be aware of spigot / paper etc etc
so it would be nice if they just said that spigotmc & papermc could distribute
legal is bullshit and shit never works the way you want it to or the way it should
oh yeah i completely agree
Cannot resolve org.spigotmc:spigot:1.17-R0.1-SNAPSHOT
Did you run the buildtools for 1.17
yes
Gradle or maven?
Anyways if you use gradle you need to declare the mavenLocal() repo inside repositories block
He's using maven
Oh nvm
Morshu you will also have to reload your maven for project in addition of merely adding the dependency
Programming related questions should be asked here although I hope you have googled your problem in first hand
Yes.
ok, thanks
you should ask google those questions first, however
Ask Google first. If you still struggle ask here.
so do you know a way to modify player nbt?
open the file and modify it
it work instantly?
no
i see you are on my 1.8 list of plebians
and have asked about nbtapi before
use nms
no today I am on 1.16.5
you're on 1.8 anyway and will never update so it doesn't matter
why do you want to modify the player's nbt
most of those things are modifiable through the api
because It's for a friend and he really want to do it in command block and datapack
then ask a command block and datapack discord
You are using 1.16.5 so you can use the PDC
this is java help
no just I do a command in a plugin and he use it in a command block
may i send a link to my problem thread?
yes but you can't do it for a player
looks like i may not..
you are a very funny individual
I founded an answer but I don't really know if it work
gamble, take a chance
as for whether anyone has the effort to open it is another matter
the initial problem was solved but turned out that the method doesn't exist on the version i am using
also how can I use the vanilla selector in a spigot command in 1.16.5
let me grab my list
- closes the link *
basically, using outdated software means you don't get to use the stuff that was added since
so get rekt scrub
update or suffer
...
did you know that 1.16 supports custom enchants natively
From what I remember you have to use reflection to register enchants that show up in tables.
i prefer to suffer on a version that i know on both minecraft and spigot better than any other versions, rather than updating to a version that will lag on any device i have and that i don't know on an intuitive level
suit yourself
but, know that majority of the people who help other people here don't know 1.8 at all
so finding help will be difficult
there are plenty of 1.8 people here
you didn't even open the link i bet
Actually I did not
but they don't help other 1.8 people
for (ItemStack i : player.getInventory().getContents()) {
if (i != null) {
player.getWorld().dropItemNaturally(player.getLocation(), i);
player.getInventory().remove(i);
player.sendTitle(Color.RED+ "All your item dropped out","",10,70,20);
player.playSound(player.getLocation(),Sound.ENTITY_ENDERMAN_SCREAM,1,1);
}
}
}```
will this make my player drop all of his item in the inventory (not include armor slot) in front of his face ?
let me ping a few for you and see if they can help their fellow plebian
sure ty
@crude charm
@echo ether
@quaint mantle
i think that you shouldn't go for player.getInventory().remove(i) since dropping the item will already remove it and this line might cause NPE
one of them is pink so you should pressure them extra hard
ok ty
try it though, not sure if dropItemNaturally removes it
will 50 kilopascals be enough
it doesn't
Hello, i need a help please, what are the difference off orginal, normal and remapped ? (Spigot 1.17)
the item you obtain from getContents is a clone
dropItemNaturally will set it to air
player.dropItem(true); i randomly saw this, this still work ?
but since it's a clone, it won't be reflected in the underlying original inventory
idk, check the javadocs
ok thank you guys
it said that boolean for allitem or not
what
idk then
why u pingd me
dropItem
boolean dropItemā(boolean dropAll)
Make the entity drop the item in their hand.
This will force the entity to drop the item they are holding with an option to drop the entire ItemStack or just 1 of the items.
Parameters:
dropAll - True to drop entire stack, false to drop 1 of the stack
Returns:
True if item was dropped successfully
settype(air)
Iām still curious about this 1.16 supporting custom enchantments natively
yes
who are you talking to
set the block type to air
well, "support"
u
the api doesn't
You have been found guilty of using 1.8 and as such your sentence is to help other 1.8 offenders.
um
because the api doesn't support custom anything
i didn't even type anything about removing the blocks
this is my problem and obviously no one else gives a fuck about 1.8
but, you can pretty trivially register your custom enchantments in the nms enchant registry now
and they will be treated by enchanting ables and anvils and whatnot as they were vanilla enchantments
yeah nobody gives a fuck thatās true
the only issue is that since they don't have translation keys in the client's locale, you don't see them in the lore
@quaint mantle i will ping you every time
you are a 1.8 plebian
you should help your fellow 1.8 plebians
who is this guy
you need to unite
this guy has a problem i guess
you need to form a community
Iām surprised they donāt show a messed up translation instead
Hello guys, i have a problem. I have 2 classes, and i need take from Commands class in method onCommand variable nameS, and put it in class DB in method getMoney.
DB
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;import org.bukkit.entity.Player;
import java.sql.SQLException;
public class DB {
private Money plugin; private String host; private String login; private String password; private String sender; public DB(String host, String login, String password, Money plugin) { this.host = host; this.login = login; this.password = password; this.plugin = plugin; } public Connection getConnection() throws Exception { return DriverManager.getConnection(this.host,this.login,this.password); } public int GetMoney(String sender) throws Exception { this.sender = sender; String tableName = this.plugin.getConfig().getString("tableName"); String dbNames = this.plugin.getConfig().getString("columnFirst"); String dbBalance = this.plugin.getConfig().getString("columnSecond"); Connection c = this.getConnection(); Statement s = c.createStatement(); ResultSet res = s.executeQuery("SELECT " + dbBalance +" FROM "+ tableName +" WHERE " + dbNames +" = '"+ sender +"'" ); res.next(); return res.getInt(dbBalance); }
Commands
package money.main;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;public class Commands implements CommandExecutor {
private Money plugin; public static String nameS; private DB database; public Commands(Money plugin) { this.plugin = plugin; String host = this.plugin.getConfig().getString("host"); String login = this.plugin.getConfig().getString("login"); String password = this.plugin.getConfig().getString("password"); this.database = new DB(host, login, password, plugin); } @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { String nameS = sender.getName(); if(args.length == 0 ) { String showBalance = this.plugin.getConfig().getString("messages.showBalance"); try { showBalance = showBalance.replace("&", "\u00a7").replace("_nm", nameS).replace("_bl", String.valueOf(this.database.GetMoney(nameS))); sender.sendMessage(showBalance); } catch (Exception e) { e.printStackTrace(); } return false; }
How i can do this?
my solution would be to change the offer on PrepareItemEnchantEvent with a 15% chance, select a random offer and change it to my enchantment, then add the lore after enchanting
Or rather, the key as a string
delete
that shit isn't possible without e.getOffers
?paste
and it doesn't exist on 1.8
here comes slow mode
nice
ZBLL if u need help in 30 mins again just dm me
don't post such long stuff
i cannot do anything for now
aight ty
@wraith rapids i have a question
do you
who tf r u
no he clearly doesn't
i am the man who will create a 1.8 community
NNYa is cancer, but he's our cancer
aight nice
i created it and there's only one member
s
me
you may call me jolly christmas hitler
i won't call you
we better have people stop treating 1.8 like it's the worst thing in the world apart pineapple pizza
like
They shoudl add a 1.8 channel. Voice only š
yeah we need a community with people who can answers and not trash when the donc know
donāt
true
it's remarkable in how in over half a decade the 1.8 plebians haven't managed to establish a community or be able to backport anything from the new api
why would we separate spigot from spigot
they still linger around scattered in all of the minecraft related guilds asking for help with their 6 year old version
iāll get out
just because one spigot is a little bit older
"a little bit"
i already noticed
or he has no talent to pvp -1.8
why give a fuck about legacy when you can trash talk
yeah anyways cya
make sure to help them
alright
make sure to fuck off whenever you want us to help somebody without even trying it yourself
thank god
yeah i was like āyo wtf did the spigot team accepted him?ā
if a helper like that would exist i don't think i would still use spigot
the official helpers have mod level permissions
which means they wouldn't give me the role
because i'd ban all of the 1.8 people
why is ur name white
because i haven't verified
i would rather play on 1.8 and get banned, than ever be in the same community and opinion as a toxic piece of bad word
probably 5
ig 11
that'd make me younger than the version you campaign
or 12
Stabbed through the heart
so you weren't even there when the version got created, yet you complain about people using it
nice
1.8 is fine just please dont come running here for support
this ^^
alr
We do not help 1.8 people
i agrƩe
that's fucking called discrimination
yeah
lmfao ok
i'm fucking discriminating you
but we gotta make a new channel for 1.8
Make a forum post too
What is the problem helping 1.8 people if you got some spare time and a good heart?
since a lot of people are using it
Cuz u can specify your version
they don't have the second
Ferkish the fact is like thereās a lot of fucking new things and the api isnāt the same
My issue is people coming here
the issue is that like two thirds of the active people here use modern versions and don't have any help to give
but anyways
and more like 90% of the active people who actually help people
nnyufndjdke is 12
Then im like fuck off i just spent time on you
agreed
i mean most times i can adapt a solution for an older version, to 1.8
but in this case i just don't see a good way
Well there are still people in here who do want to help 1.8 people, so why not let them?
Not really lol
sure, but they should have their own channel
we need to concentrate all of the 1.8 people
into camps
Yeah, why don't they already have that as there's so many asking for 1.8?
The thing is there isnt a ton of 1.8 people lol
so why are you complaining
there are quite a few people asking help for 1.8 tbh
if you are not one, why don't you just fuck off instead of spamming the complaints?
just, very few of those same people help their fellow 1.8 people
hmm yea maybe
so most of the questions fo unanswered
Yeayea
it's all take, little in the way of give
Thats more accurate
i help people as well
but no one wants to help me
just because i am on a legacy version
what the fuck is that
You literally often CAN
we haven't used your version for over half a decade
it is lmfao
im not gonna go back 8 fucking years in memory to help out
but if you can't
do you think I remember how to do some thing I did like 6 years ago
then why don't you just go away and let people, who can, try and hel
p
instead of complaining like "oh you use that version? bad lmao"
Its mostly because We who predate 1.8 have mostly forgotten everything 1.8 when API features were added.
agreed
i literally fucking pinged several people so that you could get help
i am literally the only reason you got any degree of help
ZBLL woke up and choose speaking facts š
Cant you ignore people to tell u its bad then lol?
nobody wanna get pinged bc u donāt know what to answers
Instead of trying to justify urself
dude
you wrote so much
if u donāt know stfu thatās better man
for my message of asking for help to drain in your complaints
and now no one even knows what i asked for
but everyone knows i use 1.8
you should update
your goal was not to discourage me from using it
but you discouraged other people from even attempting to help me
myes
because you don't let them see what i want
Well yea
you only let them see my fucking minecraft version
ZBLL u speaking munch munch facts
The goal here is to get you to update
indeed
Please stop this nonsense zbll
ye
and that's another example
ban him conclure
alright ZBLL iām back home whatās the oroblem
Run boys, the Oranges are here!
who cares
ZBLL ok now stop we gotta fix your problem
yea i just joined this convo 5 mins ago
LMAOOOO
sure dm me
so idk
Iām afraid I canāt do that since thereās no explicit rule
Quick question: Can I save configuration file async?
BAN CONCLURE!!!
please create a 1.8 channel and make a role for 1.8ers
you can save it async yes
Can we please change "go somewhere else with ur 1.8 problem" to "either wait until someone who helps with 1.8 is here or look for help somewhere else"
ZBLL no
true
i agree
lmfao not 1.7
why no tho
thank you. I remember it was throwing an error but maybe I'm just wrong
i think 1.7 is absolutely not used
everybody spam ping md5 about creating a 1.8 channel
but yeah
Yes, its not safe so be sure to sync all your file access.
idk about 1.7 but yeah
for somebody maybe
Yes you can altho I donāt know if the map implementation support concurrent operations
vs because itās totally irrelevant
It doesn;t
or if ya dont want Conclure, let these people stop speaking when they dont have anything good to say
saving it as a file is only a read operation from the map
1.8 is over 6 years old
+1
concurrent reads are fine
so?
Or smtng like that
isn't that still a version?
so long as you don't modify and read at the same time it's fine
We dropped support for 1.8 long time ago
if no one wants to help us in a regular channel, why fucking spend time here
just make a different channel for individuals
we need a konzentrationslager for 1.8
I just wanna say you guys gotta stop this extremely toxic behaviour against 1.8 users
Use this channel as a way to get help not complain that people complain about you using a totally outdated version. If someone wants to help you then they will thatās it.
it's an lgbt of spigot lmaoo
that sounds controversial
for legal reasons that's a joke
+1
they are the same - people don't even participate but trash talk
ZBLL again you donāt have to make this such a biggie
Im not gonna entertain this discussion
thank god minus one trash talker
now me might see someone who geniunely can help
what a surprise
basically, this issue exists on all help channels and guilds
We dont know ur issue tho
everybody dislikes the 1.8'ers
on paper, it's even worse
yet, none of you have made your own guild or discord to help one another
it is very curious
I mean thereās a very good reason to dislike it needless to say
LOL
wow very cool you talk for everyone
Why'd you ping me?
nevermind already i am getting help in dms
ah, the pink helper arrives
your fellow 1.8 plebian is in need of aid
you should help him
m8 i'm literally using 1.16 right now
i mean who the fuck knew that so many people hate 1.8 just because they use newer ones
for a survival mixed with rpg project
it's "i use arch" but spigot alternative
Yay a convert
you talked about 1.8 the other day
about how it's super good and performant and shit
I still do use it for kitpvp, practice, hcf and uhc stuff like that
Sure, 1.8 is full of bugs and glitches, but it doesn't justify the toxic response
Idt im being toxic, z is just overly defensive imo
good, that makes you a half blooded 1.8 plebian
you're still capable of helping your pure blooded 1.8'er
1.8:
- pvp
- quite a big user community
- a main version of the biggest fucking server out there
1.14:
- doesn't even start up on my strongest pc
+1
?kick @icy beacon inappropriate
We dont support 1.14 either
Done. That felt good.
How old is your strongest pc
my 600mhz laptop that can barely run discord can start up a 1.14 server
checkmate, atheists
why did he get kicked
LOL
WTF am I watching (autoplay in the backround) https://www.youtube.com/watch?v=jFk-L7Wcg0g
Arnold Schwarzenegger shows us the contents of his fridge as well as explaining what his workout looks like in 2019. The star of Terminator: Dark Fate shares his approach to eating, working out and the reason why "he'll be back".
Arnold Schwarzenegger Shows His Gym & Fridge | Gym & Fridge | Men's Health
Men's Health Official Site: https://www...
LMFAO
HAHAHAHA
Now hes gonna come back and be like āi was ostracized blah blah blahā
Hopefully not
oh i saw u kicked him
āyoure discriminating against me ā
poor guy
I did warn him twice
he had reason tho
discrimination is only bad when the reason you're being discriminated for is beyond your ability to control
for example, one can argue that discriminating based on skin color is bad because you can't change your skin color
however, changing a version is simple
i can and i fucking will discriminate you on your bad life choices
I thought his āreasonā was legit like
He depends on other 1.8 plugins
And he would update if he could
But no
a robber is discriminated by being placed in jail or fined because of his choices
It was just a pre-conceived idea of performance and such
1.14 is probably the worst performing version as of late
1.17 probably performs the best
a person without education is discriminated because he doesn't qualify for certain jobs
a person on a 6 year old version is discriminated because he has the option of getting the full, updated product that would usually solve his problem out of the box, but refuses to
well the majority of the players on the server the 1.8 dev is creating will be gone if he changes to 1.17
so
hes not gonna change version
and nobody like him or me will do it
open your brain lmfao
yep, just like a career criminal rarely stops being a criminal
name a server that's popular for pvp and minigames that's running the latest version
+1
the best we can do is round you all up and try to help you cope with your deficiency
theres no pvp server for more than 1.8
no?
And its by a lot
Thereās like 0 reason to use 1.8 imo
thats not the problem, we were saying that if u dont know about anyone questions becaure its 1.8, just say nothing
Most people play on the latest version
u dont have anything to say
yah we do tho
ok bye
the only reason I run 1.8 is performance but once I improve performance on a later ver ill be switching
it's not 0 reason to use 1.8 if the majority of your player base would never switch to 1.9+ pvp
I would not be suprised if 1.17 out performs 1.8
Im really hoping for this
Yay
plus the overall quality on 1.9+ servers are worse, for example in terms of anti cheats
Ferskfisk you can install plugins which adjust the pvp to 1.8
Even if its not 100% there but close, I can get it mostly there with a custom fork
i'll add fersk to the 1.8 ping list
Same amount of people on 1.16.4 as 1.8 lol
please do that
since he's so hell bent on helping them
im adding you to the list ill ping when someone wants help from toxic people
what is your area of expertise specifically
what
have you dealed with the protocol?
If hypixel decided to update to latest version they would not lose that many players
do you do nms?
Theyād probably benefit in the long term
i do a little bit of everything yeah
With all the features
i suppose rack is going on the list too
LOL
https://paste.ofcode.org/puDekjTD698uyMyi8fRQnn
Does anyone know why opening an inventory crashes the server?
I mean once mojang decides to release the new combat system hopefully they will add a way to remove the pvp cooldowns
Natively
I can go on the discriminators list
I thought they said they wouldn't go back?
The biggest thing is nkt the attack speed
the attack speed isn't even what they complain about
Its the movement
apparently the knockback is somehow wrong
And knockback
Rebuild yoru Spigot, this bug was fixed a few hours ago
Ok, thankks
Just give all items knock back 100
Idk itās subject to change
Then it will be fixed
The best solution is to just develop a pvp system taht your server has
ban anyone who gets hit
I like the new new combat system so far
And one that updates dont change
I hate the new combat. I panic in combat and hit all the keys.
are they improving server performance or are we just doomed
lol
they probably aren't
well, there may be negligible improvements here and there
but we're not going back to 1.12 levels ever
not to mention 1.8
A free NPC Plugin
For the client id say 1.17 better
citizens
Its for 1.12.2
For the server its probably negligible
in fact I'm kind of worried about the sound block shit in 1.17
A free NPC plugin for 1.16.5
it sounds very expensive performance wise
citizens.
itās for 1.16.5 too
since wool blocks sounds, each sound that happens needs to raytrace to each of the sound receivers and check if there are obstructing blocks in the way
For 1.16.5 its not premium
and entities make sound while moving and shit
u can download it for free
Doesnāt wool only block sounds for the sensors
i have no idea how they've tackled that in practice but it sounds like it's going to be horrible
I think raytracing algo is very optimized
but it will not help developers
yeeah but more is still more
True
making every entity do a raytrace in every direction every time it moves is still going to make a pretty big impact
But thats why they also cant happen repeatedly with 1 sensor
i certainly hope not
Cooldown helps
jus gonna leave dis here for yall devs .-. https://cdn.discordapp.com/attachments/694661573125472256/853271060647247942/unknown.png
Pretty sure entities only perform raytraces when specific AI conditions are met.
looking for targets and such, yeah
anyone knows why this isn't working? i printed it and it said true so it should work
if (WooToo.chatColorHashMap.containsKey(uuid.toString())) {
looks fine
why is it an exaggeration
He's a beginner so I'm not commenting on naming or static abuse š
net.minecraft.network.protocol.game.PacketPlayOutOpenBook and net.minecraft.world.EnumHand lol
no please, tell me how to do better
wait wut
Yeah my ide found it
š
send me a bitcon addy ill send u somethin lol @dire marsh u rly did help a lot
nms changes (read about --remapped) https://www.spigotmc.org/threads/spigot-bungeecord-1-17.510208/
https://paste.md-5.net/itehupicim.java Why does it not save my comments?
I just get a config without comments
nah it's fine that only took me 30 seconds anyway
What on earth is that formatting
i did read o.O ithought it was optional doe
ill take the bitcoin
perhaps this is why it's not working?
https://i.imgur.com/b0s6cdG.png
now i need to work out how to use mojang mappings :thonk:
no
30 second...? ._. may i ask where u looked
that's not an error, more of a tip Floofsy
what does it mean
i just opened up a project in intellij with 1.17 nms as a dependency
typed the names, ctrl + clicked on them
You can also decompile the jar in your local maven repo
eclipse should be working fine with this too though
intellij huh 𤣠funny how im only on eclipse cuz intellij has a newer version of me plogen that aint ready yet lol
so now i got 2 forks one per ide
btw this is in the main class
public static HashMap<String, String> chatColorHashMap;
public static void init() {
chatColorHashMap = new HashMap<String, String>();
}```
but yeah all field names are gone now so i need to work out adding mojang mappings
saw ito n the thread so
no gradle example š¢
can someone please help? i have no clue why this isn't working >.<
if it printed as true its working. The rest of your code must be at fault.
@eternal oxide
This means that you must only use the remapped-mojang jar for development and must remap your plugin prior to distribution. For those not using Maven you can download SpecialSource to help you do this here, and we encourage the creation of instructions/tools for other build systems.
wat .___.
Anyone skilled in docker containers?
wats wrong if i use regular jar doe?
package com.floofsy.wootoo;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.UUID;
public class ChatColorFunction implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!(sender instanceof Player)) {
System.out.println(ChatColor.translateAlternateColorCodes('&', "&c&lERROR &8Ā» &7Only players can execute this command."));
return true;
}
Player player = (Player) sender;
if (cmd.getName().equalsIgnoreCase("chatcolor")) {
UUID uuid = player.getUniqueId();
WooToo.init();
if (WooToo.chatColorHashMap.containsKey(uuid.toString())) {
WooToo.chatColorHashMap.remove(uuid.toString());
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&a&lSUCCESS &8Ā» &7Chat color &cdisabled&7!"));
System.out.println(WooToo.chatColorHashMap);
} else {
WooToo.chatColorHashMap.put(uuid.toString(), "&c");
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&a&lSUCCESS &8Ā» &7Chat color &aenabled&7!"));
System.out.println(WooToo.chatColorHashMap);
}
}
return true;
}
}
```this is the code
?paste
yes please use paste
ok sorry
you can remove the if (cmd.getName().equalsIgnoreCase("chatcolor")) {
Because you canāt distribute your plugin with Mojang mappings
since this is the sole command for this executor
i did
but i mean if i use th regular shaded jar, not -remapped
I am having issues with my BuildTools.jar, it only creates the log folder and nothing else
I am using gitbash
You call WooToo.init(); after you test so you are wiping the map
I did use the mojang mappings and that works but when I remap them to be obfuscated classes, it won't run on the server. Clasnotfoundexceptions on the obfuscated classes.
Anyone having a similar problem?
then how come i see the new nms in my ide :I
instead of old nms
net.minecraft.network.* etc.
The repackaging isnāt part of mapping
i'm confused, wootoo.init is before the if statements
i didn't know it wipes it though
your init wipes teh map so it can;t have anything in it at that point
you set it to a new Map in the init?
i did?*
this is the init thing
Yes, that initializes and wipes your Map of any data
Cannot resolve org.spigotmc:spigot:1.17-R0.1-SNAPSHOT
```it gives out this
run BuiltTools
ok so i removed the wootoo.init in the command class, does it mean that if i give it to someone who didn't have it the plugin before i removed it won't be able to use the plugin?
Your Map should be intialized when you declare it it
what's declare
i think tutorials should start with a description and introduction of OOP before actually showing a single line of code
public static HashMap<String, String> chatColorHashMap = new HashMap<>();
the biggest issue new developers face is that they know how to write code, by typing text
but they don't know how the language works
oop fundamentals are severely lacking in all of the java tutorials i've seen
did i do anything wrong??
Not that I know of
btw i removed the wootoo.init thing and the cmd.getname so now it gives internal error when i execute the command
Oof
does anyone know if openjdk works on deb:jessie? Or is it not cause its older
spigot is against me today
Yes because your Map is not initialized
but u just said it will be intiliaized
Nothing in memory will persist over restarts
when i declare it
I gave you the correct line of code to initialize it
oh i thought that was one of the line of code i have
where do i put that and what does it do
look at it and see if you can figure that out
kk brb
jeez, ok anyway. I'll bump my question. Anyone got the mojang mappings working?
wait, isn't that my code but shorter?
thats initializing yoru Map when its declared, instead of using an init method
so i put that instead of
public static HashMap<String, String> chatColorHashMap;
public static void init() {
chatColorHashMap = new HashMap<String, String>();```?
yes
why declare it in a init?
idk
Its static that is not the best place to put it
He's a beginner
^
cool it works now
But wait shouldn't we show him the right way to do it
Ok, lol sorry i saw it as was like hm....
it doesn't save after restart
save it to a file or database
you people are too lax with beginners
it won;t untill you write teh saving and loading
how do i do that
when a beginner makes a mistake you make them get down and give you 20
You have to decide how you want to save it
what are my options
file or database
i don't know what that means
go for file then š
could u explain what it means tho
Does your plugin have a config yet?
i have a plugin.yml file
nope, a config.yml
then no i do not
Here you go, some light reading https://www.spigotmc.org/wiki/config-files/
Guys, I'm trying to make a helicopter fly with armor stands, I managed to make it fly and but when I teleport the armorstands to the new location they have a little delay to go and they get messed up http://prntscr.com/155t8t4
I want to know if is possible to fix it
http://prntscr.com/155tb1l
ask questions on anything you don;t understand
do you know what a computer is
like i don't have to save other people's variables on my computer, right?
yes
a computer has in principle two ways of remembering things
Your computer has two types of storage. In memory, or on your hard disc. Surely you know what files are
firstly, there is primary memory
i know what a file is but not what memory or hard disc is
primary memory is fast
but disappears when power is disconnected; it is not persistent
public Map map = new HashMap is generally stored in primary memory, as is everything you do with your code
they are rapidly accessible, but they will disappear once the program terminates or the system shuts down
in order to persist this information, to remember it, you need to write it to secondary memory; the hard drive
the hard drive is significantly slower than primary memory, but does not forget anything unless that something is deleted
what do you mean by speed
it is a physical component of the computer, and basically every computer has one
Rephrase as none of us believe you are that incompetent
like he says "the hard drive is significantly slower than primary memory"
ok
does it mean it stores data slowly?
it reads and writes data slowly
yes, slower than in memory
That is based on the type of drive also
which is why you generally do not want to do any file IO synchronous to the main thread
a HDD is slower where a SDD or m.2 is faster
say what now
also say what now
well, i'm off
ok I'm out, losing braincells I can't afford to lose reading this
why you gotta be mean tho
Imagine your desk is memory and a filing cabinet is your hard disc. When you turn off your computer everything on your desk gets trashed, but things saved in the filing cabinet are still safe.
because the amount of effort for me to somehow get you to understand these things with the nonexistent base information you have far exceeds what you should expect of anyone here
You can access things on your desk quickly, but to fetch things from the filing cabinet are slow and take time.
ah, i see
this article says i need to use my main class' instance to do stuff in config, does that mean i have to make all the config functions in the main class and then call them from other classes?
cause idk what instance means
to start with its usually simplest
i would recommend doing it in the main class if you're just starting
i have no idea how to do it tho
How to do what?
lemme just finish this article first so i atleast know how to store stuff in the config
thats what the article is for...
store config from one class to another
You don;t have to yet
you just have to learn how to create/save/load a config
Then you get onto Dependency Injection (passing instances to other classes) and we get to fix your static errors.
i still don't know what an instance in programming is
You will soon
also in the article it talks about labels, paths and subpaths
idk what those are
oh and btw thank you for helping me
paths are like the route you take through folders on your computer to get to a file
In the examples config file player-name is a path
so a path is how i get to 3 in
1:
2:
3:
oh config paths
(numbers are folders)
yes, the path woudl be "1.2.3"
ok, so what's a sub-path and a label
so labels are folders, path is how you get to a folder and sub-path are folders inside folders?
no
oh, then what?
well what's the difference between labels and folders
labels are indices within your config. folders are locations on your hard disc
they are two seperate things
what's an index
a label š
i don't understand how they're not the same thing
In this example ```yaml
player-name: Steve
player:
time:
join: 6:00pm```
everything in brown is a label
aren't time & join sub-paths tho?
yes
so they can be two things?
labels are used to access the values in a config. You use the labels to point to where teh value is stored.
player.time.join
so they are literally folders
no
to get the value "Steve" the path consists of one label "player-name"
to get the value "6.00pm" the path consists of 3 labels "player.time.join"
but join has a value, wouldn't it make it something else?
time and join are sub elements of player. They can only be accessed by going through player
no, its still a label
every label can have a value or another label
Do it exist a bungeecord event that can change the player ip before connection to a another server? Want to ip spoof the ip on certain servers that players are able to make
Well simply disable ip forwarding on certain servers
its nested like folders, but they are not called folders
ok so this sets variable "time" to the value of join?
String time = plugin.getConfig().getString("player.time.join");
yes
and this sets the value of join to time?
plugin.getConfig().set("player.time.join", time);
yes
ok
wow partydragon, quick question
when are you going to merge my PR, it's only been 16 days š
is partydragon the owner of cubehost?
depends on the project, i normaly merge when i work on the project
nameless-forms
ah i see well it missing language support
anyways i merge next time i work on that project
oh no not missing language support š but thank u
oh sorry i meant cubedcraft not cubedhost
ye
so u are the owner of cubedcraft?
yes
š®
oh cool, i got false banned from there for a month š
173 days ago
is there a changelog somewhere with the methods that were added/removed/altered/deprecated?
what does this do?
private File customConfigFile;
private FileConfiguration customConfig;```
You should already know about Field/variable definitions.
i do not
wdym by class level
Within a Class, outside of a Method
what's a method
your init() was a method
so a function?
yes
as far as he's concerned
if he knows of a Function he has at least used some other language
i know skript
close enough
Though the difference between function and method is often irrelevant I guess
This is the error
this is the code
im trying to call this method in another plugin but i get an error can someone help me
Did you shade in something?
Yea, looking at the code you accidentally shaded in something
okay but how can i fix my problem
Fix your buildscript
so this sets a private variable (a variable that can't be accessed from other classes) to the config file, right?
private File customConfigFile;
Can't really talk in the specifics without looking at the buildscript
a Private Field, yes
what's a field
a variable at the class level, outside of any method.
ok and what does this do? private FileConfiguration customConfig;
this is the buildscript
its another Field
That later is going to hold your config
declares a field and sets it to it's implicit value (null)
Set all compile scopes to provided scopes whenever it does not apply
what's hold
contain, be assigned
i'm confused
at first it was not initialized so it was null, until you called yoru init() method.
yes
when you called your init() you assigned it an object, new HashMap<>()
ok i'm confused again
Could not pass event PlayerJoinEvent to ZAAPI v1.0-SNAPSHOT
org.bukkit.event.EventException: null
at net.zaapi.npc.nms.PacketInjector.addPlayer(PacketInjector.java:16) ~[?:?]
((CraftPlayer) player).getHandle().b.a.k.pipeline().addBefore("packet_handler", "PacketInjector", h);
wdym assigned
what is problem?
= is used to assign something
yeah no that doesn't help
how can i create an instance and use it in a another plugin
so int value = 5; assigns 5 to the variable value.
oh ok
private static Main instance;
public static Main getInstance() {
return instance;
}
@Override
public void onEnable() {
instance = this;
}
yea but does it work in bungeecord
