#help-development

1 messages Ā· Page 1765 of 1

young knoll
#

Save the view returned from openInventory and use that

#

Or use the inventory reference directly

tardy delta
#

not going to save all my inventories...

young knoll
#

Then use the view

tardy delta
#

not going to save all the views...

young knoll
#

That's what an inventory manager is for

tardy delta
#

bleh

young knoll
#

You aren't meant to be extending inventory holder

manic furnace
#

Hey guys. I try to make a plugin with an full spigot jar, but when i build it and try to load it, i become an exception that the main-class couldn't be found.

tardy delta
#

i guess you entered the wrong path for main: in your plugin.yml

#

what's there? šŸŒ

manic furnace
#

at.theduggy.testplugin.Main

#

My plugin.yml:

tardy delta
#

and are you sure thats the right path?

lean gull
manic furnace
#

My path:

tardy delta
#

or can you show the error

tardy delta
manic furnace
lean gull
tardy delta
#

nothing you're good

wet stream
#

Try to make new plugin like a new project

manic furnace
#

I do not want to make it with maven, because you can not send packets with the maven-repository

tardy delta
#

and uhh is your main class extending JavaPlugin?

wet stream
#

Can you show the main class code?

manic furnace
#
package at.theduggy.testplugin;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class Main extends JavaPlugin {

    @Override
    public void onEnable(){
        Bukkit.getLogger().warning("MSG");
    }

    @Override
    public void onDisable(){

    }

}
wet stream
#

Thanx

tardy delta
#

uuuhh

wet stream
#

No tab?

manic furnace
#

What do you mean?

wet stream
#

At bukkit.getlogger… has no. Tab

tardy delta
#

what?

lean gull
#

can someone help me with my thing aswell please?

wet stream
#

What is happening

unkempt peak
wet stream
#

@lean gull

lean gull
#

i'm trying to make a gui that opens from an item

wet stream
#

Error?

lean gull
#

none

#

it just returns null

unkempt peak
#

What's wrong

wet stream
#

Code?

wet stream
tardy delta
#

oh no codedred

unkempt peak
#

Also if your trying to detect an item use a pdc

wet stream
#

?

tardy delta
#

his gui parts go brr

lean gull
#

what's pdc

unkempt peak
wet stream
#

Ye but they work

tardy delta
#

like using 10 classes to achieve the same with 2 classes

unkempt peak
tardy delta
#

i followed his tutorials too but i changed everything šŸŒ

lean gull
#

ah

#

i don't really need it, it's just for a lobby and you can't really get items there

#

and the menu is accessible for everyone anyway

unkempt peak
#

Put a pdc on the item you are using to open the gui

lean gull
#

but i don't need it

unkempt peak
#

That way you can detect the item using only its pdc

lean gull
#

i feel like you're not reading my texts

tardy delta
#

?

unkempt peak
#

I am, I am telling you that a pdc is the best way to do what your trying to do

lean gull
#

i do not need it though

#

my current method should work fine

tardy delta
#

Consumer<ClickEvent> šŸŒ

unkempt peak
#

Just because you don't "need" it doesn't mean you shouldn't use it

lean gull
solid cargo
#

dont mind what im bout to write. its for my friend

#

?learnjava

undone axleBOT
tardy delta
#

nothing to worry about

lean gull
stone sinew
hasty dove
#

?

tardy delta
unkempt peak
hasty dove
tardy delta
#

well you only have to look at the caused by: part

#

and check what kind of exception it is

#

also i thought you got a stacktrace

lean gull
tardy delta
#

watching at the logs goes brr

hasty dove
#

Cannot load plugins/VotingPlugin/VoteSites.yml

#

org.bukkit.configuration.InvalidConfigurationException: mapping values are not allowed here
in 'string', line 50, column 15:
Messages:
^

#

says this after

#

it

#

does that count with it?

#

i did put it on the same port as my dynmap

#

could that be a reason there is an error?

unkempt peak
manic furnace
#

How can i change the name of an player above his had?

tardy delta
lean gull
#

kidalder your logic makes 0 sense

tardy delta
#

show that part of the file

hasty dove
tardy delta
#

i guess its in the messages.yml or something so send the line with Messages: on top

#

and some lines before and after

unkempt peak
lean gull
hasty dove
lean gull
#

anyways i'mma just stop responding to you because i don't wanna continue this argument or whatever this is

tardy delta
#

there would be a folder called the same as the plugin name under the plugins folder

tardy delta
#

which files are there?

hasty dove
tardy delta
#

well there would be a file with messages or something

#

maybe check them all

hasty dove
hasty dove
#

no message.yml file in them

tardy delta
#

like this on the end of the at:

hasty dove
#

at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:59) ~[patched_1.16.5.jar:git-Paper-790]

#

this is right after it

tardy delta
#

send the whole error

#

?paste

undone axleBOT
hasty dove
crimson terrace
#

thats not the whole error is it?

hasty dove
#

It is?

tardy delta
#

its an error while parsing the yml file

#

so one of the files has a wrong syntax or something

hasty dove
hasty dove
crimson terrace
#

what does the yml file look like

#

it tells you the lines where stuff went wrong

tardy delta
#

maybe something like

Messages: # this goes brr


other-stuff:
  key: ""
hasty dove
crimson terrace
#

note that there always has to be 2 spaces as steps, never one step and never a tab

ivory sleet
#

The value cannot be a list and a map at the same time

tardy delta
#

which file is that?

crimson terrace
#

just put 2 spaces in front of the '-' in line 54

hasty dove
#

I’ll try that

crimson terrace
#

and remove 2 in front of Messages

#

might be different paths at that point

#

correction: will be different paths

ivory sleet
#

That’s not the issue

#

I don’t know if I can be more clear

tardy delta
#

console:

  • eco give ...
    Messages:
    Player: ""
    looks cursed
ivory sleet
#

Yes it is intended erroneously

tardy delta
#

is it even possible to store a list as an element of a parent list?

crimson terrace
#

I think it should be

glossy venture
#

just use a - before it

#

i think that may work

ivory sleet
#

Oh Idk well yaml thinks the mapping Rewards at the bottom is valueless which is not okay

#

And it also sees console at the bottom as a mixed type (list and map)

#

Which is not okay either

glossy venture
#
foo:
 - bar
 - sus:
    - amogus
ivory sleet
glossy venture
#

wont that work?

quaint mantle
#

šŸ˜•

ivory sleet
#

uh yeah probably

glossy venture
#

._.

ivory sleet
#

Never seen someone doing that before lol

crimson terrace
#

you just cant have a single value in the same line for any of the elements of "foo"

tardy delta
#

_<

crimson terrace
#

it should work tho

#

even tho ugly

tardy delta
#

i miss json šŸŒ

glossy venture
#

json > yaml imo

crimson terrace
#

Im too young to know Json

glossy venture
#

you can reformat it however u want

ivory sleet
#

I mean valid json is valid yaml

glossy venture
#

what

#
foo:
  bar: sus
``` wont parse as json
eternal night
#

that is yaml -> json

#

conclure stated the opposite

glossy venture
#
{
  "foo" : {
    "bar" : "sus"
  }
}
ivory sleet
#
{ #Lynx knows (:
  "this": [
    "valid",
    "yaml"
  ]
}```
glossy venture
#

is that actually valid?

tardy delta
eternal night
#

yea json is a subset of yaml

glossy venture
#

oh

tardy delta
#

oh yaml has {} and [] too

ivory sleet
glossy venture
#

well then why am i not writing my plugin.yml's like that?

ivory sleet
#

Good question

glossy venture
#

or json config files

#

then YamlConfiguration.load() should work on that right

#

or doesnt it support the syntax

ivory sleet
#

I’d be careful with that yeah

#

The parser lib may not support it

twilit wharf
#

hi! I am trying to get all the current servers on a bungeecord network, when a command is sent. But it doesnt return any. I think I am not waiting long enough for the message to be send back, but I am not sure. The code is a bit separated but I can try and send the bulk of it

ivory sleet
#

Yeah send the code (:

twilit wharf
#

here is the code that runs the first function: java public Inventory createLobbyInv(Player p) { SendMessage.sendGatherLobbies(p); lobbyGUI = Bukkit.createInventory(p, 54, ChatColor.AQUA + "Lobby Selector"); for (int i = 0; i < lobbies.size(); i++) { lobbies.get(i).setAmount(i); lobbyGUI.addItem(lobbies.get(i)); } return lobbyGUI; }

ivory sleet
#

Do you have bungeecord set to true in spigot.yml?

lean gull
crimson terrace
lean gull
#

it's right above createMainMenuItem
ItemStack mainMenuItem;

crimson terrace
#

is the paste all inside the onEnable?

lean gull
#

wdym

crimson terrace
#

do you have multiple classes ?

lean gull
#

yes

crimson terrace
#

is the paste you sent inside the main class or are some methods outside?

lean gull
#

the first section is in 1 class, the next 2 are in another, and the last is in main

crimson terrace
#

try making the ItemStack mainMenuItem into a static, possibly final variable

lean gull
#

works now, thanks

crimson terrace
#

np

twilit wharf
serene trench
#

i need help why i can't use enchantment table

#

i do not know mybe from world gurd

hasty dove
rough jay
#

How would I check if a player is in an area defined by two locations? (one on the up left corner, and the other on the bottom right corner)

hybrid spoke
#

get the region between those corners and check if the player is inside this region

rough jay
#

thx

mortal hare
#

anyone great with generics and wildcards here

#

lets say i have a abstract class

#

with generic <T extends OtherClass>

#

there's an abstract method called public void myMethod(T object);

#

lets say i implement this class

#

and i need to pass the value to it through another class via its implementation

#

what should i do

#

if i have type unsafe value

ivory sleet
#

What value?

mortal hare
#

Object class object for example

ivory sleet
#

So the implementation wants an instance of type Object, where though?

mortal hare
#

no

#

wait

#

lemme show you an example

ivory sleet
#

Sure

mortal hare
#
public abstract class GenericTest<T extends AnotherClass> {

private final Class<T> clazz;
public GenericTest(Class<T> clazz) {
  this.clazz = Objects.requireNonNull(clazz);
}

public abstract void genericMethod(T value);

and this is implementation class

public class GenericClass extends GenericTest<ThirdClass> {

  public GenericClass() {
    super(ThirdClass.class);
  }

  @Override
  public void genericMethod(ThirdClass value) {
    System.out.println("Hey generic method has been invoked!");
  }
} 

lets say I have an instance of GenericClass object and i need to pass the value to it, but i have Typed down version (Object class instance)

quaint mantle
#

Cast it?

mortal hare
#

it doesnt work for some reason for me, it casts to AnotherClass instead of ThirdClass

quaint mantle
#

Show us code

mortal hare
#

I tried using clazz.cast(ObjectValue)

ivory sleet
#

So you have an instance of GenericClass but the type you’ve gotten is GenericTest<Object> ?

mortal hare
#

I've got the type of just Object

quaint mantle
#

again, show use code that fails

ivory sleet
#

Java won’t be able to handle this

#

Or well maybe

#

Cuz type erasure is a bit peculiar

mortal hare
#

i don't have any, im just tinkering around

#

with generics

#

its just pain the ass to work with

#

especially with dynamic typing

ivory sleet
#

Thing is Object is just a type in generics

#

it’s not the same as ?

#

or even ? extends/super

quaint mantle
#

no its not

mortal hare
#

yea i've been following this

quaint mantle
#

Object is exact type. ? is any type that extends Object

silver shuttle
#

Okay so I am trying to prevent players from "claiming" a 3x3x3 structure if it intersects with another 3x3x3 structure.
The coordinates of the CENTER block are stored in a MySQL as 3 separate integers.
How do I check using the most efficient way whether or not x, y and z is within 2 blocks of another value in the MySQL or not?

#

wait

#

there's MySQL comparison operators?!?

#

welp that solves it ^^ ty tho

quaint mantle
#

I dont think you really want do sql queries for this

#

cache your data

silver shuttle
#

kinda cant

#

needs to be in the MySQL

quaint mantle
#

why so

silver shuttle
#

but with the operators it works just fine

quaint mantle
#

no its not

#

You're just unecessary doing expensive operations

silver shuttle
#

What should I be doing instead in your mind?

quaint mantle
silver shuttle
#

Using what methods?

sullen marlin
#

I mean if you're just doing it on create or something then mysql is fine

#

but doing it every block place in mysql will be slow af

silver shuttle
#

it is only called when a user command is done to create the structure

quaint mantle
#

Just dont do sql calls everytime. Load data to the memory once and then re-use it

ivory sleet
#

List<? super T> is if you want to be able to pass a List<E> where E might be T or any super type of T where ? extends is the opposite, it’d allow you to pass a List<E> where E might be T or any subtype of T. This is better demonstrated between Supplier<? extends O> where you might want to in let’s say CustomFuture<O> pass a Supplier<B> (B extends O) to its constructor CustomFuture(Supplier<? extends O>). It would make no sense if you pass a Supplier<Object> to it since it will be assuming the supplier to drop an object which has the properties of type O at least, in which any subtype would still have the properties of O. Opposite for something like Consumer. Where let’s say you have the constructor CustomFuture(Consumer<? super O>). Here we could pass a Consumer<Object> which should work fine as when we use Consumer::accept passing an object of type O still confirms type Object. That’s the essentials of the shorthand notation PECS, producer extends, consumer supers. Probably not helpful here.

However let’s say you do want a type parameterized class. For instance Conclure<T>. What you could do is to only expect object. So you might have the method Conclure#set(Object o) simply. But where the Conclure#get still returns an instance of type T. This is done in Set, Map and so on iirc.

sullen marlin
#

is this a copypasta?

ivory sleet
#

Uh I wrote it on mobile just now lol

silver shuttle
#

lmao

#

Are there any very fast ways to compare a 3x3x3 structure to a (by material type) defined structure in a config?

#

rotation is relevant (as in north must always be facing north, cant be rotated)

mortal hare
#

is 3*3*3 structure its only 27 blocks

silver shuttle
#

yeah, anything faster or more efficient than 27 comparisons?

mortal hare
#

i don't see a better way to do this, since it involves checking the material types

#

and that involves comparisons

silver shuttle
#

alr ty

#

that code gonna look horrible

mortal hare
#

maybe use some sort of lookup array if that works

foggy estuary
#


import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

import net.md_5.bungee.api.ChatColor;


public class Main implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (cmd.getName().equalsIgnoreCase("startbankheist")) {
        Bukkit.getServer().broadcastMessage(ChatColor.RED + "The Bank Heist Has Started!");    
        
        
    }
        return false;
       
         
    }
}

    

plugin.yml

version: 1.0
main: me.yev.Main
description: Command for bank heist event
commands:
  startbankheist:
  usage: /<command>```

Does anyone know why the plugin isnt showing up as a cmd and as a plugin? im new to command execution.
mortal hare
#

but nah

silver shuttle
#

i thought like:
stone,stone,stone,stone,dirt,stone,stone,stone,stone
as the uppermost layer and then 2 more layers in the config

#

^^ wold create a stone ring and dirt in the middle

mortal hare
foggy estuary
#

how would i do that?

silver shuttle
#

why are you naming your class Main?

mortal hare
#

add this.getCommand("startbankheist").setCommandExecutor(this) to your onEnable override method

foggy estuary
#

its just a test

#

i cant be asked to rename it to commands

mortal hare
#

it knows that you're having the command but the server doesnt know what to do with it

#

so you need to hook your CommandExecutor to implement your logic

arctic moth
#

is there a way to make custom items appear in the creative inventory?

sullen marlin
#

no

#

creative is client side

crimson terrace
arctic moth
#

lol

#

k

silver shuttle
#

😭

young knoll
#

Loops?

silver shuttle
#

how would I loop through a 3x3x3 grid of blocks?

#

oh

#

hmm

#

yeah i see how i could

marsh plaza
#

Does this look right?

server_connect_timeout: 5000
remote_ping_cache: -1
forge_support: false
player_limit: -1
permissions:
  default:
  - bungeecord.command.server
  - bungeecord.command.list
  admin:
  - bungeecord.command.alert
  - bungeecord.command.end
  - bungeecord.command.ip
  - bungeecord.command.reload
timeout: 30000
log_commands: false
network_compression_threshold: 256
online_mode: false
disabled_commands:
- disabledcommandhere
servers:
  lobby:
    motd: '&1Hub 1'
    address: localhost:25565
    restricted: false
  Survival:
    motd: '&1Capboi Survival server'
    address: localhost:25567
    restricted: false
  Dev:
    motd: '&1Capboi Dev server'
    address: localhost:25568
    restricted: false
  PVP:
    motd: '&1Capboi PVP server'
    address: localhost:25569
    restricted: false

listeners:
- query_port: 25565
  motd: '&1Capboi Network&r\n&e[1.16.2+] &6Survival, &2PVP, &9and &8More!"'
  tab_list: GLOBAL_PING
  query_enabled: false
  proxy_protocol: false
  forced_hosts:
    pvp.md-5.net: pvp
  ping_passthrough: false
  priorities:
  - lobby
  bind_local_address: true
  host: 0.0.0.0:25565
  max_players: -1
  tab_size: 60
  force_default_server: false
ip_forward: true
remote_ping_timeout: 5000
prevent_proxy_connections: false
groups:
  md_5:
  - admin
connection_throttle: 4000
stats: 66228c58-cc13-4b32-8cfc-48b4ab8ecda8
connection_throttle_limit: 3
log_pings: true
#

does that look right?

silver shuttle
marsh plaza
#

oh

#

its just it keeps kicking me for the reason that im already connected when im not

silver shuttle
#

anything else in console?

marsh plaza
#

ill dm u it

#

16:25:06 [SEVERE] java.lang.NoSuchFieldException: modifiers

16:25:06 [SEVERE] at java.base/java.lang.Class.getDeclaredField(Class.java:2610)

16:25:06 [SEVERE] at net.buycraft.plugin.bungeecord.httplistener.ReflectionUtils.setStaticFinalField(ReflectionUtils.java:39)

16:25:06 [SEVERE] at net.buycraft.plugin.bungeecord.httplistener.BungeeNettyChannelInjector.inject(BungeeNettyChannelInjector.java:17)

16:25:06 [SEVERE] at net.buycraft.plugin.bungeecord.BuycraftPlugin.onEnable(BuycraftPlugin.java:86)

16:25:06 [SEVERE] at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:265)

16:25:06 [SEVERE] at net.md_5.bungee.BungeeCord.start(BungeeCord.java:285)

16:25:06 [SEVERE] at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67)

16:25:06 [SEVERE] at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)

sullen marlin
#

that buycraft version doesnt support your java version

#

update buycraft

arctic moth
#

how do you set the owner of a fireball

sullen marlin
#

and why tf does buycraft need to inject into bungee netty

arctic moth
#

and also explosion knockback

sullen marlin
#

jeez

marsh plaza
#

omg

#

is that real md_5?

arctic moth
#

lol

sullen marlin
#

yes

marsh plaza
#

nice to meet you ive seen lots of your work

quaint mantle
#

no thats a fake account trying to scam you guys

arctic moth
#

hes admin

#

lol

marsh plaza
#

your the person who enspired me to start my own network

crimson terrace
sullen marlin
silver shuttle
arctic moth
#

send bitcoin or ban xD

#

i dont think thats how it works

silver shuttle
steady bronze
#

If I win on crash

crimson terrace
silver shuttle
#

16:28:55 [INFO] java.lang.NullPointerException: Cannot invoke "net.md_5.bungee.api.connection.Server.getInfo()" because the return value of "net.md_5.bungee.api.connection.ProxiedPlayer.getServer()" is null
Anyone got an idea what this means?

crimson terrace
#

your serverinstance is returning null

#

did you set it?

silver shuttle
#

not my server

#

@marsh plaza

crimson terrace
#

youre the one who codes it right?

#

oh nvm me didnt see the md_5

silver shuttle
#

i got the error from @marsh plaza , he needs to respond here

marsh plaza
#

hi

crimson terrace
#

oh ok sorry

mortal hare
#

It seems i solved my generics problem by using this one simple rule from stack overflow

#
PECS
Remember PECS: "Producer Extends, Consumer Super".

"Producer Extends" - If you need a List to produce T values (you want to read Ts from the list), you need to declare it with ? extends T, e.g. List<? extends Integer>. But you cannot add to this list.

"Consumer Super" - If you need a List to consume T values (you want to write Ts into the list), you need to declare it with ? super T, e.g. List<? super Integer>. But there are no guarantees what type of object you may read from this list.

If you need to both read from and write to a list, you need to declare it exactly with no wildcards, e.g. List<Integer>.
foggy estuary
# mortal hare add ``this.getCommand("startbankheist").setCommandExecutor(this)`` to your onEna...

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public final class Command extends JavaPlugin {
public static Command plugin;
    @Override
    
    public void onEnable()  {
        plugin = this;
        this.getCommand("start").setCommandExecutor(this)
        }
        
        
        
    
    
    
    @Override
    public void onDisable() {
        
    }
    
    
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(command.getName().equals("start")) {
            if(sender instanceof Player) {
                Player player = (Player) sender; 
                player.sendMessage("test");
            }else {
                System.out.println("You need to be a player to do this command");
            }
            Bukkit.getServer().broadcastMessage(ChatColor.RED + "The Bank Heist Has Begun!");
                
        }
        
    
        
        
        
        
        
        
        
        return false;
        
    }
    
    
    ``` i try it and the .setCommandExecutor is red
mortal hare
#

you forgot semicolumn

young knoll
#

You do not need to setExecutor to your main class

#

Also, it is setExecutor not setCommandExecutor

mortal hare
#

this.getCommand("debug").setExecutor(new DebugCommand(this)); i use this dirty command right now to debug

foggy estuary
#
        plugin = this;
        this.getCommand("start").setExecutor(this);
        }```
#

this?

mortal hare
#

you don;t need to set plugin = this

#

just pass this

young knoll
#

Once again

mortal hare
#

oh right

#

his command in main class

#

sorry

#

i havent registered commands like this in ages

silver shuttle
#

Can somebody explain this?

mortal hare
#

class path has moved

#

reimport maybe

silver shuttle
#

i used the import method from vaults website

mortal hare
#

it could be outdated info

silver shuttle
#

oh I'll try master

mortal hare
#

it clearly states that the driver is deprecated

silver shuttle
#

first line says enabled vault, last says no vault found

mortal hare
#

oh

#

you're talking about vault ;D

#

ok

silver shuttle
#

yea xd

#

nope, still says no Vault dependency found

mortal hare
#

maybe you're loading the vault after the plugin has been enabled

#

have you added vault as dependency in plugin.yml

silver shuttle
#

during the onEnable

silver shuttle
#

and my onEnable has the Vault given load methods

crimson terrace
# silver shuttle

you can set fasttravel as an alias in the ft command assuming it does the same thing

silver shuttle
#

ah ty

crimson terrace
#

that wont solve your problem but its still good practice

silver shuttle
mortal hare
#

i've had issues with vault api before like this too

crimson terrace
#

only one executor

mortal hare
#

but i forgot how i solved it

silver shuttle
#

damn

#

he created it for simplicity and now we can't solve the simple problems xd

mortal hare
#

try debugging the setupEconomy method

#

add the debug messages there everywhere

#

and see what fails

#

at least I did it like this to fix it

silver shuttle
#

it gave me this line in a previous error code

RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
#

but that is just copy pasta

mortal hare
#

ik

#

that copy pasta for me didnt worked in a first place too

#

it could be that permission system is fucking up, at least iirc that was the case for me

#

im not sure tho

#

iirc vault has some api for permission handling

silver shuttle
#

does Player.hasPermission() also check permissions from plugins like LP or do I need to use Vault?

mortal hare
#
    private boolean setupEconomy() {
        if (getServer().getPluginManager().getPlugin("Vault") == null) {
            return false;
        }
        this.getLogger(Level.INFO, "Vault plugin found!");
        RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
        if (rsp == null) {
            return false;
        }
        this.getLogger(Level.INFO, "Vault Economy Bukkit service has been found!");
        econ = rsp.getProvider();
        return econ != null;
    }

#

try debugging like this

quaint mantle
silver shuttle
#

nvm stupid m,e

foggy estuary
# young knoll .

im stupid and dont know how to do it. is it like this? public void onEnable() { plugin = this; this.getCommand("start"); }

mortal hare
#

dont do this what i told

#

im sorry that i misinformed you

foggy estuary
#

yes but how do i pass it lol

silver shuttle
#

this.getCommand("start").setExecutor(new class());

foggy estuary
#

i did that and coll told me you shouldnt!

old cloud
#

If your onCommand method is in your main class, then do getCommand("start").setExecutor(this); otherwise pass in the class which contains the onCommand method

silver shuttle
#

if it is not in the Main then you need the class name

young knoll
#

I’d your onCommand method is in main, do nothing

old cloud
#

If you do nothing, then how is the server supposed to know what to execute when you run the command?

young knoll
#

Your main class is the default executor

old cloud
#

Okay, I knew that you don't have to implement CommandExecutor in your main class but I did not knew that it also takes it as the default executor

silver shuttle
#

i ummmm

#

might have forgotten to install an economy plugin with my vault problem

graceful turret
#

how to create tablist in 1.17? PacketPlayOutPlayerListHeaderFooter this packet has changed since 1.17

vague oracle
#

Iirc it takes 2 net.minecraft texts I forgot which

young knoll
#

You can set the header and footer with the API

sullen marlin
#

YOU DONT NEED PACKETS FOR THAT

graceful turret
young knoll
#

?jd

sullen marlin
#

Search header in the javadocs

young knoll
#

I believe it’s just setPlayerListHeader/Footer

graceful turret
#

rly?

old cloud
#

How do I know if a runTask or runTaskAsynchronously has finished? Does it mark the returned BukkitTask as cancelled?

marsh plaza
#

erhm??

ivory sleet
old cloud
ivory sleet
#

read their javadoc

old cloud
#

The javadoc is trash

ivory sleet
#

wat

old cloud
#

Doesn't say anything about what I want to know

ivory sleet
#

Use BukkitTask::isCancelled BukkitScheduler::isCurrentlyRunning and BukkitScheduler::isQueued

old cloud
#

Yea

ivory sleet
#

if task is not cancelled and is not queued and is not currently running

#

then it has already been executed

old cloud
#

Yes

#

Thankyou :)

foggy estuary
#

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin {
    @Override
    
    public void onEnable()  {
        // startup
        // reloads
        // plugin reloads
        
        
        
    }
    
        
        
        
    
    
    
    @Override
    public void onDisable() {
        // shutdown
        // reloads
        // plugin reloads
    }
    
    
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (label.equalsIgnoreCase("start")) {
            if(sender instanceof Player) {
                // player
                Player player = (Player) sender;
                player.sendMessage(ChatColor.RED + "The Bank Heist Has Begun");
                return true;
            }
            
            else {
                // console
                sender.sendMessage("Hey console");
                return true;
                
            }
        }
    
        
        
        
        
        
        
        
        return false;
        
    }
    
    
    
}    
    ``` ok so i gave up on doing whatever it was before. This still doesnt work though and its the most basic one. Anyone know what the issue is?
#

it doesnt show up as a plugin nor command

ivory sleet
#

send plugin yml

foggy estuary
#
version: 1.0
main: me.yev.Main
author: DeadMan
api-version: 1.17.1

commands:
  Start:```
ivory sleet
#

looks fine

#

altho idk if its case sensitive, so Start -> start

#

also why comparing label?

quaint mantle
#

"(label.equalsIgnoreCase("start")) " ???

foggy estuary
#

no clue the yt dude told me that lol

#

i never do commands...

foggy estuary
quaint mantle
foggy estuary
#

hm well what should it be instead of a string

quaint mantle
#

I register the commands in the main and give the commandname like this

#
 if (cmd.getName().equalsIgnoreCase("start")) {

is the one u want i guess

unkempt peak
#

What is the issue?

#

Is the command not working?

foggy estuary
#

nah

#

it may now after skiaru suggested that thing

#

nop it didnt

unkempt peak
#

Oh nvm I didn't scroll up

foggy estuary
#

I didnt work anyway.

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

can u send full code?

foggy estuary
#

there

#

wait why didnt it send

quaint mantle
#

think you got enough spaces?

unkempt peak
#

lol

foggy estuary
#

i like to know what im seeing šŸ™‚

unkempt peak
#

So your saying the command isn't showing up at all or it's just not working?

foggy estuary
#

at all

#

nothing

unkempt peak
#

Then it's not registered in your yml or the plugin isn't enabled

#

Are you sure the plugin is enabling?

foggy estuary
#

How would i check apart from /pl?

#

i looked at console

unkempt peak
#

Is it showing on pl

foggy estuary
#

no

unkempt peak
#

Then it's not enabled

#

Check your console for errors

foggy estuary
unkempt peak
#

Your name cannot contain spaces

eternal night
#

seems rather obvious

foggy estuary
#

😦

#

works now thanks @unkempt peak

mortal hare
#

is there any concurrent identity hashmap implementation in java

#

cause i cant find it

ivory sleet
#

Guava MapMaker

mortal hare
#

thanks

subtle folio
#

Im trying to cancel movement in my duels server. Currently i use this code which isnt working too well and causes alot of issues java Player p = event.getPlayer(); if (!QueueManager.canMove.get(p)){ event.setCancelled(true); }

buoyant viper
#

ok i glossed over the identity part

#

uhh

arctic moth
#

how do you make fireballs do more kb

young knoll
#

Seems weird there isn’t a concurrent one in the standard library

ivory sleet
#

Yeah, well arguably not needed

tranquil viper
#

I want to check if a block has been placed by a player or is natural (specifically ores). Right now when someone places a block I am giving it the Metadata PLACED however I realized this would reset when the server restarts. With that in mind, how should I go about checking if a block is natural or placed, even if the server restarts?

young knoll
#

I would do chunk pdc or an external database

tranquil viper
#

How would I store that in a database though

#

I understand mongodb & know how to efficiently use it

muted sand
#

Is there a way I can get the last 10 (or more) messages from chat?
Or would I have to make my own logger in a plugin?

ivory sleet
#

A logger is needed

#

Though you could simply just use a LinkedList for that

muted sand
#

ah, thank you!

waxen plinth
#

Anyone good with SQLite? I've got a big mindfuck here

#

I have two tables

#

One has a foreign key referencing the other

#

I enabled the foreign key option, so the constraints should be working

#

But when I update the column the foreign key references, it does nothing

#

The second screenshot is the update query

young knoll
livid tundra
#

I had basicly the same problem, and I just saved the list of blocks as a file on the onDisable

#

it doesn't seem to be working, though, so I suggest not doing that

#

what's chunk pdc

patent horizon
#

hey so i dragged my current project over from my other computer to my macbook after installing intellij and adding the mc development plugin

#

doesnt seem to be recognizing my apis

unreal quartz
#

needs to reference a primary key of another table

waxen plinth
#

I figured out the issue

#

The issue is that PRAGMA foreign_keys = ON; has worked for every single fucking plugin I have ever made before this

#

But now it stopped working for no reason

#

And I have to pass ?foreign_keys=on; at the end of the jdbc url

quaint mantle
#

is sql.execute using the same database connection?

waxen plinth
#

Yes

#

It'd be dumb to make a new connection for every query

tranquil bone
#

Ello o/ Does anyone know how the world.locateNearestStructure method works?

https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/World.html#locateNearestStructure(org.bukkit.Location,org.bukkit.StructureType,int,boolean)

More specifically, what is the location returned? The center of the structure? The block of the structure nearest to the player?

Also - the documentation says

The radius is not a rigid square radius. Each structure may alter how many chunks to check for each iteration. Do not assume that only a radius x radius chunk area will be checked. For example, StructureType.WOODLAND_MANSION can potentially check up to 20,000 blocks away (or more) regardless of the radius used.

How do I know how many chunks a specific structure will check per iteration? For example, if I wanted to know how many chunks an endcity would check through?

young knoll
#

It probably reflects the vanilla locate command

#

But I’m not sure the functionality of that is documented either

patent horizon
#

how come I cant change spigot-api to spigot in my new project?

#

actually no that was indeed a stupid question i think i would need buildtools

young knoll
#

You need to run buildtools for the desired mc version

patent horizon
#

mhm

#

is gitbash necessary for installing buildtools or can i just run it in terminal or smth

quaint mantle
#

just use your command line

young knoll
#

I

#

Have so many questions

hardy agate
#

alrighty - so this is my code:
https://www.toptal.com/developers/hastebin/behazixige.java
and these are my errors:

Description    Resource    Path    Location    Type
Syntax error, insert "}" to complete Statement    VarmTab.java    /Varm/src/me/theeyeofthepotato/varm/parser    line 154    Java Problem
Description    Resource    Path    Location    Type
Syntax error on token "}", delete this token    VarmTab.java    /Varm/src/me/theeyeofthepotato/varm/parser    line 186    Java Problem

I checked, and I don't think I have unbalanced curly braces... any ideas? Thanks!

sullen marlin
#

you must, follow the suggestions

hardy agate
#

when I do, it throws kinda he same errors

unkempt peak
#

Show your code

hardy agate
#

I did...

sullen marlin
#

idk run an outformatter or something

#

I dont have an ide open

hardy agate
#

what's an outformatter

sullen marlin
#

autoformatter

hardy agate
#

is that just an ide?

sullen marlin
#

yes your ide will have a button

#

the weird indentation of your very last line does suggest there is a } missing

patent horizon
#

can someone help me install buildtools on mac

#

spigot forums tutorial isnt very clear

hardy agate
#

watch codedred's vid

sullen marlin
#
  1. install git; 2) install java; 3) java -jar BuildTools.jar
hardy agate
#
  • or just watch codedred's vid
patent horizon
#

git or gitbash?

drowsy helm
hardy agate
#

git

hardy agate
drowsy helm
hardy agate
#

ok

#

thank you

unkempt peak
#

Ctrl+shift+f

#

In eclipse

patent horizon
#

hmm

#

terminal is asking me for a password to install homebrew but its not letting me type anything

unkempt peak
#

Homebrew? I thought you where trying to run buildtools

patent horizon
#

the install git page suggests to get homebrew

#

idk

ancient plank
#

mac moment

unkempt peak
#

Just use a bat file

sullen marlin
#

theres 3 options there

drowsy helm
sullen marlin
#

you can install xcode or use the binary installer

unkempt peak
#

Oh wait your on mac

patent horizon
#

which one do you prefer?

unkempt peak
#

Well that's your issue lol

sullen marlin
#

idk I dont have a mac

#

Im sure they all work

young knoll
#

Better to be on mac than crack

drowsy helm
quaint mantle
#

better to be on windows than the strip poles

young knoll
unkempt peak
#

I don't understand how anyone can possibly be a programmer on mac

drowsy helm
#

xcode?

quaint mantle
#

mac is so bad

drowsy helm
#

its a huge thing lol

#

most swift devs are mac users aswell for obvious reasons

patent horizon
#

wowza

#

10 gb for xcode

#

nothankyou

sullen marlin
#

well did you try the third option, the installer I linked

young knoll
#

This is why I program on my etch-a-sketch

patent horizon
patent horizon
#

oh didnt see the link

hardy agate
#

another question- how do I add arguments and make them not go in alphabetical order

sullen marlin
#

client probably sorts them alphabetical

young knoll
#

It does

hardy agate
#

so it's impossible?

young knoll
#

Probably

#

Maybe if you dive deep into brigadier

patent horizon
#

hmmm

#

on windows, gitbash has its own terminal gui

#

is mac's integrated into terminal?

hardy agate
#

alright thank you

sullen marlin
#

yes, since macs already have bash installed

patent horizon
#

how do i input buildtools destination?

sullen marlin
#

?

#

destination is current folder

patent horizon
#

how would it know what my current folder is

#

i just opened up terminal

sullen marlin
#

pwd

#

terminal opens up to your home folder

#

unless you open it in another folder

patent horizon
#

ah ok

patent horizon
#

so i ran the terminal command and it came back with the "successfully installed all stuff" after a while

#

but none of the spigot, bukkit, work, etc. folders are coming up where the buildtools jar is

sullen marlin
#

it comes in your current directory

#

pwd

patent horizon
#

hmm so

#

i wonder where its been installing

#

cuz i did java -jar Desktop/BuildTools/BuildTools.jar

#

and it worked fine but nothing showed up

#

but i did like cd (directory) or something and it did work

sullen marlin
#

type pwd

echo basalt
#

For some reason calling ConfigurationSection#addDefault(path, true) sets *id002 on the config

#

🤨

sullen marlin
#

weird

#

are you sure its being set to true and not something else later

echo basalt
#

Yes, this is the only place I touch config values

#

Only difference to usual is that I'm saving async

sullen marlin
#

make sure only one thread is touching the config at a time

echo basalt
#

Yeah that's happening too

sullen marlin
#

async prolly causing your issues

echo basalt
#

I wonder if calling set instead of addDefault changes anything

sullen marlin
#

CompletableFuture.runAsync(this::save); // Todo: Not call this 200 times (cache for a bit for less IO)

#

you're calling shouldEnable whilst the async task is running

echo basalt
#

Hmm

sullen marlin
#

your comment even suggests this is an issue

echo basalt
#

Yeah that's valid

#

snakeyaml weird

patent horizon
#

so the million dollar question

#

what exactly is spigot?

#

is it like an alteration of minecraft?

echo basalt
#

plumbing

#

Spigot is basically an extension of minecraft's server implementation

#

Containing an updated version of Bukkit API along with Spigot's own API

#

which I find weird that they're doing both but oh well

patent horizon
#

bukkit api is just a deobfuscation library of core minecraft

echo basalt
#

No

#

Not exactly

#

Bukkit API is an interface that calls minecraft's implementation, with friendly methods

#

And provides event systems and such

patent horizon
#

so bukkit api is solely for plugin development?

echo basalt
#

Mostly, but Bukkit also contains its customizability and NMS patches

patent horizon
#

nms patches?

echo basalt
#

NMS is net.minecraft.server - Minecraft's implementation

#

It does some modifications for better interactability and perhaps performance, I haven't read bukkit's entire code

patent horizon
#

whats the difference betweek bukkit and craftbukkit

echo basalt
#

CraftBukkit is a fork of Bukkit with some fancy stuff that allowed NMS-like code

#

I wasn't around that age so I can't tell you much regarding it

worldly ingot
#

not quite

#

Bukkit is primarily a series of interfaces. Not much more than that.

echo basalt
worldly ingot
#

CraftBukkit implements those interfaces

echo basalt
#

Yeah

patent horizon
#

interfaces?

echo basalt
#

I love how bukkit doesn't let me see craftbukkit's code because interfaces

worldly ingot
#

Bukkit can be taken to other servers if they really want. Glowstone is a good example of that. The Glowstone server tries to implement Bukkit as best as possible

echo basalt
#

so half of the time I'm stumbling around blindly

#

It's all fun and games until someone calls NMS on glowstone

worldly ingot
#

There is no NMS in Glowstone ;p

#

That's the goal of it

echo basalt
#

That's the fun

#

plugins thinking it's a spigot server and getting fooled

worldly ingot
#

Oh you mean a plugin calling NMS. Yeah. Then you're SOL

echo basalt
#

and authors getting anonymous reports and wondering where their reflections went wrong

patent horizon
#

ok so from my understanding, nms is minecraft's server implementation code, craftbukkit is the deobfuscation of that code, bukkit is an api to access easy methods for plugin development, spigot is an extension of bukkit, and paper is an extension of spigot

young knoll
#

Bukkit implementation on fabric when

#

A complete one that is

echo basalt
#

And purpur is a fork of tuinity

patent horizon
#

forkforkforkfork

echo basalt
#

and airplane is a fork of purpur

#

Imagine using airplane lmao

young knoll
#

Yatopia

echo basalt
#

Airplane -> purpur -> tuinity -> paper -> spigot -> craftbukkit -> bukkit -> nms

#

"Performance driven fork"

patent horizon
echo basalt
#

at that point you just rewrite it entirely

young knoll
#

I code all my plugins in binary thank you never much

echo basalt
worldly ingot
#

Did the Glowstone project halt? Seems like there's not been a commit for over 2 months

echo basalt
#

I think they died in 1.12

#

which is quite sad

worldly ingot
#

Well they've been behind for a bit now

#

Though it was at least maintained

echo basalt
#

I always wanted to write my own impl but I'm the kind of guy that writes 90% of a project and gets bored

ebon siren
#

java.io.FileNotFoundException: modifiers.yml (The system cannot find the file specified)
is there another way to reference files because just putting it in a plain string doesn't work even though the class referencing the yml file and the yml file itself are right next to eachother in the filesystem

#
new File("modifiers.yml")
#

do i need to specify the package or put a ./ in the beginning

echo basalt
#

Yes

#

You need to

#

Usually a .jar is a weird .zip file you can open

#

So you can just see how JavaPlugin#saveResource works and replicate it

ebon siren
#

got it

quaint mantle
quaint mantle
young knoll
#

It wouldn’t be trash if the API was implemented well

#

Although I guess it would still have issues due to stuff like the material enum

quaint mantle
#

bukkit api wasnt designed to work with mods at all. Thats not about well implementation

tacit drift
young knoll
#

It’s mostly just because Bukkit expects a fixed number of items, biomes, etc

quaint mantle
young knoll
#

To be fair those changes probably need to be made anyway

#

Biomes aren’t fixed anymore, blocks probably won’t be some day

lusty sentinel
#

So apparently its not possible to detect Keypresses, but on the Manacube prison server, the "F" key opens a custom menu. How is this done??

young knoll
#

F is they key to swap the held item to the offhand

#

Which you can detect

lusty sentinel
#

Oh of course

#

Thank you so much

young knoll
#

There is even an event

#

PlayerSwapHandItemsEvent

tranquil viper
#

How can I get the amount of items dropped onBlockBreak?

#

For example if you break a diamond ore and it drops 3 diamonds because you have fortune it prints that to console that you got 3 diamonds from one ore

young knoll
#

You can use BlockDropItemEvent

#

I think you can also pass an itemstack to Block#getDrops

hasty dove
drowsy helm
#

your commands need quotes

hasty dove
subtle kite
#

end of the stream or a document separator is expected (34:6)

31 | 29
32 | 30
33 | 31
34 | Name: minecraftservers.org
-----------^
35 | Priority: 4
36 | Hidden: false

#

Your spacing is messed up

#

I'm to busy to do it , just

hasty dove
#

what should i fix in this?

#

and can someone make a model one for me

sullen marlin
#

work off the default one

#

also this is a dev channel

quaint mantle
#

hi md_5

#

what is the first thing to do when we fork someone project heh

tacit drift
noble lantern
#

I am trying to get a CreatureSpawner after a BlockPlaceEvent

I place a spawner, and I get the first debug message but the second debug message doesn't fire:

Is this one of those things where I need to check 1 tick after the event?

#

Oh i forgot about Block#getState() whoops, ignore me

vernal pier
#

is there something like Collections.max( but for arrays ?

quaint mantle
#

Oh and just my personal issue, but i feel like doing check false before doing something is not that easy to read.
for example

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (sender instanceof Player p) {
            if (p.hasPermission("risingcore.spawnsystem")) {
                if (args.length == 1) {
                    String locationName = args[0];
                    if (!locations.getConfig().contains("Locations-Data." + locationName)) {
                        locations.getConfig().set("Locations-Data." + locationName, p.getLocation());
                        locations.save();
                        language.setSpawn(p);
                        return true;
                    }
                    language.alrName(p);
                    return true;
                }
                language.noArgs(p);
                return true;
            }
            language.noPerm(p);
            return true;
        }
        language.playerOnly(sender);
        return true;
    }

instead of

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (!(sender instanceof Player p)) {
            language.playerOnly(sender);
            return true;
        }
        if (!p.hasPermission("risingcore.spawnsystem")) {
            language.noPerm(p);
            return true;
        }
        if (args.length <= 1) {
            language.noArgs(p);
            return true;
        }

        String locationName = args[0];
        if (locations.getConfig().contains("Locations-Data." + locationName)) {
            language.alrName(p);
            return true;
        }
        locations.getConfig().set("Locations-Data." + locationName, p.getLocation());
        locations.save();
        language.setSpawn(p);
        return true;
    }```
#

Easier to read right?

noble lantern
#

ewie normal bukkit comand handling

quaint mantle
#

But it looks cleaner than the other one right?

ivory sleet
quaint mantle
#

I used return to make sure it will never interfere with the codes that are not inside the if

#

or might be something like this, a huge else if

        if (value instanceof String) {
            writeString((String) value);
        } else if (value instanceof Number || value instanceof Boolean) {
            write(value.toString());
        } else if (value instanceof TemporalAccessor) {
            String formatted = TomlManager.DATE_FORMATTER.format((TemporalAccessor) value);
            if (formatted.endsWith("T")) // If the last character is a 'T'
            {
                formatted =
                        formatted.substring(0, formatted.length() - 1); // removes it because it's invalid.
            }
            write(formatted);
        } else if (value instanceof Collection) {
            writeArray((Collection) value);
        } else if (value instanceof int[]) {
            writeArray((int[]) value);
        } else if (value instanceof byte[]) {
            writeArray((byte[]) value);
        } else if (value instanceof short[]) {
            writeArray((short[]) value);
        } else if (value instanceof char[]) {
            writeArray((char[]) value);
        } else if (value instanceof long[]) {
            writeArray((long[]) value);
        } else if (value instanceof float[]) {
            writeArray((float[]) value);
        } else if (value instanceof double[]) {
            writeArray((double[]) value);
        } else if (value
                instanceof Map) { // should not happen because an array of tables is detected by
            // writeTableContent()
            throw new IOException("Unexpected value " + value);
        } else {
            throw new TomlException("Unsupported value of type " + value.getClass().getCanonicalName());
        }```
#

I would instead of doing that, use something like if to check then return.

#

it looks cleaner than these else if lol

noble lantern
noble lantern
#

For the second chunk why not use a switch case instead of a fat tree of ifs

quaint mantle
solid cargo
#

does Bukkit.getScheduler().cancelTasks() only cancel plugin tasks

quaint mantle
#

i forgot switch

buoyant viper
#

could probably do something with the Arrays.stream() method?

#

Arrays.stream(arrayIn).max(maxFunc).get();

quaint mantle
#

editsnipe

#

oh i forgot this server dont even have snipe

#

typing.

#

conclure is typing.

ivory sleet
#

It’s a bit ambiguous if it’s not some obvious type like numeric

ivory sleet
quaint mantle
#

2

#

1

glossy venture
#

dont see shit

glossy venture
#

yeah it cancels only plugin tasks i think

solid cargo
#

aight thanks

iron palm
#

scheduler is not working (it ignores the delay) https://paste.md-5.net/bivugosuce.cs

am i wrong in usage of it? I also tried using it onEnabled in final main class but not working either

lavish hemlock
#

like why the fuck would you use Arrays.stream like that

#

Streams are much slower than anything imperative

#

(btw asList is optimized for arrays as it actually uses a private immutable List implementation)

#

otherwise,

int max = 0;
for (int i : array) {
    if (i > max) {
        max = i;
    }
}
#

it's not really that hard to make a "get max" method

#

and tbh I'd go for this if it's just a one-time thing, otherwise it's just pointless to use a util method

lavish hemlock
#

I'm almost right

#

it's

#

<T extends Comparable<? super T>> and then Collection<? extends T>

#

otherwise, you can use a Comparator if it isn't comparable

buoyant viper
buoyant viper
summer scroll
#

Does someone know why when I try to get this string from config, it will return null?
name: "ขโดย"

lavish hemlock
#

Uhhh probably a locale issue?

#

Or improper encoding?

summer scroll
#

Yeah could be, any way to fix that?

lavish hemlock
#

Dunno.

quaint mantle
#

enforce entire server in the batch file

#

did you do that

summer scroll
#

one sec

ivory sleet
lavish hemlock
#

it fails on write, does it not?

#

actually I haven't tested set

ivory sleet
#

it fails on add, possibly remove and similar methods but should work fine for set yes.

lavish hemlock
#

hm

latent dove
#

yall ever baked a hamster

lavish hemlock
#

damn right I have

latent dove
#

ya like jazz

summer scroll
ivory sleet
#

Wat

lavish hemlock
#

asian moment

mystic sky
#

Why not indian?

summer scroll
#

That's not from me xd, what language is that anyway?

mystic sky
lavish hemlock
#

not indian moment

#

that sounds weird bruv

sharp hemlock
#

that's Thai

lavish hemlock
#

asian moment

quaint mantle
#

Hey there!

Where can I get net.md_5.bungee.api.plugin.Plugin import?

project(':hackedserver-bungeecord') {

    repositories {
        maven { url 'https://mvn.exceptionflug.de/repository/exceptionflug-public/' }
    }

    dependencies {
        compileOnly group: 'net.md-5', name: 'bungeecord-api', version: '1.17-R0.1-SNAPSHOT'
        compileOnly group: 'net.kyori', name: 'adventure-text-minimessage', version: '4.1.0-SNAPSHOT'
        compileOnly group: 'dev.simplix', name: 'protocolize-api', version: '2.0.1'
        implementation group: 'org.bstats', name: 'bstats-bungeecord', version: '2.2.1'
    }

}

This is my current code and bungeecord-api doesn 't seem to provide me the plugin* stuff

#

feel free to tag me šŸ™‚

summer scroll
#

I want to send an embed message to a discord server from spigot plugin, how can I achieve that?

drowsy helm
#

you'd need a discord bot aswell

lavish hemlock
#

or a webhook

summer scroll
#

With webhook you don't need to do that right

drowsy helm
#

i mean if you just want to send a message you could start it up when you want to send the message

#

im not too familiar with webhooks sorry, but if you just want to send messages any nothing else its probably your best option over bots

summer scroll
#

and i should use JDA?

drowsy helm
#

thats what i use for bots, not sure on webhooks though

summer scroll
lavish hemlock
#

I believe JDA works with webhooks?

drowsy helm
#

cant see webhooks mentioned in it's github

dark osprey
#

You can see.

drowsy helm
#

yeah its not jda itself

#

another project

summer scroll
#

Have any of you guys used this before?

drowsy helm
#

nope, but its listed in JDA's wiki

#

so i'd assume its reputable

summer scroll
#

Do I need to close the client after using it? just like sql database.

drowsy helm
#

if its a one time thing i probably would

#

depends on how often you're accessing it

summer scroll
#

i would say very often

drowsy helm
#

probably a good idea to do it async and closing on disable i reckon

summer scroll
#

what about enhanced try/catch

drowsy helm
#

wdym

#

do you mean try with resources?

summer scroll
#

the

try(WebhookClient client = WebhookClient.withUrl(ConfigValue.WEBHOOK_URL)){
            
}
drowsy helm
#

yeah try with resources

#

i mean if you want go for it if it works correctly

foggy estuary
summer scroll
#

i just don't want to blow up the server lol

#

never use this before

drowsy helm
#

thats why i recommend async

rough jay
#

If I want a list of players, wouldn't it be better to use their UUID instead of just saving Player?

drowsy helm
#

if the thread dies, the server wont die with it

drowsy helm
#

keeping a reference to player can cause mem leaks

summer scroll
#

ofc i'll use async

drowsy helm
foggy estuary
#

11.11 12:52:09 [Server] ERROR Could not load 'plugins/DeadManWeapons.jar' in folder 'plugins'
11.11 12:52:09 [Server] INFO org.bukkit.plugin.InvalidDescriptionException: commands are of wrong type

drowsy helm
#

oh your commands seciton isn't indented correctly

#
commands: 
  dmkit: 
  description: "Command kit"
  usage: /dmkit

should be

commands: 
  dmkit: 
    description: "Command kit"
    usage: /dmkit
foggy estuary
#

oh ok lol

#

ty ty

drowsy helm
#

yeah can be annoying lol

#

nw

solid cargo
#

how can i make on a TextComponent click send the player messages

round gale
#

I'm needing help with the PluginMessageChannel as I don't know what I need to have because my tests failed consistently. I have the channel registered in both Bungee and Spigot side plugins. I don't get the Receiver to work (I know this because I set a breakpoint in IntelliJ and started in debug mode)
Bungee Side Plugin is just registering the channel. The Spigot Plugin has the Sender and Receiver. Code below.

You don't need to make and send some functioning code but I'm not getting how you arrange it so it works. (to be honest, the documentation is very unclear or I'm too dumb to get it)

I'm just desperate because I tested for whole 2 days now.

public class Sender {
Ā  Ā  public Sender(String test) {
Ā  Ā  Ā  Ā  ByteArrayDataOutput out = ByteStreams.newDataOutput();

Ā  Ā  Ā  Ā  out.writeUTF("Forward"); // So BungeeCord knows to forward it
Ā  Ā  Ā  Ā  out.writeUTF("ALL");
Ā  Ā  Ā  Ā  out.writeUTF("winner:broadcast"); // The channel name to check if this your data

Ā  Ā  Ā  Ā  ByteArrayOutputStream msgbytes = new ByteArrayOutputStream();
Ā  Ā  Ā  Ā  DataOutputStream msgout = new DataOutputStream(msgbytes);
Ā  Ā  Ā  Ā  try {
Ā  Ā  Ā  Ā  Ā  Ā  msgout.writeUTF(test); // You can do anything you want with msgout
Ā  Ā  Ā  Ā  } catch (IOException exception){
Ā  Ā  Ā  Ā  Ā  Ā  exception.printStackTrace();
Ā  Ā  Ā  Ā  }
Ā  Ā  Ā  Ā  byte[] msgbytes_bytearray = msgbytes.toByteArray();
Ā  Ā  Ā  Ā  out.writeShort(msgbytes_bytearray.length);
Ā  Ā  Ā  Ā  out.write(msgbytes_bytearray);
Ā  Ā  }
}```


```java
public class Receiver implements PluginMessageListener {
Ā  Ā  @Override
Ā  Ā  public void onPluginMessageReceived(@NotNull String channel, @NotNull Player player, @NotNull byte[] message) {
Ā  Ā  Ā  Ā  ByteArrayDataInput in = ByteStreams.newDataInput(message);
// Ā  Ā  Ā  Ā if (channel == "winner:broadcast") {
Ā  Ā  Ā  Ā  Ā  Ā  String test = message.toString();
Ā  Ā  Ā  Ā  Ā  Ā  String test2 = in.readUTF();
Ā  Ā  Ā  Ā  Ā  Ā  WinnerBroadcastBukkit.plugin.getLogger().info(test);
Ā  Ā  Ā  Ā  Ā  Ā  WinnerBroadcastBukkit.plugin.getLogger().info(test2);
Ā  Ā  }
}
summer scroll
serene trench
#

help

round gale
#

Worldguard

quaint mantle
#

Hello

#

Can anyone help me with the fastlogin plugin?

summer scroll
chrome beacon
summer scroll
#

cuz the github page didn't tell me to do so

summer scroll
#

it is what it is

vocal mirage
#

Hello!
Do you know if there's a way to do a loop every second in a bukkit/bungee scheduler?
Thanks

quaint mantle
undone axleBOT
summer scroll
quaint mantle
#

How would classes exist in classpath if you didnt shade them? Magically came out of nowhere?

chrome beacon
#

To run code the code needs to exist

#

So you put it in the jar

summer scroll
chrome beacon
#

Because Spigot loads your plugin which means Spigot is in the classpath

quaint mantle
#

spigot is provided

summer scroll
#

okay

#

what should i shade?

#

like the pattern

vocal mirage
# chrome beacon ?scheduling

no, like if i make a countdown and that i want to send a message every second before the timer ends, what should I do ?

quaint mantle
#

How do i send all the strings from a list in the config to a player?

chrome beacon
#

You loop the list and send the message

quaint mantle
#

Uhm im really new to spigot i dont know how to do that :c

chrome beacon
#

Java or Spigot?

quaint mantle
#

Spigot

chrome beacon
#

What part do you need help with? Loading and reading the config?

vocal mirage
chrome beacon
quaint mantle
tardy delta
#

food šŸŒ

#

gimme

quaint mantle
eternal night
#

your configuration has that method

tardy delta
#

get...List()

eternal night
#

getConfig().getStringList("Foodlist")

quaint mantle
#

Yes i understand that but how do i send all the strings in the list to a player

tardy delta
#

i'd call it foodies

eternal night
#

it is a list of strings ?

#

loop over them

tardy delta
#

use a stringbuilder?

hybrid spoke
#

?learnjava

undone axleBOT
quaint mantle
eternal night
#

then follow ciphers learn java links

chrome beacon
hybrid spoke
quaint mantle
tardy delta
#

would it be logic to join the chatchannel when i set it as main channel?

chrome beacon
lavish hemlock
#

I mean, that's kind of a technicality.

#

"Coding in <language>" is also deemed improper, but nobody cares because it's a common phrase.

quaint mantle
#

Anyone has a clue how to obfuscate my code? I'm not that known with cryptography sooo.

lavish hemlock
#

Cryptography != obfuscation.

quaint mantle
#

obfuscation uses crypto tho

lavish hemlock
#

No it does not.

quaint mantle
#

well.. no clue myself hence why I'm asking.

lavish hemlock
#

You can use an obfuscator like ProGuard.

quaint mantle
#

and it works with plugins? dope..

lavish hemlock
#

Yeah it works with all Java projects.

#

Well, maybe not all, there's probably like a few odd edge-cases, but you get the point.

quaint mantle
#

Why do you need obfuscation? It wouldnt save your plugin from cracking and it would make stacktraces unreadable

lavish hemlock
#

Manya is right on that front.

lavish hemlock
#

Obfuscation does practically nothing against leaks or cracks.

onyx fjord
#

it does nothing other than hiding package names

#

tbh

quaint mantle
#

like, whats the point of it then

onyx fjord
#

hide bad code

#

i guess

lavish hemlock
#

If you sent me the obfuscated version of your plugin, I could deobfuscate it in just a day.

onyx fjord
#

or hide malicious code

quaint mantle
onyx fjord
#

no

#

they mostly increase size

quaint mantle
onyx fjord
#

thats why im against obfuscating

#

and spigot should make obfuscation rules more strict

#

or just deny obfuscation

quaint mantle
#

oh i remember obfuscation drama

lavish hemlock
#

And because of that, it really only works on large codebases, where you have so many fucking classes that it's hard to deobfuscate everything lol.

quaint mantle