#help-development

1 messages · Page 1562 of 1

quiet ice
#

settings.bungeecord in spigot.yml

eternal oxide
#

if you have it all setup correctly it shoudl be using Mojang auth so you will have online UUIDs

quaint mantle
#

right

vague mason
#

that does not sync uuids

dusk scroll
#

So, I seem to have a memory leak on my server that causes the memory to rise--and therefore cause a major drop in TPS, even with no players online--but after checking the heap dump, these are the suspects

quiet ice
#

well, what does it do then?

eternal oxide
dusk scroll
#

It's all net.minecraft.server stuff, so no plugins

#

none of my plugins even use this (to my knowledge)

vague mason
dusk scroll
#

is there any fix?

quiet ice
vague mason
#

Like to open communication system

quaint mantle
dusty herald
#

don't use name, use uuid

quaint mantle
#

i save it with uuid...

quiet ice
#

ah, you mean permament plugin message channel? I do not think that that setting does that

eternal oxide
quaint mantle
#

but on the command i use
/stats player
not
/stats uuid

quiet ice
#

But to connect to the bungee server you need the ip of the bungee server, so I don't get your logic

dusty herald
vague mason
dusty herald
#

or is that not applicable

quiet ice
#

Bukkit.getOfflinePlayer is a thing btw

vague mason
#

it can return null. I don't trust this XD

quiet ice
#

just note that it might not be good for performance, but it is there

dusty herald
#

what I typically do is each time that user logs in, assign a string (their username) to their UUID upon login

quiet ice
quaint mantle
eternal oxide
quiet ice
#

For it, everything is a valid player

dusk scroll
dusty herald
#

);

quiet ice
#

uhm, is that efficent though?

dusty herald
#

Bukkit.getOfflinePlayer(String) is deprecated but it is very useful when trying to identify if a username belongs to a specific uuid

eternal oxide
#

oh no can;t use stream as its an array

vague mason
eternal oxide
#

sec

runic mango
#

q: does anyone know how to make this work? Right now the plugin loads but the command errors if you run it

quiet ice
granite stirrup
#

doesnt give a offline player with the name null?

dusty herald
#

I mean why do you need the player's name if you already know the player's name e.g, arg[0]

vague mason
granite stirrup
#

no i mean when you get a offlineplayer with uuid

vague mason
#

Deprecated methods? XD

quiet ice
vague mason
#

which can return null XD

dusty herald
#

the string is depreated but UUID is not and they're both annotated notnull

quiet ice
#

It can NEVER return null

dusk flicker
#

^

quiet ice
#

?jd

ivory sleet
#

For that method, an offline player with every possible name exists

quiet ice
#

Here, look it up yourself

dusk flicker
#

dont know why you think it can return null /shruh

dusty herald
#

/shruh

vague mason
#

Bukkit.getOfflinePlayer("Player that has never joined your Minecraft server")

dusty herald
#

it returns a player

granite stirrup
#

@notnull doesnt do shit tho if it returns null its still going to return null?

ivory sleet
#

Might throw before

dusty herald
#

even if it is invalid

eternal oxide
# quaint mantle ok thanks
Arrays.asList(Bukkit.getOfflinePlayers()).stream().filter(p -> p.getName().equalsIgnoreCase(args[0]));```
dusty herald
#

yeah that also works really well

#

might work better but the player has to have joined before

ivory sleet
#

Why not just stream it?

dusk flicker
vague mason
#

but you won't be able to get their name which is the whole point here.

dusty herald
#

that's not the point ziga

dusty herald
#

the point is to check to see if a username has a valid UUID inside of their config

quiet ice
#

You can still do validation if that is an issue

#

it's not like that bukkit has methods for that

granite stirrup
quiet ice
#

correct.

dusty herald
#

iirc it always returns offlineplayer

dusk flicker
#

what? yes?

quaint mantle
#

yep that what i wanted
show player online stats
show player offline & saved on database stats
and if he dont on database show 0 on everything
thanks you

ivory sleet
dusk flicker
#

you can only get an offline player from getOfflinePlayer but if they are online you can cast it to a player

ivory sleet
#

getPlayer()

#

🥲

dusk flicker
#

yeah was about to mention that lol

dusty herald
#

OfflinePlayer#isOnline() seems a bit redundant but it isn't

#

😂

granite stirrup
#

why should that exist if you have a OfflinePlayer doesnt it mean it is offline

quiet ice
#

Player extends OfflinePlayer

granite stirrup
#

why

dusty herald
#

woah

granite stirrup
#

shouldnt OfflinePlayer extend Player

#

wtf

quiet ice
#

Player extends HumanEntity

vague mason
#
[{"name":"Black1_TV","uuid":"5ddda7b6-5e79-4dbc-8c74-bcf2364d06c7","expiresOn":"2021-08-08 18:18:49 +0000"},{"name":"Katja02","uuid":"cfaee8ea-209b-4244-8b43-bbb363e69767","expiresOn":"2021-08-08 08:13:16 +0000"}]
dusk flicker
#

why would offlineplayer extend player?

vague mason
#

usercache.json

dusk flicker
#

that... doesnt make sense?

granite stirrup
dusk flicker
#

It's not

#

It's an OfflinePlayer

quiet ice
#

HumanEntity extends (by extension) Entity

ivory sleet
#

Player represents a player playing on the Sever

quiet ice
#

^

eternal oxide
#

yep is cleaner java OfflinePlayer target = Arrays.stream(Bukkit.getOfflinePlayers()).filter(p -> p.getName().equalsIgnoreCase(args[0])).findFirst().get();

dusty herald
#

god i love lambda

granite stirrup
dusty herald
#

because that's not how mojang works

quiet ice
ivory sleet
#

Because they represent totally different things despite both containing the term Player

dusk flicker
#

offline player has like nothing that player has tho?

granite stirrup
quiet ice
#

Heck, the paper API even has it's own dedicated method for it that does not block!

ivory sleet
vague mason
granite stirrup
#

but then you cant do if (player instanceof OfflinePlayer) {} it would say it for a offlineplayer and a player?

quiet ice
#

And that is the geolykt way of doing it - as it assumes that the plugin has been there from day 0

vague mason
#

so if you don't need to store any data for a player just remove it

granite stirrup
#

yeah i guess you could use .isOnline() but it would be nice not to

ivory sleet
#

Thing is, OfflinePlayer isn’t an entity

#

Whilst Player is

granite stirrup
#

oh

quaint mantle
#

thats will be work?

    public static void getPlayer(String PlayerName) {
        OfflinePlayer target = Arrays.stream(Bukkit.getOfflinePlayers()).filter(p -> p.getName().equalsIgnoreCase(PlayerName)).findFirst().get();
    }
quiet ice
#

if it is an entity, it has to be online

ivory sleet
#

It will throw if none is find derpy

dusk flicker
#

that wont do anything

#

it doesnt return anything

#

also

#

?conventions

undone axleBOT
ivory sleet
#

use orElse(null)

dusty herald
#

isn't OfflinePlayer's getName nullable

ivory sleet
#

It is

granite stirrup
#

i think so

#

cuz getOfflinePlayer(uuid) i think creates a OfflinePlayer with a null name

quiet ice
#

time for yoda statements!

ivory sleet
#

🥲

eternal oxide
#

Yes, however getOfflinePlayers only returns known players to the server, so no names will be null

dusty herald
#

🤔

#

would this be data retrieved from usercache?

quiet ice
#

dont trust this

dusty herald
#

OfflinePlayer target = Arrays.stream(Bukkit.getOfflinePlayers()).filter(p-> p.getName() != null).filter(p -> p.getName().equalsIgnoreCase(PlayerName)).findFirst().get(); jic

#

😉

dusty herald
#

check to make sure the name isn't null

quiet ice
#

doesn't follow naming conventions 0/10

granite stirrup
#

i dont know much about streams in java

dusty herald
#

i was following the format !!

#

fine

quiet ice
ivory sleet
#

Arrays.stream(server.getOfflinePlayers()).map(OfflinePlayer::getName).filter(Objects::nonNull).filter(playerName::equalsIgnoreCase).map(server::getOfflinePlayer).findAny().orElse(null) maybe?

quiet ice
#

just define them as black magic and do whatever you are acustomed to

dusty herald
#
OfflinePlayer target = Arrays.stream(Bukkit.getOfflinePlayers()).filter(offlinePlayer -> offlinePlayer.getName() != null).filter(offlinePlayer -> offlinePlayer.getName().equalsIgnoreCase(PlayerName)).findFirst().get();```
vague mason
#
for(OfflinePlayer op : Bukkit.getOfflinePlayers()){
    if(op.getName() == null) continue;
    if(op.getName().equalsIgnoreCase(PlayerName)) return op.getUniqueId();
}
ivory sleet
#

Yeah that’s way more performant

quiet ice
#

aren't streams multithreadable?

ivory sleet
#

Yup

chrome beacon
vague mason
#
int-array, for-loop : 0.36 ms
int-array, seq. stream: 5.35 ms
#

if you look benchmarks streams are slower

ivory sleet
#

Myeah, streams have quite a bloated implementation

quiet ice
#

for what data set?

eternal oxide
#

very much so. So many extra object created for streams

dusk flicker
#

yet I love streams

eternal oxide
#

I'm coming around to them

runic mango
#

oop shoulda specified its just the Random thing I can't get to work, if i put the random thingamajig in onCommand everything works as expected

ivory sleet
vague mason
#

I'm avoiding streams because they are slow.

#

Also they can be always avoid.

ivory sleet
#

It can be nice with parallel ones

quiet ice
#

again, the dataset matters

ivory sleet
#

Altho you could of course implement your own parallelable loop

quiet ice
#

I have seen a game doubling it's fps in part by using streams instead of iterators

#

dont ask how, but the evidence is undeniable

vague mason
#

Games don't use Java...

ivory sleet
#

I kinda wish we could provide a custom fork join pool for parallel streams

dusk flicker
#

most games dont use Java

vague mason
#

yes

quiet ice
granite stirrup
ivory sleet
chrome beacon
#

Starmade and Mindustry are 2 cool games

vague mason
#

Wouuu I really didn't know that.

granite stirrup
#

then why did you say games dont use java

ivory sleet
#

He probably generalized

quiet ice
#

I know that there is a freeciv equilavent that was also coded in java

vague mason
#

When I was programming plugins for 10 years it really seems strange for me why this C# syntax is so strange 😂

ivory sleet
#

GetYes

quiet ice
#

don't think so - it had a 2000's website from what I recall, unciv looks more modern

#

And unciv is done in kotlin, so it only counts halfway

weary geyser
chrome beacon
#

If you're using Adventure Paper discord might be better to ask in since they know it better

#

Personally I haven't used it yet

quiet ice
#

better ask the kyoripowered server, they are the ones that maintain adventure

chrome beacon
#

Didn't even know they had one

weary geyser
#

Yeah I am there now

ornate heart
#

Is it possible to have custom ingredients (Custom Item meta and quantity) in ShapedRecipes?

chrome beacon
#

Meta yes quantity no

#

You can however work around the quantity issue with the prepare event

granite stirrup
#

like yeah you can get around that but who wants longer lines in they javascript

quaint mantle
#
    ConfigurationSection cs = section.getConfigurationSection(key);
    if (cs == null) continue;
    
    String type = cs.getString("type");
    if (type == null) continue;
    
    Material material = Material.matchMaterial(type.replace(" ", "_"));
    if (material == null) continue;

how do i make this less ugly

ivory sleet
#

that looks fine

quaint mantle
#

it doesnt sit right with me

lilac dagger
#

very useful error indeed

#

any idea?

quaint mantle
#

select the whole thing and send it

unreal quartz
#

essentially

#

what happened

#

it that it failed to execute the goal

lilac dagger
#

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project version: Fatal error compiling

#

the whole thing

#

how it fails? i've no idea

#

maybe the compiler is too old for java 16?

unreal quartz
#

maybe update you rmaven compiler plugin

eternal oxide
#

nm, its InteliJ

lilac dagger
#

I dunno how

#

I think i did it via the properties tag

mystic sky
unreal quartz
#

yes

#

you specify the version in the plugin definition

outer sorrel
eternal oxide
#

check you rplugin.yml

outer sorrel
#

what do i look for?

eternal oxide
#

it says you have a null permission node, on the command probably

outer sorrel
#
permissions:
  betterkeepinventory:

its in there

#

i have the permission in the plugin.yml

eternal oxide
#

no true or false

#

its null

ivory sleet
#

you need to set the default value

#

I think

eternal oxide
#

yep

#

add true or false at the end

outer sorrel
#

?

eternal oxide
#

betterinventory: false

outer sorrel
#

what does that do?

eternal oxide
#

sets the default to false

outer sorrel
#
permissions:
  betterkeepinventory:
    default: false
tepid thicket
#

Anyone knows how line wraps are handled? The first one is with §f before the N.
How does the color actually affect linewrapping?

ivory sleet
#

it continues

#

for instance §cBlah\nd

#

Blah
nd

#

both would be red

tepid thicket
#

Not sure how you mean that. Shouldn't both cases be the same on my screenshot?

#

Or what causes the first version with the color to linewrap diffently?

ivory sleet
#

oh nvm i am lost

#

probably some client sided mess

#

the client probably considers the first message as 2 different components concatenated thus it handles it differently, exactly how and why Idk but yeah

tepid thicket
#

Can we be sure it is client side? Spigot does nothing on linewrapping?

ivory sleet
#

afaik its client sided

tepid thicket
#

Anyone else can confirm?

unreal quartz
#

the client failed to recognise that Nutze is a whole word in the first one

#

because normally the client doesn't just cut words in half like that

#

and the small indent on the second line show it's word-wrapped

#

but that is only processed by the client

#

the server doesn't tell the client how to wrap the text

tepid thicket
#

Ah alright didn't know if spigot would modify the message. Seems to be a client bug then.
Just weird, that the color is affecting it. Thx then!

worn sierra
#

can someone help me with a java problem? (not spigot related)

ivory sleet
#

sure

worn sierra
ivory sleet
#

first of all, cache the Pattern

unreal quartz
#

if endpoint is an instance of Endpoint, then it's not gonna be an instance of Nameable or Patternable

#

slightly confused with how you've decided to model this

worn sierra
#

class PlayerEndpoint implements Endpoint, Nameable

#

and I have:

#

class FileEndpoint implements Endpoint, Patternable

#

endpoints are actually http contexts

#

we to find files I use patterns

#

otherwise using context name

worn sierra
ivory sleet
#

So you're trying to linearly search for something which can implement any of those interfaces by matching pattern or name?

worn sierra
#

yep

#

if subclass of endpoint and instance of patternable, then i use that pattern method

#

otherwise simply compare names

ivory sleet
#

I don't see the problem really

worn sierra
#

let me give an example then

#

"localhost/player" this goes to player context (simply loops the list and find the one that has the name of "player")

ivory sleet
#

myeah

worn sierra
#

but if i want to get a file from the server like

#

"localhost/file/to/path/file.yml"

#

then I need to use a pattern

tepid thicket
#

Seems to be a bit overcomplicated.

foggy bough
#

excuse me? but I have this code... ```java
private Main plugin;

private ItemStack compass = new ItemStack(Material.COMPASS);

public Hunter(Main plugin) {
    this.plugin = plugin;
}

@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    if(sender instanceof Player) {
        this.plugin.hunted = args[0];
    }
    
    return false;
}

@EventHandler
public void onRespawn(PlayerRespawnEvent e) {
    Player player = e.getPlayer();
    
    player.getInventory().addItem(compass);
}

@EventHandler
public void onClick(PlayerInteractEvent e) {
    Player player = e.getPlayer();
    Material held = e.getItem().getType();
    Action act = e.getAction();
    
    if(!(player.getName().equals(this.plugin.hunted)) && held == Material.COMPASS && (act == Action.RIGHT_CLICK_AIR || act == Action.RIGHT_CLICK_BLOCK)) {
        Player hunted = player.getServer().getPlayer(this.plugin.hunted);
        player.setCompassTarget(hunted.getLocation());
        player.sendMessage(ChatColor.GREEN + "Now tracking: " + this.plugin.hunted);
    }
}``` It is supposed to give me a compass when I respawn but it didn't I have been trying to figure it out but I couldn't
ivory sleet
#

btw cant Patternable#getPattern return a Pattern type instead?

tepid thicket
#

TheCaptainSleepy, you could spare the ifs in the filter by polymorphism.
When you add a method to Entpoint that would return a boolean.

foggy bough
worn sierra
#

from the list

unreal quartz
#

i would just have a common interface for this with a method like matchString which returns a boolean, then have Patternable or Nameable actually implement the comparisons

unreal quartz
worn sierra
#

lol

#

how couldn't i think of that

tepid thicket
#

Sometimes its the obvious things.

unreal quartz
#

give the compass a tick later

#

the player may not have respawned yet when that event is called

foggy bough
worn sierra
#

so now, i have this:public interface Comparable<T> { <T> boolean compareTo(T type); }

    Pattern getPattern();
}```
and same thing goes for Nameable but with String type
#

using this way, I must create compareTo method for every subclass of Endpoint

foggy bough
unreal quartz
#

hello

worn sierra
ivory sleet
#

I thought of something like

interface Endpoint {
  boolean matches(String stringOrPattern);
}

//then
.filter(endpoint -> endpoint.matches(stringOrPattern))
foggy bough
unreal quartz
unreal quartz
worn sierra
ivory sleet
#

Idk might wanna make the stringOrPattern to a separate object but yeah

worn sierra
#

lol

ivory sleet
#

ye

#

tho iirc kinda outdated

unreal quartz
#

you're free to update it

#

lol

#

though most current information would be dumped on spigot's wiki now

ivory sleet
#

yeah

worn sierra
#

what about an abstract class

#

that implements to Endpoint

ivory sleet
#

sure but you could have a base class that has a default match method

worn sierra
#

and I use that abstarct class

ivory sleet
#

or just supply a Predicate

unreal quartz
#

you can have classes like PattenedEndpoint and NamedEndpoint whiuch implement that if you want to take that approach

worn sierra
ivory sleet
#
class EndPointImpl implements EndPoint {
  final Predicate<? super String> predicate;
  EndPointImpl(Predicate<? super String> predicate) {
    this.predicate = predicate;
  }

  public boolean matches(String stringOrPattern) {
    return predicate.test(stringOrPattern);
  }
}```
#

tho thats not a good solution

worn sierra
ivory sleet
#

yeah

#

tho a base class is enough?

#

or maybe not

worn sierra
#

isn't abstract class and base class same thing?

#

that's what i know tho

ivory sleet
#

abstract classes create powerful abstractions

#

base class is just straight inheritance

#

myeah abstract class is better here

worn sierra
#

in maps, lists should I use Endpoint or AbstractEndpoint

#

i guess i will go for Endpoint interface

ivory sleet
#

yes

eternal oxide
#

why not a default implementation in the interface?

worn sierra
foggy bough
# unreal quartz you're free to update it

is it like this ```java
BukkitScheduler br = plugin.getServer().getScheduler();
Player player = e.getPlayer();
br.scheduleSyncRepeatingTask(this.plugin, new Runnable() {

        @Override
        public void run() {
            player.getInventory().addItem(compass);
            
        }}, 3L, 0L);```
unreal quartz
#

there are multiple implementations he wasnts tho

#

to match via pattern and just stright up with a anme

ivory sleet
#

like

if (this instanceof Blah) {
doSmnt();
}

unreal quartz
#

repeating

ivory sleet
#

sure that would work but kinda defeats the point

foggy bough
ivory sleet
#

then he can just go with the original one

worn sierra
unreal quartz
#

well you're calling the scheduleSyncRepeatingTask method

ivory sleet
unreal quartz
#

that will make it repeat

worn sierra
unreal quartz
#

ever 3 ticks

worn sierra
#

this guy

ivory sleet
#

anyways TheCaptainSleepy feels like you don't need the abstract class

unreal quartz
#

meaning 6 compasses per second

#

forever

foggy bough
ivory sleet
#

just have the interface?

worn sierra
#

wait I am confused now

#

I will have Endpoint interface

ivory sleet
#

yup

worn sierra
#

and nameable, patterable

worn sierra
#

damn i am stuck

ivory sleet
#
class NameableEndpoint implements Nameable, Endpoint {

}

class PatternableEndpoint implements Patternable, Endpoint {

}```
#

just this?

#

or my bad, maybe the reply method is the same regardless

#

well in that case go with the abstract class

worn sierra
#

i will try that abstract class first

#

my brain has stopped

#

can't do shit

#

please tell me that cursing is allowed here

#

i don't want to get punished for "shit"

unreal quartz
#

of fucking course it is

eternal oxide
#

ah my innocent ears!!!

unreal quartz
#

sorry

#

iu shall rephrase

#

of fricking course

worn sierra
unreal quartz
#

lmao

eternal oxide
#

I smell colours too 🙂

worn sierra
#
    void reply(HttpExchange exchange, Map<String, String> parameters, boolean prettyPrint);
}```
```public interface Patternable extends Comparable { // I seriously suck at naming
    Pattern getPattern();

    @Override
    boolean compare(String str);
}```
```public abstract class PatternedEndpoint implements Endpoint, Patternable {

    private final Pattern pattern;

    public PatternedEndpoint(Pattern pattern) {
        this.pattern = pattern;
    }

    @Override
    public Pattern getPattern() {
        return pattern;
    }

    public abstract void reply(HttpExchange exchange, Map<String, String> parameters, boolean prettyPrint);
}```
#

it doesn't require to add Comparable's compare method to any sub classes

#

even if I remove it from Patternable

#

sooooooooooo

#

I mean PatternedEndpoint doesn't inherit Comparable's compare method

ivory sleet
#

first of all

#

Comparable a type parameter which u probably wanna pass String to

worn sierra
#

Comparable is my custom class

ivory sleet
#

oh wtf why lol

#

I guess

#

but just implement a Predicate<String> at this point

#

or extend

worn sierra
#

gonna use it like that

#

but the problem is it doesn't require that, it's like bukkit's onEnable methot

#

I want it to be required

unreal quartz
#

it does require it

#

you've defined it in the interface Patternable

worn sierra
#

no errors

unreal quartz
#

because it is abstract

worn sierra
#

here removed

unreal quartz
#

implementations of your abstract class will have to implement it

worn sierra
#

implements doesn't work tho

unreal quartz
#

if yoy don';t implement it t

worn sierra
unreal quartz
#

keep your override there

#

seems like you've made a mess of it though

#

but it is required when you come to create the base class in the example you provided

worn sierra
#

if yes what is your language level

#

i use 8

unreal quartz
#

it is true for 8

worn sierra
#

damn

#

it didn't require because my class (PatternedEndpoint) is abstract

#

lmao

unreal quartz
#

that is what i said after all

worn sierra
#

alr I guess I fixed everything

#

thank you

worn sierra
#

welp

#

sorry

unreal quartz
#

no worries

worn sierra
#

btw I don't need patternable interface

#

or nameable

#

do I?

unreal quartz
#

seems redundant

worn sierra
#

yep

#

alr, last question how may I pass that reply method to subclasses

#

I must use abstract right?

#

I mean make that whole class abstract

unreal quartz
#

yes but your class must also be abstract

worn sierra
#

I remember something like passing method to subclass without using abstract

unreal quartz
#

you should probably have reply defined in Endpoint instead

worn sierra
#

that's where reply inherited from

#

endpoint interface

unreal quartz
#

then you don't need to write anything for it then

worn sierra
#

but I want subclasses of NamedEndpoint to inherit that reply method

#

like required

unreal quartz
#

i twill

#

anything not implemented in yhour abstract class will need to be implemented somewhere later on

worn sierra
#

how should I leave this class then?

unreal quartz
#

just get rid of the line altogether

worn sierra
#

like that?

unreal quartz
#

no because you've created an implementation there

#

get rid of the whole method

#

and make your class abstract

worn sierra
#

yep, it seems to work

#

thank you once again

unreal quartz
#

no problem

true pike
#

Does Anybdy here use aternos?

dusk flicker
#

Dont ask in every channel

true pike
#

oh

#

oki il stop here

#

srry

#

but is anybdy familarar with using plugins in aternos ?

dusk flicker
#

aternos support may be better either way

true pike
#

but dis sorta includes spigot

#

thx btw

ivory sleet
undone axleBOT
#

Custom command successfully added.

ivory sleet
#

?scheduling

undone axleBOT
dense pulsar
#

how could I use world edit in my plugin?

#

for example the //set command

quaint mantle
#

send it from your player

#

or preferably use the worldeditapi

#

but its kinda overkill

#

Player#performCommand("/set " + args)

dense pulsar
#

hmm

steep spruce
#

Hello, I started to create a plugin for spigot 1.17 based on the version of my plugin in 1.16, but it seems that I cannot add items in the inventories (whether it is a player inventory or other (ex: dropper))
to add an item in the inventory I used:
dispenser.inventory.addItem(item) (kotlin)
It worked with version 1.16 but not anymore (and doesn't give me an error)
Has the method changed for 1.17 or is this a bug?

subtle kite
quaint mantle
runic mango
#

Is this the right way to load info from config.yml?

#

seems suspicious but I can't think of anything better

young knoll
#

Pretty much

warped cradle
#

can cnyone help me i m compliling a maven project

#

but this error is comming

#

anyone 😭

latent yarrow
#

Can you pastebin the pom.xml as well?

warped cradle
#

yes

#

sure

#

jsut a sec

latent yarrow
#

Ah, found it on GitHub. It requires the specified Spigot JARs (https://github.com/Indyuce/bounty-hunters/blob/master/pom.xml#L69-L172) when building, and since it's using scope provided for those, you need to place them on the classpath. You'll need to either run BuildTools for those, name them correctly, and place them in the correct place or modify the POM (and potentially code) to work around it (for example, if you only want to build it with 1.17 support, you can probably drop the other version and the related code.)

GitHub

Source code of BountyHunters Premium. Contribute to Indyuce/bounty-hunters development by creating an account on GitHub.

warped cradle
#

yes

#

i want to build with 1.17

#

so what to do

latent yarrow
#

you can probably drop the other versions (from the POM) and the related code

warped cradle
#

like how

#

oh i see

#

w8

latent yarrow
#

By deleting the references to it. If you're not familiar with plugin development though, it's not going to be an easy task.

warped cradle
#

just a sec

#

let me try

warped cradle
#

ahhhhhhhhh

#

😭

#

like do i just have to delete the other versions from that pom.xml

#

?

latent yarrow
#

You'd need to delete any code in the plugin that references them as well. Of course, you'd still need to place the 1.17 JAR on the classpath for it to build.

warped cradle
#

😕

#

like sry if i m asking too much but can u pls pls do it for me

#

😅

latent yarrow
#

The easiest solution is probably just building all of those versions of Spigot and using your IDE to put them on the classpath.

#

Sorry, but not something I have the time to do, unfortunately.

warped cradle
#

that just sounds so confusingggggggg

young knoll
#

Who on earth manages dependencies that way

latent yarrow
warped cradle
#

like if i download it from dark spigot just saying will it still be piracy ?

#

cuz its open source

patent ice
#

Don't go on bs

latent yarrow
#

Likely so, as I don't see a license permitting it. And of course, you'd be risking malware.

warped cradle
#

hmm

patent ice
#

If you call yourself a developer you can always decompile the jar before using it

#

To test for malware

patent ice
#

Why are you trying to compile maven then

warped cradle
#

cuz this plugin is paid

latent yarrow
warped cradle
#

i need for 1.17 tho

latent yarrow
#

It says 1.13+, so perhaps it will work if you haven't tried it yet?

warped cradle
#

nope

patent ice
#

It will work with 1.17

warped cradle
#

but will it really work

patent ice
#

If it supports 1.13

#

Yes

warped cradle
#

1 premium n 2nd this

patent ice
#

99% of plugins which support 1.13 work with 1.17

#

One is better features one is less

warped cradle
#

hmm

patent ice
#

Just give it a go lmao

warped cradle
#

ok will try this

patent ice
#

Worst case scenario doesn't work

warped cradle
#

like the features r the same lol

patent ice
#

I doubt he made it premium purely for the fact that it's 1.17

#

That's just stupid

warped cradle
#

idk like the front page is completely same

patent ice
#

Just try it

warped cradle
#

yes

#

the server is starting

patent ice
#

See

#

Works fine

warped cradle
#

like its starting

#

i still have to try lol

latent yarrow
#

Hmm, I misread on the provided scope. So, it's trying to search public repos for those Spigot API JARs, but of course they're not there, at least the way it's configured in that POM... You could try updating the POM to use the Spigot Maven Repo and API JARs from there if you wanted. The example at the bottom of this page has all you need; you'd just need to update things accordingly. https://www.spigotmc.org/wiki/spigot-maven/

warped cradle
#

[10:08:39 ERROR]: [BountyHunters] Your server version is not handled with NMS.
[10:08:39 WARN]: [BountyHunters] Loaded class me.clip.placeholderapi.expansion.PlaceholderExpansion from PlaceholderAPI v2.10.9 which is not a depend, softdepend or loadbefore of this plugin.
[10:08:39 INFO]: [PlaceholderAPI] Successfully registered expansion: bountyhunters
[10:08:39 INFO]: [BountyHunters] Hooked onto PlaceholderAPI
[10:08:39 ERROR]: [BountyHunters] Couldn't load Vault. Disabling...

latent yarrow
#

And suddenly, I come to the realization that it's been about a year and a half since I've worked with Maven much...

#

Ah, so it is using NMS, so scratch the idea about updating the POM to use the Spigot Maven Repo.

warped cradle
#

so nothing cn be done?

latent yarrow
#

You could still build the JAR(s) with BuildTools, then mvn install it to your local Maven repo to get it to build.

warped cradle
#

just a sec let me try

young knoll
#

Actually it seems it will run without NMs

#

But you need vault

warped cradle
#

i do have vault installed

#

i m dying

granite stirrup
#

gtg

warped cradle
#

anyone who can compile a maven project for me SORRY FOR BEING SHAMELESS 😭

cold heron
#

install maven, open a terminal in the project directory, type mvn clean package

warped cradle
#

i did it all

warped cradle
cold heron
#

im not familiar with the src artifacts

#

have you ran buildtools?

warped cradle
#

nope like i did it all in cmd

#

now the thing is that i m exhausted i have been doing it since yesterday

#

now the only hope i have is that someone does it for me

latent yarrow
#

https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html Instructions here on how to install Spigot JARs to your local Maven repo. The first command on that page is the one you want. <packaging> would be jar for this, the rest of the parameters should match up with what's in the pom.xml (and of course, <path-to-file> being the relative path to the JAR that BuildTools generated for whatever version you're installing to your local Maven repo). Try it for 1.17 first, then if it still complains, try removing the older versions from the POM. If that breaks the plugin, add them back and go through the process to mvn install all the other versions as well, I suppose. Aside from that, I think your best bet is to just buy the plugin--gotta put in the work to DIY otherwise in this case.

quaint mantle
#

[10:08:39 ERROR]: [BountyHunters] Couldn't load Vault. Disabling...

#

why does this guy use spigot-src

warped cradle
#

What's that

quaint mantle
#

looks like you can just delete all the other versions which is just deleting from pom & removing the respective wrapper class
then build 1.17 with buildtools, and add the proper 1.17 depend cause this src one looks pointless

warped cradle
#

How can i change that

#

@quaint mantle like what do u mean but dependencies i have hosted servers before but never had to do all that

quaint mantle
#

also looks like the github repo is 1 update behind

#

other then that, the steps I said do work

#

Delete these

warped cradle
#

where will i find these

quaint mantle
#

Delete all of these from the pom.xml. Make sure only to do the "spigot-src" ones, not the other dependencies

warped cradle
#

w8 a min

quaint mantle
#

its under version/wrapper

warped cradle
#

will this not work with 1.17

#

?

quaint mantle
#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.17.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

Paste this in the pom.xml dependencies section(Where the src ones previously were)

#

will have to run buildtools for 1.17.1 still tho

warped cradle
#

ahhhhhhhhh

#

i dont even know hat build tools is

#

how will i use it

quaint mantle
warped cradle
#

like what is build tools a software

#

plugin

#

or what

quaint mantle
#

It builds the server & adds it to your local maven repositories

quaint mantle
warped cradle
#

k where do i paste it?

#

w8 its git bash?

#

i do have it installed

#

its starting cloneing something

#

done

#

it said build successgul

#

now there r some files

#

what to do now?

#

then why did he ask to do that?

#

so like what should i do now?

#

nope

#

k

#

done

#

its deleting

#

done

#

now

#

?

#

-_-

#

was that useful?

#

i mean the files i deleted

#

were they of any help?

patent ice
#

Yes of course they were

#

They're a requirement.

warped cradle
#

so do u think i wont be able to redownload it

quaint mantle
#

no those only existed so it works on those versions

#

if you don't need to run it on those versions they are useless to you

warped cradle
#

w8 a min a dev

#

sent me a file

#

of complied bounty hunter

#

but i am confused it could be a malware

#

can anyone help?

split egret
#

If you're that worried either decompile it or compile it yourself

warped cradle
#

-_-

#

k let me risk my pc

split egret
#

No one is telling your to run it

warped cradle
#

well scam i just did 😂

#

rip my pc

patent ice
#

Maybe don't open files from people you don't know....

warped cradle
#

ufff it worked

split egret
#

At least do a virustotal check

warped cradle
#

thank god

#

it was fine

split egret
#

Just because it worked doesn't mean there isn't malicious code

patent ice
#

It worked but you probably infected your server 🙃

#

^

warped cradle
#

lol

patent ice
#

It could have a backdoor to forceop people

#

Or it could just run code to slow down your server without you noticing

warped cradle
#

well i m just making one idc if it does that like i was just worried bout data issues

split egret
#

"data issues"?

patent ice
#

Lemme guess you used the black spogot Version

#

Spigot

warped cradle
#

nope

#

u want ss?

#

damn it works jus fine

split egret
#

lmfao

#

I love how mfs download things off of black spigot when it's open source on github

#

like what

warped cradle
#

i did not

#

a dev did it for me

#

i can send ss of that dev sending

split egret
#

this guy

patent ice
#

A "Dev did it"

#

He probs got it off black

#

Spigot

split egret
#

or the "dev" did

subtle kite
#

what is it suppose to do

warped cradle
#

nope even dark spigot does not even have that version

patent ice
#

Have fun with malware 🙃

#

The whole purpose of BS is to infect people's servers

subtle kite
#

question is infect it with what?

split egret
#

Backdoors

#

Bruh

#

Black spagot has their own "DRM" type thing

warped cradle
#

so a dev did it for me

#

so i used his file

#

thats it

patent ice
#

The Dev probably backdoored it then lmao

#

I would if I was him

latent yarrow
#

Just replace "a dev" with "the guy who has full access to my PC now"

patent ice
#

^

warped cradle
#

-_-

patent ice
#

All because you're too broke to buy a plugin

warped cradle
#

yes i m

hexed hatch
#

Get some money then lol

split egret
#

Just compile it yourself

warped cradle
#

i tried

#

so much

subtle kite
#

can you get the .jar of the github

warped cradle
#

nope there is no .jar for it

split egret
#

What were you using to compile it?

warped cradle
#

like i tried just one thing

#

downloaded maven

#

then run the folder in cmd

patent ice
#

Just google java decompiler

warped cradle
#

then mvn install

patent ice
#

There's tools to do it for you

warped cradle
#

let me see

subtle kite
warped cradle
#

nope

#

just met him yesterday

patent ice
#

LeL

split egret
#

Have you seen him make anything in Java?

warped cradle
#

nope

subtle kite
#

scan your pc with windows defender and I suggest (malwarebytes)

split egret
#

fuck it I'm curious

#

can you send me the Jar file

warped cradle
#

eys

#

yes

split egret
#

I want to decompile it

cold heron
#

i compiled it for him i would never backdoor it

warped cradle
#

done dm;ed it

patent ice
#

@cold heron lies

cold heron
#

what i did is i removed all his spigot dependencies added the normal spigot 1.17 nms dependency and deleted all the other wrapper classes from other versions

#

then it compiled perfectly

patent ice
#

Perfectly?

warped cradle
#

tysmmmmmmmmmmmm

patent ice
#

How does one define perfectly

cold heron
#

without errors?

patent ice
#

You didn't get one single error?

cold heron
#

it wouldnt have compiled…

patent ice
#

How did you compile it

cold heron
#

maven

patent ice
#

Yeah go through every step

#

So I can repeat

cold heron
#

why

patent ice
#

So I can learn

cold heron
#

i did mvn package in my terminal

near crypt
#

how can i setup, that in a bungeecord network a play joins everytime on the lobby server and not on the lastest server he was on?

summer scroll
near crypt
#

ok

#

but what is when i set it to true?

#

@summer scroll

#

how can i lock commands as /plugins or /spigot or /? ?

glad iron
near crypt
#

and what is the permission for this?

glad iron
#

for /plugins it is bukkit.command.plugins I think

near crypt
#

ok

#

thx

quaint mantle
#

anyone know the easiest way to add prefixes to Tab?

glad iron
#

I think you could use teams

quaint mantle
#

whats wrong with this if statement thats making it not work
https://hastebin.com/guzozixute.java
im trying to disable /home within 1000 blocks of spawn
and for some reason its just disabling it everywhere

chrome beacon
#

Well that's not going to work

#

There are negative cordinates you know

#

And you put an or

#

Put an &&

silk mirage
#

.

subtle kite
#

hmmm
any idea how to do a permission on a item

silk mirage
subtle kite
#

PlayerinteractEvent

#

is what is needed

quaint mantle
subtle kite
quaint mantle
#

i download the DAILY, WEEKLY & MONTHLY REWARDS | PAPI SUPPORT [1.13 - 1.17] 1.0.7 plugin but i didnt know how to change the rewards

idle grotto
quaint mantle
#

oke thnx

subtle kite
#

can I use
Bukkit.getConsoleSender().
to run a command or do I need to do something else.

chrome beacon
#

If you want to run as console use that

subtle kite
#

I'm having a command runned when a player right clicks

#

so I believe i'm going to use console

glad iron
subtle kite
#

Bukkit.dispatchCommand(Bukkit.getConsoleSender()

#

this is what i'm using atm

glad iron
#

Ok

subtle kite
#

idk if it works atm though

#

have not tested

waxen plaza
#

Why can't I delete it? I stopped my server...

#

nvm I am dumb lol

glad iron
#

Have you opened it in explorer?

waxen plaza
#

I opened the config.yml from it

glad iron
#

If you dont find the program that causes this just restart your computer. Windows is sometimes buggy :/

waxen plaza
#

I closed the file and it's working I just forgot I had that open

glad iron
#

Ah ok

waxen plaza
#

and I have 20 tabs open so it was hard to realize that

humble heath
glad iron
# humble heath

Did you register the "wether" command in your plugin.yml file?

humble heath
#

configManager.getConfig().getStringList("plugin-banner").forEach(line -> Bukkit.getServer().getConsoleSender().sendMessage(Utilities.color(line)));

glad iron
# humble heath

Seems like the configManager.getConfig call returns null. Did you write the ConfigManager class yourself or is it from a libary? Why arent you just using JavaPlugin#getConfig()?

ivory sleet
#

?kick @subtle kite advertisement

undone axleBOT
#

Done. That felt good.

tardy delta
#

is there a short way to check in the blockbreakevent if the broken block is a log?

#

i mean instaceof Tree is deprecated

glad iron
#

Yes You can use Tag.LOGS.isTagged(Material)

#

Just pass the material of the broken block to this

#

EDIT: The method name is isTagged() and not contains()

split egret
#

Are you able to unload the default world?

    public void onPlayerDeath(PlayerDeathEvent event){
        for (Player player: plugin.getServer().getOnlinePlayers()) {
            player.kickPlayer(event.getDeathMessage());
        }
        
        plugin.destroyWorlds(event.getEntity().getWorld());
        plugin.createWorlds();
    }
waxen plaza
#

How can I see if the server is in offline mode or online mode?

glad iron
split egret
#

sigh

glad iron
waxen plaza
glad iron
sullen dome
#

oops, wrong message answered

waxen plaza
#

Will the plugin I am developing right now work on older version? like 1.8

sullen dome
#

depends on what you're doing

near crypt
sullen dome
#

but i'm pretty sure that api-version from the plugin.yml will make it not enabling

waxen plaza
#

If I test it and it works then I am fine?

ivory sleet
#

Ye

near crypt
#

Yes obviously

sullen dome
#

if you do stuff that isn't different in the versions, for sure it will

#

if you do, you need multiple code for every versions i guess

ivory sleet
#

Rivex u code mods right btw?

waxen plaza
#

is the api-version a problem if I am going to upload the plugin?

sullen dome
#

huh?

#

wdym

#

with mods

ivory sleet
#

Just set it to 1.13 iirc and it should all good BigPing

#

Oh like minecraft mods

sullen dome
#

well, not directly

ivory sleet
#

Or maybe I was mistaken

sullen dome
#

i'm coding a client. but i'm not using any modloaders

ivory sleet
#

Ah fair

near crypt
#

What is the nams of the client you code?

sullen dome
#

RivexClient 🦆
pretty self explaining xd

#

but it's private at all

near crypt
#

Uh okay and why do you code it when you make no money with it or don't publish it?

sullen dome
#

to use it? lmao

near crypt
#

Okay xD

sullen dome
#

so i don't need to pay 13€ for badlion cosmetics lol

sullen dome
unreal quartz
#

people actually buy those?

#

lol

sullen dome
#

buy what

#

clients? sure

unreal quartz
#

badlion cosmetics

sullen dome
#

yea

near crypt
#

Yes lmao

sullen dome
#

they actually indeed to lol. to tell their favourite youtubers DUD, I have your cape/wings/Halo/shield/everything

#

I Am A FaN

unreal quartz
#

that's

#

interesting

sullen dome
#

to be fair, i have 1 cosmetic too lol

near crypt
#

I have two cosmetics lol

sullen dome
#

but never play badlion, so pretty much dumb to buy it

unreal quartz
#

i have never used it

sullen dome
#

nvm, i have to aswell i gues? lemme see

near crypt
#

but not from YouTubers xD

sullen dome
#

those badlion update take even longer than normal minecraft updates lol

#

lmao

#

if that's really downloadign with that speed, how big is it then lmao

ivory sleet
#

:0

sullen dome
#

got those 2. that's all tho

#

still figuring out how to make a custom font lmao

ivory sleet
#

Oo

random ledge
#

Does anyone have an example of adding custom tags to an entity?

glad iron
sullen dome
#

can anyone tell me... is my presence showing the name of any file right now?

#

seems broken

#

seems like the plugin was broken.. interesting

random ledge
glad iron
# random ledge Thanks, but I'd like to add, similar to NBTTags with both key and value.

For that you could use the persistent data storage api: Entity#getPersistentDataContainer(). You can find a great tutorial about that here https://www.spigotmc.org/threads/a-guide-to-1-14-persistentdataholder-api.371200/

glad iron
random ledge
#

Solve

tardy delta
#

When i break a log that is above a grass block will this replace it with an oak sapling?

@EventHandler
    public void onBlockBreak(BlockBreakEvent event) {
        Block b = event.getBlock();
        if (Tag.LOGS.isTagged(b.getType())) {
            if (b.getLocation().subtract(0, -1, 0).getBlock().getType() == Material.GRASS_BLOCK) {
                b.setType(Material.OAK_SAPLING);
            }
        }
    }
eternal night
#

I think you'd wanna cancel the event tho

tardy delta
#

Uhh

#

Would cancelling place air or what?

eternal night
#

no, but if it isn't cancelled block breaking logic would still be executed

#

e.g. block drops

tardy delta
#

Huh but cancelling would prevent the player from breaking the log no?

eternal night
#

but you are setting it to a new block

subtle kite
#

can someone give me a example of bukkit.dispatchcommand ,
i cant figure it out

tardy delta
#

Ah

desert sedge
#

if anybody has experience with custom world generation, is possible to use the default generator and change the way lava lakes are spawned? Like the chances

glad iron
desert sedge
#

yeah but wont just disable all caves?

eternal night
#

the spigot world generation API is not that advanced sadly

#

changing partial decoration parts using the API is, afaik, impossible

glad iron
subtle kite
#

can a ( event.getplayer be a sender

sullen dome
#

ofc

glad iron
#

Yes it can because event.getPlayer() returns an Player Object. The player class extends the CommandSender class so the types are compatible.

sullen dome
#

i mean, in which case?

subtle kite
#

event.getplayer was what I needed , Thanks

waxen plaza
#

How could I check if user input respects my naming conventions (only letters, numbers and underscore) no other characters, is there a library that does this?

chrome beacon
#

Regex time 👀

quaint mantle
#

Having some trouble with vector, currently 2 locations are in db I want to store 2 vectors into List<Vector> someone knows how to ?

waxen plaza
chrome beacon
#

Well you have to check them

waxen plaza
#

it might be faster to check if the input doesn't contain a character that I am allowing

chrome beacon
#

Which is what you'd want the regex for

#

?

waxen plaza
#

probably

glad iron
chrome beacon
#

Regex would probably be better

#

Either way both should work

tardy delta
#

prob not really the right way

chrome beacon
#

You can have different classes for each command

#

Also a switch statement would be much better here

tardy delta
#

yea i'm not really someone who makes lots of classes for every command

#

some of them are very little

chrome beacon
#

If you don't want multiple classes use a switch statement instead of that mess with if else

tardy delta
#

is a switch more efficient than if else?

chrome beacon
#

With that many if else yes

#

It will also be cleaner

unreal quartz
#

so you guys like messy commands huh

ivory sleet
#

try to create some sort of abstraction

chrome beacon
#

I always have per command classes

opal juniper
#

Messy plugin = more serious coding 😎

#

That was a joke before I get crucified

ivory sleet
#

jfc

unreal quartz
#

🙂

opal juniper
#

Oh nonono

unreal quartz
opal juniper
#

I put the tab completer in the same class

#

U*

#

What monster does that

#

Smh

tardy delta
#

i have one class for tabcompleters 💀

unreal quartz
#

and i have one class for everything

tardy delta
#

😳

unreal quartz
#

I've been meaning to refactor it for a while now, but I always end up doing some other meaningless change whenever I open the project#

opal juniper
#

I have used your quests plugin before though - it’s very cool

unreal quartz
#

tis

eternal oxide
#

I generally have a CommandBase class, that has tab completers etc, then I extend it for all commands so I can override

opal juniper
#

I normally just have a class for the command and a class for the tab completer per command

#

My plugins have never had enough args to require separate classes tho

tardy delta
#

is it also a good way to make a class for command that can be executed with the console and a class without?

unreal quartz
#

both players and console are instances of CommandSender

#

unless the behaviour of the command is drastically different then I don't see the need for different classes for similar behaviour

subtle kite
#

so i'm guessing
Bukkit.dispatchCommand(event.getPlayer(),command example)

#

doesn't run unless the player has is op

unreal quartz
#

it runs as if the player ran it

subtle kite
#

yeah

#

how do I make it console any idea

unreal quartz
#

get the console sender

quiet ice
#

just note that that would not run the command as the player

#

So a command such as "/healme" would not produce the expected outputs

subtle kite
#

Thanks for the help.
I made my own paper rank system 🙂

sick ravine
unreal quartz
#

they're not the same item

#

one has a NBT tag on it

chrome beacon
#

^

sick ravine
#

how was the player supposed to get the item from NBT?

unreal quartz
#

wut

sick ravine
#

how did the player get this item?

unreal quartz
#

a plugin probably

#

or any other type of modification

#

e.g a plugin writing to its persistent data container

sick ravine
#

data container?

unreal quartz
#

used to store data

sick ravine
#

how to get it

#

for itemstack

eternal night
#

like remove ?

chrome beacon
quiet ice
#

stack.getItemMeta().getPersistantDataContainer()

#

beware on itemMeta being nullable and stuff

sick ravine
#

okey

#

thanks

eternal night
#

it is spigot 1.14 and beyond btw

#

don't know if that matters to you

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

PVP.java:45

public static FileConfiguration DB = getCustomConfig("database.yml");

PVP.java:35

    public static FileConfiguration getCustomConfig(String fileName) {
        customConfigFile = new File("plugins/" + PVP.plugin.getName(), fileName);
        customConfig = new YamlConfiguration();
        try {
            customConfig.load(customConfigFile);
        } catch (IOException | InvalidConfigurationException e) {
            e.printStackTrace();
        }
        return customConfig;
    }
eternal night
#

not every nbt tag is part of the pdc

#

might very much be something different