#help-archived

1 messages · Page 90 of 1

brisk mango
#

what a stupid example though?

#

this is java tard

wraith thicket
#

I meant physically gets broken, not uses its breaks

brisk mango
#

why ur comparing this to java lol

#

makes no sense

wraith thicket
#

I rest my case.

sinful lotus
#

How can i put my proxy on the same server as my lobby?

jaunty night
#

wdym same server?

frigid ember
#

you canot asbest

#

if you mean running bungeecord and a spigot server together, like on 1 shared host you probably cant

jaunty night
#

I mean if you have a VPS you can run it on the same host

#

or just a dedicated host, or self hosted for that matter

#

but if you're talking about traditional minecraft hosting like mcprohosting you can not you'll need to buy multiple servers

pastel fox
#

How do you do tab autocomplete errors and red text?

#

The method just returns a list

#

If you type /gamemode bad, the "bad" is in red and there's an error above it

#

I want to do that for custom commands

hollow thorn
#

can you do the while(Sytem.getTickoutputthing >1000000+ w) work

#

for sleeping

lament wolf
#

Hello !
This occured

com.mysql.jdbc.PacketTooBigException: Packet for query is too large (4739923 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.```

When I do
    ```Java
private void connect(){
        try {
            Class.forName("com.mysql.jdbc.Driver");
            this.connection = DriverManager.getConnection(this.dbCredentials.toURI(),
                    this.dbCredentials.getUser(), this.dbCredentials.getPass());
            Logger.getLogger("Minecraft").info("Succesfully connected to the DB.");
        } catch (SQLException | ClassNotFoundException e) {
            e.printStackTrace();
        }
    }```
#

I tried to set this "max allowed packet"

#

But nothing changes

wraith thicket
#

@hollow thorn if you want something to happen later, use the scheduler. Otherwise you'll block the main thread and nothing will happen on the server while you wait.

hollow thorn
#

if your not using it in the main class though

#

but as the EVentHandler

wraith thicket
#

It doens't matter which class you use it in, it matters which thread you're in

#

The server runs on (mostly) one thread. So unless you explicitly scheduled an asynchronous task, you're likely on the main thread

hollow thorn
#

so as long as its not in the main

wraith thicket
#

The main thread - again, the class is not important

#

@hollow thorn I feel I need to reiterate this. Just because you're in a different class, does not mean you're on a different thread.

hollow thorn
#

so is a different file

#

a different thread

wraith thicket
#

No

#

That's what I'm saying

#

The server runs on (mostly) one thread. So unless you explicitly scheduled an asynchronous task, you're likely on the main thread

hollow thorn
#

public class StaffWeaponUse implements Listener {

#

public class StaffWeapon extends JavaPlugin {

wraith thicket
#

You're on the main thread.

hollow thorn
#

are those the same thread

wraith thicket
#

Yes

hollow thorn
#

buyt my server

#

keeps working

wraith thicket
#

Ask yourself "Did I explicitly call an async thread?" - if the answer is no, then you're on the main thread

hollow thorn
#

when i do

#

this

#

while(loc.getBlock().getType() == Material.AIR) {
loc = loc.add(loc.getDirection());
world.spawnParticle(Particle.FLAME, loc, 0);
world.playEffect(loc, Effect.BLAZE_SHOOT, 4);
for(Entity ent : getEntitiesByLocation(loc, 0.545f)) {
if(ent instanceof LivingEntity) {
((LivingEntity) ent).damage(10, me);
((LivingEntity) ent).setFireTicks(10);

                    }
#

to make a gun

brisk mango
#

@wraith thicket Probably has never heard of timestamps

#

I mean you can use timestamps/scheduler @hollow thorn , depends on what you doing

hollow thorn
#

i was making a plugin

brisk mango
#

Youre just confusing people lol

hollow thorn
#

that adds in ranged weapons

#

i was just wondering if i could use a similar thing

#

for cooldowns

brisk mango
#

this guy doesnt know nothing about threads lol, just point him in the right direction instead confusing him with threads @wraith thicket

wraith thicket
#

lol

#

I told him to schedule a task

brisk mango
#

I mean what exactly are you trying to accomplish, explaine me please @hollow thorn

#

no u were talking something about threads

hollow thorn
#

oh i wasnt trying to achieve anything

brisk mango
#

huh?

hollow thorn
#

but i was just trying to help with the cooldown thing

wraith thicket
#

If you want something to happen at a later date, then schedule a task for it

brisk mango
#

becaues its a while loop lol

#

ofc its gonna keep going if the type is still air

hollow thorn
#

yeah i know i was using it for

#

a gun

brisk mango
#

bruh you havent even provided any info of you current code and more in detail what are you trying to achieve so we cant help you atm

hollow thorn
#

oh no the code there was fine

#

i was just trying to help with

#

the cooldown

#

because when i use the gun

#

it doesnt stop everything elese from working

#

as far as i can tell

brisk mango
#

What do you mean

#

"it doesnt stop everything else from working"

wraith thicket
#

Fire it towards the air and see what happens

#

They probably shot towards some mountain or something - iterating like 100 blocks and then stops because it hit a non-air block

hollow thorn
#

it works until i spam

#

then it slows down a bit

wraith thicket
#

Or, actually, even the sky uses VOID_AIR I think

hollow thorn
#

sso i could just use

#

if Material == null

wraith thicket
#

Yep - that's why the while loop terminates (the VOID_AIR bit, that is)

finite belfry
#

hello! How can I do /enchant sharpness 1000?

#

how can I do it?

wraith thicket
#

As for a cooldown, generally you want to do it per player. What you'll do is make a mapping from the player's UUIDs (not the player object nor their name) to the time at which their cooldown ends. And when a player tries to use/do whatever is on cooldown, you check if their UUID is in the map and if it is, check if the current timestampe (System#currentTimeMillis) is higher than what's in the map

#

I don't think the regular /enchant command does that, ray - but you can simple use one of the countless online /give command generators to give yourself a sword with sharpness 100

brisk mango
#

public final class Main extends JavaPlugin {

private final Map<UUID, Long> players = new HashMap<>();

@Override public void onEnable() { 
Bukkit.getPluginManager().registerEvents(new Listener() {
@EventHandler
void onLaunch(ProjectileLaunchEvent event) {
if(event.getEntity() instanceof Arrow && event.getEntity().getShooter() instanceof Player) {
Player player = (Player) event.getEntity().getShooter();

if(isOnCooldown(player) {
player.sendMessage("Youre on cooldown");
return;
}

//Your gun here

}
}
}, this);
}

 private boolean isOnCooldown(Player player) {

        if (players.containsKey(player.getUniqueId())) {
            if (players.get(player.getUniqueId()) > System.currentTimeMillis()) {
                return true;
            }
            
            players.remove(player.getUniqueId());

        }

        return false;
    }

private void addToCooldown(Player player) {
players.put(player.getUniqueId(), System.currentTimeMillis() + 1000L * secondsL;
}
}
#

@hollow thorn

finite belfry
#

I mean youtubers can do it

brisk mango
#

ItemMeta#addEnchantment

finite belfry
#

In a server

#

Ok

#

Thx

wraith thicket
#

So you should be able to specify froce in the end to force the level

frigid ember
#

Where are upload my plugin?

wraith thicket
frigid ember
#

Thx

lofty mica
#

@atomic rapids sorry for mentioning but i changed my name on spigot mc how can i change my name on this discord? (the nickname)

finite belfry
#

Where are upload my plugin?
@frigid ember you make plugins? What is the plugin about?

frigid ember
#

Why?

finite belfry
#

I don’t know I just want to know it

frigid ember
#

I making my 5.plugin Hide Pluger

finite belfry
#

Ok

brisk mango
#

what is your name on SpigotMC @frigid ember

lofty mica
#

"screenshot"

#

lol

obtuse rose
#

@atomic rapids how do I sync my Discord name with forum name

lofty mica
#

yeah i had same question a few minutes ago @obtuse rose

obtuse rose
#

oof sorry xD

#

My old name was too cringy

#

I mean "current", it was 6 years ago or so lol

silk cape
#

Where is config for /msg

#

[Me -> Player] ...

#

I want to edit color for this

brisk mango
#

plugin config perhaps?

silk cape
#

In notepad++

jaunty night
#

Depends what plugin he's using.

silk cape
#

Essentials

#

I think

jaunty night
#

This thread here will have some useful info

brisk mango
#

"I think"

pastel fox
#

@wraith thicket ty!

tulip pendant
#

@silk cape

#

@silk cape it's Essentials

#

But I think you can't change it

lilac quarry
#

Everytime I interact any block it says on chat "You don't have the permissions" with red color

#

Please help me

torn robin
#

@lilac quarry plugins...?

#

Have you installed any recently?

lilac quarry
#

No I haven't

torn robin
#

have you edited your permissions recently?

#

list of plugins?

lilac quarry
#

Wait please

torn robin
#

👍

lilac quarry
#

I'll send it on dm

torn robin
#

123 plugins 💀

sick citrus
#

Some people just want to watch their cpu burn

frigid ember
#

Is someone here willing to teach me how to give someone speed when they join the server?

torn robin
#

@frigid ember as in make a plugin to do so?

frigid ember
#

edit the .jar i think

tiny dagger
#

Player#setWalkSpeed(0-1)

frigid ember
#

yeah

#

where do i insert that

torn robin
#

are you making your own plugin?

tiny dagger
#

well

#

start with the basics then

torn robin
#

and do you want to give the potion effect or set their speed? (different)

frigid ember
#

potion effect

tiny dagger
#

compile a plugin, learn events then you can use my method

frigid ember
#

or walkspeed

#

ok

#

fsr i thought it had to do something with the actual server .jar file

torn robin
#

nah nah

barren abyss
#

How do I make a zombie hanger on spawn?

#
if(event.getEntity() instanceof PigZombie){
               String piggyname = ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + "Angry Zombie";
               LivingEntity piggy = event.getEntity();
               piggy.setCustomName(piggyname);
               piggy.setCustomNameVisible(true);
           }
icy cosmos
#

I have this code for jump pad plugin, but at the moment it only actually works when the player is on creative although I don't ever check that
https://hastebin.com/revofowuzi.cpp

proud lynx
#

hello can I downgrade a world from 1.15.2 to 1.14.4 pls answer

#

tag me when answer as I am going offline

icy cosmos
#

@proud lynx

floral isle
#

hi everyone i have a problem with an anticheat module that i am creating you can help me

proud lynx
#

@icy cosmos ...

hidden mica
#

How do you see if a player has an item with metadata in their inventory, cause

if(player.getInventory().getItemInMainHand().getItemMeta().equals(randomItemMeta))``` only shows for main hand, and not whole inventory
#

sorry, I'm a bit of a noob :/

fiery scroll
#

loop through the inventory and check each item?

icy cosmos
#

@hidden mica

        for(ItemStack item : player.getInventory().getContents()){
            if(item.hasItemMeta()){
                //do stuff here
            }
        }
#

This should do it

hidden mica
#

Thanks!

cinder elbow
#

Hi, how are you need help me staff

#

Speak only english or spanish ¿?

#

download Citizens link please <3

barren abyss
#

Yo hablo español que te pasa

cinder elbow
#

Es que quiero el link

#

de descarga del Citizens

barren abyss
#

https://www.spigotmc.org/resources/citizens.13811/

cinder elbow
#

Versión 1.8

sturdy oar
#

😂

silk cape
#

Why slime spawners does not work

#

bat too

#

AskyBlock server

sturdy oar
#

is GameProfile only available with NMS?

silk cape
#

whats that?

sturdy oar
#

oh yeah nvm my bad, it's inside com.mojang.authlib

#

but Is it possible to access it without implementing NMS code as a dependency into my project?
Possibly thinking about reflection

surreal sedge
#

how can I retrieve a list from a yaml config file ? There's the method getList but I don't know wich type it returns
it returns a List<?>

tiny dagger
#

it returns whatever it has in that list's type

surreal sedge
#

And what is wath is in the list's type ?

leaderboards:
        - leaderboard:
                name: "main"
                objectives:
                        - objective:
                                name: "kills"
                                display-name": "Nombre de kills"
                        - objective:
                                name: "balance"
                                display-name: "Argent"
#

the list is leaderboard

obsidian pulsar
#

Is there a guide for creating your first plugin?

tiny dagger
#

seralizable objects i suppose

obsidian pulsar
#

or at least how to set up spigot

surreal sedge
#

no, it's not serializable

tiny dagger
#

then you can't make sure of that

#

unless you store primitives

#

and their boxed versions

#

which are serializable

surreal sedge
#

ok, so I will make them serializable

#

ok, thanks

frigid ember
#

there is on spigot wiki @obsidian pulsar

floral isle
#

Hi everyone i have a problem wiht an anticheat

upper hearth
#

I've been having major issues getting a built in resource from the JAR file once it's built.

All I'm trying to do is copy the embedded file to the plugin's directory, but no matter what I do, getResource() returns null at some point. Even getResourceAsStream() is returning null.

Even if I move the file and the class I'm using to the same package, they return null. Any ideas??

fading owl
#

Show some code

#

I know that getProtectedDomain() sometimes is useful

#

iirc

#

i think thats the method name

upper hearth
#

Tried that, didn't work either.

fading owl
#

What is the location of your resource file(s)

#

is it src/main/resources

upper hearth
#

It's in the same location as the class I'm accessing it from. So even if I do getClass().getResource("test.txt") it doesn't do anything

fading owl
#

lol

#

yeah so resource files dont go in the same directory as java files

#

your project layout should be

#

src/main/java

#

src/main/resources

#

getResource will look for "test.txt" in
src/main/resources/test.txt

upper hearth
#

The layout should be like that even if I'm not using Maven/Gradle?

fading owl
#

yeah, it's conventional.

upper hearth
#

Why would IntelliJ not lay it out like that if that's the case

fading owl
#

if u created ur project using gradle or maven

#

it probably would have

upper hearth
#

It does, but normal Java projects aren't laid out that way by default even though they should be? 🤔

fading owl
#

Well, maven set the standard and gradle followed up with it. Prior to that the convention, which is still used, is the model to use your website URI reversed.

#

I.e

#

com.google.myproject

upper hearth
#

Yeah that's what I've been using

fading owl
#

sec

#

gradle follows this too

#

for unit testing you do

#

src/test/java

#

src/test/resources

#

or microbenchmarking

#

using JMH

obtuse rose
#

if you created the project with Eclipse/IntelliJ, by default resource and source code folder were the same folder though?

fading owl
#

i have intellij ultimate, if i create a java project with maven or gradle as dependency management it will create src at top level, followed my main/test follwoed by java/resources respectfully.

obtuse rose
#

that's when you use maven/gradle

upper hearth
#

I'm not using those. IntelliJ Community does the same thing.

fading owl
#

yeah so a baseline java project sure, why give the additional boilerplate

#

better to do things conventionally

#

unless u want to work alone forever

obtuse rose
#

just use maven/gradle, problem solved 👍

upper hearth
#

Not a fan of them.

fading owl
#

why arent u a fan

#

of maven ro gradle

#

they make life considerably easier

obtuse rose
#

and it's easier for other people to collab too

#

because compiling is just a command

#

instead of download tons of stuff and add to project manually

upper hearth
#

Gradle isn't too bad, IMO Maven is a complete disaster.
I generally do personal projects, so there's no reason for me to put them on Github, so those don't really have a point

wraith thicket
#

Maven has nothing to with github

fading owl
#

do u understand gradle or maven though

#

i.e have u spent time leanring them

upper hearth
#

Gradle to an extent, yes

fading owl
#

so u would rather use nothing for dependency management

#

then gradle or maven

#

or do u use an alternative

#

or do u stick .jar files in a folder called /lib/ and call it a day

upper hearth
#

^ pretty much yep

fading owl
#

yeah thats a pretty brutal way of doing it

#

definitely how we all start out though

wraith thicket
#

Agreed^^

#

But it's simply not scalable in the long run

fading owl
#

yup

hallow surge
#

maven isnt that hard to figure out

#

always reccomend maven or gradle

fading owl
#

maven is super easy

#

they provide a 5 minute (really 20) on maven essentials

#

then u can spend a few hours indepth on their larger tutorial

#

then ur smooth sailing

upper hearth
#

Idk why but my maven never worked. I obviously did something wrong and just couldn't be asked to figure it out

fading owl
#

then u get the benefits of aggregation and inheritence

hallow surge
#

i have entire book on maven

wraith thicket
#

Everything is easy nowadays. You just google it.

fading owl
#

truth

#

stackoverflow for daysssss

hallow surge
#

its super easy

#

wdym cant be bothered

fading owl
#

if maven never worked for u

#

u aint working for maven

#

communication is a 2 way street my dude

upper hearth
#

If I'm going to use a dependency manager I would just use Gradle. Is there a reason to know both 🤔

fading owl
#

yes

#

how could you decide to use gradle if u dont know maven

#

grass could be greener on the other side

wraith thicket
#

I'd say using one is a bigger step than knowing both.

fading owl
#

(its not)

hallow surge
#

atleast use oone -_-

fading owl
#

or

#

use ANT

#

XD

hallow surge
#

Lol

#

yea use ant

fading owl
#

ok back to minecraft with me

#

peaceee

hallow surge
#

Lol i love this kid on spigot he got book banned from his own server and made a post on spigot asking about the bobbing xD thinking it was a glitch

#

I hate like everybody thinks they can just run a server even though they arent qualified

obtuse rose
#

@hallow surge tbh, isn't that like the majority of people on SpigotMC forum?

hallow surge
#

im not qualified thats why I dont try to run my own server xD

#

@obtuse rose it really gets on my nerves when they dont even know mc in general

#

not only do you not know how to program you dont know the game

obtuse rose
#

😆

hallow surge
#

like okay your new to program but atleast know the game

obtuse rose
#

you would still need a bit of basic networking/programming stuff to run a server though

#

but those people who just download everything, throw it in plugins folder and call it a day....

#

I totally agreed with you @hallow surge 😅

hallow surge
#

this kid had a creative server

#

and got book banned

#

hes the owner 😄

obtuse rose
#

that's entertaining ngl xD

frigid ember
vernal spruce
#

looks more like ping

cloud sparrow
#

That's ping.

#

What are their pings or your ping.

#

@frigid ember

frigid ember
#

@cloud sparrow they have 80 ping

barren abyss
#

Is there any way to remove the console output from a lightning strike?

Bukkit.getWorld("world").strikeLightning(Location); // This gives "Summoned new Lightning Bolt" in console.
naive goblet
#

idk if strikeLightningEffect

#

is different?

#

It would trigger the event?

tiny dagger
#

i think its just the effect

naive goblet
#

It would trigger the event?

tiny dagger
#

so no it won't show

naive goblet
#

and if it triggers the event just apply damage after

#

otherwise idk

barren abyss
#

but if I trigger the effect it dsnt burn/damage etc right?

naive goblet
#

nope?

uneven cradle
#

Can I give NBT tags to players (like {tag=true})? Or do I need to muck around with player data for that?

subtle blade
#

Players are PersistentDataHolders

#

1.14+, "NBT" API

uneven cradle
#

So I can use NBT?

frigid ember
#

What are Nbt tags

uneven cradle
#

👌

tiny dagger
frigid ember
#

what the fuck is that plugin

#

scam

subtle blade
#

An obfuscated free resource

#

Isn't it great?

frigid ember
#

lmao

subtle blade
#

Because fuck open source, right?

frigid ember
#

.-.

tiny dagger
#

he has one more

#

not sure how many he has like this

frigid ember
subtle blade
#

Report the resources that don't abide by the obfuscation regulations

tiny dagger
#

oh k

frigid ember
#

or you could like

subtle blade
#

This Discord is not the place to report them

frigid ember
#

lol

#

holy shit how many plugins does he have

vernal spruce
#

well he even has a premium one

frigid ember
#

yeah

subtle blade
#

Seems to be the type of person to write a basic resource in 5 minutes and upload it

frigid ember
#

def

tiny dagger
#

and then for some reason he is having an expensive obfuscator

surreal sedge
#

does Collection<? implements ConfigurationSerializable> implements ConfigurationSerializable ?

silk bane
#

looks like stringer 3.0.0 which has been cracked

vernal spruce
#

i just noticed

#

the same guy reviewd all his premiums with 5 stars 😂

frigid ember
#

LMAO

barren abyss
#

obfuscate is not allowed? (just asking didnt know)

hoary parcel
#

Read the rules

tiny dagger
#

i think just basic name obfuscation is allowed

subtle blade
#

Basically limits you to what Mojang does

#

As a quick TL;DR

tiny dagger
#

but that guy has like control flow/ string obfuscation and what else it's using

subtle blade
#

Right, so

Report the resources that don't abide by the obfuscation regulations

#

Resource staff will tend to it lol

frigid ember
#

lol

surreal sedge
#

does Collection<? implements ConfigurationSerializable> implements ConfigurationSerializable ?
or how can I retrieve the value of a list in a yaml configuration file ?

naive goblet
#

FileConfiguration#getList(path, def) ?

#

returns List<?>

surreal sedge
#

oh, yes, you're right
but to what should I downcast the item I'm referencing ? Map<String, Object> ?

#

I have the following yaml file

leaderboards:
        - leaderboard:
                name: "main"
                objectives:
                        - objective:
                                name: "kills"
                                display-name": "Nombre de kills"
                        - objective:
                                name: "balance"
                                display-name: "Argent"
naive goblet
#

You're overengineering it...

#

Just use the system that spigot provides you?

surreal sedge
#

it's different because It doesn't represent a scoreboard that can be displayed by the side like the minecraft ones

naive goblet
#

whut

surreal sedge
#

I display it with holographics display

naive goblet
#

and?

surreal sedge
#

so I can't use the org.bukkit.scoreboard.Scoreboard Interface 🤔

naive goblet
#

No? But you can still use the built-in yaml system in the api?

surreal sedge
#

yes... I implemented ConfigurationSerializable, but now how can I deserialize them ?

naive goblet
#

Certainly that provides you the most essential features of conguring

#

doesn't a method exist for that?

#

wait send ur code?

sturdy oar
#

You deserialize them as everything else

surreal sedge
#
for (Object o : conf.getList("leaderboards")) {
   Map<String, Object> map = (HashMap<String, Object>) o;
   String name = (String) map.get("name");
}

but I don't know how to get the second list

subtle blade
#

get() and cast, or getSerializable() for a generic version

#

getList() should also be castable

surreal sedge
#

I'm new to spigot So i don't know very much about it

#

but how can I get the second list ?

naive goblet
#

you can't ?

#
                        - objective:
                                name: "kills"
                                display-name": "Nombre de kills"
                        - objective:
                                name: "balance"
                                display-name: "Argent"
subtle blade
#

I think the fact that it's a list to begin with is a design flaw

#

It should be a section

naive goblet
#

using a key twice will mess it up ?

surreal sedge
#

maybe, I can modify it
what is a section ?

naive goblet
#

a key holding a map

subtle blade
#
leaderboards:
    nameOfLeaderboard:
        objectives:
            kills:
                display: "Number of kills"
            balance:
                display: "Money"```
naive goblet
#

^

subtle blade
#

That's how I'd do it

surreal sedge
#

ok
and how can I retrieve the name "kills" and kills.display, for example ?

keen goblet
#

Hello guys, i need help

how to make chunks that do not discharge with the passage of a player from one chunk to another

naive goblet
#
FileConfiguration
      .getString("leaderboards.nameOfLeaderboards.objectives.kills.display")
#

Knovobo wym by discharge?

surreal sedge
#

the fact is, that y a can have an arbitrary number of objectives
so how can I iterate of them ?
getList returns a List<?>, and I don't know to which type I have to cast it

naive goblet
#

FileConfiguration#getStringList

#

ConfigurationSection#getKeys(false)

subtle blade
#

ConfigurationSection has a getKeys() method to get the set of keys

#

It's a set of strings all being the entries in that section

surreal sedge
#

ok, thanks

keen goblet
#

basically, I made a plug-in to modify the knockbacks on my server but each time a player knockbacks from one chunk to another, the chunk unloads and reloads and it becomes a chunk corrupted with restart :/

#

@naive goblet

vernal spruce
#

overkill?

#

?paste

worldly heathBOT
vernal spruce
#

Was thinking to simply changing to local ints

#

so i only work with config every once and then..

keen goblet
#

no, when 2 players fight and they change chunks, I would need a code which allows that the chunk does not move

#

the problem happens when a lot of people fight in the same chunks

#

and after restart

frigid ember
#

hello

#

i came back wanting to know if anyone still knows how to cancel an incoming packet from a clientnwith metty

#

netty

#

or is the only solution letting it succeed and ignoring it

#

i want the client to know that the packet has been canceled with the channel.writeAndFlush(packet).isCancelled()

#

when they send it

#

or isSuccess() isk

#

idk

#

is this possible, i am using netty 4.1

subtle blade
#

What are you doing

frigid ember
#

attempting to cancel a packet with netty

subtle blade
#

I... I get that

#

Why

frigid ember
#

in the channelRead(ChannelHandlerContext ctx, Object msg)

#

idk why many people like context about why i do stuff but fo example i dont want clients spamming me with packets

#

maybe have a limit per second and the rest cancel

subtle blade
#

You're going to compromise the experience of your users by doing that

frigid ember
#

or if data is not readable cancel or select what i want

#

in my client and server it is not bornal for the user to randomly spam packets

#

that was an example

#

a good example maybe with minecraft is cancelling a position update @subtle blade

#

the client must know so he can teleort back

paper compass
#

Is this a good way to keep chunks loaded that I really need loaded? [1.8.8]

    
    @EventHandler
    public void onUnload(ChunkUnloadEvent e) {
        if(chunks.contains(e.getChunk())) {
            e.setCancelled(true);
        }
    }```
frigid ember
#

is there a way than doing extra work server side and sending a packet to the client saying “cancel” that packet for example

tiny dagger
#

that's amazing

#

@paper compass

paper compass
#

Really?

tiny dagger
#

yup

paper compass
#

woah

tiny dagger
#

i would've done the same

#

but it would only work for 1.13 and lesser versions

frigid ember
#

can i get a response quickly man i really gtg

paper compass
#

I'm removing the chunk from the list when the player leaves

#

so it unloads

tiny dagger
#

i don't know how the unload works if it got cancelled

paper compass
#

Should I just loadChunk?

#

and setCancelled

#

just incase

#
    
    @EventHandler
    public void onUnload(ChunkUnloadEvent e) {
        if(chunks.contains(e.getChunk())) {
            e.getChunk().load();
            e.setCancelled(true);
        }
    }```
frigid ember
#

choco???

tiny dagger
#

if you have the chunk instance that means its loaded

#

pretty sure of it

#

unless is a leftover chunk instance ie after an unload

paper compass
#

should I just save a location

#

or what

tiny dagger
#

no it's fine

paper compass
#

kk

tiny dagger
#

it will work

frigid ember
#

wont it fuck up your ram

#

that arraylist could get large no?

tiny dagger
#

yeah

#

you're now trading ram for cpu time

paper compass
#

its not an arraylist btw

#

Plus minions cost irl money

#

so people wont have many

frigid ember
#

i didnt check the code exactly

#

oh a set

#

still

bronze marten
#

Mbe do a Set<> with a custom object which only has a x,z

paper compass
#

Max chunks per player might be like 2-4

frigid ember
#

ok

tiny dagger
#

set uses more ram and has better cpu while arraylist is the oposite

frigid ember
#

k

#

@subtle blade can u help

#

i gtg asap asf

paper compass
#

So my code is the best it can be?

#

Or?

tiny dagger
#

i dunno it can always get improved so :p

frigid ember
#

assembly

#

😛 thats step 1

bronze marten
#

Rly think you should do an custom object with x,z variables there, unnecessary to store the whole chunk in a Set

frigid ember
#

choco im actually pissed now u made me wait so long why respond and then for no reason leave

#

just pop off

subtle blade
#

a good example maybe with minecraft is cancelling a position update @subtle blade
[4:46 PM]
the client must know so he can teleort back
This is EXACTLY why we have events

frigid ember
#

now u respond

subtle blade
#

Also, I'm not entitled to support you. There are literally 6,300 members in this Discord

frigid ember
#

u responded first

#

then you just left

subtle blade
#

Because I had been available at the time and was not afterwards

frigid ember
#

as the others didnt really comment i assume they don’t know

#

events are called by packets

#

i guess

subtle blade
#

The reason I ask for context is because often time people overcomplicate things for seemingly no reason

#

Everything on the server is handled by the client sending it packets

frigid ember
#

what happens whens when you cancel an event

#

in the background

subtle blade
#

Depends on the event

frigid ember
#

playermoveevent

subtle blade
#

It sends back a packet to the client telling it not to move

frigid ember
#

so there is no cancelling

#

what if i had timer for example

bronze marten
#

There is?

frigid ember
#

wont it kill the server

subtle blade
frigid ember
#

if the derver does extra worki telling the client to stop

subtle blade
#

No

#

That's the server's job

frigid ember
#

200 players with timer

subtle blade
#

It's meant to handle and distribute packets

frigid ember
#

server will die

subtle blade
#

It won't

frigid ember
#

😂

#

what

subtle blade
#

You're severely underestimating the amount of packets that get sent at any given point

#

One mere packet will not do a single thing

frigid ember
#

when i debug all minecrafts lackets why dont i see this

#

why dont i see the server sending a packet not to move

subtle blade
#

because it sends a teleportation packet

frigid ember
#

where is it

#

then say that

subtle blade
#

I literally just sent it to you above

#

teleport(from)

frigid ember
#

you said cancel

#

i said “cancel”

subtle blade
#

CANCEL THE FUCKING EVENT, RETROOPER

#

lmao jesus christ

#

you don't need to sniff for packets

#

It's unnecessary

frigid ember
#

that is not cancelling

#

its teleporting back

subtle blade
#

I just...

#

*sigh*

frigid ember
#

its just faking cancels

#

calm down

subtle blade
#

Client sends packet to move, server doesn't respond. Client assumes it's right, server thinks its in another position, server kicks player

#

The server has to send a packet

#

That is how it is cancelled

frigid ember
#

i thkught there was an inbuild way to cancel and the server wont deal with the packet

subtle blade
#

You're not going to out-smart the server

#

The events exist for a reason

#

It's to make your life easier

frigid ember
#

idk what you mean out smart

latent rock
#

f1 doesnt hide nametags anymore?

frigid ember
#

i just used bukkit events as an example so you know what i meant

vernal spruce
#

hmm @subtle blade does playerdeathevent gets called even if the killer is an arrow?

#

by that i mean the getKiller will return null in that case?

dusty topaz
#
        new BukkitRunnable() {
            @Override
            public void run() {
                CompletableFuture<String> future = generateTopTenMessage();
                future.thenAccept(message -> cachedTop = message);
            }
        }.runTaskTimer(instance, 0L, 300 * 20L); // every 5 minutes
    private CompletableFuture<String> generateTopTenMessage() {
        CompletableFuture<String> future = new CompletableFuture<>();
        database.executeQuery(data -> {
            StringBuilder sb = new StringBuilder();
            int place = 1;
            while (data.next()) {
                sb.append(messages.getLine("topten.place", Messages.getPlaceholders("%place%", "%name%", "%shards%", String.valueOf(place), data.getString("name"), String.valueOf(data.getInt("balance")))));
                place++;
            }

            future.complete(sb.toString());
        }, "select name, balance from shards order by balance desc limit 10;");
        return future;
    }
#

The more I look at this, the more I think it's blocking

#

is thenAccept blocking the main thread or am I good

bronze marten
#

No its your completablefuture

#

Do CompletableFuture.supplyAsync(() -> { return value; });

dusty topaz
#

the future is completed in an async callback

#

that's not my concern (at least, I don't think so)

frigid ember
#

What is the way to get if a player is standing on a honeyblock?

abstract panther
#

anyone tried using https://mariadb.com/kb/en/about-mariadb-connector-j/ or any other connector?
i keep getting exception java.lang.NoClassDefFoundError: org/mariadb/jdbc/MariaDbPoolDataSource, but i added the .jar to the classpath
and imported into class
is is because of the creating normal java threads(ban/blocade)?

bronze marten
#

No your db execution happens bf you return the completablefuture

#

Which is blocking

dusty topaz
#

the future returns outside of the callback

#

it shouldn't block, i don't think?

#

i think the .thenAccept is blocking, though I'm unsure

bronze marten
#

is the database.executeQuery() method async?

dusty topaz
#

yes

bronze marten
#

ah ok, then its fine

#

.thenAccept shouldnt block afaik, but you could try .whenComplete

dusty topaz
#

whats the difference?

abstract panther
#

it cant be sync cuz u dont know when you will get the db response

#

it can take seconds if you have a shit load of data

floral isle
bronze marten
#

thats not an argument for a method to be sync/async, depends on the implementation

woeful mural
bronze marten
#

its a reason for it to be implemented async if it takes a long time though

woeful mural
#

Do I cast the 0 to Object perhaps?

crimson cairn
#

@floral isle what specifically is your problem

abstract panther
#

yeah i meant that. sry tired and shit eng

subtle blade
#

.remove((Integer) 0)

woeful mural
#

Ah, thanks

floral isle
#

@crimson cairn the anticheat notify the player when he dony do anithing

bronze marten
#

@dusty topaz idk the real difference, but it seems to me they make no diff other that whenComplete returns also a throwable if it fails, - I dont think thenAccept has a blocking functionality

#

what makes you sure it blocks? is it noticeable in timings?

crimson cairn
#

@floral isle that's still pretty vague. can you elaborate how/when this happens?

dusty topaz
#

was just thinking how will .thenAccept be called

abstract panther
#

anyone tried using https://mariadb.com/kb/en/about-mariadb-connector-j/ or any other connector?
i keep getting exception java.lang.NoClassDefFoundError: org/mariadb/jdbc/MariaDbPoolDataSource, but i added the .jar to the classpath
and imported into class
is is because of the creating normal java threads(ban/blocade)?
@abstract panther bump. help pls xD

#

i tried everything

bronze marten
#

@dusty topaz they will store the function, call it when its done lol

#

its a Consumer youre passing through

crimson cairn
#

@floral isle Oh well that explains it. The check is designed terribly. No offense to whoever wrote your anticheat.

bronze marten
#

they just store it, and do .accept(<return value>) when the competablefuture is done

crimson cairn
#

get someone else to write your anticheat lol

dusty topaz
#

yeah, but if the .thenAccept is called on the main thread it may be blocking

#

since it has to wait

floral isle
#

the anticheat sends the warnings of the fly to a player who makes a pillar or hops continuously

crimson cairn
#

yeah

#

the check is garbage juice

#

get someone else to write an anticheat for you lol

floral isle
#

Yeah this Is a snapshot

subtle blade
#

or use one that exists already

#

there are dozens

bronze marten
#

it doesnt have to wait lol, the only waiting that happens is the writing of the reference variable to the inner Consumer in completablefuture

subtle blade
#

Some in development longer than you've played Minecraft

floral isle
#

@crimson cairn have an idea ti fix it

crimson cairn
#

rewrite it

#

lol it doesn't even follow minecraft logic

floral isle
#

Ok but i dont know Better method for this

crimson cairn
#

i mean, whoever wrote this clearly has no idea how the client works

floral isle
#

There are example of Flight module?

crimson cairn
#

nocheatplus

#

if you wrote this, I highly suggest looking into MCP and reverse-engineer how motion works in the game

#

for starters, the basic function for determining the next delta Y is:
((last delta Y) - 0.08) * 0.98

floral isle
#

THX the anticheat have problem only with the Flight

crimson cairn
#

and then there are quirks in the game

#

if abs(delta Y) is less than 0.005, it is clamped to 0

floral isle
#

Ok i must go THX for the he help

crimson cairn
#

below minecraft 1.9 (i believe) the client holds back on motion updates until the client has moved at least 0.03 blocks or if 20 client ticks have passed

#

alright, you're welcome

abstract panther
#

Any spigot devs on this discord?

#

then rip for me

subtle blade
#

?services if you want to hire somebody

worldly heathBOT
subtle blade
#

If you want contributors to Bukkit, I'm sure there are a number lurking about. Myself included

abstract panther
#

me? xD

#

oh i meant ppl that made spigot

#

i am a c# dev 5+ years but new to spigot and kinda intermediate to java ide's

#

i am sending a mail to support

#

need a experinced java dev

#

anyone tried using https://mariadb.com/kb/en/about-mariadb-connector-j/ or any other connector?
i keep getting exception java.lang.NoClassDefFoundError: org/mariadb/jdbc/MariaDbPoolDataSource, but i added the .jar to the classpath
and imported into class
is is because of the creating normal java threads(ban/blocade)?
@abstract panther @subtle blade did you ever try using a sql connector framework?

keen compass
#

you would need to shade that connector into your project

abstract panther
#

i did

keen compass
#

The other option is to use mysql's connector which is already shaded in

abstract panther
#

i am using it but the connection breaks if there are no calles made in the respone timeout perion and i can not reconnect via code

#

i solved it by making "blank" requests but that aint a sloution

#

i dont have that kind of dc's in c#

#

xd

keen compass
#

that is where connection pooling comes in

silk cape
#

need help with json file

#

drops

keen compass
#

Something like BoneCP or HikariCP solves that problem and keeps connections alive for you

#

or you can implement connection pooling yourself

abstract panther
#

thank you

keen compass
#

but according to that link you specified it appears that having both mysql connector and mariadb connector on the same classpath can cause issues

#

spigot automatically shades in mysql connector into the server jar

#

mysql connector does work for mariadb btw

abstract panther
#

yeah but it didnt keep the connection. Ill try multiple options cuz its ez to replace

#

and in examples they use the framework just to get the connection and the rest is java.sql

#

am i right?

keen compass
#

yes, however they do discuss the issue with mysql and mariadb drivers being present

#

and how to resolve it

#

as for your driver not being found, I am not sure if you are actually shading it in or not or what build system you are using or if you are specifying the correct driver name. I recommend using maven as it is more reliable when it comes to shading in dependencies but up to you.

abstract panther
#

i have been lazy to learn maven cuz adding jar is the same as adding .dll in c#

#

frome the answers i got from another forum i added in the java build path in the order and export tab in eclipse ide

#

frome the answers i got from another forum i added in the java build path in the order and export tab in eclipse ide
@abstract panther for shading

keen compass
#

probably should check that if it indeed placed that jar in your jar like you expected it to

abstract panther
#

will i can chech with jar size

keen compass
#

but just because it is in your jar, doesn't mean it was also added to the classpath either

abstract panther
#

add external jar and its referenced ?

#

/added to classpath

keen compass
#

merely placing a jar inside another jar doesn't mean its on the classpath automatically

#

anyways, I don't mess with ant build system so I am not all that familiar in setting it up properly. I mostly use maven because it tends to be more reliable and easier to do these things.

abstract panther
#

if adding to classpath is the same as referencing with maven i did use that

#

i use several other plugins in my plugin

#

and it works fine

#

i know only ant build

#

from college days

keen compass
#

well all I can tell you is that for whatever reason it is not finding the driver. There is only few ways this happens, and that is either you have the incorrect driver name or the driver is not on the classpath.

abstract panther
#

ok ill try to google it out and try to set it up again

#

tnx a lot for the help

cloud crater
#

Google is always a start

abstract panther
#

i googled the shit out of it xD

#

i made my plugin now just a bit refactoring

cloud crater
#

3 before me. Think, google it, then if you really cant solve it then ask specific developers.

abstract panther
#

3 before me. Think, google it, then if you really cant solve it then ask specific developers.
@cloud crater did all of that

keen compass
#

sometimes googling fails because of not using the proper keywords and coming here can sometimes give some insight into that 😛

cloud crater
#

Yep

abstract panther
#

yeah found out that also got better at java googling

#

some the same stuff dont have the same name in java and c#

keen compass
#

just tack java to end of the google search, most times that works in finding things related to java XD

fickle surge
#

finally

abstract panther
#

yeah ik that XD

fickle surge
#

can some1 help me?

keen compass
#

?ask

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

fickle surge
#

i downloaded Itemshop but how do i use it with boss shop pro?

cloud crater
#

Asked the developer of it?

fickle surge
#

how?

#

there isnt any way

keen compass
#

you can generally see the developers names for resources

#

and generally clicking on their name takes you to their profile page

#

where you can send them a message

fickle surge
#

he does not have discord

keen compass
#

that is fine, private messaging on the forums exists

fickle surge
#

no one can help me fast right now?

abstract panther
#

@keen compass also shame we cant use normal threads in plugins

cloud crater
#

People using my plugins contact me using private message on spigotmc or I link my discord 9/10 on my resource page

keen compass
#

@abstract panther you can

#

not sure where you get the idea that you are not allowed to

abstract panther
#

scheduler.scheduleSyncRepeatingTask(schedulerPlugin, new Runnable() {

#

this

keen compass
#

there is Async tasks too

#

but you also don't have to use the Scheduler either, you can implement threads yourself

abstract panther
#

but you also don't have to use the Scheduler either, you can implement threads yourself
@keen compass i tried like 3 different ways and they didnt work xD

keen compass
#

then you didn't do it properly. But threads are allowed

fickle surge
#

but it would take weeks.

#

ok i am going to try

abstract panther
#

then you didn't do it properly. But threads are allowed
@keen compass i made a thread but thread.sleep didnt work

#

forgot to say xd

keen compass
#

depends on how you called it

#

and how you are referencing the thread you want to sleep as well

abstract panther
#

Thread.sleep(miliseconds)

#

cant remember the exact code

#

its been 2-3 weeks i thinks

#

think

#

in C# it references the thread the code is in

keen compass
#
Thread newThread = new Thread {
@Override
public void run(code goes here){}
}();
newThread.start();
newThread.sleep(time);
}

very basic way to run a new thread. You can even have a class that implements Thread and put your code in the run method there as well.

abstract panther
#

Thread newThread = new Thread {
@Override
public void run(
newThread.sleep(time);
){}
}();
newThread.start();

}

#

i needed this

keen compass
#

There is many ways to do it. And no singular way is the best way either as it is all dependent on your code

abstract panther
#

need to read more java docs so many things are diffrent

keen compass
#

but, spigot API also helps with this too. There is methods in the API to schedule async tasks and the server will take care of the thread stuff for you

abstract panther
#

the code is the same but the api omg

#

i read that when i can

keen compass
#

just like your sync repeating task you found in the api, there is an async repeating task

#

if that is what you want

abstract panther
#

i found that few weeks ago

keen compass
#

Well just informing you, threads are allowed and are actually encouraged to use if the code will benefit from it 😉

abstract panther
#

this sql problem is the first one in 2 months that i cant solve 😄

#

tnx

#

i am also using something like clean arhitecture so i can replace any part of the plugin very easy

keen compass
#

ah, modularizing it?

abstract panther
#

yes

keen compass
#

sounds like a good idea if its complex 😉

abstract panther
#

yeah making a custom bossarena/dungeon plugin

frigid ember
#

Hey y'all I need help, When I use luckperms then I start my server to generate the files it just don't work it didn't do anything my server is 1.8 I my other plugins are ViaVersion I tried to uninstall ViaVersion to see if it change anything it didn't LuckPerms don't create any folder can someone help me?

Edit : It do that with all plugins

keen compass
#

Are you using the correct versions for 1.8

#

also take note that 1.8 is severely outdated

#

and that support for it is going to be very limited as well

#

if you can't solve problems on your own for 1.8 might want to think about upgrading then

frigid ember
#

Yes but when I used the latest built via version said like no built for 1.15.2

#

something like that

#

I might use 1.12 then

#

is there a way I can like not use all my world

abstract panther
#

export the parts you need via world edit?

frigid ember
#

yeahhh how do I do that

#

I copy the "world" folder into my new server?

cloud crater
#

Syxteen().setDied(true);

frigid ember
#

what

cloud crater
#

Don’t mind me sorry

keen compass
#

lol

abstract panther
#

that one hurt me also

#

do you have the world edit plugin?

frigid ember
#

no

#

I tried something

bronze marten
#

Why is the method setDied(boolean)

frigid ember
#

cause I cant put any plugins

bronze marten
#

Can you revive yourself? O.o

abstract panther
#

cpr?

cloud crater
#

Got disabled in my update version xD

bronze marten
#

Should be void.

abstract panther
#

@bronze marten its bool xD

bronze marten
#

Smh

abstract panther
#

@keen compass ill invite you to the server when we open it 😄

#

Planning to add a lot custom stuff

deft pollen
#

Hello everybody, I'm getting this error when i try to join the server after trying to create a firework via command block, anyone knows how to solve it?

#

Console:

[19:45:18 ERROR]: java.lang.IllegalStateException: Cannot make 
FireworkEffect without any color
keen compass
#

Well there is your problem

#

need to add a color to the firework

deft pollen
#

I know my dear, but right now i can't access the mc server with my main account because i get this error, and i need to solve that first.

keen compass
#

well, with the server off, go into the server.properties and disable command blocks

#

should allow you to get it up and running to go remove that command block that is causing the issue or disable it

deft pollen
#

I already turned it off, the error is being caused because the item is in my inventory i guess, i already tried to delete the .dat player data of my account but i'm getting the same error

keen compass
#

you sure you deleted the right one? they are named after your UUID

#

unless it was the only one

#

deleting the player data file should cause you to be reset as far as where you were at and items in your inventory unless you have something that is giving you the item upon joining the server like a kit or something

deft pollen
#

Yes, i checked my uuid in namemc, and deleted it;

#

Hello everybody, I'm getting this error when i try to join the server after trying to create a firework via command block, anyone knows how to solve it?
Solved, I just deleted all "playerdata" folders from all worlds.

keen compass
#

well now you can go fix your stuff

frigid ember
#

This is more mathematics help

#

how much is 1.5899E12

#

1.58 trillion?

#

if so i've done something very wrong

keen compass
#

E12 means there is 12 more digits

sly kayak
#

How do i fix it?

keen compass
#

CPU's will only go so far out in floating points

frigid ember
#

Im thinking of e+12 then, but still rounding it says its above 10ms..

keen compass
#

IE precision as it is called

#

you need to put a limit on how many digits your floating points contain

#

and then do your rounding

#

If you don't do that, your rounding can be off by a whole number as well

#

due to that sometimes a 1 will generally be at the end of a very long floating point lol

#

it could be all 0's but there will most times still be a 1

frigid ember
#

but that is the rounded number to 3 decimal places along with whatever value it actually is, is above 10 so ¯\_(ツ)_/¯

#

Do someone know deluxehub?

#

like group aren't working

#

it show %vault_rank% and yes I did installed vault.

torn robin
#

@frigid ember did you install placeholder api?

frigid ember
#

Yes

torn robin
#

did you also type /papi ecloud download Vault

#

and then /papi reload?

frigid ember
#

where do I type that?

torn robin
#

in game

frigid ember
#

oh

#

now it says default

#

thank you

torn robin
#

yep

frigid ember
#

can I put like luckperms group

#

as rank

torn robin
#

what group are you part of?

frigid ember
#

Admin

#

Owner but its called admin

torn robin
#

hmmm it should do it automatically

frigid ember
#

ill send you the screenshot

#

Can someone help me to set up luckperm to show rank instead of default in deluxehub??

#

It stuck to default

wind dock
#

how do I make it so that there are announcements set off every couple minutes?

#

is this built into essentials or do I need a plugin for this

frigid ember
#

deluxehub does it

#

but rank system is weird

rare junco
#

On the chat is says []CoBra5332 how do I take the [] away?

frigid ember
#

what's the bungeecord build for 1.8?

hardy cedar
#

Lastest one can work for 1.8 and higher

frigid ember
#

alright ty

#

how do i get a float from a config file

velvet halo
#

(float) getConfig().getDouble("key");

frigid ember
#

ah ok thanks

cloud crater
#

anyone know any non-deprecated alternative to PlayerPickupItemEvent ?

#

it still works fine but any alternatives

frigid ember
#

Can someone help me to set up luckperm to show rank instead of default in deluxehub??

#

It stuck to default

velvet halo
#

@cloud crater EntityPickupItemEvent

brisk mango
#

go ask in luckperms discord lol

cloud crater
#

thanks @velvet halo

fleet crane
#

Can someone help me to set up luckperm to show rank instead of default in deluxehub??
what is javadocs

cloud crater
#

^

proud lynx
cloud crater
#

loading the jar

proud lynx
#

lol so I have to wait 20 sec every time I start my server

glass pendant
#

In the build tools wiki, there is a script for windows that allows you to input what version you want when you run it. Is there one for Linux?

wraith thicket
#

What do you mean? You just java -jar BuildTools.jar --rev 1.xx.y

glass pendant
#

Is there one of these for Linux?

slim hemlock
#

important help request

#

I am a nigerian prince locked in conflict and I am looking to move a very important package

#

also unrelated, does anyone know the unicode character for half a heart

#

so it renders the same way it does in-game

#

or is there no unicode for that

slender bone
#

<-- glances at MagmaGuy.

#

<-- thinks . o O ( talented )

cloud sparrow
#

@proud lynx that's because the spigot is outdated, whenever a new spigot 1.15 is out, it'll be outdated unless you constantly are updating through build tools.

brisk mango
#

@cloud sparrow you can disable the message on the start tho

cloud sparrow
#

yeah, just saying you still have to wait 20 seconds, unless you constantly update tho.

#

I just have my system's console check if there's a update and if so it'll automatically compile and restart the server once it's done and installed.

brisk mango
#

@proud lynx either update or just type:
-DIReallyKnowWhatIAmDoingISwear
in the startup parameter

proud lynx
#

ok

finite belfry
#

how can i dont let the admin bypass the ban?

#

what is the permmision node

brisk mango
#

What

#

why you cant do this in super

finite belfry
#

?

brisk mango
#

Thats not related to your question @finite belfry

finite belfry
#

ok

heavy epoch
tropic nacelle
#

Sir, the explanation is right there.

heavy epoch
#

Didn't understand u mate 🙂

proud lynx
#

well @heavy epoch seriously explaination: check if your jar file name is same of the cmd?

brisk mango
#

@proud lynx it would say that its not accessible

#

it says its corrupted to just download updated spigot from buildtools and try again @heavy epoch

#

and look at the parameter in the .bat file

fluid marlin
#

Anyone here familiar with NMS NPCs?

hallow surge
#
public String loadString(String config_value) {
        getConfig().getStringList("HelpMessage");
        return ChatColor.translateAlternateColorCodes('&', getConfig().getString(config_value));
    }``` how could I get the return to check every line in the string list rather than just one
brisk mango
#

either return the string list or just use string concatenation

#

public List<String> getList() {
return getConfig().getStringList("help_message");
}
fluid marlin
#

return the string list then iterate over it to send the message @hallow surge

#

if its a message

hallow surge
#

its a message

#

temedy so something like this could workjava return getConfig().getStringList("HelpMessage")

fluid marlin
#
public List<String> getMessgaeList(String path){
return getConfig().getStringList(path);
}

List<String> message = getMessageList("path");
for (String line : message){
p.sendMessage(color(line))
}
#

^^ @hallow surge

brisk mango
#

public String getStrings() {
for(String string : getConfig().getStringList("help_message")) {
String message = String.join("\n", string);
}
}
#

@hallow surge

hallow surge
#

§ works in configs correct

brisk mango
#

no

hallow surge
#

okay

fluid marlin
#

If anyone here is familiar with NMS NPCs please dm me 😃

brisk mango
#

that would return formatted message as in the string list

#

my method

#

list:
- message1
- message2
#

and the method should return

#
message1
message2
#

i mean it doesnt matter if u loop through all strings in the string list or get them in 1 string

hallow surge
#

what would i put in my other class something like

String hlpmsg = plugin.getStrings("help_message");
        p.sendMessage(hlpmsg);
        }```
fluid marlin
#

its returning a string list isnt it?

brisk mango
#

no

fluid marlin
#

if its returning a string list then it should be List<String> helpmsg = plugin.getStrings("help_message");

brisk mango
#

bruh why you being ignorant

#

look at the method

hallow surge
#

lol

fluid marlin
#

if its returning a string then you need to do it like temedy put and yeah that works

hallow surge
#

than why are you argueing with it xD

fluid marlin
#

not being ignorant, just didn't notice what you said while i was typing chill out lmfao

#

jeesus people have such low patience these days

hallow surge
#

temedy much easier than an alternative of a string list

#

i tried adding /n in my command class

#

shoulda thought to try adding in main class

brisk mango
#

what is plugin in ur other class

hallow surge
#

wdym

brisk mango
#

if u use plugin instance from ur other class

#

what do you use

wraith thicket
#

Dependency injection

brisk mango
#

im not asking you im asking him @wraith thicket

#

🤦‍♂️

hallow surge
#

😐

#
    public HelpCommand(HelpMain instance) {
        plugin = instance;
    }    ```
brisk mango
#

you know about the this keyword existence?

hallow surge
#

i know this exists

brisk mango
#

you dont need to name it differently in the constructor lol

#

then why dont you use it

hallow surge
#

thx for your help 🙂 this is the part where i leave because you start shaming

brisk mango
#

what

#

private final Main instance;

public HelpCommand(Main instance) {
this.instance = instance;
}
#

replace with this

hallow surge
#

why

#

my main file is called HelpMain

brisk mango
#

because it looks better than naming the variables in the constructor different than in the declaration

wraith thicket
#

@brisk mango Main is a terrible name for a plugin.

brisk mango
#

then name it whatever the class name is

hallow surge
#

I did

#

😐

brisk mango
#

It's not, calling it Main is fine

wraith thicket
#

It's not

brisk mango
#

give me a reason why its not

wraith thicket
#

The class name should reflect its responsibilities

hallow surge
#

you should be more descriptive

brisk mango
#

it can just be called Main, there is no reason why should it be wrong

#

Main is just main class

wraith thicket
#

It's not tho

frigid ember
#
Caused by: java.lang.NullPointerException
        at org.bukkit.ChatColor.translateAlternateColorCodes(ChatColor.java:206) ~[spigot.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
        at me.l3ilkojr.hubcore.Utils.StringUtil.format(StringUtil.java:19) ~[?:?]
        at me.l3ilkojr.hubcore.Servers.ServerInventory.getServerGUI(ServerInventory.java:21) ~[?:?]
        at me.l3ilkojr.hubcore.Listeners.ItemClickListener.onInteract(ItemClickListener.java:21) ~[?:?]
```  what could be possibly be null?
wraith thicket
#

It's an extension of JavaPlugin.

brisk mango
#

ItemClickListener:java:21

wraith thicket
#

@frigid ember no idea -we'd need to see the code

brisk mango
#

Bruh it doesnt matter how'd you call it. its matter of preference

frigid ember
#

That leads to getServerGUI

brisk mango
#

what

#

just show

frigid ember
#

line 21 event.getPlayer().openInventory(serverInventory.getServerGUI());

brisk mango
#

@hallow surge you dont need to be more descriptive in the case of bukkit plugins's main class

wraith thicket
#

@frigid ember The string you pass to ChatColor#translateAlternativeColorCodes is null

#

You don't need to, but you should.

brisk mango
#

no you shouldnt, there is no reason for it as i said

#

and that thing you said cant even be called a reason

frigid ember
#

if (item.getItemMeta().getDisplayName().equalsIgnoreCase(("&9&l» &5&lServer Selector &9&l«"))) { could i do this without problems or should i use translateAlernateColorCodes?

wraith thicket
#

Imagine someone trying to support 10 of your plugins, all of which have the Main class as the one that extends JavaPlugin - they can't import the class because there's 10 of them. It'll become a horrible mess.

brisk mango
#

@frigid ember did you know that display name is nullable

#

and ItemMeta too

frigid ember
#

it only errors on the item its looking for tbh

brisk mango
#

i mean

#

show me the code

wraith thicket
#

@brisk mango Do you also name your other classes Class1 and Class2?

brisk mango
#

no

wraith thicket
#

Why would you think your JavaPlugin extension is different? It's not.

frigid ember
#
public class ItemClickListener implements Listener {
    @EventHandler
    public void onInteract(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        ItemStack item = event.getPlayer().getItemInHand();
        if (item.getItemMeta() != null) {
            if (item.getItemMeta().getDisplayName().equalsIgnoreCase(StringUtil.format("&9&l» &5&lServer Selector &9&l«"))) {
                if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
                    ServerInventory serverInventory = new ServerInventory();
                    event.getPlayer().openInventory(serverInventory.getServerGUI());
                }
            }
        }
    }
}
hallow surge
wraith thicket
#

It's a class that the server uses, just like any other.

brisk mango
#

Main is different than Class1, i dont want to argue with you about this lol, stop trying to act smart because you arent

#

You never checked if the ItemStack is null

#

if you click outside the inventory its gonna be null

#

ah wait

#

this isnt inventory click event

#

ignore me

wraith thicket
#

The stack itself cannot be null, really - it can have type of AIR, though

brisk mango
#

bruh read

#

i said i misread

wraith thicket
#

Chill dude, I was scrolled up at his code.

brisk mango
#

You should check if it has a display name too

#

because it doesnt neccessarily need to have one

wraith thicket
#

And calling a random class Main is the same as calling it Class1

brisk mango
#

What does StringUtil.format do