#cant use the options of the team
1 messages · Page 1 of 1 (latest)
Your current class creates a memory leak
a what
wdym to make help channel acceptable
also you said You See so im guessing a roast is coming
whenever you call new Teams(...)
another new Teams(...) will be created cause of Teams owner = new Teams("OWNER");
no
This is a fastpass to a stackoverflow
oh since the method is called Teams it will create a team and then make another one of the field
i can try and help
(did i get that right?)
well sort of
its just like you would do
void lol() {
lol();
}```
infinite recursion
which ends up with a stackoverflowerror
won't it just crash if ur right
if Im right then it will crash yes
u called me gay so expect me to be suspicsous of what you're saying and telling me to do
also i saw u deleted the message, you forgot to delete the other one :p
i'm pretty sure i did
to spigot support email
righty
or whatever it's called
I wish I could turn of autocorrect on my phone
but iOS sucks thoroughly
he admitted it tho
I did kinda
and now he lyin on how it happend lmao
but it wasn't what I thought I wrote
he lied back then too
Buenny are you floofsy
oh
It did

press x to doubt
well Idk its hard to prove
im guessin you gonna skedaddle?
anyways as said take it with md5
again, i did i think
no
or it was with other helpers
its just i thought you were familiar
other helpers don't have the authority to manage other staffs tho
never call new ClassName() inside the same class
oh i was told to do a constructor so i searched it up and followed along
cause idk what a constructor is
i swear to god if you tell me to learn java-
its a method that runs when new ClassName() is called
btw here
that was like 20 min after when I came back in case you didnt see
yeah i saw that
oh right not a lie
if it did autocorrect then it means you said floofgay atleast once in your device
i mean flo gay
let me see
well I probably didn't type floofsy but something similar like floogsy and then it autocorrected
Do you have an iphone?
Oo here I tried
that's a 50% chance it autocorrected or a 50% chance it autocorrected to a past message
^^^
like luckperms?
sure
i was told teams fixes the % bug
(where if you type something with or just "%" in chat it makes it default chat format)
y'know i could probably just disable the format and then broadcast but i'm already doing this sooo
ye
wait i fogot to actually activate the thing
on the main class
dumb question: how do i do that
wait lemme just try to put it in onEnable
nope i failed
lemme make a command
sure
ok gimme like 5-10 mins
go do something else in the meantime
question: why is this doing else? i only did /teams create
if (arguments.length >= 2) {
send entire code
package com.buenny.makacore.teams;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class TeamsCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String s, String[] arguments) {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cOnly players can use this command!"));
return true;
}
Player player = (Player) sender;
if (command.getName().equalsIgnoreCase("teams")) {
if (player.hasPermission("teams")) {
if (arguments.length >= 2) {
if (arguments[0].equals("create")) {
Teams owner = new Teams("OWNER");
player.sendMessage("&a&lSUCCESS &8» &7Created group \"OWNER\"");
} else {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c&lERROR &8» &7Insufficient arguments!"));
player.sendMessage("");
//help here
}
} else {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c&lERROR &8» &7Too many arguments!"));
player.sendMessage("");
}
} else {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c&lERROR &8» &7Insufficient permissions!"));
}
}
return true;
}
}
oh and thank you for helping and not being mean
btw/teams create
is only 1 argument
cuz the command name /<commandName> does not count as an argument
yes but it's >=
yup
if its equal to 2
or higher than 2
however /teams create is lower
it only has 1 argument
then it will do the if thing
wat
if (arguments.length >= 2)
if arguments.length is higher than 0 maybe
👍
right
no worries lol
ok so i did it and it and then did /team list (the vanilla command) and it said There are no teams
hey conclure
when do u have to go
conclure?
ye
how much time before u gtg
hello?
o ye
ye
lmk what u needed help with now again
like a scoreboard team?
You need to do something like Bukkit.getScoreboardManager().getMainScoreboard().registerNewTeam("name")
ok 1 sec
ok sorry i took so long i was making up a game and explaining it to fellow spigot bois in #help-development
anyways it didn't work, /team list still says "There are no teams"
the built in team command?
package com.buenny.makacore.teams;
import org.bukkit.Bukkit;
import org.bukkit.event.Listener;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.ScoreboardManager;
import org.bukkit.scoreboard.Team;
public class Teams implements Listener {
Team team;
public Teams(String name) {
// ScoreboardManager manager = Bukkit.getScoreboardManager();
// Scoreboard board = manager.getNewScoreboard();
// team = board.registerNewTeam(name);
Bukkit.getScoreboardManager().getMainScoreboard().registerNewTeam(name);
}
}
wdym
maybe you need to call ((Player)commandSender).getScoreboard().registerNewTeam(name)
unsure
what does that do
but there are no scoreboards, im confused
oh okay
then Bukkit.getScoreboardManager().getMainScoreboard().registerNewTeam(name);
should work
unless that new Teams("OWNER") is never executed
no it's in a command
yeah
?ask
oh and thank you
on threads lol
create a new thread also mayvbe