#help-development

1 messages · Page 1609 of 1

quaint mantle
#
Stack stack;
Set processed;
while (!stack.isEmpty()) {
   Node n = stack.pop();
   if (n.isObstructed()) continue;
   n.getNeighbors().forEach((neighbor) -> {
      if (processed.add(neighbor)) stack.push(neighbor);
   })
}
#

a simple depth first impl for the seek phase without any heuristics

grim ice
#

mannn

quaint mantle
#

will explode unless you add a max depth condition or heuristics

grim ice
#

i cant find why my thing isnt working

quaint mantle
#

for heuristics, sort the list of a node's neighbors based on the estimated distance to the destination

#

so that the closest node is put on the stack last

cold tusk
#

So you can't help me?

quaint mantle
#

and is therefore popped out first

grim ice
#

borat do you have an idea

quaint mantle
#

your code is illegible

#

use more newlines

#

group blocks of code together

#

uses sysouts or whatever to figure out what is stopping it from working

#

you could also use a binary heap in place of the stack I suppose, with a comparator comparing the estimated distance to target

#

that may be better or faster or slightly slower than sorting the neighbors

#

the standard java impl for a binary heap is the PriorityQueue

#

would using a json file for punishments be better than using a sql database

#

define punishment

#

ban, warn, kick etc

#

db would be more robust, but not necessary

torn shuttle
#

not at a scale

quaint mantle
#

preload a player's warning data to memory on asyncprelogin

opal juniper
#

borat it actually works now - it returns the target node ....

quaint mantle
#

the downside of json is that it's not easily shared across servers, and every time you need to retrieve something from it, you need to read through the entire file

#

alright ill use sql

#

or keep the whole file in memory at all times to avoid having to read it

torn shuttle
#

yeah I don't think json would help in the long run at all

quaint mantle
#

probably not necessary

#

should i just load everything into a map at the startup?

#

you should load things to a cache during async player prelogin

#

and optionally block the event until the data is retrieved

torn shuttle
#

that second one might cause issues

quaint mantle
#

only if your data retrieval takes longer than 30 seconds

#

at which point you have bigger problems

torn shuttle
#

yep

quaint mantle
#

whats wrong with loading everything to memory then sending it back to db on disable, like a map

#

that's not scalable

#

you'll end up with 60 thousand players' worth of shit you're probably not going to read in memory

torn shuttle
#

loading arbitrary amounts of data on startup straight into memory is a fun way of finding out how many people have thousands or millions of entries

quaint mantle
#

granted, some plugins like towny do do it

#

but that's more because there is no feasible alternative or because the changes involved in doing it differently would be infeasible

stone sinew
#

Is there a way to get the class that called a method?

public class Test {
    Methods.runMethod();
}

public class Methods {
    public static void runMethod() {
        // System.out.println("Class that called this method");
    }
}
torn shuttle
#

or because of bad initial implementation and not having the patience to fix it

quaint mantle
#

use StackWalker on java 1.9+ or whatever that class was called

#

or dump the thread's stack and look at the immediately preceding frame on java 1.8

#

there's also a reflective method to get the calling frame on java 1.8 but I remember that being haram for some reason

quaint mantle
#

Object or Class<?>

stone sinew
#

I saw something using reflection getCallerClass or something like that. But that method doesn't work exactly how I wanted.

stone sinew
quaint mantle
#

the better question is why do you need that information

#

^

stone sinew
quaint mantle
#

its most likely a bad design pattern

#

well

#

use stackwalker

#

you can always throw an exception

#

and get the stack trace

stone sinew
#

So if a class outside of my plugin is doing something I can display which class is calling the method

quaint mantle
#

that is very slow but if it isn't a super hot loop and only for debug, it's probably fine

#

the advantage of the stackwalker is that it doesn't need to shit out the entire stack trace every time

#

but it does have a little bit of a learning curve iirc

stone sinew
#

Funny enough I just saw StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE).getCallerClass() lol

ivory sleet
#

Got me thinking if sponge which is entirely switching to a key based system

gleaming grove
# stone sinew So if a class outside of my plugin is doing something I can display which class ...

https://www.youtube.com/watch?v=FIACGmzibAM&t=1383s&ab_channel=KodySimpson The thing you are talking about is called "Reflections" but i don't think you need to use it for display logs

In this episode, I show you the basics of reflection in Java. Reflection put in simple terms is the process of deconstructing classes and data structures using code itself, dynamically at runtime. #Java #Reflection #JavaTutorial

Code: Coming Soon

⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite ...

▶ Play video
quaint mantle
#

he knows what reflection is

ivory sleet
#

Yeah also reflections != reflection for anyone who’s mixing the together

stone sinew
quaint mantle
#

well

ivory sleet
#

Reflection is for scanning at runtime I’d say

quaint mantle
#

technically reflection is all actions that pertain to code looking at itself, that is, reflecting upon itself

ivory sleet
#

Well yes we can invoke stuff

quaint mantle
#

so getting the calling class of your method is sort of reflection

ivory sleet
#

But that’s probably more performant with method handles now

stone sinew
gleaming grove
ivory sleet
#

Yeah

#

Scanning precisely

grim ice
#

Non-static method 'setCooldown(java.util.UUID, int)' cannot be referenced from a static context is becuz ineed an object right

ivory sleet
#

Myes partly

#

It’s not like instance methods can’t be invoked in static context

#

You just can’t reference a non static method in a static context

quaint mantle
#

non-static methods exist on objects

#

if you don't have an object, you don't have a method

#

because the method is part of the object

#

and hence you can't call the method, which you don't have

grim ice
#

has some mistakes

#

i mean its easy to fix them yourself

quaint mantle
#

most spigot resources do

grim ice
#

yeah ig

ivory sleet
#

I should update that

grim ice
#

it has like

#

3 errors that are straightforward java

#

even I know it

#

lol

ivory sleet
#

Where exactly ;o

grim ice
#

Non-static method 'setCooldown(java.util.UUID, int)' cannot be referenced from a static context

#

is one for example

ivory sleet
#

That’s not an issue with the code

#

It’s probably a pebkac issue

gleaming grove
#

Guys do you know how to get LecternInventory object?

grim ice
#

tell me the ways

gleaming grove
#

just google it

grim ice
#

sorry for irrelevance

gleaming grove
#

"how to set background image in Intelji"

ivory sleet
#

Especially api wise

quaint mantle
#

what are you doing

gleaming grove
#

even when i get inventory from OnInventoryOpen event, i can;t cast it to LecternInventory

quaint mantle
#

what's stopping you

gleaming grove
#

should i consider it as a spigot bug?

quaint mantle
#

LecternInventory extends Inventory

gleaming grove
#

yea

quaint mantle
#

you can cast it, just make sure to instanceof

#

as not every Inventory is a LecternInventory

#

actually looking at the screenshot, it doesn't make sense for that to happen, but I'm not sure how bukkit handles inventories internally

stone sinew
#

Thread.currentThread().getStackTrace()[2].getClassName() actually works...

quaint mantle
#

digging into it a bit, I don't see why that'd return a craftinventory

#

the call is forwarded to CraftServer which forwards it to CraftInventoryCreator

#

which, if it doesn't have an inventory holder, will forward it to CraftTileInventoryConverter.Lectern

#

which creates a new TileEntityLectern

#

and returns its inventory

#

which is a LecternInventory

#

are you passing it an inventoryholder?

ivory sleet
#

Yeah he did

ivory sleet
#

That might have caused it

quaint mantle
#

yeah if it has a holder the inventory is created by CraftCustomInventoryConverter

#

but that shouldn't return a CraftInventory like the exception says, but rather a CraftCustomInventory

gleaming grove
ivory sleet
#

You could map it

#

Having a Map<Player,LecternInventory> or smtng

gleaming grove
#

but how to get LecurnInventory object this is the case

#

i cant cast it from event.getInvenotry()

#

to prove i open the right inventory here is the book

ivory sleet
#

Oh yeah you could just have a Set<LecturnInventory> then?

gleaming grove
#

how to fill this set? Look when i try to get LecturnInventory error is thorn up

ivory sleet
#

Of course you’d have to ensure no memory leaks are happening

#

Try pass null instead of player

gleaming grove
#

ok

unkempt ore
#

Quick one: if I build 1.7, how far will it reach compatibly?

quaint mantle
#

1.8

ivory sleet
#

F

unkempt ore
#

Or might as well say, how do I make my plugins are version flexible as I can

#

Cuz that’s what I’m trying to do

unkempt ore
#

Hmmm

quaint mantle
#

take a look here

#

it shows how you can handle multiple versions

ivory sleet
#

Where you encounter incompatibilities, some abstraction could be a solution

gleaming grove
unkempt ore
#

Yeah makes sense

gleaming grove
#

same story ;<

quaint mantle
#
private Instant getInstant(String[] args) {
    if (args.length == 4) {
        try {
            DateTime dt = DateTime.of(args[3]);
            if (dt == null) return null;

            int type = dt.duration;
            return Instant.now().plusSeconds((long) Integer.parseInt(args[2]) * type);

        } catch (NumberFormatException e) {
            return null;
        }
    }
    return null;
}

better way of doing this?

#

looks really clunky

unkempt ore
#

Separating things that change across versions, I see

ivory sleet
quaint mantle
#
@RequiredArgsConstructor
private enum DateTime {
    MIN(60),
    DAY(86400),
    MONTH(2592000);

    private final int duration;

    public static DateTime of(String msg) {
        String upperCase = msg.toUpperCase();

        for (DateTime time : values()) {
            String name = time.name();

            if (name.equals(upperCase) || (name + 's').equals(upperCase)) {
                return time;
            }
        }
        return null;
    }
}
#

its a custom enum

ivory sleet
#

@gleaming grove you might actually have to pass a Lectern

#

Oh then it’s fine btw

#

Commands aren’t spammed frequently

quaint mantle
#

aight

gleaming grove
ivory sleet
#

Yeah would be one solution, or use nms straight on

gleaming grove
#

yea good idea i create Lecturn at the player position and then send information that he actually stand on AIR

#

maybe with this approach i can do without NMS

ivory sleet
#

Oo ye

waxen locust
#

hey is there a good way to get a random block? everything i've seen has relied on MaterialData, which is depreciated

gleaming grove
#

@ivory sleet This is fuck up XD i cant cast block to Lecturn

waxen locust
#

i thought all the blocks were seperate classes with the interface BlockData now?

quaint mantle
paper viper
#

^

opal juniper
paper viper
#

You don’t cast from the Block directly

quaint mantle
gleaming grove
waxen locust
quaint mantle
#

use blockdata

gleaming grove
#

right i see, thanks for help

manic bison
#

Hey, i made a code where a player gets in spectator, when he uses the spectator teleport menu he can't teleport, but i've put a bypass using hashset.
However, players still cannot teleport (they cant use spec menu but the plugin cant teleport them automatically where i want)

#

here's my code

lost matrix
ivory sleet
#

😩

quaint mantle
#

the only solution or repentance is death

lost matrix
#

This is solvable by writing a new method.

quaint mantle
#

you should delete the old method while you're at it

lost matrix
# manic bison https://hastebin.com/xijixogiki.java

This should be used each time you want to teleport a player with a bypass.

public void teleportBypassed(Player player, Location location) {
  this.bypassedPlayers.add(player.getUniqueId());
  player.teleport(location);
}
manic bison
#

so i put the method every time so player teleports ?

#

so in my case, 6 times ?

quaint mantle
#

😬

manic bison
#

indeed

opal juniper
#

when i realised that i could not use Thread#sleep() i nearly cried

#

"wdym i have to use a scheduler???!!!?!??!?!"

manic bison
manic bison
#

so it'd be like that ? doesn't work tho

                @Override
                public void run() {
                    public void teleportBypassed(Player player, Location location) {
                          this.bypassedPlayers.add(player.getUniqueId());
                          player.teleport(one);
                        }
                    player.sendMessage(StringUtils.repeat(" \n", 100));
                    player.sendMessage("                §a§lIci, c'est la Banque de Comodo Island!\n \n   §aIci, vous pourrez retirer de l'argent ou en déposer\n    §aen toute sécurité.\n \n    §b§lLes taux de conversions sont:\n   §8§l- §f§a§l5$ §7pour §a§l1 émeraude \n ");```
quaint mantle
#

i recommend a java beginner tutorial

#

of the "you can't declare a method inside a method" variety

manic bison
#

indeed

torn shuttle
#

quick q:

class a{
void x(){}
void y(){x();}
}

class b extends a{
@Override
void x(){super.x(); ...}
@Override
void y(){super.y(); ...}
}

if i call b.y(); it does a.y() which does ... b.x() or a.x()? It should be b.x() right?

opal juniper
#

terrible names

#

i think i am having a stroke reading it

ivory sleet
#

Yes magma

torn shuttle
#

it's pseudocode

ivory sleet
#

b.y() calls a.y()

torn shuttle
#

thanks conclure

ivory sleet
#

(:

quaint mantle
#

a.x

opal juniper
#

^

torn shuttle
#

wait what?

quaint mantle
#

b.y forwards to a.y

#

which calls b.x

opal juniper
#

which calls x()

quaint mantle
#

which forwards to a.x

torn shuttle
#

right ok

#

so everything runs

quaint mantle
#

yes

torn shuttle
#

if you call b.y()

#

ok thanks

manic bison
#

okay almost fixed it

plain scroll
#

ik this is some beginer shit

#

but this aint working

ivory sleet
#

Ofc not

eternal oxide
ivory sleet
#

Coloring output stream is slightly more than trivial

manic bison
plain scroll
#

or is that not an option?

ivory sleet
#

Hmm frankly I haven’t done it myself but why not just use Bukkit.getConsoleSender().sendMessage(...);

quaint mantle
#

i think paper supports colors in the standard logger

#

at least I've never had to fuck around with the console sender to get colors working

torn shuttle
#

well til I learned it takes 8-12 hours to brew black tea in cold water

plain scroll
#

like Chatcolor RED + "something"

ivory sleet
#

Ye

quaint mantle
#

it'd probably go faster if you made the tea in an ultrasound washer

torn shuttle
#

what I've done in the past is put it in boiling water then add ice cubes

quaint mantle
#

that's how it's supposed to be done yes

#

stuff doesn't want to dissolve at low temperatures

torn shuttle
#

oh no the cold tea police is going to put me down

quaint mantle
#

more like dying of old age because it takes so long

torn shuttle
#

1.5 hours more and I am done

quaint mantle
#

do you even get paid

torn shuttle
#

I'm not staying awake to work, I'm staying awake because I have to attend a social event in 1.5 hours

quaint mantle
#

take a power nap

torn shuttle
#

that's a myth

quaint mantle
#

ants do it

#

i'm sure you can do it

torn shuttle
#

the only power it would give me is the power to sleep through an alarm

quaint mantle
#

if you drink something heavily caffeinated before going to sleep it works pretty nicely

hybrid spoke
#

just take a nap without a timer

#

play the nap roulette

torn shuttle
#

yall need to stop trying to bait me into going to bed

#

I'm already falling asleep at my desk as is

hybrid spoke
#

you dont have to be in your bed to take a nap

quaint mantle
#

it's one of those things you learn when you're a truck driver and need to drive around despite sleep deprivation

torn shuttle
#

I'm trying to maintain a delicate balance here because I want to be able to go to sleep right after this and not mess up my sleep debt too much

lost matrix
#

"sleep debt"
What is that?

#

Do you owe someone sleep?

torn shuttle
#

are you being facetious or do you just not know the concept

quaint mantle
#

it's what bears accumulate during the summer

#

that's why they hibernate throughout winter

lost matrix
quaint mantle
#

it is

lost matrix
quaint mantle
#

basically, your body expects you to sleep roughly 30% of your time alive

torn shuttle
#

if you stay awake for 72 hours and then go sleep you're not going to sleep 8 hours

quaint mantle
#

if you sleep less than that, you are more likely to sleep more later, to 'catch up'

torn shuttle
#

or at least you won't feel rested after 8 hours

quaint mantle
#

or 'pay a debt'

lost matrix
#

Ah now it makes sense

torn shuttle
#

and this is how I've at times slept 30 hours

#

do not recommend

#

makes you sick

quaint mantle
#

mostly because of dehydration

torn shuttle
#

yep

#

and only mostly at that

#

last time I made sure I was hydrated and it still hit me like a truck

quaint mantle
#

you could always just wake up for a quick shit and a snack every 12 hours

torn shuttle
#

not moving for 30 hours isn't good for you

quaint mantle
#

well it's not like you're sleeping on the toilet next to the fridge

opal juniper
#

How does it feel knowing you slept thru a day tho

lost matrix
#

I dont even know how to stay awake on order to have to sleep >12 hours at a time.
Last time i was awake for more than 2 days was ~4y ago. And even then i only slept like 12 or 13 hours

torn shuttle
#

longest day I've had was 72h

quaint mantle
#

yeah it's pretty abnormal to go past the 18h mark in my experience

quaint mantle
#

only happens when your circadian rythm and your body is crippled

#

hospital

#

i sleep at 2 and wake up at 10

torn shuttle
#

I have no circadian rythm lmao

quaint mantle
#

perfect 8 hours

#

yeah well maybe you should consider a red theme

#

to not fuck with it

torn shuttle
#

I just can't live in a 24h format

quaint mantle
#

i'm not from a third world country

#

you still can look like em

torn shuttle
#

I never did well with 24h, days should be closer to 30h long for my sleep schedule not to slip

lost matrix
#

Mine naturally shifts to the night. When i have semester breaks i always tend to stay up longer and sleep into the mid day.

quaint mantle
#

that's racist

torn shuttle
#

but also I keep working with people in japan and the US on a daily basis who are only available at specific times so there goes my sleep schedule

quaint mantle
#

having a tendency towards a 24h+ day cycle implies that you don't know how to relax yourself properly at night

#

so you need to force your body to be able to sleep by tiring it

#

an unhealthy and common problem in this modern world

torn shuttle
#

please I don't need you to go into detail about how you "relax yourself properly at night" borat

quaint mantle
#

too much shit going on and too much shit to worry about

#

consider reading a book, for example

torn shuttle
#

I always read before bed

quaint mantle
#

maybe you read too hard

torn shuttle
#

ah I see

quaint mantle
#
public enum PunishmentType {
    KICK,
    BAN,
    IP_BAN,
    MUTE,
    WARNING
}

am i missing any punishments

torn shuttle
#

I'm too good at relaxing

quaint mantle
#

no, you suck at it

torn shuttle
#

if I sucked at it how can I be excessively good at relaxing activities

quaint mantle
#

make it a registry so you don't need to worry about missing any

torn shuttle
#

1v1 me at reading

quaint mantle
#

reading a book isn't inherently relaxing

ivory sleet
#

Depending if you add new punishment types as the time comes

quaint mantle
#

?

#

oh i get it

#

in english, you need to modify the source code of your enum in order to add new types of punishments

torn shuttle
#

tbh I also have no interest in changing how I currently do my sleep pattern, I will have to in the future and I already miss doing it this way

quaint mantle
#

you ideally want that to be doable without that

#

via f.e a registry

ivory sleet
quaint mantle
#

i could use some sort of int id for the punishments

#

but, idk if its even worth it tbh

#

int ids have their own issues, the only solid and futureproof id is a namespaced key

torn shuttle
#

who doesn't love magic values

ivory sleet
#

Or just have an interface and then a registry with entires and each one derive that interface

quaint mantle
#

i think ill just stay with the enum for now until i understand what the hell yall are talking about samsungsmile

ivory sleet
hardy swan
#

I think enum is alright

quaint mantle
#

it's 'fine'

proud basin
quaint mantle
torn shuttle
#

temp ip ban

quaint mantle
dusk flicker
#

blacklist

torn shuttle
#

temp warning

quaint mantle
#

shadowban

#

who the hell needs a temp warning

#

shadowmute

torn shuttle
#

and invent temp kick

dusk flicker
#

warnings are temp

#

kek

quaint mantle
#

rangeban

torn shuttle
#

where after a while it forces the client back in

dusk flicker
torn shuttle
#

tempshadowban

dusk flicker
#

I have those

ivory sleet
torn shuttle
#

tempshadowmute

dusk flicker
#

I need to order that better lol

quaint mantle
#

shadowban is probably kind of difficult to implement

torn shuttle
#

tempshadowipban

hardy swan
quaint mantle
#
public BanPunishment(BanList.Type type, @Nullable Instant expires, String enforcer) {
    super(enforcer, expires);

    this.type = type;
    this.expires = expires;
    this.enforcer = enforcer;
}
public class IPBanPunishment extends BanPunishment {
    public IPBanPunishment(Instant expires, String enforcer) {
        super(BanList.Type.IP, expires, enforcer);
    }
    
    @Override
    public PunishmentType getType() {
        return PunishmentType.IP_BAN;
    }
}
#

this is how the whole system works

#
@RequiredArgsConstructor
public abstract class Punishment {
    public abstract PunishmentType getType();

    private @Getter final String enforcer;

    /**
     * Apply a punishment to the player with the provided reason.
     *
     * @param player the player
     * @param reason the reason
     */
    public void applyPunishment(Player player, @Nullable String reason) {}
}
public abstract class TemporaryPunishment extends Punishment {
    private final Instant date;

    public TemporaryPunishment(String enforcer, Instant until) {
        super(enforcer);
        this.date = until;
    }

    public boolean isActive() {
        return date == null || Instant.now().isBefore(date);
    }
}

spam 😱

#

but yeah its super simple

grim ice
#

uh help

#

so um

ivory sleet
grim ice
#

i want to make a player get teleported every second in a certain condition

#

and i want the scheduler to stop

quaint mantle
#

that isn't what a condition means

grim ice
#

when the condition

#

isnt true

#

what

quaint mantle
#

you don't do things in a condition

#

a condition is a condition

#

while (!condition) {
runnable.run()
}

hardy swan
quaint mantle
#

it can be evaluated, and its result can either be true or false

grim ice
#

@quaint mantle using while crashed the whole server

torn shuttle
quaint mantle
#

😐

grim ice
#

hmm can u give me an example if u dont mind

torn shuttle
#

2hex just out of curiosity have you published any plugins on spigot so far

hardy swan
#

i think he did

torn shuttle
#

4

#

just checked

quaint mantle
#

dear god

paper viper
#

Yikes

quaint mantle
#

someone send link

#

are they bad

torn shuttle
#

it's pretty rich to start with bettersprint when you crash your server half the time you upload anything

grim ice
#

they are legit shit

torn shuttle
#

then take them down

grim ice
#

yeah i was thinking about that

torn shuttle
#

don't let your dreams be dreams

quaint mantle
#

well

#

spigot is full of horrible plugins

grim ice
#

well that isnt the topic

quaint mantle
#

they fit right in

#

so don't worry about it

torn shuttle
#

so guys

#

how do you think he did flossing armorstanddance

paper viper
#

Dude your plugin 2Hex

grim ice
#

oh god

#

now shit starts

paper viper
#

Do you know how broken that is?

grim ice
#

can you please help my case instead of checking over shit plugins i've made

quaint mantle
#

perfectly balanced

grim ice
#

:/

quaint mantle
#

i'll decompile the flossing plugin

torn shuttle
#

too late

tardy delta
#

how can i check if a player has free slots?

#

empty ones

torn shuttle
#

you are the second person I ever bring up the source code for on here

grim ice
#

uh and?

torn shuttle
#

the first one ended up its own spigot post (the story of bob)

quaint mantle
#
BukkitRunnable runnable = () -> {
    while (!condition) {
        player.teleport(someLocation);
    }
}.runTaskTimer(plugin, 20, 0);

@grim ice something like this, i havent used runnables in a while

grim ice
#

lmao

quaint mantle
#

story of bob

#

?scheduling

undone axleBOT
quaint mantle
#

that reminds me of something slimefun related for some reason?

grim ice
quaint mantle
#

np

torn shuttle
torn shuttle
#

on irc

quaint mantle
#

for slimefun? lmao

torn shuttle
#

yeah

quaint mantle
#

god I fucking hate that thing

torn shuttle
#

people flooded it with pull requests about diamond operators and such

quaint mantle
#

it fills me with indescribable hatred

#

@tardy delta

    /**
     * Get if the item can fit in the provided inventory.
     *
     * @param item the item
     * @param inventory the inventory
     *
     * @return if the item can fit in the inventory
     */
    public static boolean canFit(@NotNull ItemStack item, @NotNull Inventory inventory) {
        int amount = item.getAmount();
        int stackSize = item.getMaxStackSize();

        for (ItemStack i : inventory.getStorageContents()) {
            if (i == null || i.getType() == Material.AIR) {
                amount -= stackSize;
            }
            else if (i.isSimilar(item)) {
                amount -= stackSize - i.getAmount();
            }
            if (amount <= 0) return true;
        }
        return false;
    }
hardy swan
#

he wants empty slots

quaint mantle
#

k

tardy delta
#

i want to check how many free slots the player has

#

to give him the items from a trade

quaint mantle
#

yeah use this

lost matrix
tardy delta
#

oki just a for loop

lost matrix
#

Spigot hat a method for that

tardy delta
#

o

tardy delta
quaint mantle
#

yeah

tardy delta
#

so 36 slots

#

ki

quaint mantle
#

it may include the off hand

#

you have to test that though

lost matrix
# tardy delta o
  public void giveOrDropFor(final Player player, final ItemStack... items) {
    final World world = player.getWorld();
    final Location playerLoc = player.getLocation();
    Inventory playerInv = player.getInventory();
    playerInv.addItem(items).values().forEach(overFlownItem -> world.dropItemNaturally(playerLoc, overFlownItem));
  }
tardy delta
#

owh thanks

#

lemme see

clever sapphire
#

yo, I want to send to the player the close window packet

#

but I'm wondering if its important to send the correct id with it, for example 0 is for the players private inventory

quaint mantle
#

anyone got an sql library

#

or a tutorial

clever sapphire
#

but I'm wondering how I can get the correct id as there are a lot of kinds of inventories in the game that could be open

tardy delta
next crater
quaint mantle
#

isnt he the one who promotes static, bad code structure and bad class naming conventions

#

he explains pretty well, ill check it out

#

jfc a 20 minute tutorial

#

Hey is anyone familiar with quality armory vehicules ?

#

?

#

I bought the plugin

#

and it's spamming console

tardy delta
#

"bought"

#

brr

quaint mantle
#

Yes

#

i legit bought it

#

I am familiar with it yes

#

it is total trash

#

get a refund

#

How

#

get a refund

#

can I get a refund

#

it sucks in every way imaginable

#

I need a vehicule plugin anyways

#

the models are alright I suppose

#

Is there an alternative ?

#

i don't know

#

if you're willing to pay for it, yeah there are alternatives

#

just make sure you can get a refund in case they suck too

#

Yeah I got money

#

Yeah

#

because they probably suck too

#

I want my quality armory money back

#

I really need vehicules tho

#

grab some torches and pitchforks and proceed to the review section

grim ice
#

i dont think that's correct

#

is it

quaint mantle
#

I have an error : x is not finite

tardy delta
#

why is this suspicious?

quaint mantle
#

with quality armory

#

I've sent an issue on github

#

yeah that is caused by them trying to normalize a zero velocity

#

which shits out nans

#

no response for 5 days

lost matrix
tardy delta
#

oki

quaint mantle
#

the fix itself was trivial

#

but it didn't actually solve the issue

#

now it doesn't blow up, but none of the flying vehicles fly

lost matrix
quaint mantle
#

The vehicules work

#

but it spams console

tardy delta
#

oh

quaint mantle
#

That's my only problem

tardy delta
#

oh i was trying to remove a consolesender instead of a player

quaint mantle
#

the version I fixed a while ago had an issue with flying vehicles

gentle kestrel
#

hello, what is the plugin, when you right click on a specific item, it puts all the mini games in an inventory you can choice and you can access the mini game of your choice

quaint mantle
#

there are probably 100s of such plugins

#

consider being original

#

Do you know how

gentle kestrel
#

okay

grim ice
#

Anyone doesnt mind helping? I want a player to get teleported every second if smth is true (i have it setup) and if it stopped being true itll stop tping the player

quaint mantle
#

@quaint mantle Do you think you can check my issue

#

i'm not going to contribute to that shitshow

#

sad

#

some servers do use it tho

lost matrix
quaint mantle
#

they've probably fixed it on their own

#

Is there a discord support

#

for qa vehicules ?

#

i don't know

#

How do I get a refund for qav

grim ice
#

u mean like that

#

itll prob consume so much ram and stuff though

#

wont it

quaint mantle
#

iterate over all players so you only need one runnable

#

start it at onEnable

grim ice
#

o

grim ice
#

from there

quaint mantle
#

you don't

#

you iterate over all players

#

so hum

#

How does one get a spigot plugin refund

grim ice
quaint mantle
#

all of the mods seem to have conveniently disappeared

grim ice
#

can u show me or an example or something

quaint mantle
#

for (Player player : Bukkit.getOnlinePlayers())

grim ice
#

how am i supposed to get the location though

#

of the player who right clicked

quaint mantle
#

event.getPlayer()

lost matrix
# grim ice ` Bukkit.getScheduler().runTaskTimer(plugin, () -> { if(Objects.equals("...

This would be an autarc class for your task:

public class TeleportRunnable implements Runnable {

  @Getter
  @Setter
  private static boolean teleporting = false;
  private static TeleportRunnable teleportRunnable;

  public static void start(final JavaPlugin plugin, final Location location) {
    Preconditions.checkState(teleportRunnable == null);
    teleportRunnable = new TeleportRunnable(location);
    Bukkit.getScheduler().runTaskTimer(plugin, teleportRunnable, 20, 20);
  }

  private final Location location;

  private TeleportRunnable(final Location location) {
    this.location = location;
  }

  private void tpPlayer(final Player player) {
    player.teleport(this.location);
  }

  @Override
  public void run() {
    if (teleporting) {
      Bukkit.getOnlinePlayers().forEach(this::tpPlayer);
    }
  }

}
quaint mantle
#

you'll have to store that somewhere else

#

in a map, for example

grim ice
#

where will this teleport the player to

lost matrix
#

Then you can just use

TeleportRunnable.start(plugin, location);

To start it and

TeleportRunnable.setTeleporting(true/false);

To enable/disable the teleporting

grim ice
#

oh so

quaint mantle
#

assuming each player is teleported to a different location, you need a Map for Player -> Location

grim ice
#

location is the target location

quaint mantle
#

otherwise everybody gets teleported to the same location

grim ice
#

o

lost matrix
grim ice
#

yeah..

#

its when a player right clicks a player the right clicked person keeps getting tped

lost matrix
#

Then you should scrap the static stuff and make this a Singleton

grim ice
#

until the other play right clicks again

#

is there no way to make this easier

#

i feel like smth this simple should have an easier solution

quaint mantle
#

the solution is easy

#

you're just too much of a noob to see it that way

grim ice
#

there is legit nothing on google bruh

compact cape
#

Anyone knows what is exactly this error?

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project AGMRanks: Fatal error compiling: error: invalid target release: 1.16 

I have java 16 installed and ready to use

quaint mantle
#

its just 16

#

not 1.16

lost matrix
compact cape
#

what?

lost matrix
# grim ice is there no way to make this easier
public class TeleportRunnable implements Runnable {

  private static TeleportRunnable teleportRunnable;

  public static TeleportRunnable getInstance() {
    if (teleportRunnable == null) {
      teleportRunnable = new TeleportRunnable();
      Bukkit.getScheduler().runTaskTimer(JavaPlugin.getPlugin(YourPlugin.class), teleportRunnable, 20, 20);
    }
    return teleportRunnable;
  }

  private final Map<UUID, Location> teleportLocations;

  private TeleportRunnable() {
    this.teleportLocations = new HashMap<>();
  }

  public void addPlayer(final UUID playerID, final Location location) {
    this.teleportLocations.put(playerID, location);
  }

  public void removePlayer(final UUID playerID) {
    this.teleportLocations.remove(playerID);
  }

  @Override
  public void run() {
    final Set<UUID> offlinePlayers = new HashSet<>();
    for (final Entry<UUID, Location> entry : this.teleportLocations.entrySet()) {
      final Player player = Bukkit.getPlayer(entry.getKey());
      if (player == null) {
        offlinePlayers.add(entry.getKey());
        continue;
      }
      player.teleport(entry.getValue());
    }
    this.teleportLocations.keySet().removeAll(offlinePlayers);
  }

}
quaint mantle
#

🥄

grim ice
#

WAIT

#

new BukkitRunnable() { @Override public void run() { //Your code here! if(!Objects.equals("handcuffed", e.getRightClicked().getPersistentDataContainer().get(key, PersistentDataType.STRING))) cancel(); //Cancels it if condition is met, can be whatever. } }.runTaskTimer(plugin, 20, 20);

#

wont that be better

quaint mantle
#

wtf

lost matrix
#

Letting a player tp every second:

TeleportRunnable.getInstance().addPlayer(playerID, location);

Stopping it again:

TeleportRunnable.getInstance().removePlayer(playerID);
grim ice
#

wait

lost matrix
#

And it automatically removes offline players

quaint mantle
grim ice
quaint mantle
quaint mantle
#

that means what the fuck

#

use Player as key for the map

#

i know

#

iterate over the entry set with removeIf

#

thats how i feel

quaint mantle
grim ice
#

@lost matrix i have a question tho

quaint mantle
#

and return !entry.getKey().isOnline()

#

borat made bad suggestion?

#

use UUID

#

using players as keys is fine as long as you're sanitizing them

#

which is what we're doing

lost matrix
#

I mean... having a reference to game bound objects is discouraged

quaint mantle
#

i love UUIDs

#

it's only discouraged because noobs would misuse it otherwise

grim ice
#
                       new BukkitRunnable() {
                            @Override
                            public void run() {

                                if(!Objects.equals("handcuffed", e.getRightClicked().getPersistentDataContainer().get(key, PersistentDataType.STRING))) cancel(); 
                            }
                        }.runTaskTimer(plugin, 20, 20);```
#

this will not work, will it

quaint mantle
#

who the hell told you to use Objects.equals

#

so long as the player object is checked for validity before doing anything with it, it's fine

grim ice
#

someone, and i seem to misuse it?

quaint mantle
#

Object#equals

#

and ideally dropped out of memory if it is found invalid

lost matrix
quaint mantle
#

Player objects are invalidated and abandoned when the player logs out

#

an abandoned player object will always return false for isOnline

#

because it no longer represents that player

grim ice
#
new BukkitRunnable() {
                            @Override
                            public void run() {
                                e.getRightClicked().teleport(target);
                                if(!Objects.equals("handcuffed", e.getRightClicked().getPersistentDataContainer().get(key, PersistentDataType.STRING))) cancel(); 
                            }
                        }.runTaskTimer(plugin, 20, 20);```
@lost matrix will this work alternatively
quaint mantle
#

if anything, the alternative is less robust, because the player being retained for one second is arbitrary

lost matrix
quaint mantle
#

yes, and that is less robust

#

because you now have an additional variable to debug

grim ice
#

can one of you please answer me if you know?

quaint mantle
#

the retention of the player should be handled separately

grim ice
#

i think the thing i just sent will work fine? won't it

lost matrix
lost matrix
grim ice
#

1s

#

o

#

why

quaint mantle
#

regardless

#

my actual point which was forgotten because the noooo muh player objecterino debacle

eternal oxide
quaint mantle
#

was that you should iterate it with removeIf

#

instead of building a hashset of elements to remove

lost matrix
grim ice
#

so uh

#

conclusion

quaint mantle
#

or at the very least use a linkedlist for the removal collection

lost matrix
grim ice
#

why

quaint mantle
#

or alternatively alternatively

#

use an actual iterator and its remove method

lost matrix
# grim ice why

Depending on the rest of your code it might even keep teleporting the player without you being able to ever cancel it again.

grim ice
#

what

lost matrix
quaint mantle
#

yes, but time complexity isn't all in all

#

what you are doing right now is allocating a new 16 element array to back the hashset every time

#

which goes entirely wasted

#

furthermore, with every insertion, you are computing the hashcode and equals of the inserted element

#

further, the iteration time complexity of a set is slower than that of a list

#

it is in every way inefficient

#

the only saving grace is that it's done only every second

lost matrix
#

Yes i know it clutters the GC. I would normally also do this with a linked data structure because removeIf is O(1) then. It was just a quick mock up.

grim ice
#

So uh

#

now?

lost matrix
# grim ice now?

Dont use lambdas for this. Try properly implementing a new class for your task. The scopes are defined more clear then.

grim ice
#

so

queen niche
grim ice
#

do i use ur solution

lost matrix
lost matrix
grim ice
#

ok

#

o

#

i mean as long as its not the worst

#

its fine

lost matrix
# grim ice ok

This is the changed version to also satisfy borat:

public class TeleportRunnable implements Runnable {

  private static TeleportRunnable teleportRunnable;

  public static TeleportRunnable getInstance() {
    if (teleportRunnable == null) {
      teleportRunnable = new TeleportRunnable();
      Bukkit.getScheduler().runTaskTimer(JavaPlugin.getPlugin(YourPlugin.class), teleportRunnable, 20, 20);
    }
    return teleportRunnable;
  }

  private final Map<Player, Location> teleportLocations;

  private TeleportRunnable() {
    this.teleportLocations = new LinkedHashMap<>();
  }

  public void addPlayer(final Player player, final Location location) {
    this.teleportLocations.put(player, location);
  }

  public void removePlayer(final Player player) {
    this.teleportLocations.remove(player);
  }

  @Override
  public void run() {
    this.teleportLocations.keySet().removeIf(player -> {
      player.teleport(this.teleportLocations.get(player));
      return !player.isOnline();
    });
  }

}
grim ice
#

o

lost matrix
#

But its quite a bit harder to understand

quaint mantle
#

but it's satisfying

lost matrix
#

*for a beginner

quaint mantle
#

hey im trying to

#

oh

grim ice
#

e honestly

#

i think i can understand it

#

idk tho ill try

quaint mantle
#

i'm trying to set an entity's AI, right? but its for LivingEntity, so im kinda crossed on what to do here

grim ice
#

@lost matrix quick question

quaint mantle
grim ice
#

the YourPlugin

lost matrix
#

Hm. Im not sure if i should call removeIf on the keySet or the entrySet there...

grim ice
#

i dont mess with that, its meant to be my main class

#

right

quaint mantle
#

if you don't need values, use keyset

#

if you need values, use entryset

#

both are cached and both are live views of the map so it doesn't really matter beyond the presence of the values

lost matrix
lost matrix
hexed hatch
quaint mantle
plain scroll
#

how can i use an itemstack from one java class in another as a material?

quaint mantle
#

Entity != LivingEntity

grim ice
#

@lost matrix and to use it TeleportRunnable.getInstance().addPlayer((Player) e.getRightClicked(), target);
will be fine, right?

hexed hatch
lost matrix
quaint mantle
#

wdym

#

personally instead of a singleton I'd store the runnable instance in the main class or somewhere else that is per plugin instance, and access it from there

hexed hatch
#

Don't think LivingEntity has the AI method

quaint mantle
#

but it doesn't really matter and is more a question of preference

hexed hatch
#

Since LivingEntity includes players which don't have AI

#

but the Mob object does have that method

quaint mantle
#

actually i just found a way

#

you probably want to use setAware instead of setAI anyway

compact cape
#

Anyone understands this error?

I don't get it at all 😞

quaint mantle
#

awareness controls the actual AI of the entity

#

setAI controls gravity, taking damage, and everything else

queen niche
quaint mantle
#

i.e; walking, etc.

#

it's a vegetable with setAI(false)

#

it's more like a statue

#

which is the point of spawnNpc

#

as in you can't damage it, you can't move it, it isn't even affected by gravity

#

you probably want at least gravity

quaint mantle
#

not really lol

lost matrix
quaint mantle
#

so it just floats in the air incorporeally

quaint mantle
#

it won't go up or down

#

unless it has like, levitation

#

levitation won't do anything either

#

all movement is disabled when ai is set to false

compact cape
lost matrix
#

I suspect some static init bullshittery

quaint mantle
#

static initializers are haram

quaint mantle
#

perfect

#

just waht iwant lol

compact cape
lost matrix
lost matrix
#

Hm. Are you trying to load another spigot plugin while your current one is being enabled?

quaint mantle
#

do we have a stack trace or something

plain scroll
#

im trying to give the player an item when they click on something in the GUI

#

what would the "item" be?

lost matrix
compact cape
quaint mantle
#

do you have your depends set up correctly

lost matrix
# plain scroll

p.getWorld().dropItem()
And pls dont use single character variables lile e or p

quaint mantle
#

spigot doesn't let you load classes from random plugins anymore

compact cape
grim ice
#

Location currentLocation = e.getPlayer().getLocation(); Vector Direction = e.getPlayer().getLocation().getDirection(); Location target = currentLocation.add(Direction);
in this case, target means the player location but 1 block ahead, right

compact cape
lost matrix
plain scroll
ivory sleet
#

The removeIf that is

quaint mantle
#

using a linkedlist as the imtermediate collection makes it acceptable

lost matrix
quaint mantle
#

it's still not as good as it could be but it's significantly better

ivory sleet
#

Indeed

compact cape
plain scroll
lost matrix
grim ice
#

honestly

#

he doesnt need that

#

he can do it in a simpler way

#

thats kinda dumb but it still works

#

method: copy paste the item stack

lost matrix
#

If i hear static im hunting you catgun

grim ice
#

no statics

#

just

#

rewrite it

#

lol

plain scroll
#

ik a way

#

that i can easy;y do it

#

so if i make an item stack in the same class how can i drop that item?

lost matrix
# grim ice rewrite it

That violates the DRY principle:
Dont
Repeat
Yourself
One of the first principles you should really take to heart when programming.

plain scroll
#

so see here i make an item

grim ice
#

yeah

plain scroll
#

and iwanna use it here

grim ice
#

but i mean its dumb but works

#

lol

compact cape
grim ice
#

and how exactly do u want him to do that instead @lost matrix

#

if theres a way i want to use it too

#

DI?

lost matrix
#

Im going out with someone now. Hf pepeOK

grim ice
#

o

quaint mantle
#

how do players obtain end crystals

grim ice
#

uh

#

craft them

#

lol

ivory sleet
#

Crafted isn’t it

#

Ye

grim ice
#

you know all that much about spigot and u dont know how to craft end crystals-

#

w h a t

quaint mantle
#

i don't play the game

#

i make the game

grim ice
#

oh okay

ivory sleet
#

eye of ender, glass pane and a ghast tear

grim ice
quaint mantle
#

isn't that ridiculously cheap

grim ice
#

yeah

quaint mantle
#

aren't they supposed to be like endgame items

grim ice
#

but it isnt rly useful

quaint mantle
#

or something

grim ice
#

yes but theyre not rly useful

ivory sleet
#

Ghast tears are kinda hard to get arguably

grim ice
#

no

quaint mantle
#

i suppose

grim ice
#

i legit can get one in under 10 minutes in a complete new world

ivory sleet
#

I mean it’s not really close combat plus the drops could fall down into a lava pit

compact cape
#

Would some one clarify this error for me?

java.lang.LinkageError: loader constraint violation: when resolving method 'void me.ashenguard.api.Configuration.<init>(me.ashenguard.api.spigot.SpigotPlugin, java.lang.String, java.lang.String, java.util.function.Function)' the class loader org.bukkit.plugin.java.PluginClassLoader @4734270 of the current class, me/ashenguard/agmranks/ranks/Rank, and the class loader org.bukkit.plugin.java.PluginClassLoader @10e9d5dd for the method's defining class, me/ashenguard/api/Configuration, have different Class objects for the type me/ashenguard/api/spigot/SpigotPlugin used in the signature (me.ashenguard.agmranks.ranks.Rank is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @4734270, parent loader 'app'; me.ashenguard.api.Configuration is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @10e9d5dd, parent loader 'app')
grim ice
#

its luck

quaint mantle
#

unless you have a ghast grinder yeah I'd say it's pretty difficult to get lots of them

ivory sleet
#

ye

quaint mantle
#

they don't spawn that often and their AI is shit so they just float over lava most of the time

ivory sleet
#

lmao yup

grim ice
#

thats why u should use my plugin to get ghost spawners!

#

poggers!!!

#

anyways

#

back to my extreme stupid questions

quaint mantle
#

my server actually does have ghast spawners

plain scroll
#

it says i dont have "item" as a ver

#

but i do...

grim ice
#

Location currentLocation = e.getPlayer().getLocation();
Vector Direction = e.getPlayer().getLocation().getDirection();
Location target = currentLocation.add(Direction); target means 1 block ahead of the player, right?

quaint mantle
#

we also have other perfectly balanced things

#

like wither spwners

grim ice
plain scroll
grim ice
#

is it in a other class

plain scroll
#

nope

#

same classs

grim ice
#

what...

plain scroll
grim ice
#

theyre

#

not in the same place

#

lol

plain scroll
#

oh

grim ice
#

an easy solution is to write the itemstack in the class

#

when u make it inside a method itll only be accessible there

#

if u dont use other stuff

plain scroll
#

i think it works

grim ice
#

honestly

#

an easier solution

#

nvm

#

but do u have in mind that the player might not have an empty slot

queen niche
quaint mantle
#

how rare are hearts of the sea

queen niche
#

not rare if you have a treasure map

quaint mantle
#

surely one treasure map doesn't get you that many of them

#

although I guess you can repeatedly buy them from a villager

opal juniper
#

Huh

#

I think they are fairly rare tbh

#

But if you need something rare use a nether star

quaint mantle
#

i would but the wither spawners kind of make it not rare

hasty prawn
#

You're guaranteed exactly 1 Heart of the Sea in each Treasure Chest I'm pretty sure

#

And Treasure Maps aren't really all that rare

quaint mantle
#

how far do you need to travel to find the treasure usually

#

it ought to take at least a few minutes, right

hasty prawn
#

Yeah it takes a few mins, usually it's finding the stupid chest and not actually getting to the x

quaint mantle
#

rare enough for me ig

shadow gazelle
#

Is there some function to refresh tab? I made a command that removes and adds the NPCs that were spawned with my plugin and it adds them to the tab list every time.

#

Or some way to exclude NPCs from tab?

digital plinth
#

packets?

#

sometime when I press tab on hypickle

#

i see the NPCs in the tablist for a split second

#

and then they disappear

opal juniper
#

You can find treasure with the seed

plain scroll
#

how do i make it so a player needs a permition to run a command?

#

this is the command i wanna add it 2

grim ice
#

}

shadow gazelle
#

player.hasPermission("")

queen niche
#

https://0bin.net/paste/3kHHZH0A#B3f6xlpm5UCYwElxYtXDBTLLtra8TbOT2fXmJzt7UTs

Can someone look at my code?
Im litteraly pulling my hair since its supposed to work.

The command can only be used in command blocks but when using it it doesnt give any output neither does it give a error. I dont think its a big issue since its a easy code.

shadow gazelle
plain scroll
shadow gazelle
#

Jesus, my tab needs help

grim ice
#

what

shadow gazelle
plain scroll
#

or is there a way to implement it to what i allraedy have?

grim ice
#

wtf ru talking about

plain scroll
#

lmao

#

even i dont know

grim ice
#

uh if u dont know those umm

queen niche
#

hes asking if its possible to add that line to code inside his code.

flat kindle
#

How would one have a multiline description in the plugin.yml file?

plain scroll
#
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (sender instanceof Player) {
            Bukkit.getServer().getPluginManager().callEvent(new GuiEvent((Player) sender));
            return true;
        }else {
            Bukkit.getLogger().info("You must be a player to run this command");
        }```
grim ice
#

maybe learn basics before gui

shadow gazelle
#

That shouldn't be confusing...

plain scroll
#

ikr

shadow gazelle
#

It's just another if

grim ice
#

just check if player has the permission inside

#

ye

queen niche
#

https://0bin.net/paste/3kHHZH0A#B3f6xlpm5UCYwElxYtXDBTLLtra8TbOT2fXmJzt7UTs

Can someone look at my code?
Im litteraly pulling my hair since its supposed to work.

The command can only be used in command blocks but when using it it doesnt give any output neither does it give a error. I dont think its a big issue since its a easy code.

flat kindle
#

How would one have a multiline description in the plugin.yml file?

queen niche
#

maybe add another description line?

#

like:

plugin
description: line1
description: line2?

flat kindle
#

it cant

#

its duplicated

chrome beacon
#

Unsure if multiple lines is even supported

hasty prawn
#
description:
  - "line1"
  - "line2"

and then use getConfig().getStringList("description")

grim ice
#

what

#

he's talking about pluginyml

hasty prawn
#

Wait plugin.yml

grim ice
#

lmao

hasty prawn
#

why would you need that

grim ice
#

its /f or smth idek

heavy void
#

Why you need that on plugin.yml, its only a plugin description ' -'

plain scroll
#

ive tryed but it didn't work lol

queen niche
#

https://0bin.net/paste/3kHHZH0A#B3f6xlpm5UCYwElxYtXDBTLLtra8TbOT2fXmJzt7UTs

Can someone look at my code?
Im litteraly pulling my hair since its supposed to work.

The command can only be used in command blocks but when using it it doesnt give any output neither does it give a error. I dont think its a big issue since its a easy code.

chrome beacon
plain scroll
late sonnet
#

Any know why when build a custom branch of craftbukkit with buildtools the branch change to master?

chrome beacon
grim ice
#

pls read it

plain scroll
grim ice
#

"A short description of what the command does."

chrome beacon
plain scroll
#

oh

#

nvm

#

i think ik

grim ice
#

@plain scroll

#

just watch

#

a few yt tutorials

#

before u start coding

plain scroll
#

ik like a med amout of java

grim ice
#

I never talked about java

plain scroll
#

i have about 15mins of spigot knolage

#

lol

chrome beacon
#

Do you know how to use Javadocs?

heavy void
#

You can check with Player.hasPermission

queen niche
#

https://0bin.net/paste/3kHHZH0A#B3f6xlpm5UCYwElxYtXDBTLLtra8TbOT2fXmJzt7UTs

Can someone look at my code?
Im litteraly pulling my hair since its supposed to work.

The command can only be used in command blocks but when using it it doesnt give any output neither does it give a error. I dont think its a big issue since its a easy code.

hasty prawn
#

Are you registering the command

queen niche
#

yes. Its in both my main.java and plugin.yml if thats what you mean

heavy void
#

Why you dont send the error.

queen niche
#

Since there is no error

hasty prawn
#

Add some print statements, see where it's getting stuck.

glossy scroll
#

is world.getHighestBlockYAt async safe?

heavy void
#

neither does it give a error.

flat kindle
grim ice
#

the plugin

#

not the command desc

queen niche
grim ice
#

why would u have multiple lines for a command

hasty prawn
grim ice
#

just make a command that's like /<urcommand> help

chrome beacon
grim ice
#

if u have args or smth

glossy scroll
#

yea i just ask cuz the world isnt undergoing any writing at all

heavy void
#

You can do a paged help command...

glossy scroll
#

(at the time of using it)

quaint mantle
#

it shouldn't blow up, but you're not guaranteed to get correct information

chrome beacon
quaint mantle
#

and there might be an async catcher explicitly put on it to make it blow up

glossy scroll
#

mm ok

tribal holly
#

Hi, got a infinit problem ! I wanna damage all player of a team by 50% when a mate is hit but i have a exponential problem. I use EntityDamageEvent when the mate is hit and then apply a damage to all mates of the team, but this trigger again EntityDamageEvent and etc : infinit loop

#

someone know a solution ?

heavy void
#

Create a list

#

When a player is damaged, if it is in the list, it will not trigger, if it isnt in the list, you add it on the list, hit it, and remove it of the list

grim ice
#

@quaint mantle

#

uh

#

after what you've seen

grim ice
#

do you know a place i can learn from

#

either it was java or spigot stuff that i seem to lack info on

#

?learnjava does not help me btw

undone axleBOT
grim ice
#

honestly i used w3school

#

but idk if these r better

chrome beacon
#

W3Schools is good