#development

1 messages · Page 102 of 1

dusky harness
#

theres isClosedForSend but u have to do the opt in thingy

#

theres a function to send data while catching errors, but idk how i'd detect a disconnect right away

#

i could use ping the client but

in the docs it says that it handles close and ping/pong stuff unless its a raw web socket session

dusky harness
#

fixed

#

just added a loop to check if the coroutine is active or not

formal crane
#

How do i loop through a config list and do something with every string ?

pure crater
#

you gotta be more specific here

#

show some code

formal crane
#

I tried this but it didnt work as planned, it put everything in one item and not in multiple items:

        for(Object object : listobjects) {

            ItemStack obj = new ItemStack(Material.SKULL_ITEM);

            List<String> objLore = new ArrayList<>();
            objLore.add(Format.chat("&7Rechter muisklik om te openen!"));
            ItemMeta objMeta = obj.getItemMeta();
            objMeta.setDisplayName(Format.chat("&a" + object.toString()));
            objMeta.setLore(objLore);
            obj.setItemMeta(objMeta);

            inv.setItem(i, obj);
            i++;
        }```
#

it gives this but i want it to be seperated items

pure crater
#

thats cause you are using toString

#

on a list

#

and you are getting your objects using the get method which is returning a list

#

Use the getList method instead

formal crane
#

instead of Collections.singetonList ?

pure crater
#

you seem to be getting confused here

formal crane
#

yes

pure crater
#

Collections.singletonList shouldnt be involved

#

show your full code

formal crane
pure crater
#

Yeah no <Collections.singletonList(Data.getCustomConfig1().getStringList("player-data." + p.getUniqueId()));>

#

dont do that

#

final List<String> list = Data.getCustomConfig1().getStringList("player-data." + p.getUniqueId());

#

then loop through elements of list

#

and also please actually use managers rather than static abuse

formal crane
formal crane
pure crater
#

// :copyright: RazerStorm Production's why

#

lmao

formal crane
#

idk

#

xd

pure crater
#

you are making your config static

#

when it can just be a manager class

#

like configmanager

formal crane
formal crane
pure crater
#

ok

arctic holly
#

Hey anyone can help me with this that would be wonderful
I have an NPC plugin that uses craftworld and craftserver i want to set up a PlayerInteractionEvent but I can't figure out how to make it specifically work with only the NPC it still works on the NPC but when I click a grass or anything else it still works anyway to block everything else but keep the NPC

plucky delta
#

Can I transfer a Skull BLOCK to a Skull Item?

leaden sinew
#

I'm probably being dumb, but why is this only saving the last insert? (MySQL)

            for (final BlockPosition blockPosition : blockPositions) {

                final int x = blockPosition.x();
                final int y = blockPosition.y();
                final int z = blockPosition.z();

                statement.setString(1, uuidString);
                statement.setLong(2, chunkKey);
                statement.setInt(3, x);
                statement.setInt(4, y);
                statement.setInt(5, z);
                statement.setInt(6, x);
                statement.setInt(7, y);
                statement.setInt(8, z);

                this.plugin.logger().error("Saved block: " + blockPosition);

                statement.addBatch();
            }

            this.plugin.logger().error("Executing batch");
            statement.executeBatch();

The statement is

 "INSERT INTO " + TABLE_NAME + "(" +
                    WORLD_UUID_COLUMN + ", " +
                    CHUNK_KEY_COLUMN + ", " +
                    POSITION_X_COLUMN + ", " +
                    POSITION_Y_COLUMN + ", " +
                    POSITION_Z_COLUMN + ") " +
                    "VALUES (?,?,?,?,?) " +
                    "ON DUPLICATE KEY UPDATE " +
                    POSITION_X_COLUMN + "=?, " +
                    POSITION_Y_COLUMN + "=?, " +
                    POSITION_Z_COLUMN + "=?";
#

I'm also using HikariCP if that helps

#

I am dumb

#

I set up the keys wrong

lyric gyro
#

yeah i was about to say

leaden sinew
#

I'm too tired for this lol

untold path
#

Does anyone know how to hook into MVdWPlaceholderAPI? I copied the repository and dependency on the SpigotMC page, but it does not seem to work...

frail bramble
#

Can anyone help with bungee supervanish?

untold path
#

I don't think SuperVanish has BungeeCord support.

dense drift
#

Mvdw is deprecated, Maxim's plugins use PAPI

lyric gyro
#

What is the event to listen to command executed on proxy from console.

#

@dense drift I saw you asked the same question before. ChatEvent is for player commands. I wanna get console executed commands.

formal crane
#

How do i make an exact copy of a item?

#

so it contains all the data

dense drift
#

.clone()

formal crane
#

ty

#

How do i check if a material is a tool?

broken elbow
formal crane
#

How do i create a set?

dusky harness
#

u can probably just take the material name and check if it ends with AXE, SHOVEL, etc

broken elbow
#

that is also an option yeah. but problem with that is youd still need to have to make like 7-8 cchecks bcz there's other tools as well

#

Set<Material> tools = new Set(Material.FIRST_TOOL, Material.SECOND_TOOL);

broken elbow
#

sheers, fishing rod

dusky harness
#

oh

broken elbow
#

what others are there. only those probably unless carrot on a stick is also considered a tool

formal crane
#

it is

#

i am getting this error

broken elbow
#

right. bcz I know java xD

dusky harness
#

try EnumSet

#

d;java.util.EnumSet

uneven lanternBOT
#
public static interface Map.Entry```
Map.Entry has 2 implementing classes, and  7 methods.
Description:

A map entry (key-value pair). The Map.entrySet method returns a collection-view of the map, whose elements are of this class. The only way to obtain a reference to a map entry is from the iterator of this collection-view. These Map.Entry objects are valid only for the duration of the iteration; more formally, the behavior of a map entry is undefined if the backing map has been modified after the entry was returned by the iterator, except through the setValue operation on the map entry.

Since:

1.2

dusky harness
wheat carbon
#

not sure why that's not working

formal crane
#

I am getting a null error that is saying that this is null:

                        || !playerItem.getType().toString().contains("BOW")
                        || !playerItem.getType().toString().contains("HELMET")
                        || !playerItem.getType().toString().contains("CHESTPLATE")
                        || !playerItem.getType().toString().contains("LEGGINGS")
                        || !playerItem.getType().toString().contains("BOOTS")) {

                    return;
                }```
sterile hinge
#

"this" isn't null

#

you should be more precise

#

also, use tags for stuff like that

dusky harness
proud pebble
#

if (playerItem == null) { return; }

formal crane
#

I am 100% sure the itemtype contains SWORD but it still says it doesnt

shell moon
#

I doubt the item material name includes the words sword, bow, helmet, chestplate, leggings and boots at the same time, you'd better use && instead of ||
Quick question: PlaceholderAPI.setPlaceholder(p,text) translates hex or color codes?

leaden sinew
dense drift
#

Armor is also damageable

#

@lyric gyro no idea, sorry

lyric gyro
#

Oh okay no problem

formal crane
#

So i have a command in my plugin but the player and also the console must be able to execute it, but i have the Player p = (Player) sender; in my code and i don't know how i can make it compatible with both

broken elbow
#

only cast if you're sure the sender is a player

#

so check if sender is insatnceof Player

formal crane
#

tried that but i don't think it was right

#

i tried:

        ConsoleCommandSender console = null;
        if(sender instanceof Player){
            p = (Player) sender;
        }else {
            console = (ConsoleCommandSender) sender;
        }```
proud pebble
#

afaik you can have only 1 instances of each event, whats the best way to pass through data from other classes so that i dont have 1000 lines in my event class?

median glen
#

Hi guys, can you please give me a hint on setting up a modern MC plugin development environment?
What i am used to is using IntelliJ IDEA, Java SE 8, Gradle and the Spigot API.
But AFAIK there is modern Java like SE 17, should be a lot more modern than the 8. What version can I use? What are the restrictions and conditions?

graceful hedge
#

A java class with the java version x and a jvm instance with java version y you get the compatibility
x <= y

median glen
#

I don't understand how that would help me.

proud pebble
#

you wanna support 1.8 to 1.17? use java 8

graceful hedge
#

You might be able to use java 17 to compile your plugin, however that also requires your server to run java 17

median glen
graceful hedge
#

However, you can still compile your plugin to a lower version like java 11 and still be able to run your plugin on a server that runs java 17 or java 11 (or something in between)

graceful hedge
#

but depending version certain things might not be compatible at all

median glen
#

I am confused, so can a server owner choose what version of java do they want to run their minecraft server instance on?

broken elbow
#

tho

#

on spigot for example you are limited

#

on older versions

#

for example on spigot 1.13 you can only have up to java 11

dense drift
#

Who cares about spigot 🤡

broken elbow
#

paper lifts those limitations I believe tho

#

yeah

#

exactly what gaby said

median glen
broken elbow
#

the thing I'd recommend you use newer versions of java for public plugins. I usually do at least 11.

pure crater
#

If you are coding your plugin only for 1.17 tho, just use java 16

median glen
pure crater
#

Well Java 16 is the min for 1.17

#

If you use java 17, the server owners have to run java 17 too, but that's good tbh

#

Because 1.18 is going to have Java 17 as minimum anyways

median glen
#

Okay so let's say MC server is 1.17.
How can the server owner tell which version of java is he hosting the server on?

pure crater
#

1.17 MC servers can only run in java 16 and above

#

it cant run anything below

#

or else it will crash

median glen
#

Okay, great, but still how can I tell the java version on a server? (owner is a friend so can access the server)

pure crater
#

Programmatically or in general?

#

you can run java --version

#

if its in general

median glen
#

in linux terminal right?

pure crater
#

Yes

median glen
#

Great, thank you.
And if he installs the latest Java LTS (SE 17), will everything work correctly as if it would run on an earlier Java version? I mean plugins written for Java 8, etc.

pure crater
#

some plugins use NMS

#

But otherwise, for the most part, yes

#

(if they use only api)

median glen
#

Ah what I meant is that his current 1.17 server, if he runs java 16, change to java 17 would not make anything go wrong

pure crater
#

Yes, actually. Is he using the --ilegal-permit flag?

median glen
#

Sorry, help me out with that flag

pure crater
#

Like when he runs his server

#

with jvm arguments

#

does he include that too?

#

also this doesnt seem to be development related, maybe lets move to #minecraft

dusky harness
broken elbow
#

yeah. its what I found out yesterday lol

manic wharf
#

anyone got a Deluxemenus Config already Configed that i can use for my server ?

edgy bobcat
#

anyone have issues with unresolved references when trying to compile a module in intellij that depends on another module in the same project?

I've run maven install on the project i need as a dependency and I see it in my .m2 folder, however when compiling the second project it gives me unresolved reference errors and fails to compile

maiden igloo
#

o/ question. anyone knows a good, up-to-date item nbt api? i did some searching but what i found was either too old or too bloated with unnecessary stuff

plucky delta
#

how to convert SKull block to SKull item

hard wigeon
#

d;health

uneven lanternBOT
#
public class ThreadLocal
extends Object```
ThreadLocal has 1 extensions, 6 methods, and  1 sub classes.
Description:

This class provides thread-local variables. These variables differ from their normal counterparts in that each thread that accesses one (via its get or set method) has its own, independently initialized copy of the variable. ThreadLocal instances are typically private static fields in classes that wish to associate state with a thread (e.g., a user ID or Transaction ID).

For example, the class below generates unique identifiers local to each thread. A thread's id is assigned the first time it invokes ThreadId.get() and remains unchanged on subsequent calls.

Each thread holds an implicit reference to its copy of a thread-local variable as long as the thread is alive and the ThreadLocal instance is accessible; after a thread goes away, all of its copies of thread-local instances are subject to garbage collection (unless other references to these copies exist).

Since:

1.2

hard wigeon
#

d;spigot health

uneven lanternBOT
#
public final class HelpTopicComparator
extends Object
implements Comparator<HelpTopic>```
HelpTopicComparator has 1 extensions, 1 implementations, 3 methods, and  2 all implementations.
Description:

Used to impose a custom total ordering on help topics.

All topics are listed in alphabetic order, but topics that start with a slash come after topics that don't.

hard wigeon
#

d;spigot EntityHealth

uneven lanternBOT
#
public class EntityChangeBlockEvent
extends EntityEvent
implements Cancellable```
EntityChangeBlockEvent has 1 extensions, 1 implementations, 8 methods, 1 all implementations, and  1 sub classes.
Description:

Called when any Entity changes a block and a more specific event is not available.

lyric gyro
#

#bot-commands

edgy bobcat
#

Just ctrl + click it in your ide

lyric gyro
#

I mean he could be on the phone

dusky harness
#

are there "official" or widely used naming conventions in sql? i keep finding a bunch of things
ex when looking for tables i found "Something", "something_else", "SOMETHING", etc so idk which one is best to use ;-;

#

or is it just do-whatever-you-want

lyric gyro
#

I personally go with snake_case

#

I think that's what it's called

dusky harness
#

what about columns?

leaden sinew
#

That's what I use

broken elbow
hard wigeon
#

Was looking for all events that contained health

#

But failed

#

Miserably

fiery pollen
#

if you use Bukkit.getOfflinePlayer(uuid); Can i do this with a uuid of a player that hasn't joined before.

broken elbow
#

yeah. the javadocs say that it will return an object even if the player does not exist

edgy bobcat
#

Always use capitals for SQL :P

fiery pollen
broken elbow
#

probably. you'll have to try

#

But I believe the answer is yes

fiery pollen
#

Okay i'll try

fiery pollen
marble nimbus
#

bump :c

lyric gyro
#

Uh doesn't shadowjar relocate all already? Even transitive ones?

median glen
#

Can you recommend me a good/standard .editorconfig file for Java/Minecraft plugin development?
(Like I would recommend dotnet/roslyn's .editorconfig for C# development.)
(Bonus question: does Intellij IDEA support it? 😄 It should I guess)

tight junco
#

I believe intellij does support it

median glen
#

Is this a correct gitignore file? I'm using gradle + IDEA

# out folder
output/

# Gradle
.gradle/
build/

# IDEA
.idea/
*.iml
#

Because that way, these are getting commited, I guess it's fine

tight junco
#

yeah you want those to get committed

median glen
#

I need some help with gradle, a new version seems to work differently than old, and I am getting error:

#

So my plugin.yml is like this and this script used to work

main: arphox.JumpCounter.JumpCounter
api-version: 1.16
name: @name@
version: @version@
author: @author@
dusky harness
honest spoke
#

In Kotlin, I can't search a MatchGroupCollection by name anymore, it just throws an UnsupportedOperationException: Retrieving groups by name is not supported on this platform. Any ideas?

median glen
dusky harness
#

processResources {}

median glen
dusky harness
#

np

lavish vessel
#

Anyone have a clue why depend does nothing and my plugin loads after vault?

honest spoke
#

If you depend on vault, your plugin should start after vault

lavish vessel
#

Sorry, I meant the other way around 😅 Vault loads after my plugin!

#

I do get org.bukkit.plugin.UnknownDependencyException: Vault if Vault doesn't exist at all

broken elbow
#

maybe youve given it the wrong name in the plugin.yml? its case sensitive I believe

lavish vessel
#

depend: [ Vault ]

broken elbow
#

nvm. that looks god

#

good

robust flower
#

What is the most idiomatic way of flattening a Option<Pair<A, Option<B>>> to Option<Pair<A, B>> using arrow? This is the code were I want to apply that

fun playerDisconnect(player: Player) {
    activeDungeons.remove(player.uniqueId) // returns a String?
        ?.let { dungeonRepo.getDungeon(it) } // returns an Option<Dungeon>
        ?.tap {
            dungeonRepo.getLastLevel(it)  // I need to somehow zip the "Dungeon" with this Option<Level> (returned by the getLastLevel), and use both, or none of the two, if there's no last level
            // filter the result using levelSpawnsManager#isLevelComplete, passing the Level I just got as argument
            // then run these methods after
            levelSpawnsManager.cancelDungeonSpawns(dungeon)
            levelSpawnsManager.resetCompletedLevels(dungeon)
            player.runLogoffCommands(dungeon)
        }
}```
lavish vessel
#

Any clues then on whats happening?

icy shadow
robust flower
#

No, there's no error there, I need both Dungeon and Level, or none of them, so it is really an Option

#
fun isLevelComplete(dungeon: Dungeon, level: Level): Boolean =
        level.id in completedLevels[dungeon.name]``` I'll use both to check for the completion of the level, and if it's *not* completed then I would like to run the three method calls on the `tap` method
#
fun playerDisconnect(player: Player) {
    activeDungeons.remove(player.uniqueId).toOption()
        .flatMap { dungeonRepo.getDungeon(it) }
        .flatMap { dungeonRepo.getLastLevel(it).map { level -> it to level } }
        .filterNot { (dungeon, level) -> isLevelComplete(dungeon, level) }
        .tap { (dungeon, _) ->
            levelSpawnsManager.cancelDungeonSpawns(dungeon)
            levelSpawnsManager.resetCompletedLevels(dungeon)
            player.runLogoffCommands(dungeon)
        }
}``` this is what I got so far, it works, but doesn't look exactly idiomatic since I had to use `map` inside `flatMap`
icy shadow
#

hm, there's not much you could do, perhaps remove the filterNot onto the getLastLevel directly

#

Then you never need to deal with a pair

median glen
#

Argh help me how to broadcast a simple string please 😄 it has been deprecated what I used before

#

This is deprecated this.getServer().broadcastMessage("hello world");

pure crater
#

i think it is changed to be components

#

d;paper Server#broadcastMessage

uneven lanternBOT
pure crater
#

Yep, you have to use the Component API

#

do something like Component.text("Hello World")

median glen
pure crater
#

all raw String's and stuff have been replace with components

median glen
pure crater
#

let me show u

lyric gyro
#

I mean not because of that

pure crater
lyric gyro
#

Because the game hasn't used strings to represent text for over 7 years

pure crater
#

^ lol

robust flower
# icy shadow hm, there's not much you could do, perhaps remove the filterNot onto the getLast...

You mean something like this?kt fun playerDisconnect(player: Player) { activeDungeons.remove(player.uniqueId).toOption() .flatMap { dungeonRepo.getDungeon(it) } .filter { dungeonRepo.getLastLevel(it).map { level -> !isLevelComplete(it, level) }.getOrElse { false } } .tap { levelSpawnsManager.cancelDungeonSpawns(it) levelSpawnsManager.resetCompletedLevels(it) player.runLogoffCommands(it) } }

lyric gyro
#

Because the game internally has been using components but Bukkit is dumb fuck to push legacy text since then

sage thorn
#

hey, i got an issue when trying to connect to my mariadb database:

Current charset is UTF-8. If password has been set using other charset, consider using option 'passwordCharacterEncoding'

#

it denies me access and it says this

robust flower
#

password is wrong probably (or at least is what this message seems to indicate)

sage thorn
#

no it isnt i double checked

robust flower
#

then idk

median glen
#

What is the modern way to format strings in Java?
I would like something similar to C#: $"Hi {name}, how are you today?"

#

because the percentage stuff look awful

pure crater
#

formatted

#

or String.format

#

depending on your java version

median glen
#

16

pure crater
#

Ok nice

robust flower
pure crater
#

d;String#formatted

uneven lanternBOT
#
public String formatted(Object... args)```
Description:

Formats using this string as the format string, and the supplied arguments.

Since:

15

Returns:

A formatted string

Parameters:

args - Arguments referenced by the format specifiers in this string.

pure crater
#

There

#

"something %s".formatted(s)

median glen
#

Like this?

    @EventHandler
    public void onPlayerJump(PlayerJumpEvent event) {
        jumpCounter++;
        event.getPlayer().sendMessage("JumpCounter: %s.".formatted(jumpCounter));
    }
pure crater
#

Yes

median glen
#

Thank you

pure crater
#

Format actually has different thing for each percent too

#

it checks for the specific type

lyric gyro
#

you can do very silly things, it's pretty cool

pure crater
#

Mhm lol

lyric gyro
#

Not much I would say other than a) make sure to run the jvm with the -Dfile.encoding=UTF-8 flag and b) make sure the file is saved with UTF-8 encoding as well

icy shadow
#

I think

lyric gyro
#

do you?

broken elbow
#

no he doesn't

graceful hedge
formal crane
#

how do i get a skull using the base64 system?

brittle thunder
#

Anyone aware of a kotlin compiler API similar to javac api?

pulsar ferry
brittle thunder
#

Not to execute it like with kts, just to compile to bytecode

pulsar ferry
#

Oh hmm I'm don't know that ugh

brittle thunder
#

💀

median glen
#

Why do I get these kind of errors? Should I care?
Enabled plugin with unregistered PluginClassLoader
I literally created a new dummy plugin and enabling-disabling it to test how it behaves.

sterile hinge
#

show your code

median glen
#

Not necessary, if someone knows this problem, they will know why it happens. My code is literally a new, empty plugin.

sterile hinge
#

glhf

limber hedge
#

Hi,

    public void inject(Player player) {
        CraftPlayer craftPlayer = ((CraftPlayer) player);
        channel = craftPlayer.getHandle().playerConnection.networkManager.channel;
        channels.put(player.getUniqueId(), channel);

        if (channel.pipeline().get("PacketInjector") != null) return;
        channel.pipeline().addAfter("decoder", "PacketInjector", new MessageToMessageDecoder<PacketPlayInUseEntity>() {

            @Override
            protected void decode(ChannelHandlerContext channelHandlerContext, PacketPlayInUseEntity packet, List<Object> list) throws Exception {
                list.add(packet);
                readPacket(player, packet);
            }
        });
    }```
This is outdated (1.8) and I'm trying to update it to 1.17 how do I fix this line:

```java
channel = craftPlayer.getHandle().playerConnection.networkManager.channel;```

The method should inject the player into the packet reader
prisma briar
#

I'm guessing you got red text on the playerConnection?

cinder forum
sharp hemlock
#

You haven’t set the variable yet

cinder forum
#

?di

neat pierBOT
broken elbow
#

I'm not really sure but maybe the declaration in the constructor is made after the other variables are initialized @cinder forum

#

so in this case it would try to initialize host, port etc. before you gave a value to plugin

#

you will have to initialise those variables in your constructor as well

lyric gyro
#

How do you think, an Object should be capable of saving itself to a database?

graceful hedge
#

Sounds the object has more than one major reason of changing, which can arguably break single responsibility principle but I mean. If you have a valid reason to do so, maybe it’s fine.

lyric gyro
graceful hedge
#

Yeah usually I try to keep storage and data model separated, for the implementation.

And for the api, I assume its just a set of interfaces. So in that case you might wanna make a proxy implementation of the interfaces which encapsulates your actual model, where it might be fine to merge some storage behavior with data model behavior.

lyric gyro
dense galleon
#

Is there any way to have a variable E in an abstract class, which is of a different type based on which class is extending it?

graceful hedge
#

yeah

#

define a type parameter in the abstract class

lyric gyro
#

Incompatible types. Found: 'me.ocracked.playagain.tasks.HealPoolTask', required: 'java.lang.Object'

#
package me.ocracked.playagain.tasks;

import com.andrei1058.bedwars.api.arena.GameState;
import com.andrei1058.bedwars.api.arena.IArena;
import com.andrei1058.bedwars.api.arena.team.ITeam;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import me.ocracked.playagain.Main;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;

public class HealPoolTask extends BukkitRunnable {
    private final ITeam team;

    private final int maxX;

    private final int minX;

    private final int maxY;

    private final int minY;

    private final int maxZ;

    private final int minZ;

    private final IArena arena;

    private final Random r = new Random();

    private final int particles = Main.instance.getConfig().getInt("heal-pool-particles");

    private static final List<HealPoolTask> healPoolTasks = new ArrayList<>();

    public HealPoolTask(ITeam team) {
        this.team = team;
        int radius = team.getArena().getConfig().getInt("island-radius");
        this.maxX = Math.max(team.getSpawn().clone().add(radius, 0.0D, 0.0D).getBlockX(), team.getSpawn().clone().subtract(radius, 0.0D, 0.0D).getBlockX());
        this.minX = Math.min(team.getSpawn().clone().add(radius, 0.0D, 0.0D).getBlockX(), team.getSpawn().clone().subtract(radius, 0.0D, 0.0D).getBlockX());
        this.maxY = Math.max(team.getSpawn().clone().add(0.0D, radius, 0.0D).getBlockY(), team.getSpawn().clone().subtract(0.0D, radius, 0.0D).getBlockY());
        this.minY = Math.min(team.getSpawn().clone().add(0.0D, radius, 0.0D).getBlockY(), team.getSpawn().clone().subtract(0.0D, radius, 0.0D).getBlockY());
        this.maxZ = Math.max(team.getSpawn().clone().add(0.0D, 0.0D, radius).getBlockZ(), team.getSpawn().clone().subtract(0.0D, 0.0D, radius).getBlockZ());
        this.minZ = Math.min(team.getSpawn().clone().add(0.0D, 0.0D, radius).getBlockZ(), team.getSpawn().clone().subtract(0.0D, 0.0D, radius).getBlockZ());
        this.arena = team.getArena();
        runTaskTimer((Plugin)Main.instance, 0L, 70L);
        healPoolTasks.add(this);
    }

    public void run() {
        if (this.arena == null || !this.arena.getStatus().equals(GameState.playing)) {
            cancel();
            return;
        }
        for (int x = this.minX; x < this.maxX; x++) {
            for (int y = this.minY; y < this.maxY; y++) {
                for (int z = this.minZ; z < this.maxZ; z++) {
                    Location l = new Location(this.team.getSpawn().getWorld(), x, y, z);
                    if (l.getBlock().getType() == Material.AIR) {
                        int chance = this.r.nextInt(this.particles);
                        if (chance == 0)
                            l.getWorld().playEffect(l, Effect.HAPPY_VILLAGER, 1);
                    }
                }
            }
        }
    }

    public static boolean exists(IArena arena, ITeam bwt) {
        for (HealPoolTask hpt : new ArrayList(healPoolTasks)) {
            if (hpt.getArena() == arena && hpt.getTeam() == bwt)
                return true;
        }
        return false;
    }

    public static void removeForArena(IArena a) {
        for (HealPoolTask hpt : new ArrayList(healPoolTasks)) {
            if (hpt.getArena() == a) {
                healPoolTasks.remove(hpt);
                hpt.cancel();
            }
        }
    }

    public static void removeForArena(String a) {
        for (HealPoolTask hpt: new ArrayList(healPoolTasks)) {
            if (hpt.getArena().getWorldName().equals(a)) {
                healPoolTasks.remove(hpt);
                hpt.cancel();
            }
        }
    }

    public ITeam getTeam() {
        return this.team;
    }

    public IArena getArena() {
        return this.arena;
    }
}
graceful hedge
#

where is the error?

#

or like which class

lyric gyro
graceful hedge
#

which line?

lyric gyro
graceful hedge
#

=paste

#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

graceful hedge
#

paste it

lyric gyro
#

oki

graceful hedge
#

new ArrayList<HealPoolTask>(healPoolTasks) maybe

#

idk why u create a new array list

#

but that'd fix it

lyric gyro
dense galleon
#

Thing is that E wouldn't extend Mob

#

It would implement Mob

#

But I cant do Beast<E implements Mob>

#

Does it work fine anyway?

#

(I want E to be an instance of an object which implements Mob)

pulsar ferry
#

Generic extends means both implementing and extending

dense galleon
#

Ahh alright cool

#

also I am getting this warning here

#

Is generic casting bad?

#

Cause if I don't cast to E then I won't be able to save what world.spawnEntity() returns to mob

graceful hedge
#

Not bad

#

But cannot be checked unless you have something which can keep the type at runtime

dense galleon
#

Alright good to know

#

I'll just suppress the warning then

dense galleon
#

Is there any way to avoid this warning? Is suppressing the only way

#

or I mean should I be ignoring that warning

#

replacing Beast with Beast<?> removes the warning, but it feels wrong to do that

#

Is it alright to use <?> when I am fine with anything being assigned to the generic?

pure crater
#

unless it is supposed to be some sorta type

dense galleon
#

Alright

dense galleon
#

Is this source for making a flickerless scoreboard still reliable?

broken elbow
#

using jda chewtils to make jda commands but this also applies to discord slash commands in general.

I have a /play command and I want to have 4 options: link youtube youtube-music and soundcloud. Is there a way to make it so they have to chose 1 option? But like it doesn't matter which but they have to chose 1 and can't chose another. Or do I have to set up subcommands?

lyric gyro
#

Yes you can do that

#

Idk about chewtils but just don't mark the sub commands as optional?

broken elbow
#

oh so I Do have to make sub commands

#

I was trying to do it with just Options

#

but makes sense

lyric gyro
dusky harness
#

i've tried with other server engines so i don't think thats the issue

pulsar ferry
#

CIO doesn't support HTTPS? thonk

dusky harness
pulsar ferry
#

Where did you find that?

dusky harness
#

when starting the server

#

it spit out an error in console ☹️

pulsar ferry
#

Which version? ;o
I thought that was fixed already

dusky harness
#

oh?

#

1.6.5

pulsar ferry
#

Hmm maybe i was thinking about 2.0

dusky harness
#

2.0?

#

is it a pre release?

pulsar ferry
#

Early access

dusky harness
#

ah

#

ill try v2

pulsar ferry
#

Changes a lot btw, so i don't know if it's a good idea to try it right now

dusky harness
#

oh

#

have u used ssl with ktor before?

pulsar ferry
#

Yeah
Also if you want you can try creating your own engine

dusky harness
pulsar ferry
#

Well i never really used websockets with it

dusky harness
#

ah

#

what did u use?

pulsar ferry
#

Basic routing for a rest API

dusky harness
#

:/ even if i remove ssl

#

it doesn't work

#

it's just when i have the environment parameter it stops working
nvm now nothing works 😦

limber lagoon
#

Are there any JAR's or something similar that I need on my computer to create a discord bot in java?

graceful hedge
#

You need a jdk installed

limber lagoon
#

Jar was the wrong word

graceful hedge
#

But else than that

dusky harness
#

and a discord bot lib

#

such as JDA

limber lagoon
#

I need that installed? Don't I just put that in my build.gradle?

dusky harness
#

yes

graceful hedge
#

Yes

dusky harness
#

in build.gradle

graceful hedge
#

So it doesn’t really count :p

limber lagoon
#

Oh yeah I'm pretty sure I already have that, I just imported a discord bot file I had and it's not recognizing jda so..

dusky harness
#

IntelliJ?

graceful hedge
#

Since you could technically go with the standard jdk tools to build something to interact with the discord api.

limber lagoon
#

Yessir

dusky harness
#

make sure ur not using jcenter

#

in build.gradle

graceful hedge
#

Reload gradle project nevertheless

neat pierBOT
dusky harness
#

lol

limber lagoon
#

yikes

#

one sec

#

YIKES

graceful hedge
#

Holy cow

limber lagoon
#

wait

dusky harness
#

jcenter bad

limber lagoon
#

It's being stupid

graceful hedge
#

totally

limber lagoon
#

There 🙂

graceful hedge
#

Yeet jcenter

dusky harness
#

verbosity 😷

limber lagoon
#

What does JCenter do?

dusky harness
#

its a repository thats going bye bye

graceful hedge
#

Nothing

limber lagoon
#

So why was it there? 🥲

dusky harness
#

¯_(ツ)_/¯

#

reload gradle and press build tab

graceful hedge
#

Hmm

dusky harness
#

and see if there are any errors

limber lagoon
#

Alright, but is there literally no reason to have JCenter..?

pulsar ferry
#

Not anymore, JCenter is closing

limber lagoon
#

I see

#

Well, a lot of my errors are resolved

#

I'm left with

graceful hedge
#

use Somethibg like jetbrains annotations

#

There is another one, just can’t get it on my mind rn

#

For the JDA utilities

#

Might wanna check up on that dependency

dusky harness
limber lagoon
#

Oh, it's the implementation that's an issue

graceful hedge
dusky harness
#

wait what

graceful hedge
#

Like link an example where JDA uses it

dusky harness
#

i swear jda uses it

#

WaT

graceful hedge
#

Afaik they used their own annots but that was a while back

pulsar ferry
#

It uses javax yeah

dusky harness
#

ez

graceful hedge
#

Ah well

limber lagoon
#

Is that something I need to import orr

#

I can't even find jda utilities' latest version on their github 🤨

#

wut

dusky harness
#
route("/testing", HttpMethod.Get) {
    handle {
        println("handle start")
        call.respondText("Hi! ${Random.nextInt(1..5)}")
        println("handle end")
    }
}
webSocket("/chat") {
    println("ws")
    session = this
    runSession(this)
    println("ws end")
}
```anyone know why does `/testing` work but not `/chat` ☹️ (gives 404)
#

or what i could do to debug

marble nimbus
#

Hey probably a very stupid question but how do I get random Files from a folder?

#

(Javascript on a website)

limber lagoon
#

Also probably a stupid question - When using a jar application, where exactly do I set the path to jar?

dusky harness
limber lagoon
#

Remember what you did for me a while back?

#

I don't have a jar

#

I'm trying to run my discord bot on my machine

dusky harness
#

gradle run

limber lagoon
#

just put gradle run..?

dusky harness
#

well

#

exit out of the configurations menu and double click ctrl

#

then type gradle run

#

if you configured ur build.gradle correctly

#

it should run ur bot

limber lagoon
#

Task 'run' not found in root project 'TheHokage'.

#

I guess I didn't configure it correctly

dusky harness
#

show build.gradle

limber lagoon
#

(new project btw)

dusky harness
#

ctrl click twice again

#

and type gradlew

#

then tell me what gradle version it says

limber lagoon
#

7.1

dusky harness
limber lagoon
#

I see, so which one do I use?

dusky harness
#

[run]

limber lagoon
#

Could not find or load main class your.package.MainClass 🤨

dusky harness
#

u need to change that 🥲

limber lagoon
#

oh lmao

#

what an idiot

#

Okay thanks man

dusky harness
#

np

#

oh

#

and to create ur .jar file

#

use gradle shadowJar

limber lagoon
#

Also, jda has support for slash commands right?

dusky harness
#

yes

limber lagoon
dusky harness
#

yes

limber lagoon
#

Idk how you know this

#

But thanks again lmao

limber hedge
#

How can I update this (1.8) function into a 1.17 one?

    public void inject(Player player) {

        CraftPlayer craftPlayer = ((CraftPlayer) player);
        channel = craftPlayer.getHandle().playerConnection.networkManager.channel;
        channels.put(player.getUniqueId(), channel);

        if (channel.pipeline().get("PacketInjector") != null) return;
        channel.pipeline().addAfter("decoder", "PacketInjector", new MessageToMessageDecoder<PacketPlayInUseEntity>() {

            @Override
            protected void decode(ChannelHandlerContext channelHandlerContext, PacketPlayInUseEntity packet, List<Object> list) throws Exception {
                list.add(packet);
                readPacket(player, packet);
            }
        });
    }```

The problem is with playerConnection
limber lagoon
#
        if (event.getMessage().getContentRaw().equalsIgnoreCase(Constants.TheHokagePrefix + "shutdown")
                && event.getAuthor().getIdLong() == Constants.ownerID) {

            event.getChannel().sendMessage("Access granted - Shutting down").queue();
            event.getJDA().shutdown();
            System.exit(0);
        }
```Anyone know why the message isn't being sent but the bot is shutting down?
lyric gyro
#

@upper walrus check your dm please 😅

hoary scarab
hoary scarab
#

Do .complete()

limber hedge
#

what about network?

hoary scarab
#

Wait I found it lol
Channel channel = ((CraftPlayer) p).getHandle().b.a.k;

#

I was recently working on packets and had to find the obfuscated variables myself

limber hedge
#

ah ty so much

hoary scarab
#

np

hard wigeon
#

Is there a good way to in-IDE hot reload a spigot plugin?

#

(HotSwap it)

limber hedge
#

I'm getting a
class file has wrong version 60.0, should be 52.0
Error on compilation

#

For

import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntityLiving;```
brittle thunder
#

Wont work

limber hedge
#

Is there a way I can fix it without swapping?

#

If I swap to 16, I get

Could not initialize class org.jetbrains.jps.builders.JpsBuildBundle```
brittle thunder
brittle thunder
#

What build tool are you using?

limber hedge
#

I'm not sure what that is but im using artifacts in the project structure

brittle thunder
#

Ew

#

Please switch to a proper build tool, you'll have an easier time around

#

Anyway

#

File -> Project Structure -> Project SDK

limber hedge
#

Ok

#

Then I add an JDK?

brittle thunder
#

select 1.8

#

Assuming you have it installed

limber hedge
#

Yea

limber hedge
vital aspen
#

I have src of a plugin , it has a class called papihook , but now I aint able to figure out what are its placeholders...... can someone help me out ?

high edge
#

I mean look in the class

vestal valve
#

Hi where can i suggest a plugin?

#

I want someone to develop an plugin for me (free)

brittle thunder
vestal valve
#

ok

slow kiln
#

Do chunks outside of the world border not load for example if I create a small world border that means it won't use server resources loading chunks that can't be accessed right?

tight junco
#

to an extent yes

#

they'll likely still render whatever your server render distance is outside of the border

marble nimbus
#

Hey does anyone know how to bypass the autoplay policy? I am working on a Loading Screen for Garry's Mod for a private Server. because we have long load times sometimes we wanted to add music to the loading screen. The problem is that the Music doesn't play. In the Browser I get this in the console : The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. Once I click the page once it works fine, but I can't click inside Garry's Mod because it doesn't work

slow kiln
tight junco
#

the preset worlds prob weren't pre rendered

#

because when you render out a world, the folder becomes the chonkiest shit you've ever seen

slow kiln
#

is 300mb for an empty world with an area of only 40x40 normal though?

tight junco
#

maybe GWcmeisterPeepoShrug

#

world folders are typically huge so maybe

slow kiln
tight junco
#

no

slow kiln
#

Alright, thank you for your help 🙂

warm steppe
#

204 chunks (overworld), 18 (nether), 0 in end, haven't reached it yet ~1gb

opal tartan
#

help

#

@pulsar ferry not worked command: /dm open advancedmenu GABSSGOD

#

@celest tendon

graceful hedge
#

Can you chill my buddy

celest tendon
opal tartan
void orchid
#

because from what you described, it's not development related but rather, a configuration one

surreal hare
#

Hey, im having a little bit of a issue, and would like to ask for help:

I have set up a integer in my config.yml which can be used to define a block.
This block should then be pasted down below in
block == Material.[The Block]
Does anyone know how I can paste it in there?

(Yes, I've looked it up, but I cant seem to find anything that helps.)

#

My config is layed out with 3 variables in this example, lets just say the variables are "block-1", "block-2" and "block-3".

limber lagoon
surreal hare
#

pretty much

#

I want it to use the variable

#

hm

#

I would prefer if my config could just be

#

STONE

hoary scarab
surreal hare
#

without the Material.

#

since I wanted that to be pre-defined

#

woah

#

that is

#

surprisingly complicated

#
if (block == Material.) {
                player.sendMessage("Test");
limber lagoon
surreal hare
#

Im gonna look if it works, thank you!

dusky harness
dusky harness
#

wheras .queue() runs async

#

it's the same with bukkit - if you run laggy tasks on the main thread, it'll lag the server

#

so if you do queue() and then a complete() inside the success consumer, I think that should be fine

#

if you use too many .complete() operations on the main thread, jda will throw an error in console too

dusky harness
#

(but how it works is that complete() blocks the thread so it won't shut down until the action is completed)

graceful hedge
#

It’s like await for an async function

clever ridge
#

What could be wrong when registering a command...?
this.getCommand("aw").setExecutor(new *******Command());
(The full file is censored for secure reasons. The IDE does not shows any errors, but the server cannot load this line, and disabled the plugin. Is my server the problem or... I am just too tired to fix it...?)

lyric gyro
#

"the server cannot load this line, and disabled the plugin" what does it say or do exactly? how do you know it's disabling the plugin?

clever ridge
#

Well... Easy awnser: after a reload (there are only three other plugins, and I am optimanizeing the plugin), the plugin becomes red in the /pl, and actually... I get a big error.

#

This is just some lines from the error

[00:12:50 ERROR]: Error occurred while enabling AgeWars v1.0E-4 (Is it up to date?)
java.lang.NullPointerException
        at agewars.nog.****.Loader.onEnable(Loader.java:16) ~[?:?]
lyric gyro
#

does it work fine without reloading? on normal startup

clever ridge
#

Lemme try 🤔

lyric gyro
#

..?

clever ridge
#

Uuuh.. No. It doen't works.

lyric gyro
#

sounds like you forgot to put the command in the plugin.yml

clever ridge
#

🤔

lyric gyro
#

if it's not there, getCommand will return null (and that line there will throw an NPE which is what's happening)

clever ridge
#

That might be true. Once the server actually said, that the plugin.yml is invalid, and I was like... WAT?

lyric gyro
#

if it was in the plugin.yml then it would work fine

clever ridge
#

Oh yes. That was the problem. Thank you for the help.

#

I learned a lesson: using getCommand("cmd").setExecutor requires plugin.yml.

lyric gyro
#

myes

limber lagoon
#

If I want to hide a file in .gitignore, can I just type out the file name or do I need to also type out the directory?

warm steppe
#

location

#

/dir/file

limber lagoon
#

Thanks

#

But I screwed up when pushing my project to github, I deleted the repository but I also wanna reset the project in the ide

#

It still thinks it has a repository

dusky harness
#

you need to do a couple things:

  • delete .idea/vcs.xml
  • Go to Settings | Version Control, select the mapping(s), click [-] icon or press Delete to remove the mapping or change the association to None.
  • delete .git
limber lagoon
#

I don't see the mappings option

dusky harness
#

ye just disable that

limber lagoon
#

I can't

dusky harness
#

o

#

weird

#

whys yours grayed out

#

🤔

#

mine works

#

then

#

click Git

limber lagoon
#

huh

dusky harness
#

and then in the dropdown

#

click none

limber lagoon
#

There is no dropdown

#

I can't click it

dusky harness
#

o

limber lagoon
#

am I gonna need a new project

dusky harness
#

no

#

just delete vcs.xml and .git folder for now

limber lagoon
#

I don't have a .git folder

dusky harness
#

then just delete vcs.xml 🥲

limber lagoon
#

Yeah I did

#

Am I supposed to have a .git folder? 🤨

dusky harness
#

does the button at top bar say VCS or Git?

limber lagoon
#

VCS

dusky harness
limber lagoon
#

o

dusky harness
#

i think u should be good then

limber lagoon
#

Oh

#

Yeah

#

The colours are gone now

#

Thank you

dusky harness
#

np

limber lagoon
#

Ok time to start again

#

It's not working 🥲 I try and share project on github but it says remote origin already exists

dusky harness
#

don't press "Share project on Github"

#

that creates a new repository

bitter basin
#

proceeds to spam press until github runs out of storage 🙂

broken elbow
bitter basin
#

maybe if we band together we can achieve it before then 🙂

broken elbow
#

we'll get banned before that happens

#

also. why would you want to ruin github?

#

its already bad

#

enough

bitter basin
#

so we can launch our own product and gain an instant fan base

limber lagoon
#

but share on github makes sense

dusky harness
limber lagoon
#

It doesn't recognize https://github.com/YourUsername/YourRepository.git

dusky harness
#

plz tell me u changed YourUsername and YourRepository

limber lagoon
#

😂

#

I'm just joking

#

Thanks again

dusky harness
#

🥲

#

np

limber lagoon
#

I have 2 now

#

which one do I keep

#

also I can't see the repo on github

dusky harness
#

delete github

dusky harness
limber lagoon
#

I could try again

dusky harness
#

i thought u were changing repos

limber lagoon
#

No I just wanna create a repo

#

🥲

dusky harness
#

oh

limber lagoon
#

Also - when I get asked this

dusky harness
#

then press Share to Github

dusky harness
limber lagoon
#

activate windows 🥲

dusky harness
#

🥲

limber lagoon
#

That's when I share to github

dusky harness
#

the repo exists

limber lagoon
#

Yeah but nothing's in it

dusky harness
#

its still considered as existing

#

use git pull

dusky harness
limber lagoon
#

Nope

#

Just one

dusky harness
#

master/main

limber lagoon
#

Literally master/main?

dusky harness
#

no

#

idk what ur main branch is

limber lagoon
dusky harness
#

just delete the repo

#

and start over

limber lagoon
#

👍

#

Ok it's created again

#

It works 🥲

#

Thanks

dusky harness
#

btw

#

add .idea to gitignore

#

@limber lagoon

#

you shouldn't really put IDE specific stuff (such as .idea) in git

#

and whenever you want to update gitignore run the commands (after changing gitignore): ```
git rm -rf --cached .
git add .
````rm= remove (to remove files that should be ignored)-rf= recursive (for folders)--cachedso that it doesn't remove the files from the git repository.= all filesadd` = readd the files that weren't ignored

limber lagoon
#

Oh okay

#

and where do I run these commands?

#

Ok I pushed the new commit

#

Yet it didn't update?

#

😔

#

I thought github was simple

pure crater
#

are you sure you actually pushed to origin and didnt just commit the files

#

lol

limber lagoon
#

Well I pushed push

#

I'll try again

#

"Everything is up to date"

pure crater
#

Did you commit your files first

#

before pushing

limber lagoon
#

Yes

#

See it even says 37 minutes ago

pure crater
#

i dont think thats related

#

Hm

#

Well do you see your files in blue names

#

in intellij

limber lagoon
#

My files?

#

Such as this?

#

or this

dusky harness
dusky harness
#

or something similar to that

dusky harness
limber lagoon
#

or can I just Commit and Push

dusky harness
limber lagoon
#

I did infact run the commands

#

So, how do you know this

#

Where did you learn all that

dusky harness
#

google :))

limber lagoon
#

🥲

#

also

#

do I click on properly added whatever

#

orm aster -> origin

dusky harness
#

show .gitignore

#

wait

#

its gray

#

i think that should work

#

yea

dusky harness
limber lagoon
#

yeah but on the left

dusky harness
#

no u just press push

limber lagoon
#

which one do I click on

dusky harness
#

or commit

limber lagoon
#

it's push

dusky harness
#

left just shows what ur committing

limber lagoon
#

Oh it's not actually a selection? 🥲

dusky harness
#

nope 🥲

limber lagoon
heavy wadi
#

Hey friends, I need career advice 😄
My employer just sent me my new contract in which my position is called "IT Specialist".
Is having that on my CV bad when there is a good chance I will try to apply for jobs in 100% Software Development in a couple years? (as of now, development is only part of what I do)

brittle thunder
#

You'll most likely only need to submit a resume when applying for a job. Just exclude this position in it if you feel like it doesn't contribute to the position you're applying for

heavy wadi
#

Well if I leave that out I'm gonna have a hole in my resume right after I finish my masters and raise even more questions why my masters took so long 😄

BSc Computing (2018)
Jr. Software Developer 20h/week (2017-2021)
MSc Information Technology & Management (2018-2022)
IT Specialist (2021-2023 maybe)
#

I mean, can I just informally agree with my employer on a cooler title and call it a day or does it have to say the exact title on the contract and I need to sort this out before signing it?

#

oh wait, this should've been in #dev-general I hope cube doesn't lynch me 😳

brittle thunder
heavy wadi
#

I postponed plenty of exams and now here we are 😄

#

I suppose it's not that bad, because I worked 20+ hours all the time, but I know it doesn't look epic. But one more reason I cannot just leave out the jobs I did 😄

brittle thunder
#

I assume thats a joke xD

heavy wadi
#

There's a little truth to every joke 🙃

heavy wadi
#

@lyric gyro Not 100% sure, but don't you have to specify a delay in runTaskLater() ?

#

oh, I'm turbo blind.

#

You forgot the , tho, didn't you 🤔

#

before 30L

sharp hemlock
#

i wanna get all users in the db

cinder forum
#

what database

broken elbow
#

luckperms database

#

so probably using luckperms api if possible

cinder forum
#

isnt normal db request faster

broken elbow
#

probably. pretty sure lp api doesnt even offer that so maybe that's what they want

cinder forum
#

also i doubt there is lp method "get all users"

sharp hemlock
#

not sure if thats all users in the db though

dense drift
#

Test?

sharp hemlock
#

yeah thats what i am doing lmao

sharp hemlock
#

in their docs it literally just says gets all unique users

#

so its not really much of an explanation

icy shadow
#

That seems like what you want

sharp hemlock
#

Yeah, i wish it loaded it as a user object though so much easier xd

graceful hedge
#

iirc olzie

#

It queries max 500 or smtng

lyric gyro
#

How can I force download a PAPI expansion from my plugin?

#

through PAPI's API

graceful hedge
#

PlaceholderAPIPlugin.getInstance().getCloudExpansionManager().downloadExpansion(…)

#

I think?

high edge
#

jesus

#

Where's the expansion factory

broken elbow
#

question. in C# the default SystemSounds only work in windows? Because I'm trying to play them and I hear nothing. am on linux rn

#

oh nvm.

Retrieves sounds associated with a set of Windows operating system sound-event types.

#

if only I Could read the docs

#

Hmm. New question. So I have an Class Library in my solution and under it I have a Sounds directory and in that directory I have an MP3 file. How would I get this file using relative paths? This is basically my setup:

Solution -> Project -> Class.CS
-> Utilities -> Sounds -> Sound.MP3

And I'm trying to get the sound from class

#

oh ok. Directory#getCurrentDirectory might get me there

median glen
#

Hi, is it possible to hide a world border (WB API)? So it will remain existing, but is invisible when you are far away.

lyric gyro
#

how do I get that?

#

Do i have to do it like it?

dense drift
#

CloudExpansionManager#findCloudEpansionByName

lyric gyro
#

Thank you

#

does anybody got that problem w moded/plugin minecraft:
The drops just vanish

lyric gyro
#

Is there any way I can add load before dynamically?

#

like soft depends dynamically?

lyric gyro
#

huh?

lyric gyro
#

load-before does not prevent your plugin from loading if the other is not present, just so you know; it's somewhat like "other plugin soft-depend on this plugin"

lyric gyro
#

and my plugin have an extension system, so if any other developer wanna make an extension that uses another plugin's API than I need to plugin to have a soft depend of that "another plugin" So that plugin don't get loaded after my plugin.

#

Cause if it does than my plugin's extension will error out

dusky harness
#

it's probably possible to use reflection (idk about java 9+ tho), but imo just don't worry about it - it's just a warning, not an error

#

and iirc the same is with PAPI

lyric gyro
#

hm what you can do is check if the other plugin is loaded:

  • if it is, load the extension
  • if it isn't, just wait and listen to the PluginEnableEvent so you can load the extension then when the respective plugin enables
dusky harness
#

it'll still give the warning tho - but thats a good idea 👀

lyric gyro
#

it will, yes

#

so do PAPI expansions when they depend on another plugin

broken elbow
vital aspen
#

posted there

#

;]

wraith scarab
#

https://pastebin.com/gMRBhms7
can somone explain me why the "3" are not brodcast ?
at line 42 - 43 the outpout are the same but the next line don't become true

tropic furnace
wraith scarab
#

?

#

i need to do a .equals ?

tropic furnace
#

No check the x y z and worldname

wraith scarab
#

Oh thx i go try rn

tropic furnace
#
    public boolean isEqual(Location from, Location to) {
        return from.getWorld().getName().equals(to.getWorld().getName()) && from.getBlockX() == to.getBlockX() && from.getBlockY() == to.getBlockY() && to.getBlockZ() == from.getBlockZ();
     }```
tropic furnace
dusky harness
#

or just from.equals(to)

wraith scarab
wraith scarab
dusky harness
#

new = new instance

wraith scarab
#

oh

#

k i get it ; )

dusky harness
cerulean birch
#

idk if I'm stupid or smthing

#
        @Getter private YamlConfiguration data;

        public YAML enable(Plugin plugin) {

            file = new File(plugin.getDataFolder(), "language.yml");

            if (!file.exists()) {

                try {
                    boolean success = file.createNewFile();
                } catch (Exception e) {

                    e.printStackTrace();

                }

            }

            data = YamlConfiguration.loadConfiguration(file);

            for (LanguageEnum lang : values()) {

                if (lang == null || lang.getKey() == null || lang.getKey().isEmpty()) {

                    Bukkit.getConsoleSender().sendMessage("what");
                    return this;

                }

                data.set(lang.getKey(), lang.getValue()); < error here 

            }```
#
java.lang.IllegalArgumentException: Cannot set to an empty path```
cerulean birch
#

Just an enum with several VALUE("key", "value");
none of them are null/empty

#
    @Getter private final String value;

    LanguageEnum(String key, String value) {

        this.key = key;
        this.value = value;

    }```
#

problem found

pure crater
#

Does anyone know if I have to call the release function of a ByteBuf if im using ByteBuf.allocate()?

tropic furnace
#

Was your key null?

cerulean birch
#

one of the keys was incomplete (ended with a .), i.e something-asd.

tropic furnace
#

thought so, good job debugging!

cerulean birch
#

cheers

pure crater
#

ahh kk

brittle thunder
#

will be gc'd

pure crater
#

ic ty

#

but directBuffer

#

i have to right?

brittle thunder
#

you mean when calling allocateDirect ?

#

Still no afaik

pure crater
#

Yeah

brittle thunder
#

It there was such a requirement it would be explicit in the jvadocs

pure crater
#

idk why i said ByteBuf#allocate

#

it should be unpooled

#

lol

#

seems like ur right tho

#

either way

brittle thunder
#

Oh also, it seems allocateDirectBuffer is actually in the native heap

pure crater
#

Yeah

brittle thunder
#

Not sure if there's anything to explicitly release it

#

I'd assume its taken care of with a phantom ref or something

hazy jackal
#

Might be in the wrong place here, but im new to discord/PC in general and I downloaded Minecraft Java Edition through xbox gamepass and I'm trying to add it on steam as a non-steam game so i can use a controller but the file is nowhere to be found. Anyone have any advice or is there somewhere else I should be asking this?

brittle thunder
hazy jackal
#

Ok, where is a better place

brittle thunder
#

Thats the only place this would go afaik

hazy jackal
#

ok thanks

wheat carbon
#

since when is java edition on xbox game pass

brittle thunder
#

lol

hazy jackal
#

who knows, its probably not im so lost lol

brittle thunder
#

oh it does include it

#

If you have an active Game Pass Ultimate or Game Pass for PC subscription, you can install and play both Minecraft: Java Edition and Minecraft for Windows on PC.

cerulean birch
#

Anyone who has experience with JacksonJson:

I have a class that I serialize/deserialize into Json, and some of the fields are annotated with @JsonProperty. When they object is serialized, however, it also serializes fields/getters that are NOT annotated with @JsonProperty. Is there a way to make these fields not be serialized by default, without @JsonIgnore'ing each one?

cerulean birch
#

praying @JsonIgnoreProperties(ignoreUnknown = true) works (update: it doesn't)
alternative annotation found

latent adder
#

where can i report discord error?

lyric gyro
#

did somebody ever got the problem of no food dropping by mobs?
i play on magma 16.5

limber hedge
#

How can I check if a player puts an item in a slot? I want them to put X item into a slot then for item Y to update its lore based on the item name

broken elbow
latent adder
#

bruh, ok

#

hates google because it recommend this and it is not useful

broken elbow
#

😦

wheat carbon
#

wonder if discord will ever ask us to change the name

dense drift
#

🤣 🤣 🤣

#

You know whats funny? The description says it is for Minecraft related stuff LOL

wheat carbon
#

yeah well ig people don't read that bit

dense drift
#

I doubt discord would use their own platform for support

#

But hey

brittle thunder
#

🥵

broken elbow
wheat carbon
#

=flex

#

/flex

#

idk what the command is

#

11219

#

personally I love how there's 2 links to helpchat

#

and both have different member counts

neat pierBOT
#
<:discord:699228850537889854> - HelpChat Stats

Here are some guild wide stats for your eyeballs. :eyes:

XP Generated:

xp23,378,114

Level Ups:

levelups 24,941

Pastes Created:

pastes 68,471

Commands Ran:

commands 150,927

Images Generated:

images 84,434

Words Scrambled:

words 71,952

Total Messages:

messages 4,897,743+

Guild Members:

members 11,219

Date Created:

calendar Mar 29 2016

broken elbow
#

you were looking for this?

wheat carbon
#

yes

#

had to go into settings to find mem count, command is easier

limber hedge
#

Hio,

How can I check if a player puts an item in a slot in a custom gui? I want to make a repair GUI, so a player puts their sword in and the item they click to purchase will have a cost depending on how much money it will take to repair

rugged bane
# neat pier

Damn you guys aren’t that far from my discord now

broken elbow
#

correction: your discord is nowhere near our discord.

limber hedge
lyric gyro
shell moon
#

Is it possible to insert a row with a defined rowid in mysql/sqlite?

inner valley
#

how do i make a for(int..... loop that has a countdown

#

for(int i = 54; i < 0; i--)

#

how do i make a countdown in this loop

shell moon
#

countdown?

#

doesnt it display already 54 and less

high edge
#

delay the execution

shell moon
#

wait(1000)

inner valley
#

i want to go from 54 to 0

inner valley
#

in the for loop

high edge
#

Using the for loop you made..

#
for (int index = 54; index > 0; index--)
  // Code
dense drift
#

index < 0?

#

You mean >

topaz gust
#

Got him

high edge
#

I is on mobile, leave me alone

inner valley
#
                    player.sendTitle("Hello!", String.valueOf(i), 2, 20, 2);
                }```
#

it goes from 54 instant to 1

#

how do i fix that?

high edge
#

=

high edge
#

Also, you add a delay

#

wxip, get the fuck out

warm steppe
#

who is u?

high edge
#

And your 1 letter variables

shell moon
#

I think he's asking how to make it go each second

#

instead of just printing the numbers at the same time

inner valley
#

yeah

#

thats what i mean

#

but idk how to do that

shell moon
#

well depends

#

spigot? xd

#

if so, a bukkit task

high edge
#

I mean I did mention a delay

inner valley
#

Where?

high edge
inner valley
#

how do i add a delay 😂

high edge
inner valley
#

you mean

#
    @Override
    public void run() {
        for(int i = 54; i > 0; i--){
                    player.sendTitle("Hello!", String.valueOf(i), 2, 20, 2);
                }
    }
}, 20L); ```
#

this?

high edge
#

Not exactly

#

Since that'll delay the entire thing and the prinout will still be instant

inner valley
#

how should it be then?

topaz gust
#

You could use that but have a variable you initialise outside of the loop and increase within with i++ for example and then check if it exceeds your given value and stop the runnable

dense galleon
#

this:

        int currentHP = (int) Math.ceil(entity.getHealth() - dmg);
        if (currentHP < 0) {
            currentHP = 0;
        }```and this: `int currentHP = (int) Math.max(Math.ceil(entity.getHealth() - dmg), 0);` are the same thing, right?
#

Trying to refactor my method so it has less lines

high edge
#

I believe so yes

proud pebble
#

you could also do
int currentHP = entity.getHealth - dmg < 0 ? 0 : (int) Math.ceil(entity.getHealth - dmg)

#

tho the max one would probably be cleaner

high edge
# inner valley how should it be then?
final AtomicInteger index = new AtomicInteger(54);
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
  @Override 
  public void run() {
    final int current = index.getAndDecrement(); // or whatever the hell the get and then lower by 1 method is called 
    
    if (current < 0) {
      this.cancel(); // can't remember if it's cancel or stop
      return;
    }

    // send title
 }
}
#

Don't quote me on this tho, I can't remember the exact methods cause fuck spigot

dusky harness
#

runTaskTimer 😌

dense galleon
#

Whenever possible it's better to run tasks async right?

dusky harness
#

what are you wanting to run async?

dense galleon
#

I mean idk in general, I got multiple tasks in my plugin so I was wondering if I should try running whichever I can async

proud pebble
#

not everything should be async

dusky harness
#

bukkit things should usually be ran sync unless it specifies that it's thread-safe (ex ChunkSnapshot)

dense galleon
#

I mean whichever code actually works async

dusky harness
#

so it depends on what you're wanting to run async

#

and also variables/lists are not thread safe by default

dense galleon
#

Uhm okay

high edge
#

run it async, if you get problems then don't run it async 🤷

shell moon
#

wiser words were never spoken

pulsar ferry
#

Async doesn't always mean better performance

high edge
#

Where's triumph chat weeb

pure crater
#

Asynchronous good for parallel computing

#

Do you consider that parallel computing “speeds up the full, large scale task” or do you think it simply “reduces the time”

#

I’m just wondering lol

#

Cause obviously async != faster

brittle thunder
pure crater
#

but assume its the optimal number

brittle thunder
#

It simply lets the cpu time share between tasks, time taken on the cpu is usually the same, just multiple things share the time