#cant use the options of the team

1 messages · Page 1 of 1 (latest)

sterile umbra
#

So

flat stone
#

lmao

sterile umbra
#

Your current class creates a memory leak

flat stone
#

a what

sterile umbra
#

no its to make help channel acceptable

#

You see

flat stone
#

wdym to make help channel acceptable

#

also you said You See so im guessing a roast is coming

sterile umbra
#

whenever you call new Teams(...)
another new Teams(...) will be created cause of Teams owner = new Teams("OWNER");

#

no

fluid thistle
#

This is a fastpass to a stackoverflow

flat stone
#

oh since the method is called Teams it will create a team and then make another one of the field

fluid thistle
#

i can try and help

flat stone
#

(did i get that right?)

sterile umbra
#

well sort of

#

its just like you would do

void lol() {
  lol();  
}```
#

infinite recursion

fluid thistle
#

in the constructor of Teams you call new Teams("OWNER");

#

what conclure said

sterile umbra
#

which ends up with a stackoverflowerror

flat stone
#

but the method isn't in the method

#

all it does is make it twice i think

sterile umbra
#

you'd think

#

well

#

try it out

flat stone
#

won't it just crash if ur right

sterile umbra
#

if Im right then it will crash yes

flat stone
#

u called me gay so expect me to be suspicsous of what you're saying and telling me to do

sterile umbra
#

ok

#

you can always report me to md5

flat stone
#

also i saw u deleted the message, you forgot to delete the other one :p

flat stone
#

to spigot support email

sterile umbra
#

righty

flat stone
#

or whatever it's called

sterile umbra
#

I wish I could turn of autocorrect on my phone

fluid thistle
#

i doubt conclure called you gay

#

he is too nice

sterile umbra
#

but iOS sucks thoroughly

flat stone
#

he admitted it tho

sterile umbra
#

I did kinda

flat stone
#

and now he lyin on how it happend lmao

sterile umbra
#

but it wasn't what I thought I wrote

flat stone
#

he lied back then too

sterile umbra
#

?

#

Not really

fluid thistle
#

Buenny are you floofsy

flat stone
#

autocorrect doesn't just correct floofsy to floofgay

#

yes

fluid thistle
#

oh

sterile umbra
#

It did

fluid thistle
flat stone
#

press x to doubt

sterile umbra
#

well Idk its hard to prove

flat stone
sterile umbra
#

anyways as said take it with md5

flat stone
#

again, i did i think

fluid thistle
#

no

flat stone
#

or it was with other helpers

fluid thistle
#

its just i thought you were familiar

flat stone
#

who knows

#

i really wanna be toxic rn but i won't

sterile umbra
#

other helpers don't have the authority to manage other staffs tho

flat stone
#

no i mean i reported other helpers

#

or you and another hleper

#

helper*

sterile umbra
#

ok

#

anyways about your issue

#

first of all

flat stone
#

anyways what was i doing

#

oh right getting my server crashed

sterile umbra
#

never call new ClassName() inside the same class

flat stone
#

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-

sterile umbra
#

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

flat stone
#

yeah i saw that

flat stone
#

that was reffering to that message

sterile umbra
#

oh right not a lie

flat stone
#

if it did autocorrect then it means you said floofgay atleast once in your device

#

i mean flo gay

sterile umbra
#

let me see

#

well I probably didn't type floofsy but something similar like floogsy and then it autocorrected

flat stone
#

press x to doubt

#

i don't use autocorrect but i doubt that's how it works

sterile umbra
#

Do you have an iphone?

flat stone
#

no an galaxy andriod

#

we're getting off topic, can we get back on topic?

sterile umbra
#

Oo here I tried

flat stone
#

that's a 50% chance it autocorrected or a 50% chance it autocorrected to a past message

sterile umbra
#

sure

#

but what are you trying to do in the long run?

flat stone
#

imma go see if it crashes my server 1 sec

#

make a rank thing

sterile umbra
#

like luckperms?

flat stone
#

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

sterile umbra
#

ye

flat stone
#

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

sterile umbra
#

sure

flat stone
#

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) {

sterile umbra
#

send entire code

flat stone
#
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

sterile umbra
#

btw/teams create

#

is only 1 argument

#

cuz the command name /<commandName> does not count as an argument

flat stone
#

yes but it's >=

sterile umbra
#

yup

#

if its equal to 2

#

or higher than 2

#

however /teams create is lower

#

it only has 1 argument

flat stone
#

yes... and...

#

so if it's two or higher it will do the else thing

sterile umbra
#

then it will do the if thing

flat stone
#

wat

sterile umbra
#

if (arguments.length >= 2)

flat stone
#

wait im a dum dum

#

lmao

sterile umbra
#

if arguments length is higher than two or equal to two

#

yeah

#

lol

flat stone
#

<= 1 then right

#

wait no just ==

#

wow im really dum dum

sterile umbra
#

if arguments.length is higher than 0 maybe

flat stone
#

wait nvm i still need a help thing for when you don't puit anything

#

<= it is

sterile umbra
#

👍

flat stone
#

i mean <= 1

#

ok gimme a sec

sterile umbra
#

right

flat stone
#

sorry to keep u waiting

#

u're actually being very helpful

sterile umbra
#

no worries lol

flat stone
#

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?

sterile umbra
#

ye

flat stone
#

how much time before u gtg

flat stone
#

hello?

sterile umbra
#

o ye

flat stone
#

h i

#

sooo we can we continue?

sterile umbra
#

ye

flat stone
#

alr

#

so um

sterile umbra
#

lmk what u needed help with now again

flat stone
#

it did not create team

#

wat do i do

sterile umbra
#

like a scoreboard team?

flat stone
#

yee

#

for ranks and stuff

sterile umbra
#

You need to do something like Bukkit.getScoreboardManager().getMainScoreboard().registerNewTeam("name")

flat stone
#

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"

sterile umbra
#

the built in team command?

flat stone
#

yee

#

that's what i did before too, is it bad?

sterile umbra
#

oh no just curious

#

send ur Teams class

flat stone
#
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);
    }

}
sterile umbra
#

weird

#

should work

#

do u use a scoreboard plugin?

flat stone
#

wdym

sterile umbra
#

maybe you need to call ((Player)commandSender).getScoreboard().registerNewTeam(name)

#

unsure

flat stone
#

what does that do

sterile umbra
#

gets the players scoreboard

#

and then registers a team on it

flat stone
#

but there are no scoreboards, im confused

sterile umbra
#

oh okay

#

then Bukkit.getScoreboardManager().getMainScoreboard().registerNewTeam(name);

#

should work

#

unless that new Teams("OWNER") is never executed

flat stone
#

no it's in a command

sterile umbra
#

yeah

flat stone
#

wait im a dum dum

#

i didn't actually execute the command

#

it works now

sterile umbra
#

oo

#

pog

flat stone
#

derp moment

#

alr could u help me with another thing?

sterile umbra
#

?ask

flat stone
#

oh and thank you

sterile umbra
#

uh

#

bot cmds dont work

#

but yeah just ask

flat stone
#

on threads lol

sterile umbra
#

create a new thread also mayvbe