#help-development

1 messages · Page 1908 of 1

spiral light
#

yes

ivory sleet
#

Got a better solution?

Edit, I dont see a problem with that

analog prairie
#

Walk and Run?

spiral light
#

too

analog prairie
#

How to make?

spiral light
#

The easiest thing is maybe getting Statistics of player ^^
if you need something specific PlayerMoveEvent (from -> to locations) and measure the distance

analog prairie
#

PlayerMoveEvent?

spiral light
#

spigot api ^^

tardy delta
#

learning database design at school, finally something i can use in my code

analog prairie
spiral light
tardy delta
#

it's more difficult than i expected

spiral light
tardy delta
#

"normalisation of databases", "from erm diagram to relations"

spiral light
tardy delta
#

belgium

#

europe

spiral light
#

hmm sounded like stuff we did in my school too

tardy delta
#

its high school and it sucks in some way

#

last year now

analog prairie
spiral light
#

@ivory sleet do you can help on creating those patches ?

#

i need to somehow make a patch for a class i added/changed in craftbukkit .... adding the file and makePatches does nothing

analog prairie
spiral light
#

what exactly ?

#

location ?

analog prairie
#

Yes

spiral light
#

xD

#

?jd

spiral light
#

yes Location is one of the biggest used stuff in minecraft

#

without that the api would be almost useless

analog prairie
#

I still have no idea

#

I don't know how to count distance

spiral light
#

when do you need the distance ? all the time ? or just every 10s or at the end of what your doing ?

analog prairie
#

Maybe what I need is a math formula or something

#

All the time

spiral light
#

PlayerMoveEvent

analog prairie
#

this is a statistic

spiral light
#

then define somewhere where your startLocation (lowest point) is

#

in PlayerMoveEvent you just get the location where the player moves (p.getLocation() will do it)

#

Location has already builtin "distance" - method ...

analog prairie
#

Start location is a method?

spiral light
#

no

#

its the point where you want the players to have walked distance 0

#

you said they walk always in + direction

analog prairie
#

No, I mean this method seems to only work if the player is only going in the positive direction

#

So I feel confused

spiral light
#

what do you want to do ?

analog prairie
#

I need a suitable way to calculate the player's irregular walking distance

spiral light
#

the overall walking distance ?

analog prairie
#

Yes

spiral light
#

then you need to calculate it everytime or you just use the Statistics from the Player

analog prairie
#

Cumulative distance traveled on the server

spiral light
#

player.getStatistics() or smth like that

analog prairie
#

getStatistics() is form player on the server or player on all server

spiral light
#

current server

quaint mantle
#

Hi, im gonna make a plugin which adapts how spiders can spawn but as of 1.10.2, do spiders spawn in 2x2 areas or 3x3 areas?

analog prairie
#

Can it reset?

spiral light
spiral light
quaint mantle
#
versionID:
    versionList: [~~~~,~~~~,~~~~,~~~~,~~~~,~~~~]

How can i get full array versionList using getConfig()?

tardy delta
#

is that yaml?

#

[]

quaint mantle
#

yea

unreal quartz
#

String list

quaint mantle
#

okay its getConfig()#getList(path)

tardy delta
#

isnt string list
path:

  • "something"
  • "something else"
quaint mantle
#

both are lists ig xD

tardy delta
#

hm i know the first one is a serialized collection

#

well no its more json

#

lol

quaint mantle
#

dictionaries as python & js devs like to call it

manic furnace
#

How can I set the time zone of my mysql server? Because I am from Austria and become an error when I try to connect from the Intelij Database Navigator, which says:

Cannot connect to "Connection".
The server time zone value 'Mitteleurop�ische Zeit' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utilize time zone support.
vocal cloud
#

Configure your driver?

manic furnace
#

How? Sry I just began to work with databases

vocal cloud
manic furnace
#

I get that error, when I restart it after I set it to +8:00:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@@global.time_zone' at line 1
spiral light
#

@@global.time_zone ?
are those @ correct ?

analog prairie
#

I got null form this

manic furnace
#

When I set it everything works completly fine, but after the restart I become an erroo

analog prairie
#

What's wrong?

quaint mantle
#

If I have a Plugin object, how can I get its current version?

#
PluginDescriptionFile#getDescription()

Solved

spiral bridge
#

Is there any way to override suggestions for bungeecord command?
I found TabCompleteEvent but I don't know how to overwrite suggestions

tardy delta
#

you have to override the TabCompleter#onTabComplete, it works like onCommand but you'll need to set a tabcompleter in the same way as you set an executor for a command

manic furnace
red sedge
#

is there anyway to detect if the player punches a dropped item

#

i had the idea of spawning an armor stand

#

but im not sure

young knoll
#

You could use the interact event and rayTrace

kindred aurora
proud basin
#

Can yall help me improve my speed check ```java

if (player has the movement of a hacker) {
Console.print("This person is hacking");
}```

spiral light
#

well

#

add some _ and a ()

#

and then use System.err.print

#

and not Console.print

quaint mantle
#

    public Object test() {
        File file = new File("plugins/" + getDirectory(), "Data.yml");
        YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(file);
        Object returnThis = yamlConfiguration.get("Object");
        return returnThis;
    }
``` can this lead to memory leak?
spiral light
#

dont think so

quaint mantle
#

how about its being used 5 times per second?

spiral light
#

dont

quaint mantle
#

10?

spiral light
#

do that

#

why should you run that multiple times ?

quaint mantle
#

to get data from files?

spiral light
#

the result will be the same ... so you should safe the result onEnable()

quaint mantle
#

i actually use different version

#

to get player's kills

modern vigil
#

wh- why

quaint mantle
#

Then how would i store data?

spiral light
#

why do you call the method that often ?

modern vigil
#

databases

young knoll
#

You don’t need to read the file that often

#

Just read it once at startup

spiral light
#

if you want to know how many kills the player has you can store in at PlayerJoinEvent and increase it and do stuff with that ... and PlayerQuitEvent you safe the value back

quaint mantle
young knoll
#

Okay, then read them when the player logs on

quaint mantle
spiral light
#

yes

young knoll
#

YamlConfiguration is already a cache for you

quaint mantle
#

yup

#

wait

#

so should i just cache "yamlConfiguration"

spiral light
#

if your lazy yes

quaint mantle
#

no im not

spiral light
#

using config method to get obj also takes time ...

#

if you store values seperate your faster

quaint mantle
#

I have SSD tho

spiral light
#

still

#

also SSD is not ram ^^

quaint mantle
#

i know

#

but it's faster to read yml on ssd then hdd

#

i've noticed it

#

on HDD you would lag

spiral light
#

yes... but still slow

spiral bridge
quaint mantle
quaint mantle
#

i Meant, what you do know is just a pointless spend of resources and disk usage

#

Hello,
How set amount on ShapedRecipe

#

Nohow

#
    public ShapedRecipe getCommonCobblestone() {
        NamespacedKey key = new NamespacedKey(Main.getInstance(), "commonCobblestone");
        ShapedRecipe recipe = new ShapedRecipe(key, commonItems.cobblestone());
        recipe.shape("CC ", "CC ");
        recipe.setIngredient('C', Material.COBBLESTONE);

        return recipe;
    }```
quaint mantle
#

ow

#

but

#

there is a way

#

you need to make a listener and check if the amount is X

#

I don't remember the name of it

#

ty

quaint mantle
ivory sleet
# quaint mantle I have SSD tho

Regardless, an IO operation is in fact an IO operation and unlike a normal java bytecode instruction execution, IO stuff can take arbitrarily more time to execute due to that it has to go through a lot, therefore caching it is still considerably needed and wanted

quaint mantle
#

so the best thing is caching?

ivory sleet
#

Yeah, caching it is probably what you want to do here

quaint mantle
#

Can caching lead to memory leaks?

ivory sleet
#

No not really

#

I mean you can run out of memory

#

But that does not inherently imply any memory leaks

acoustic pendant
#
    public void drawCircle(Location loc, float radius) {
        for (double t = 0; t < 7; t += 0.1) {
            float x = radius * (float) Math.sin(t);
            float z = radius * (float) Math.cos(t);
        }``` how can i get what's inside the circle as well?
#

because, that's doing this, just the borders

quaint mantle
#

i mean, just draw multiple circles lowerinf the radius?

lost matrix
#

bounds are +/- the radius of the circle

acoustic pendant
#

i'll try, thanks!

lost matrix
# acoustic pendant ```java public void drawCircle(Location loc, float radius) { for (do...

If you want an approach with better performance you can take a look at gauss circle problem:
https://en.wikipedia.org/wiki/Gauss_circle_problem

In mathematics, the Gauss circle problem is the problem of determining how many integer lattice points there are in a circle centered at the origin and with radius

    r
  

{\displaystyle r}

. This number is approximated by the area of the circle, so the real problem is to accurately bound the error term descr...

quaint mantle
#

which free college did you go to in germany

#

is the education that good

#

in the us we get bread and frozen fishsticks for lunches

#

what do they feed yall

proud basin
#

duck feet

young knoll
#

I should look into a good sphere algorithm

quaint mantle
#

Is there a bad sphere algorithm

#

yes

#

having the maximum amount of verticies

spiral light
#

also cafeteria is a dream for students since they give extra discount for students too

lost matrix
proud basin
#

Alright people so i have ```java
Label lblChips = new Label("Chips: " + player.getChip());
lblChips.setAlignment(Pos.TOP_RIGHT);
lblChips.setFont(Font.font(SMALL_FONT));
root.add(lblChips, 2, 0);

spiral light
proud basin
#

aw

glossy venture
#

bro im reading a mathoverflow post about the gauss circle problem

#

ah yes of course

quaint mantle
#

wtf is that z

glossy venture
#

idk lol

quaint mantle
#

and that e

#

i understand all of that besides those two symbols

glossy venture
#

i have no idea what any of the symbols mean

#

it looks scary af

#

i know the less than or equal but thats about it

#

or is that not a less than or equal because that makes no sense

spiral light
#

i guess its the euler number

glossy venture
#

yeah

#

but wtf does #{(x, y) ∈ Z^2 mean

spiral light
#

with the variables x and y weird stuff follows ^^

ivory sleet
#

I remember someone talking about that

#

But iirc they’re just two numbers that belong to the set of Z

glossy venture
#

ah aight i gtg

ivory sleet
#

Gl

lost matrix
ivory sleet
#

Maybe it could be the complementary notation

quaint mantle
#

what is the pound for

#

octothorp

#

hashtag

lost matrix
#

Something from set theory... would have to look that up. Second semester...

quaint mantle
#

imagine learning so much math it looks like a different language

lost matrix
#

cardinality. So basically the number of elements in the given set

quaint mantle
#

n

#

we have the letter n for that

#

programming terms need to be normalized in math

ivory sleet
#

Yeah lol

#

Gotta get that factory in math

unreal quartz
#

Fuck that module

hasty prawn
quaint bough
#

does someone have link to nms maven dependency ?

hasty prawn
#

?buildtools

#

oh

#

?bt

undone axleBOT
hasty prawn
#

tada

torn shuttle
#

is there a way to get the default name of an item stack?

#

as in the way it displays in-game

#

if it doesn't have a custom name

hasty prawn
#

@torn shuttle This will display to the client whatever is in their Resource Pack

#

So that would display "Red Glazed Terracotta" if English is their current lang

torn shuttle
#

that requires nms right

hasty prawn
#

Not NMS no

torn shuttle
#

wait where does CraftItemStack come from?

hasty prawn
#

It imports a version specific bukkit class though

torn shuttle
#

right

hasty prawn
#

Yeah... :(

#

But afaik there's not a way to get the description ID of an ItemStack with just Spigot API

torn shuttle
#

well... balls

muted otter
#

how do i detect when a player switches from their right hand to their left hand?

hasty prawn
#

PlayerSwapHandItemsEvent

muted otter
#

like

hasty prawn
#

Oh oh

muted otter
#

you can choose right hand or left hand

hasty prawn
#

PlayerChangedMainHandEvent?

muted otter
#

okie

muted otter
hasty prawn
#

Like you would any other event

muted otter
#

im new so i dont raelly know

#

really*

hasty prawn
#

Oh, probably need to lookup some basic Spigot tutorials then 😛

muted otter
#

em

thick gust
#

Yo can I also ask for development help in this channel in case I require help with Java in general? (Including JUnit)

maiden roost
#

Hi, is there a way to emulate Player for java tests(src/test)?

ivory sleet
lost matrix
#

Or: PrismarineJS

olive lance
#

bro logic class was the worst

#

that logical notation and set theory stuff horrible

quaint mantle
#

Hello, I would like to create the beacon light effect but I don't know where to start, can someone help me?
I use version 1.8.8

near wasp
#

Question incase anyone knows. Whenever I spawn a bukkit entity I get that entities UUID and add it to a set. Though whenever I hit the exact same entity I print out that entities UUID and I get a different UUID?

quaint mantle
lethal coral
#

Is there any way to convert this garbanzo bean of javadocs to the more modern, searchable one?

near wasp
#

@lethal coral crtl+f

lethal coral
lethal coral
#

however, I'm using 1.8.8 javadocs

late sonnet
#

1.8.8?

then.... not sure in a few cases the javadocs not show the search for... dont know why xd

lethal coral
#

in my research the "javadocs search feature" was added in jdk 9 and I'm pretty sure 1.8.8 uses java 8

#

I've also had to download the javadocs for offline use since there's no website that keeps them up from what I've searched

dense heath
lethal coral
dense heath
#

There certainly wouldn't be more than 3 or 4 results for what you're looking for and you could skim those easily

lethal coral
dense heath
brittle veldt
#

pls help

#
java version "17.0.1" 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)
Attempting to build version: '1.17' use --rev <version> to override
Found version
{
        "name": "3170",
        "description": "Jenkins build 3170",
        "refs": {
                "BuildData": "3cec511b16ffa31cb414997a14be313716882e12",
                "Bukkit": "fc92ca8dd3b37dbc440de9d61575af17226cb8f0",
                "CraftBukkit": "ec116f636d55eccae1d5bb0b716b1db3b245ccab",
                "Spigot": "a483d2c9d916d4d05ad0923f2c9472e3bac64bc8"
        },
        "toolsVersion": 128,
        "javaVersions": [60, 60]
}

*** The version you have requested to build requires Java versions between [Java 16, Java 16], but you are using Java 17
*** Please rerun BuildTools using an appropriate Java version. For obvious reasons outdated MC versions do not support Java versions that did not exist at their release.```
ivory sleet
#

Well do you have the newest version of bt? Also why not just jump down to java 16 (when installing)

ivory sleet
#

Or just use 1.18 (:

brittle veldt
#

like whats the command to run

brittle veldt
#

I have java 16 corrteto installed

ivory sleet
#

Go to your system variables and change the java variable

#

make it point to the java 16 bin (wherever that folder might be located on your disk)

brittle veldt
ivory sleet
#

🤷

#

Dk where you put it

brittle veldt
#

system varibles i mean

ivory sleet
#

Environment variables is probably the better term for it

junior geyser
#

How Can I get all blocks between n2 locations? this is what I have now, but it doesn't seem to work

                        final Vector vec1 = loc.toVector();
                        final Vector vec2 = anotherLoc.toVector();
                        final Vector diff = vec1.subtract(vec2).normalize();

                        BlockIterator iterator = new BlockIterator(block.getWorld(), vec1, diff, 0.0d, (int) vec1.distance(vec2));

this is what I have now, but it is not working

ivory sleet
#

Wym by get?

#

Iterate over a volume of blocks in an AABB both min and max points being inclusive?

junior geyser
#

I want iterate through all blocks on a ray between two locations. Like draw a line between 2 points, and iterate though all the blocks that touch that line

ivory sleet
#

Oh

junior geyser
#

Any ideas?

quasi patrol
#
HttpClient client = HttpClient.newHttpClient();
                HttpRequest request = HttpRequest.newBuilder().uri(URI.create("https://discord.com/api/v9/users/" + DiscordId)).header("Authorization ", "Bot token").build();
                client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
                        .thenApply(HttpResponse::body)
                        .thenAccept(System.out::println)
                        .join();
                JSONArray array = new JSONArray(HttpResponse.BodyHandlers.ofString());
                if (array.length() == 1) {
                    JSONObject json = array.getJSONObject(1);
                    DiscordUserName = json.getString("username") + "#" + json.getString("discriminator");
                }``` I think I did something wrong? Obviously token is replaced with an actual bot token inside of the code.
ivory sleet
#

Got any errors?

ivory sleet
#

And also does it not iterate at all or what goes wrong?

junior geyser
junior geyser
#

not sure if it matters

lost matrix
#

target - base

junior geyser
minor otter
#

what is wrong with if (noteBlock.getNote() == Note.flat(0, Note.Tone.G))

lost matrix
#

.equals or else you check for identity (the exact location in memory)

minor otter
#

okay

azure osprey
#

hm, it seems like I can't copy paste my screenshot file here

dusk flicker
#

you need to be verified to upload files

azure osprey
#

oh /:

dry pike
#

Im running into some issues with an observer pattern and have a question.

        ObjectThatHasAItemFrame object = new ObjectThatHasAItemFrame();
        list.add(object);
        object.getItemFrame().setItem(someItemStack);
        list.remove(object);

This is just an example but basically im trying to figure out why an object is not being removed from the list, would the code above work? when the object containing an item frame variable has the item on the itemframe changed does the object before the change still equal the object after the item in the frame is changed?

ivory sleet
#

I mean

minor otter
ivory sleet
#

If you create a new list every time

#

🤷

lost matrix
sharp storm
#

hi,
im trying to launch a player backwards according to where they're facing

ive set the Y value in the vector to a specific height

if the player is facing straight up or down it just launches them up in the air without moving them away from the block

i want it to have a set amount of velocity when it pushes the player back

this is my current code

Vector vec = player.getLocation().getDirection().normalize().multiply(-1);

player.setVelocity(new Vector(vec.getX(), 0.6, vec.getZ()));
azure osprey
#

I just want to make lightning strike where the arrow lands

#

does anyone know what I'm doing wrong?

dusk flicker
#

yep

#

two events, one method

#

Won't work

azure osprey
#

oh, can I use an event within an event?

dusk flicker
#

also static, not the biggest thing but useless

#

No, one event per method

azure osprey
#

oh, ok thank you Rack

minor otter
#

thanks for the help

wary harness
#

Is there any easy way to send

#

packet

#

to all players in world

lost matrix
wary harness
grizzled heron
#

hello

#

gow do i make a bossbar

#

i know bar = Bukkit.createBossBar(etc.)

#

and to add to player

#

but like it wont show up

azure osprey
#

this doesn't work either /:

#

It's just one event, I see no reason why it shouldn't work

astral nova
#

TownyUniverse.getInstance().getNation(name).getKing();

#

returns random player

#

kekw

ivory sleet
#

Yikes

azure osprey
#

what?

buoyant viper
#

yoinks

ivory sleet
#

Jonathan do you register the listener instance?

azure osprey
#

yes

astral nova
#

try Bukkit.getServer().getWorld("world").strikeLightning(location);

azure osprey
#

(class name) "Implements Listener"?

ivory sleet
astral nova
#

i dont know what to do now when towny have wrong method

#

🤔

grizzled heron
ivory sleet
#

Then add the players

#

And make sure you don’t lose the instance

buoyant viper
#

whats the damage cause of Player#damage

grizzled heron
#

    public void createBar(){
        bar = Bukkit.createBossBar("Bruh", BarColor.BLUE, BarStyle.SOLID);
        bar.setVisible(true);
    }

    public void addPlayer(Player player){
        bar.addPlayer(player);
        bar.setVisible(true);
    }```
ivory sleet
ivory sleet
grizzled heron
#

dam like son idek

#

thats my problem

ivory sleet
#

Then that’s the issue

ivory sleet
#

Your methods/instructions will not be called by themselves CS

#

You have to call them (usually from some command or event listener method)

grizzled heron
#

🗣️ 💯

#

fax ong

#

can i do it here

#
        getLogger().info("plugin enabled");
        getServer().getPluginManager().registerEvents(new Listeners(), this);
    }

    @Override
    public void onDisable() {
        getLogger().info("plugin disabled");
    }
}```
ivory sleet
#

Uh yeah but there aren’t gonna be any players online unless there’s a reload when you do it there

#

I could think of just doing it during PlayerJoinEvent perhaps?

grizzled heron
#

ah

#
        Player p = e.getPlayer();
        p.sendMessage(ChatColor.BLUE + "Wassgud " + p.getName() + " Reminder that PCJ on top.");

    }```
#

so i can call the methods here

ivory sleet
#

CS yeah

#

In principle

grizzled heron
#

aight

astral nova
#

like

#

its weird cuz

#

source is

#
        return capital.getMayor();
    }```
ivory sleet
#

And what does ::getMayor do?

astral nova
#

returns Resident from capital

ivory sleet
#

can you like show that code also?

astral nova
#

where mayor of capital is king

#

uno momento

ivory sleet
#

Si

azure osprey
#

still doesn't seem to work

#

I'm completely flummoxed

ivory sleet
#

You need to learn Java

azure osprey
#

You need to learn java!

#

shutup

vocal cloud
#

Lmfao

ivory sleet
#

Don’t be rude

azure osprey
#

this is me learning Java

vocal cloud
#

The issue you're having is quite obvious.

astral nova
ivory sleet
#

No, you’re trying to learn the spigot api

dusk flicker
#

remove the static

#

please

ivory sleet
#

Learn Java on your own

#

For instance that predicate of yours is always false

azure osprey
#

I'm also taking a course on Java

astral nova
#

like

#

ah

#

i see it

azure osprey
#

but it's boring and I try to use what I learn inbetween

astral nova
#

entity is not block

#

this event return entity or block

ivory sleet
#

A vector is never equal to an integer

ivory sleet
astral nova
#

@azure osprey

ivory sleet
#

But you should try to learn the concept object orientation (and differentiate it from the semantics of Java)

#

Which most Java courses suck at doing

vocal cloud
grizzled heron
#
        Player p = e.getPlayer();
        p.sendMessage(ChatColor.BLUE + "Wassgud " + p.getName() + " Reminder that PCJ on top.");
        bar.createBar();
        bar.addPlayer(e.getPlayer());
        bar.getBar();
    }```
#

it aint working son

#

ong

dusk flicker
#

?conventions

undone axleBOT
ivory sleet
#

Tbf I have no clue what you’re doing CS

grizzled heron
dusk flicker
#

Don't start your methods with a capital letter

buoyant viper
#

what is this, c#?

grizzled heron
dusk flicker
#

yes

grizzled heron
#

the captial letter aint at da start doe

dusk flicker
#

Yes, it is

astral nova
dusk flicker
#

The start of the method name

grizzled heron
#

i think i get whatcha mean doe

astral nova
#

private Resident mayor;

ivory sleet
#

ah it’s mutable

vocal cloud
#

functions are lowerCamelCase

astral nova
#
        if (!hasResident(mayor))
            return;
                
        this.mayor = mayor;
        
        TownyPerms.assignPermissions(mayor, null);    
    }```
ivory sleet
#

Which just sucks most of the time but kopselek might be the case the field is reassigned just so often

astral nova
#

its weird

#

when mayor is online

#

it returns correct

#

else it return my other player

#

who is mayor but not of this instance

ivory sleet
#

You just confused me

grizzled heron
#

it still aint working

astral nova
dusk flicker
#

well yeah that aint gonna solve your problem

#

But conventions

ivory sleet
#

So this other player is mayor also?

dusk flicker
#

What is your actual err CS?

astral nova
#
                        if(fractionOwner != "null") {
                            if(!manager.fileExists(directoryNations + "/" + name)) {
                                Nation nation = TownyUniverse.getInstance().getNation(name);
                                if(nation != null) {
                                    System.out.println(nation.getName());
                                    Resident king = nation.getKing();
                                    System.out.println(king.getPlayer().getName());
                                    System.out.println(Bukkit.getServer().getPlayer(king.getPlayer().getName()).isOnline());
                                    if(Bukkit.getServer().getPlayer(king.getPlayer().getName()).isOnline()) {
                                        info(resident.getPlayer(), "offert_send");
                                        //oferta wysyla sie do gracza nwm czemu ale King to kurwa kazdy gracz czy jak to dziala idk
                                    }else {
                                        info(resident.getPlayer(), "is_offline");
                                    }
                                } else {
                                    info(resident.getPlayer(), "wrong_nation");
                                }
                            }else {
                                info(resident.getPlayer(), "have_fraction");
                            }
                        }```
#

there is my code

ivory sleet
#

Then what the heck does setMayor do if there can be more than one!?

dusk flicker
#

null as a string 😕

astral nova
#

but from other instance

#

nah

#

only one mayor

#

possible

ivory sleet
#

Ok

grizzled heron
#

jsut the shi aint popping up

#

i get no compiler error or nun

#

the boss bar just int appearing

astral nova
#

so mayor of town is one, where mayor of capital is king

#

so it return other king

#

ugh

#

Nation nation = TownyUniverse.getInstance().getNation(name); return correct nation

#

maybe i will try to get capital and then get mayor

#
Resident king = capital.getMayor();```
#

🤔

#

now it works

#

that was so weird

ivory sleet
#

Programming at its finest

astral nova
#
  • this return null if mayor is offline
eternal oxide
#

It should not return null if the mayor is offline

astral nova
#

Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.getName()" because the return value of "com.palmergames.bukkit.towny.object.Resident.getPlayer()" is null

#

sure

eternal oxide
#

of course, you are getting a Player not a resident

#

resident/mayors/kings are always available

#

Players are Bukkit objects

astral nova
#

sure

#

player is null when he is offline?

#

🤔

eternal oxide
#

always

astral nova
#

ok

eternal oxide
#

With Towny you use Residents

astral nova
#

king have his own

#

method

subtle folio
#

Hey, I want to make a chat click event call a function, how would I go about do this java TextComponent Accept = new TextComponent(ChatColor.GRAY + " " + ChatColor.BOLD + "CLICK HERE " + ChatColor.GRAY + "to accept."); Accept.setClickEvent(doDuel(p, target)); Accept.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent[]{new TextComponent(ChatColor.GREEN + "Click to accept duel request")}));

astral nova
#

if(Bukkit.getServer().getOfflinePlayer(king.getName()).isOnline())

#

better?

eternal oxide
#

What exactly are you trying to do?

lost matrix
subtle folio
#

that seems silly, is there any other way?

astral nova
lost matrix
astral nova
#

okay there is method

#

lol

lost matrix
#

Its the only workaround

subtle folio
astral nova
#

okay

#

now it works

#

lol

minor otter
#

`
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.NotePlayEvent;

public class Blockupdate implements Listener {
@EventHandler
public void onNotePlayEvent(NotePlayEvent event) {
event.setCancelled(true);
}
}
`
trying to cancel the event of a noteblock being played, dont see whats wrong

astral nova
#

i think you have to use protocolib and block packet

#

if you can block it

buoyant viper
#

if i wanted to allow a player in a full server if they are on the whitelist, should i use PlayerLoginEvent? i could probably do something with AsyncPreLoginEvent but id rather have simple(r) access to a Player object

lost matrix
buoyant viper
#

then what purpose does PlayerLoginEvent serve

#

its not Deprecated so id imagine its used somewhere

ivory sleet
#

I mean PreLogin is literally before login

buoyant viper
#

but they both have a result field

#

that more or less share values

ivory sleet
#

And the login is I’d assume post login (or well during)

#

myeah

azure osprey
#

why doesn't it want to work for me ): I fixed the vector .equals problem, I even took out static for that one guy

lost matrix
#

Hm im not sure if the PlayerLoginEvent is early enough for this. But you can certainly try.

buoyant viper
#

their javadoc description is basically the same thing, save for AsyncPlayerPreLoginEvent saying... its async

hot warren
#

Has anyone ever made a tool that can automatically upload a Spigot plugin jar from Gradle/Maven

lost matrix
buoyant viper
#

so its effectively the same event just one is off-thread

#

?

ivory sleet
#

I don’t remember the implementation sadly

lost matrix
ivory sleet
#

^

buoyant viper
#

then their docs are real vague here

ivory sleet
#

Yeah

buoyant viper
#

share similar fields and are both Stores details for players attempting to log in.

buoyant viper
#

i dont think the wiki is of any help to me here

lost matrix
#

It explains what information client and server exchanged before, during and after login

#
    C→S: Handshake with Next State set to 2 (login)
    C→S: Login Start
    S→C: Encryption Request
    Client auth
    C→S: Encryption Response
    Server auth, both enable encryption
    S→C: Set Compression (optional)
    S→C: Login Success
buoyant viper
#

ill just see when each event runs ig

#

something doesnt sit right about shared fields and methods

lost matrix
buoyant viper
#

it makes me think theyre fired around the same time

lost matrix
#

"around the same time" sounds right

sharp storm
#

i dont thing this guys answer to my question is good

buoyant viper
#

it looks like Login is fired before PreLogin?

#

from a quick look @ STASH

ivory sleet
#

That’s strange

lost matrix
lost matrix
buoyant viper
lost matrix
#

That would make 0 sense

#

?stash

undone axleBOT
ivory sleet
#

Can we make some actual testing?

#

Like maybe a unit test?

sharp storm
vocal cloud
lost matrix
#

lol... just write a quick plugin and sysout "bip" and "bup"

buoyant viper
#

it looks like a fake player is created, in that calling PlayerLoginEvent

#

and if that event is successful, then calls AsyncPlayerPreLoginEvent

buoyant viper
vocal cloud
ivory sleet
#

?lmgfy cute dog pics

buoyant viper
#

well damn

ivory sleet
#

Argh why did they remove this god command

buoyant viper
#

maybe i didnt look at locations in stash very well

minor otter
#

how would I be able to stop players from increasing the note on a noteblock

#

what event handles that

buoyant viper
#

cancel an interact event?

lost matrix
#
  @Override
  public void onEnable() {
    Bukkit.getPluginManager().registerEvents(new Listener() {
      @EventHandler
      public void onLogin(PlayerLoginEvent event) {
        System.out.println("LOGIN: " + System.nanoTime());
      }
      @EventHandler
      public void onPreLogin(AsyncPlayerPreLoginEvent event) {
        System.out.println("PRE_LOGIN: " + System.nanoTime());
      }
    }, this);
  }

Resulting in

[GradleSpigotPlugin] [STDOUT] PRE_LOGIN: 29965234825400
[GradleSpigotPlugin] [STDOUT] LOGIN:     29965338829100
buoyant viper
#

ye

#

i mustve read stash wrong

ivory sleet
#

I’m thankful it wasn’t the other way around

#

Would’ve been a vulnerability 🥲

azure osprey
#

Hey Conclure how long have you been making plugins?

ivory sleet
#

Idk

#

I rarely make plugins

azure osprey
#

oh

ivory sleet
#

But like, I study programming and such (:

#

how about you?

azure osprey
#

about a month

#

it's fun to solve problems 🙂

ivory sleet
#

Ah, you have lots of fun ahead of you

buoyant viper
#

i guess if u dont need? the player object then PreLogin is the way to go, but since im just checking whitelist i might as well just get the player from the UUID in Pre

azure osprey
#

do you ever get stuck on something that by all metrics should work but still doesn't and it's not even complicated

ivory sleet
#

I have

azure osprey
#

I see, well I'll get back to it then, later

ivory sleet
#

Mostly when I try to design code before making it work

ivory sleet
lost matrix
little elm
#

Thoughts on making a Spigot plugin using Kotlin?

buoyant viper
vocal cloud
ivory sleet
#

Kotlin has some cool features

little elm
#

I see (: How does one go about doing it? I had trouble following some of the tutorials

ivory sleet
#

But both are in the same sandbox at the end of the day

minor otter
#

any idea how i could go about stopping the player from changing the note on a noteblock?

little elm
#

Any recommended tutorials?

ivory sleet
#

hmm

#

Look at gh repos x)

buoyant viper
vocal cloud
#

https://www.baeldung.com/kotlin/data-classes

minor otter
little elm
#

Oops I meant setting up Spigot with Kotlin, not using Kotlin itself

vocal cloud
#

Of course Java has them now too cause Java felt left out

ivory sleet
#

Yeah

#

Danny a first is ofc use gradle

vocal cloud
ivory sleet
#

?services

buoyant viper
#
@EventHandler
    private void onPreLogIn(AsyncPlayerPreLoginEvent event) {
        if (event.getLoginResult() != AsyncPlayerPreLoginEvent.Result.KICK_FULL) return;

        OfflinePlayer offlinePlayer = getPlugin().getServer().getOfflinePlayer(event.getUniqueId());
        if (!offlinePlayer.isWhitelisted()) return;

        event.allow();
    }``` something like this should work then right? to allow a whitelisted player in a full server
undone axleBOT
dusk flicker
#

?services

mint oracle
#

Ah

#

Ok

ivory sleet
#

Sadly the discord does not yet possess a channel for such things although I proposed it long time ago

little elm
ivory sleet
#

Because gradle supports kotlin really well

#

I don’t know how maven handles kotlin

#

But from what I’ve heard it’s scarce

buoyant viper
#

i think maven has an archetype for it

sly trout
#

how do i get the blockface opposited direction to a blockface?

dusk flicker
#

I think its finally time for me to learn gradle and maybe use it in a project

lost matrix
little elm
#

Hmm if anyone has used Kotlin here, does anyone have a tutorial they followed that worked?

lost matrix
#

getOppositeFace()

lost matrix
ivory sleet
#

Two instances @little elm

#

Lol yeah gradle gets complicated if you wanna understand its entirety

little elm
#

thank you!

#

I think my main issue is that I have no clue how to set it up on my IDE (Intellij). For a Java spigot plugin, there are plenty of tutorials, and even an IntelliJ plugin that does everything for you

ivory sleet
#

File | New Project | Gradle | Mark Kotlin DSL (at the very top) and Kotlin JVM (will be existing among the other alternatives lower down) |

#

That’s it (:

little elm
#

omg thank you LOL i really needed that

#

all the tutorials are in german for somer eason

ivory sleet
#

lol

buoyant viper
lost matrix
#

I mean writing a spigot plugin is basically done like every other java application.
You add spigot as a dependency, then write code and compile it to a jar. Not much to it.
So if you know how to use kotlin with dependencies you also know how to write Spigot plugins with kotlin.

little elm
buoyant viper
#

well ill be damned using PlayerLoginEvent did it instead sadge

lost matrix
buoyant viper
#

thank u bukkit u dont make sense to me rn

little elm
#

wow gotcha tyty

buoyant viper
#

letting a player join if whitelisted and server is full

#

i thought i could just grab an OfflinePlayer from the UUID in the Async one

#

but that ended up not working

#

i could be grabbing the player incorrectly

lost matrix
buoyant viper
#

nope

lost matrix
buoyant viper
#

nope

#

that was first thing i looked for

lost matrix
# buoyant viper nope

Then there shouldnt be any problem. I think you need to handle the result of the async event a bit further

buoyant viper
#

could i grab a Player object at that point? or would it have to be Offline

buoyant viper
torn shuttle
#

quick q is there a way to add items to a player in a way that will drop them if the inventory is full without handling that case manually?

lethal coral
#

do remappings not exist for spigot 1.8.8?

dusk flicker
#

no

buoyant viper
#

nah

lethal coral
#

then what should I use

lost matrix
# buoyant viper how else could i even handle it
      @EventHandler
      public void onPreLogin(AsyncPlayerPreLoginEvent event) {
        UUID userID = event.getUniqueId();
        OfflinePlayer player = Bukkit.getOfflinePlayer(userID);
        if (bypassingRestriction(player)) {
          event.setLoginResult(Result.ALLOWED);
          event.allow();
        }
      }
dusk flicker
#

1.18

lethal coral
buoyant viper
#

oh i need to change the login result too?

quasi patrol
buoyant viper
#

haha woops

lost matrix
lethal coral
buoyant viper
lethal coral
lost matrix
lethal coral
#

for the third time...

#

😆

ivory sleet
#

I mean it does solve your problem?

lethal coral
#

It doesn't, as I want to use 1.8.8

dusk flicker
#

yikes

ivory sleet
#

Your problem was that you wanted moj maps?

#

In which it in fact solves your problem

dusk flicker
lost matrix
lethal coral
#

Any suggestions you guys have as alternatives to gain that much access?

dusk flicker
#

1.18

lethal coral
#

Thank you for your help!

ivory sleet
#

Could just roll with 1.8.8 spigot mappings (still fuck 1.8.8 literally)

dusk flicker
#

or any recent ver for that matter

#

you are welcome

quaint mantle
#

Questiob how do I launch maven there's no exe and I am quite the literal idiot

ivory sleet
#

Well just the jar itself

dusk flicker
buoyant viper
dusk flicker
#

mvn

buoyant viper
#

i thought it was using Async Pre

#

not Login

lethal coral
little elm
ivory sleet
#

Errrr

#

Bukkit

dusk flicker
#

yikes

lethal coral
quaint mantle
#

So how do I open maven?

little elm
ivory sleet
#

Use the spigot variant

lost matrix
ivory sleet
#

Bukkit is cough obsolete

buoyant viper
dusk flicker
#

yet people still work with bukkit

#

for some reason

lost matrix
buoyant viper
#

yea

#

PreLogin's result by default was ALLOWED so it wasnt even changing anything

lost matrix
quaint mantle
#

So I'm starting out with no experience whatsoever how do I get started for 1.16.5 since that's the server I'm using

lavish hemlock
#

?learnjava

undone axleBOT
buoyant viper
#

?learnjava and

undone axleBOT
buoyant viper
#

?jd

lost matrix
#

?bt

undone axleBOT
lost matrix
#

?di

undone axleBOT
lavish hemlock
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

buoyant viper
#

?google

undone axleBOT
quaint mantle
#

Thank you

lavish hemlock
#

?xy

undone axleBOT
lost matrix
#

?stash

undone axleBOT
lavish hemlock
#

The mods: "fucking stop"

ivory sleet
#

Such beautiful composition of commands

buoyant viper
dusk flicker
#

lmao

#

I miss ?cc

lost matrix
#

Btw is there a list of commands?

dusk flicker
#

not anymore

lost matrix
#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

dusk flicker
#

Use to be ?cc but it got disabled for some reason

lost matrix
#

?cc

#

Maybe just for us plebs.

ivory sleet
#

Ye there’s

#

Just unavailable for you guys

lost matrix
#

Conclure?

buoyant viper
#

?clean-code

undone axleBOT
lavish hemlock
ivory sleet
#

Hehe

dusk flicker
#

Conclure can you run all of of the commands and pin them

#

lol

lavish hemlock
#

?basics

undone axleBOT
lavish hemlock
#

huh

#

learnjava alias

#

ooh

dusk flicker
#

?details

undone axleBOT
#

Please provide your server version, relevant server logs ( https://paste.md-5.net/ ), a list of plugins, and what you've already tried doing.

ivory sleet
lost matrix
#

?cba 7smile7

undone axleBOT
#

Flo | Gestankbratwurst#4120 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.

lavish hemlock
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
ivory sleet
#

But maybe some day

buoyant viper
#

?cba sativa

undone axleBOT
#

tiva#0001 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.

dusk flicker
#

I mean do 5 CC commands

#

and just do each page and pin it

ivory sleet
#

Good point, I’ll consider doing it once I get some time over

dusk flicker
#

pog

ivory sleet
#

very pog

errant drift
#

@quaint mantle 😲

lavish hemlock
#

I'm gonna like this one

#

?conventions

undone axleBOT
lavish hemlock
#

: )

dusk flicker
#

LOL I FORGOT

#

?bing

undone axleBOT
buoyant viper
#

?ddg

lavish hemlock
#

?duckduckgo

buoyant viper
ivory sleet
#

Oh

#

?issamreal

undone axleBOT
#

Yes Sam is real. I was not programmed to say this by Sam.

dusk flicker
#

Im surprised that joke is still in

#

?ischocoreal

undone axleBOT
#

No, Choco is not real. I was not programmed to say this by Sam.

lost matrix
#

I gonna remember this
?codeblock

dusk flicker
#

Old response to the ischocoreal was the best

lost matrix
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
quaint mantle
#

Gotten this far already

dusk flicker
#

oh my god codeblock THATS SO USEFUL

buoyant viper
lavish hemlock
#

?paste

undone axleBOT
dusk flicker
#

true

quaint mantle
#

That's off my desktop so yes?

dusk flicker
#

but for small stuff code blocks are fine

buoyant viper
#

what

#

i meant like the OneDrive folder

#

ive never seen the Status field before in explorer

quaint mantle
#

Onedrive is full..

#

Again

little elm
#

how are yall sending images? i dont have an option for that on this channel particularly

dusk flicker
#

verify

lavish hemlock
#

You need to verify

buoyant viper
#

as long as u didnt run it in OneDrive folder

quaint mantle
#

31,869 sync issues XD

dusk flicker
#

we need like ?sendimage bot auto response lol

buoyant viper
#

i do wonder what Status is though

dusk flicker
#

to auto do responses for it lol

buoyant viper
#

?picperms

dusk flicker
#

Conclure u should add one

ivory sleet
#

Maybe :3

#

Btw for anyone who asked

dusk flicker
#

Pog

#

Never knew main was added as a command, interesting

ivory sleet
#

Neither did I

lavish hemlock
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

buoyant viper
#

?readup

undone axleBOT
#

If you read up you might be able to find the answer to your question :)

dusk flicker
#

?tas

undone axleBOT
buoyant viper
#

aw it doesnt embed

dusk flicker
#

oh my god

#

didnt know half of these existed

buoyant viper
#

?fixmuhlag

undone axleBOT
buoyant viper
#

hang on

dusk flicker
#

thats good but now outdated

#

Any chance you can pin those cmds Conclure?

ivory sleet
#

Hmm yeah, I’ll consider it, like that’ll be annoying to maintain

lost matrix
lavish hemlock
#

Why not just

dusk flicker
lavish hemlock
#

Allow people to use ?cc list

buoyant viper
#

what if u just added back a commands list for every1

lavish hemlock
#

Yeah lol

dusk flicker
#

fr

ivory sleet
#

Yeah maow

dusk flicker
#

ssamjh

#

pls

ivory sleet
#

idk I don’t mess with permissions

dusk flicker
#

That's sams job

ivory sleet
#

Yup

little elm
#

is there something wrong with my directories? I get an error that my plugin.yml cannot be found.

    ... 15 more```
lavish hemlock
#

Your configuration is probably fucked

ivory sleet
#

How do you build?

#

Don’t use artifacts if you do that btw

lavish hemlock
#

Build with Gradle not IntelliJ btw

ivory sleet
#

^

little elm
#

Oh ok. Yeah I just use IntelliJ and Build Artifacts

lost matrix
little elm
#

wow i am clueless

little elm
lavish hemlock
#

uhh it's in settings I believe

#

but you should probably also add a configuration in the top right

#

that runs the build task from Gradle

sly trout
#

on BlockBreakEvent
how do you get the BlockFace that the block was broken

#

i made @EventHandler public void onInteract(PlayerInteractEvent e) { if(e.getAction() == Action.LEFT_CLICK_BLOCK) { blockFaceTouched.put(e.getPlayer().getUniqueId(), e.getBlockFace()); } }

#

but that's kinda crappy

lost matrix
sly trout
#

ray trace bruh that's so complicated XD

dusk flicker
#

not really

lost matrix
#

Something like this is fine:

  private final Map<UUID, BlockFace> faceMap = new HashMap<>();
  
  @EventHandler
  public void onInteract(PlayerInteractEvent event) {
    faceMap.put(event.getPlayer().getUniqueId(), event.getBlockFace());
  }

  @EventHandler
  public void onBreak(BlockBreakEvent event) {
    BlockFace brokenFace = faceMap.get(event.getPlayer().getUniqueId());
    // Do stuff
  }
#

Or trace it

  @EventHandler
  public void onBreak(BlockBreakEvent event) {
    Player player = event.getPlayer();
    RayTraceResult result = player.rayTraceBlocks(4.0);
    if (result != null) {
      BlockFace face = result.getHitBlockFace(); // Might still be null
    }
  }
torn shuttle
#

ok so the most random thing just happened

#

a jetbrains rep hopped on my twitch stream while I was doing some dev work and gifted me a year sub with all of jetbrains products

lost matrix
#

lul...

#

Just be a student. All jetbrains products for free 😄

torn shuttle
#

can't be a student forever

forest edge
#

Does anyone know what the hash is used for when sending a resource pack?

analog prairie
#

Why event.getPlayer().getStatistic(Statistic.MINE_BLOCK) is null?

dusk flicker
#

check the javadocs

#

?jd

lost matrix
lost matrix
#

Or you didnt mine any blocks so far 😄

forest edge
lost matrix
#

If the server changed his rp or the client changed his rp

analog prairie
lost matrix
azure osprey
#

@ivory sleet I did it! 🙂

forest edge
analog prairie
#

Statistic.MINE_BLOCK.getType()?

forest edge
crystal magnet
#

Just checking:

crystal magnet
#

?main

minor otter
#

In the interact event, how would i test if the player is just breaking the block instead of interacting with it

forest edge
grizzled heron
#

yo

#

how do i make the bars progress move contuniously

#

for bossbar

#

i tried this

#
            if (line > 100){
                line = 0;
            }```
#

but dat shit dont work cuh

little elm
#

If I create a class that implements Listener, is it okay to create instances of that class in my code?

forest edge
# grizzled heron how do i make the bars progress move contuniously

Look up runnables (BukkitRunnables) online. Right now, your loop is running on the same tick (time interval), so each progression that it makes will happen instantaneously and you wont be able to see it as a player. You need to use a runnable to run tasks on a timer every x ticks/seconds to have it spaced out like an animation.

forest edge
grizzled heron
#

No candidates found for method call Bukkit.getScheduler().sheduleSyncRepeatingTask(this, new Runnable() { public void run(){ line = line - time; if(line =0){ count++; line = 1.0; } } }).

#

aw hell naw...

forest edge
#

Does anyone have a good method to force a resource pack but also kick a player with a message if they haven't accepted the resource pack? I'm currently listening to ResourcePackStatusEvent and PlayerJoinEvent to send the resource pack and then see the status, then I have a runnable running 2.5 seconds later to see if the player has accepted the resource pack. This does not seem to work on servers where players may have bad ping. For example, it works on my test server (0ms) but not a server hosted in Germany while I am in the us (100+ ms). It seems that if I kick a player before they fully load in, it gives them an "IOexeption" message instead of my kick message, which is where I am going wrong. Any ideas?

forest edge
grizzled heron
#

all of it?

#
    public void cast(){
       int task = 0;
       double time = 1.0/30;
        bar.setProgress(line);
        task = Bukkit.getScheduler().sheduleSyncRepeatingTask(this, new Runnable() {
        public void run(){
            line = line - time;
            if(line <=0){
                count++;
                line = 1.0;
            }
        }
        },0,20);
    }```
waxen plinth
#

Don't do new Runnable()

#

And the way you set that up, it'll be running once per second, I believe

#

It's also not updating the bar

#

It's just changing the value of the variable, but you have to call bar.setProgress again

#

You want:

grizzled heron
#

i changed the variable because thats what the bars progress takes

waxen plinth
#
Bukkit.getScheduler().scheduleSyncRepeatingTask(pluginHere, () -> {
  line -= time;
  if (line <= 0) {
    count++;
    line = 1;
  }
  bar.setProgress(line);
}, 0, 20);```
grizzled heron
#

bar.setProgress(line)

waxen plinth
#

The reason I put pluginHere and not this is because this is only a valid value to pass there if you're in your plugin main class - if you're not, you will need to get an instance of the plugin

grizzled heron
#

aight cuh

#

lemme test this shit out

#

dam son

#

my whole bar dissapeared

#

oh wait.

#

i didnt call the function

#

thats why

#

nvm cuh

#

even with it called my bar is gone

#

ong

minor otter
#

how would I go about changing the hardness of a block

waxen plinth
#

You wouldn't

minor otter
#

ok

waxen plinth
grizzled heron
forest edge
#

a bit tedious but I'm sure there are threads about it online

waxen plinth
grizzled heron
#

I have to add them again?

#

cuz the bar worked before

#
        bar.addplayer(e.getPlayer());
    }```
#

ive had this

#

and its working

waxen plinth
#

If the server is reloaded then online players will not be sent the new boss bar

#

Or if the bar is created while players are already online

minor otter
quasi patrol
#

Line 21 of FastStats is new hookeddiscordexpansion(this).register(); btw.

waxen plinth
#

Looks like it relies on a library, Bson, that's not loaded at runtime

quasi patrol
waxen plinth
#

Shade it or load it at runtime

quasi patrol
waxen plinth
#

No lol

#

You using maven/gradle?

quasi patrol
waxen plinth
#

Then look up a guide on how to shade with maven

#

I use gradle so I wouldn't know

lavish hemlock
quasi patrol
#

Ok.

#

Lets see if I get another error. .-.

boreal sparrow
#

any idea on how to disable punching in a world

#

i dont want players in my parkour to punch eachother off

vocal cloud
#

Just cancel entity damage entity event

boreal sparrow
#

yea but i have a hunter with a bow that should be able to shoot them :/

drowsy helm
#

check if they are the hunter

vocal cloud
#

Then only cancel it for the players parkouring