#help-development

1 messages · Page 2246 of 1

tender shard
#

The reason is that local variables reside on stack and is visible only in local method context, unlike instance variables which resides on heap and has scope throughout the program.

#

no idea if that's a good explanation but it's the only explanation I found

smoky oak
#

so if i were to make them into variables of the object they would be null?

tender shard
#

yes

smoky oak
#

k

tender shard
#

and primitives will be 0, or false if a boolean

smoky oak
#

kinda sorta null

humble tulip
#

What are they then if not null?

smoky oak
#

they are 'nothing'

#

apparantly thats different from null

#

refer to alex explanation above i guess

humble tulip
#

Btw don't u wanna separate right wing vs leftwing?

smoky oak
#

im still working on that

humble tulip
#

Check first answer

#

The line will be the direction of the location of the dragon

smoky oak
#

eh i got a completely different issue right now

#

see my plan was to part the dragon

#

part here part there

#

but apparantly you cant remove single parts of the dragon

humble tulip
#

rio

#

Rip*

#

U might have to use nms then

smoky oak
#

welp im an idiot

tender shard
#

you still can't remove parts of that

smoky oak
#

darn

#

can i somehow trick the game into applying potion effects to dragon parts

tender shard
#

I think you can only apply potions to LivingEntities. ComplexEntityPart is not a livingentity

smoky oak
#

yeah i suspected as much

#

damn

#

so its a modded thing

#

unless i want to mess with custom block models

#

which i really dont have the energy for

limpid bronze
tender shard
#

you can't

#

the generic type gets erased at compile time

#

in the bytecode, those fields will just be "Tag" and not "Tag<Material>"

smoky oak
#

is the dragon animation handled by the server or the client?

tender shard
tender shard
# limpid bronze Okay thanks

e.g. like this (haven't tested it though)

        Set<Tag<Material>> materialTags = Arrays.stream(Tag.class.getDeclaredFields()).filter(field -> {
            try {
                return ((Tag<?>)field.get(null)).getValues().iterator().next() instanceof Material;
            } catch (Exception e) {
                return false;
            }
        }).map(field -> {
            try {
                return (Tag<Material>) field.get(null);
            } catch (Exception e) {
                return null;
            }
        }).collect(Collectors.toSet());
limpid bronze
#

Thank you very much

eternal oxide
#

Why are you trying to list all members?

ebon topaz
#

is it possible to make a plugin that stops endermen from teleporting onto bottom half slabs?

eternal oxide
brave goblet
#

Is it possible to have a resource pack with a custom sound file and make the plugin play that sound?

earnest forum
#

no

#

u can only modify existing sounds

brave goblet
#

Like how does ItemAdder do it and i seen some resource pack in 1.12 add a new song without replacing anything but not sure how it works

eternal oxide
#

p.playSound(p.getLocation(), "name.of.sound.has.set.in.resourcepack", 20F, 20F); I believe

brave goblet
#

like this minecraft:ambient.customsong.1 or just ambient.customsong.1

#

ill just watch a yt :P and look at docs

eternal oxide
#

post #16

brave goblet
#

thanks! much appreciated

glossy venture
#

is there a way to load classes which can be accessed between plugins?
because you can access other plugins from plugins so i wondered why this was not working.
im currently using

URLClassLoader ucl = new URLClassLoader(
        new URL[] { pkgCUrl },
        JavaPluginLoader.class.getClassLoader()
);

// ...

Class.forName("c.pkg.PackageC", true, ucl)
        .getMethod("loadPackage")
        .invoke(null);
``` where `pkgCUrl` is a url to a jar file
#

accessing this from plugin B, throws java.lang.NoClassDefFoundError: c/pkg/PackageC

#

^ in B

wary harness
#

any one could tell how to use boss bars

glossy venture
wary harness
#

I got Tab plugin which uses boss bar already

#

I want to be sure my plugin is the one which takes

#

first bar positon

#

so like multiple boss bars

#

is it possible to know at which positon is my boss bar

#

is there any good BossBar lib

golden turret
#

maybe if you use some reflection and craftbukkit

wary harness
#

So psitening of my boss bar is important

golden turret
#

but i think it is handled by the client

wary harness
#

Because I am trying to use boss bar to display custom gui over custom font

#

and then all goes in trash bin if boss bar positon is in wrong place

golden turret
#

as i said, it may be handled by the client

#

so you can control it

#

one thing you could do is to use reflection and craftbukkit and clear all bossbars and display all of them in the order you want

#

because the bossbar dont have a priority system

agile anvil
mortal hare
daring egret
#

Why is a string variable I set null?

mortal hare
#

Bukkit bossbar api exists since 1.9 (2016)

mortal hare
#

And i know how to solve that problem

golden turret
mortal hare
#

Use negative spaces font made by AmberWat on github

#

And it would allow you to position the font without using multiple bossbar

daring egret
#
public class StaffCommand implements CommandExecutor {
    
    String msg;
    
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {

        if(!(sender instanceof Player)) return false;
            Player player = (Player) sender;
        if(!sender.hasPermission("lukaessentials.staffgui")) {
            player.sendMessage(ChatColor.RED + "You can't do that!!");
        }
        
        msg = args[1];

        //GUI CREATION
        Inventory staffGUI = Bukkit.createInventory(player, 54, ChatColor.RED + "Staff Menu");

        //GUI ITEMS
        ItemStack playerHead = new ItemStack(Material.PLAYER_HEAD);
        SkullMeta playerHeadMeta = p;
        
        player.sendMessage();
        return false;
    }
}
``` @golden turret
mortal hare
#

Also ascent in font.json can help you vertical align it

daring egret
#

String msg

#

also player.sendMessage(); is player.sendMessage(msg);

golden turret
#

ok

#

do you know java?

daring egret
#

not really lol

golden turret
#

🤔

daring egret
#

i'm still learning

golden turret
#

?learnjava

undone axleBOT
golden turret
#

ok

#

first you need to check if the lenght of the args is what you want

#

/command args0 agrs1 args2...

daring egret
#

yeah i know, i just quickly recreated it for you because it's my friends problem not mine

#

and he did chec

golden turret
#

/command args0, args.length = 1
/command args0 args1, args.length = 2

golden turret
daring egret
#

no

golden turret
#

and probably you are typing /command or /command agrs0

#

array indexes starts in 0

#

so 1 is the 2nd index

daring egret
#

I know that bro

#

i just quickly recreated my friends issue

#
package ajo_29.testplugin.testplugin.commands;

import io.papermc.paper.event.player.AsyncChatEvent;
import io.papermc.paper.event.player.ChatEvent;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Server;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChatEvent;
import org.jetbrains.annotations.NotNull;

public class customchat implements CommandExecutor, Listener {
    String prefi;
    String suffix;

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (!(sender instanceof Player)) return false;
        Player plr = (Player) sender;
        if (args.length == 3) {
            Player target = Bukkit.getPlayerExact(args[0]);
            if (args[2] == "prefix") {
                plr.sendMessage("ur bad");
                prefi = args[2];
            }
        }
        return false;
    }

    @EventHandler
    public void onPlayerChat(PlayerChatEvent event) {

        Player plr = event.getPlayer();
        String msg = event.getMessage();

        event.setCancelled(true);

        Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', prefi  + " " + plr.getDisplayName() + " " + msg));
    }
}```
#

this is my friends code

#

he sent it to me

golden turret
#

aaa

daring egret
#

String prefi; is null

golden turret
#

now you sent the error

#

he is not initializing prefix nor suffix

daring egret
#

he's not?

golden turret
#

actually he is

daring egret
#

lol

golden turret
#

but not suffix

daring egret
#

he's not using suffix yet

golden turret
#

ok

#

first, use AsyncPlayerChatEvent, it does not fix it but this is a better event

daring egret
#

okay

#

we changed it to PlayerChatEvent to try to fix

golden turret
#

2nd, probably he is chatting before running the command

#

so the prefix will be null

#

as he only initializes the variable after running the command

daring egret
#

but it's null after running the command

golden turret
#

does the command even work?

daring egret
#

yes

golden turret
#

just a question

daring egret
#

everything works but the variable is not being set

golden turret
#

im not seeing any agrs[1] there

daring egret
#

and?

proper saffron
#

mf

#

wizardly

golden turret
#

could you send me the full command he is typing pls

proper saffron
#

ur not helping

#

i found the problem

#

its nowhere near what u were saying

#

thanks for the help <3

daring egret
#

oh

golden turret
#

🤔

daring egret
#

he's typing /customchat dein0man prefix TEST

#

and TEST is null

golden turret
#

well, in the code you gave there, i did not see any args[1]

proper saffron
#

yeah because we tried that

daring egret
#

why does it need that though

proper saffron
#

that didnt work

golden turret
#

because what you were doing is

daring egret
#

Ohh no i get it

proper saffron
#

is

daring egret
#

we changed to args[2] to see if it worked

golden turret
#

/command args0 args1 args2 but the args1 wasnt being used

daring egret
#

i know

#

cause in that code we changed it

#

to see if that was the issue

proper saffron
#

yeah but args1 didnt work at first

golden turret
#

ok

#

could you send me the current code

daring egret
#

sure

proper saffron
#
package ajo_29.testplugin.testplugin.commands;

import io.papermc.paper.event.player.AsyncChatEvent;
import io.papermc.paper.event.player.ChatEvent;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Server;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChatEvent;
import org.jetbrains.annotations.NotNull;

public class customchat implements CommandExecutor, Listener {
    String prefi;
    String suffix;

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (!(sender instanceof Player)) return false;
        Player plr = (Player) sender;
        if (args.length == 3) {
            Player target = Bukkit.getPlayerExact(args[0]);
            if (args[1].equals("prefix")) {
                plr.sendMessage("ur bad");
                prefi = args[2];
            }
        }
        return false;
    }

    @EventHandler
    public void onPlayerChat(AsyncChatEvent event) {

        Player plr = event.getPlayer();
        String msg = event.message().toString();

        event.setCancelled(true);

        Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', prefi  + " " + plr.getDisplayName() + " " + msg));
    }
}
golden turret
#

is that working now?

proper saffron
#

no

golden turret
#

ok

#

could you test your code and print the console log pls

proper saffron
#

mk

#
[20:43:27 INFO]: null dein0man a```
golden turret
#

the command is working right?

#

sending the message

proper saffron
#

yeah but it doesnt set the prefix

golden turret
#

aaaa

#

ik

#

ik

#

just to be sure

#

print the code you are using to register the command and listener

proper saffron
#
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new customchat(), this);
        getCommand("customchat").setExecutor(new customchat());
    }```
#

this one?

golden turret
#

yea

#

exactly what i tought

#

the variables you created are only for 1 object

#

so

tardy delta
#

Conventions pls

golden turret
#

you creating 2 objects

#

and updating the variable for only 1 of the objects

#

a fix for taht would be using only 1 object

#

by using customchat chat = new customchat();

#

and passing chat in the setExecutor and registerEvents

daring egret
#

OHH

#

YOUR A GENIUS

#

(if it works)

proper saffron
#

@daring egret "i know java" my ass

daring egret
#

?

golden turret
#

or you can set the variables as static

#

or you can use oop

golden turret
#

and a better one

#

once you learn oop and how to apply it, back to your plugin and use oop

daring egret
#

what is oop

#

i'm kinda stupid alright

golden turret
#

object oriented programming

proper saffron
#

[20:49:39 INFO]: TEST dein0man TextComponentImpl{content="hello there", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=null, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}

daring egret
#

oh

golden turret
#

you should use event.setFormat

#

it is better

daring egret
#

oh

#

u right

#

WizardlyBump17

#

how do u access the message as a raw string

#

because the only thing close is event.message() which doesn't work

proper saffron
#

man

golden turret
#

event.getMessage?

proper saffron
#

setFormat is PlayerChatEvent

#

AsyncChatEvent or not?

daring egret
golden turret
#

it does

undone axleBOT
golden turret
#

?jd-s

proper saffron
#

man u good?

#

it doesnt

daring egret
#

but then why is it red and not auto-correct

golden turret
daring egret
#

but it doesn't work

proper saffron
#

thats not for asyncchatevent

golden turret
#

which version are using

daring egret
#

@golden turret it probably doesn't exist in AsyncChatEvent?

quaint mantle
#

how do I send a string message as a player?

daring egret
#

1.19

golden turret
#

use AsyncPlayerChatEvent

proper saffron
#

you said async chat event

#

we've been running around in circles

daring egret
#

this hurts lmao

golden turret
#

print the event.getMessage on the ide

proper saffron
#

nah we got it now

#

it workin

daring egret
#

thanks man

golden turret
#

👍

#

event.setFormat(prefix + " %s: %s"); is a better option btw

daring egret
#

ohg

#

thanks!

quaint mantle
#

I took message string, edited my targeted elements, now how do I send this string so it appears as if the player sent it?

grand magnet
#

Can someone please help me with this? I want to send a message to every player who is on the server, but not to myself. My code looks like this so far. for(Player all : Bukkit.getOnlinePlayers()) { all.sendMessage(new String(message)); }

lost matrix
quaint mantle
#

using what function

lost matrix
lost matrix
grand magnet
tardy delta
#

Then do a for loop and skip yourself

grand magnet
tardy delta
#

Learnjava moment

#

Just continue if the player has your uuid

lost matrix
grand magnet
lost matrix
lost matrix
#

And what is "it" referring to?

grand magnet
tardy delta
#

Smh

#

For player player : all player
If not you then send message

lost matrix
tardy delta
#

Continue 😋

glossy venture
#

does anyonem lkmwoiw

lost matrix
twilit roost
#

any way to make this?

glossy venture
#

i have one plugin that loads the class, and i want to make it usable from another one

lost matrix
glossy venture
#

it does look like it

#

it doesnt work

#

and i dont want to have to use reflection

lost matrix
#

What is the actual purpose of this?

glossy venture
#

the point is dyanmically loading modules for other plugins

#

and i know that plugins can access other plugins

lost matrix
#

Who is loading the modules?

#

So plugin A loads "modules" from plugin B

glossy venture
#

no i have
loader plugin A

#

user plugin B

#

and package C

#

A is supposed to load C, and then B is supposed to be able to use C

#

no reflection

lost matrix
#

Ooh... that will be very hard because every plugin has its own classloader

glossy venture
#

yeah but they are all parented to JavaPluginLoader.class.getClassLoader()

twilit roost
frosty tinsel
twilit roost
#

and do you know how?

frosty tinsel
#

Probably packets

#

Don't think there's an API for that

lost matrix
glossy venture
#

A is set to load: STARTUP

#

and the loading happens in onLoad

#

so its basically the first thing that happens

lost matrix
#

So even before B has any chance to load?

glossy venture
#

bruh i gtg now

#

yeah

#

i think now

tacit dagger
#

why isn't setInvisible imported into my plugin? I'm quite confused about the import

lost matrix
tacit dagger
tacit dagger
tender shard
#

1.16.2?!

#

LivingEntity#setInivisible was added in 1.16.3

tacit dagger
tender shard
#

if you really want to use 1.16.2 for whatever reason, you have to set the flag on the NMS entity. There's a field called "persistentInvisibility" (in 1.16, the name will be different) and then set the shared flag 5 to true

tacit dagger
tender shard
#

are you using maven?

tacit dagger
tender shard
#

then change the version of your spigot dependency from 1.16.2-R0.1-SNAPSHOT to 1.16.5-R0.1-SNAPSHOT

daring egret
#

punishMenu.setItem(0, placeHolder); i know this is a stupid question but how do i set more than 1 slot with the same item? I've tried creating arrays and things

lost matrix
daring egret
#

ohh

#

you right

#

i didn't think of that lmao

twilit roost
#

Does anyone know a good site for Retexturing Skull with higher resolutions?

tacit dagger
#

thank you

tender shard
tacit dagger
limber marten
#

Hey! I'm trying to create a plot with my own custom generator in a new void world. Ideally i would like a method like generatePlot(int chunkX, int chunkZ) which generates a plot of 4x4 chunks at the given chunks coordinates (chunkX and chunkZ) using my own ChunkGenerator. Rn, i just finished created my ChunkGenerator and i'm wondering how can i use it to create my plot?
My ChunkGenerator (screenshot) : https://media.discordapp.net/attachments/600329318559776781/991671068362280970/2022-06-29_13.45.28.png?width=1276&height=671
What i want (this is something i built as an example) : https://cdn.discordapp.com/attachments/600329318559776781/991460006748758076/2022-06-28_23.42.11.png

#

Maybe i can use ChunkGenerator#generateNoise(WorldInfo, Random, int, int, ChunkData) manually, but i don't know how to do that.

desert tinsel
#

How to insert a string array directly in method?

limber marten
heady spruce
#

Hii! Im currently coding a Test Plugin, where I want to use some functions of Bungeecord but its just an Bukkit Plugin.
When i execute the CMD i get an error:

org.bukkit.command.CommandException: Unhandled exception executing command 'tpm' in plugin aosidjasdjlias v0.1
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot-1.8.9.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot-1.8.9.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) ~[spigot-1.8.9.jar:git-Spigot-db6de12-18fbb24]``` <- Part one (to long)
#
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
    at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot-1.8.9.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot-1.8.9.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot-1.8.9.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot-1.8.9.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot-1.8.9.jar:git-Spigot-db6de12-18fbb24]
        at java.base/java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.NoClassDefFoundError: net/md_5/bungee/api/ProxyServer
        at cmd.TestPermissionManager.onCommand(TestPermissionManager.java:15) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot-1.8.9.jar:git-Spigot-db6de12-18fbb24]
        ... 15 more
Caused by: java.lang.ClassNotFoundException: net.md_5.bungee.api.ProxyServer
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot-1.8.9.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot-1.8.9.jar:git-Spigot-db6de12-18fbb24]
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[?:?]
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
       at cmd.TestPermissionManager.onCommand(TestPermissionManager.java:15) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot-1.8.9.jar:git-Spigot-db6de12-18fbb24]``` <- Part 2
desert tinsel
limber marten
#

String[] str = {"lore1", "lore2"};

lost matrix
lost matrix
limber marten
#

I already created and used a simplex noise algorithm. The issue is to use my ChunkGenerator manually

desert tinsel
#

error

lost matrix
desert tinsel
#

actually it's my method

heady spruce
lost matrix
lost matrix
heady spruce
limber marten
lost matrix
golden turret
#

which only works if there is online players

#

at least 1

lost matrix
# limber marten Oh ok, I thought ChunkData could only be accessed during the gen state of a worl...

example:

  @Override
  public void generateNoise(WorldInfo worldInfo, Random random, int chunkX, int chunkZ, ChunkGenerator.ChunkData chunkData) {
    for (int x = 0; x < 16; x++) {
      for (int z = 0; z < 16; z++) {
        double height = noiseGen.at(x, z);
        int mcHeight = (int) (255 * height);
        for (int y = 1; y < mcHeight; y++) {
          Material material = y == mcHeight - 1 ? Material.DIRT : Material.GRASS_BLOCK;
          chunkData.setBlock(x, y, z, material);
        }
      }
    }
  }

mcHeight is between 0 - 255
This just generates dirt with one layer of grass on top

twilit roost
#

How to force player to hold a specific Item in hand?

#

and make him not able to scroll over

lost matrix
#

And the swap event too. He might press F to swap off and main hand

golden turret
#

and click event too

lost matrix
#

Oh yeah. ItemFrames <- player interact event

#

And drop too

golden turret
#

he might interact with the item in the inventory

twilit roost
#

uhh

#

right

golden turret
#

and

#

if on 1.19

#

dont forget the allay

twilit roost
#

but how to set it to Main Hand?
even tho if all Hotbar slots are occupied

golden turret
#

the PlayerInvrntory have a getItemHeldSlot method

#

or something like this

#

?jd-s

undone axleBOT
golden turret
twilit roost
#

when I click it now it gets duplicated

golden turret
#

acutally this would be better

#

setItem(EquipamentSlot.HAND, item)

twilit roost
#

yep thx

hushed spindle
#

i hate to ask but how long does it typically take for issue reports on jira to get looked at

golden turret
lost matrix
hushed spindle
#

allrighty

golden turret
#
if (event.getRawSlot() == player.getInventory().getItemHeldSlot() || event.getHotbarButton() ==player.getInventory().getItemHeldSlot()) {
  event.setCancelled(true);
  return;
}```
#

?jd-s

undone axleBOT
shy shadow
#

Hey guys, could someone tell me what's wrong here ? It doesn't trigger at all (whether it's the 1st time the player die on the x time)

public class DeathListener implements Listener {
    @EventHandler
    public void onPlayerDeath(PlayerRespawnEvent e) {
        Player player = e.getPlayer();
        int deathCount = player.getStatistic(Statistic.DEATHS);
        if (deathCount == 0) {
            player.getInventory().addItem(new ItemStack(Material.BREAD, 16)
                    , new ItemStack(Material.STONE_SWORD)
                    , new ItemStack(Material.STONE_PICKAXE)
                    , new ItemStack(Material.STONE_AXE)
                    , new ItemStack(Material.STONE_SHOVEL)
            );
            player.sendMessage(ChatColor.GREEN + "Tu as reçu le kit de la honte, tu ne l'aura qu'une seule fois !");
        }
    }
}```
tender shard
twilit roost
#

ye I didn't realize that :DD

tender shard
#

the whole event? or the deathCount == 0 part?

shy shadow
tender shard
#

did you register it?

golden turret
#

^

shy shadow
#

Yep, it worked when I was listening to the playerDeathEvent, but it was giving items before the player respawns

twilit roost
shy shadow
#

So I switched to the PlayerRespawnEvent, and it doesn't work anymore

golden turret
tender shard
golden turret
#

?jd-s

undone axleBOT
severe turret
#

@lost matrixty for the post it's starting to make some sense

shy shadow
#

Yup

golden turret
severe turret
#

but when i join and leave the json is always null

golden turret
#

@shy shadow

shy shadow
#

I put a sout in the 1st line and it does appear in the console yes

golden turret
#

wrong ping

shy shadow
#

No worries 😄

twilit roost
#

thx

golden turret
#

it is a subclass from InventoryClickEvent

#

i guess you can use the same code then

lost matrix
severe turret
#

with the playerdata

twilit roost
shy shadow
# tender shard if you just print a message at the first line in that code, does it get printed?
public class DeathListener implements Listener {
    @EventHandler
    public void onPlayerDeath(PlayerRespawnEvent e) {
    System.out.println("test event player respawn event");
        Player player = e.getPlayer();
        int deathCount = player.getStatistic(Statistic.DEATHS);
        player.sendMessage(String.format("You have died %d times", deathCount));
        if (deathCount == 0) {
            player.getInventory().addItem(new ItemStack(Material.BREAD, 16)
                    , new ItemStack(Material.STONE_SWORD)
                    , new ItemStack(Material.STONE_PICKAXE)
                    , new ItemStack(Material.STONE_AXE)
                    , new ItemStack(Material.STONE_SHOVEL)
            );
            player.sendMessage(ChatColor.GREEN + "Tu as reçu le kit de la honte, tu ne l'aura qu'une seule fois !");
        }
    }
}```

With this, the sout does print in the console, and the player receive the message You have died x times 🤔

Edit : Found the solution, had to put 1 instead of 0, since the previous event was trigger before the "event", but this is now triggered after, so it's not 0 but 1 ! Thanks for your help !
severe turret
#

it creates the file with the uuid

#

like 48ff3303-e9e0-301e-a7b1-e3d2d39b171d

golden turret
severe turret
#

and this is the content

#

{}

#

it should put the uuid and name on the map

lost matrix
#

Well... then you didnt write anything into the PlayerData while the player was online...

twilit roost
golden turret
#

it extends InventoryClickEvent

#

so it have

twilit roost
#

not in my case therefore

#

all I can get is rawSlots

golden turret
#

oh yea

#

sk

#

getInventorySlots

#

and check if it cointains the held item

#

slot

earnest forum
#

do i git to run buildtools?

twilit roost
#

did u mean:
Do I need Git to run buildtools?

earnest forum
#

yes i meant that

#

i really thought i typed need

golden turret
#

buildtools already installs git on windows

#

if you dont have it

#

cant confirm on linux and mac

earnest forum
#

i have 16gb of ram

golden turret
#

that is a memory error

#

the solution is literally on the message

earnest forum
#

i tried doing xmx

golden turret
#

btw you may installed the jdk for 32bjt system

#

check it

earnest forum
#

or do i need the separate download

golden turret
#

seperate

#

install one from adoptoopenjdk

#

AdoptOpenJDK provides prebuilt OpenJDK binaries from a fully open source set of build scripts and infrastructure. Supported platforms include Linux, macOS, Windows, ARM, Solaris, and AIX.

#

you can use others jdk too

golden turret
#

that is the one i use

earnest forum
#

what about this one

golden turret
#

fuck oracle jdk

earnest forum
#

whats wrong with it

eternal night
#

Temurin you mean

earnest forum
#

oracle jdk is working fine

#

thanks for help

grand hull
#

How to generate a list of all items in minecraft?

golden turret
#

Material.values() ??????

quaint mantle
#

I'm getting this when running start.command

river oracle
#

isn't a valid amount of gigabytes

#

Lmao

golden turret
#

bruh

#

i have #G ram

quaint mantle
#

I mean

earnest forum
#

its a placeholder

golden turret
#

that is for mac

river oracle
#

Bakka

quaint mantle
#

oh

#

wait

earnest forum
#

you input how much gigs of ram you put in

quaint mantle
#

i didnt read it

#

oops

river oracle
#

It's a placeholder

quaint mantle
#

mb ty xd

neon brook
#

Hey, what can I use to store negative floats in MySQL database ? I tried int, float and bigdecimal

tardy delta
#

does joining a completablefuture on the main thread also blocks the main thread?

tardy delta
#

i guess but im a little bit confused

#

bad code design lol

old sail
#

Is it possible to make horse jump?

#

Or rear

lost matrix
tardy delta
#

mye thats what i want to avoid

ivory sleet
#

Sometimes that might be inevitable sadly

neon brook
#

I might be a dumdum again, I'l ltry again

golden turret
#

?jd-s

undone axleBOT
tardy delta
severe turret
#
   PlayerData playerJoinedData = new PlayerData();
   playerJoinedData.setClanId(event.getPlayer().getUniqueId());
   playerJoinedData.setLastSeenName(event.getPlayer().getName());
   persistenceHandler.savePlayerData(event.getPlayer().getUniqueId(), playerJoinedData);```
#

so something like this @lost matrix

stark carbon
#

why noClassDefFoundError in gradle compile ?

severe turret
lost matrix
# tardy delta i guess but im a little bit confused
  public void fetchAndBroadcast() {
    CompletableFuture.supplyAsync(this::someAsyncStuff).thenAccept(synced(Bukkit::broadcastMessage));
  }

  @SneakyThrows
  public String someAsyncStuff() {
    Thread.sleep(500);
    return "Infos";
  }
  
  // In a utility class
  public static <T> Consumer<T> synced(Consumer<T> consumer) {
    return (in) -> Bukkit.getScheduler().runTask(this.plugin, () -> consumer.accept(in));
  }
severe turret
#

and then shadowJar {
archiveBaseName.set('<name of your plugin>.jar')
}

tardy delta
#

kekw

severe turret
#

at the end of it

lost matrix
severe turret
#

so

#

what i dont understand is

#

where would i use that to write to the PlayerData class

#

like in which class

stark carbon
#

@severe turret files are not added to the compiled file

lost matrix
neon brook
#
    public void createLocation(UUID uuid, Location location, String locationName) {
        try {
            PreparedStatement ps = pS("UPDATE locations SET (locWorld=?, locX=?, locY=?, locZ=?, locName=?) WHERE UUID=?");
            ps.setString(1, location.getWorld() == null ? location.getWorld().getName() : "world");
            ps.setFloat(2, (float) location.getX());
            ps.setFloat(3, (float) location.getY());
            ps.setFloat(4, (float) location.getZ());
            ps.setString(5, locationName);
            ps.setString(6, uuid.toString());

            ps.executeUpdate();
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

This is the full code

stark carbon
#

@lost matrix

golden turret
#

i guess you dont need ()

lost matrix
lost matrix
tardy delta
#

a bit weird for me to import whole lombok stuff just for the @Sneakythrows

stark carbon
#

@lost matrix how to make?

lost matrix
neon brook
#

oh non

#

It didn't update

lost matrix
#

I dont see the error... where did you post it?

neon brook
#

this is

young shell
#

What is an unspecified State in BlockData?

golden turret
#

wdym

young shell
#

In the Method getAsString there is a boolean Argument called hideUnspecified

#

What does that unspecified mean

golden turret
#

let me see

#

?jd-s

undone axleBOT
golden turret
#

there you go

young shell
#

Yeah but what is an unspecified State

golden turret
#

if something is not specified

young shell
#

I already know that thats what's in the Javadoc, I've read it, but that doesnt answer my question

#

Example?

golden turret
#

if you have a block that dont have the waterlogged property

lost matrix
# neon brook

For MariaDB you might need to remove the brackets.

UPDATE locations SET locWorld=?, locX=?, locY=?, locZ=?, locName=? WHERE UUID=?

Try that

neon brook
#

I'll try, thx

#

Oh man that was it, thank you very much for your time 😄

heady spruce
#

Hi! Is it possible to broadcast using PluginMessageListener? (to entire Proxy)

quaint mantle
#

eclipse is very annoying

glass mauve
#

click "Add 'requires spigot api' ..."

tender shard
#

spigot doesn't even properly support modules

quaint mantle
quaint mantle
#

heres what happens

tender shard
#

btw why do you use eclipse if you find it annoying yourself? 😄

quaint mantle
#

Name of automatic module 'spigot.api' is unstable, it is derived from the module's file name.

quaint mantle
tender shard
#

intelliJ is much easier to use and also way better imho

quaint mantle
#

🤷‍♂️

#

maybe ill switch later

tender shard
#

but tbh I never saw eclipse complaining about modules. what JDK version are you using?

quaint mantle
tender shard
#

just use java 8 and you don't have to worry about modules. 1.8.8 doesnt support anything newer anyway iirc

wary harness
quaint mantle
#

java version "1.8.0_331"

#

Java(TM) SE Runtime Environment (build 1.8.0_331-b09)

#

Java HotSpot(TM) 64-Bit Server VM (build 25.331-b09, mixed mode)

tender shard
#

wtf

#

modules were added in java 9

#

eclipse at its best again I guess

quaint mantle
#

erm

#

idk

#

how do i fix it

tender shard
#

no idea. is eclipse also set to use java 8 in the project settings or however its called there?

quaint mantle
#

its the only java version on my computer

#

soooo

tender shard
#

hm I can only speak for intellij, but that one brings its own JDKs too

#

maybe eclipse also does this? idk

#

havent touched eclipse in 3 years

quaint mantle
#

xd

severe turret
mortal hare
#

since 1.12

#

achievements/advancements are serverside

golden turret
#

?jd-s

undone axleBOT
severe turret
quaint mantle
#

should I be creating a config.yml file?

#

doesnt say

golden turret
#

wdym

quaint mantle
#

I want to make a configuration file for the plugin

#

like the docs say

#

but it doesnt where where / if I make a file

golden turret
#

JavaPlugin#saveDefaultConfig?

#

that will save the default config, based on the config.yml inside the src/main/resources, if on maven/gradle, or src/ if on eclipse

quaint mantle
#

im on intellij noe

golden turret
#

are you using maven or gradle?

quaint mantle
#

idk

#

also im having trouble finding instructions on how to make custom items

golden turret
#

with the folders opened too

dim palm
#

Anyone knows what intellij idea version can i use for Windows 7?

golden turret
#

any i guess

#

just for curiosity

quaint mantle
golden turret
#

why are you on windows 7?

#

lol

dim palm
#

idk

quaint mantle
#

Windows 11 is a thing

dim palm
#

it is more optimized

#

i upgraded to windows 11 and my pc keep crashing lol

ivory sleet
#

w10 🙂

earnest forum
#

yeah

#

w10 is perfect

#

im so confused why they removed dragging files between apps in the taskbar in windows 11

#

such a useful feature

limpid bronze
#

Hey, I've discovered a bug in my custom crafting gui, I can't craft sticks or wooden pickaxe if I use Birch Planks or Spruce, only Oak Planks are accepted
Here is the ingredient map of the wooden pickaxe
{a=ItemStack{OAK_PLANKS x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, Damage=32767}}, b=ItemStack{OAK_PLANKS x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, Damage=32767}}, c=ItemStack{OAK_PLANKS x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, Damage=32767}}, d=null, e=ItemStack{STICK x 1}, f=null, g=null, h=ItemStack{STICK x 1}, i=null}
We can see when it's a slot where you have to put a Oak Planks there is UNSPECIFIC_META:{meta-type=UNSPECIFIC, Damage=32767}
What I have to add to my code to accept other types of planks or what can I do to verify if the item required has UNSPECIFIC_META:{meta-type=UNSPECIFIC, Damage=32767}?

subtle folio
#

How do I send these fancy kick messages?

earnest forum
#

\n in kick message

subtle folio
#

is that really it

#

sweet lmao

earnest forum
#

makes a new line

subtle folio
#

no kidding

earnest forum
#

yeah should work

subtle folio
#

alr alr

severe turret
#

there should be built in interface for ItemStack collections

mortal hare
#

I wonder when does server resource pack gets unloaded from the client

#

can you send kick messages with custom font

#

imagine custom kick message UI

severe turret
#

didnt know that exists

#

but i guess you could use that

#

and you will just check

limpid bronze
#

Yeah but I need to verify if the item required has UNSPECIFIC_META:{meta-type=UNSPECIFIC, Damage=32767} to use them

#

@severe turret

severe turret
#

you can do

#

ItemStack[] planks = new ItemStack[number of elements]

lost matrix
severe turret
#

and then add the custom planks

#

ig

lost matrix
limpid bronze
lost matrix
#

Every ItemStack that has no ItemMeta has an unspecific one

sweet pike
#

I'm really confused on how I am supposed to load a config.yml from the resources folder, into the plugins's data folder and have it loaded. bungee api btw

limpid bronze
limpid bronze
lost matrix
sweet pike
glossy venture
lost matrix
limpid bronze
lost matrix
glossy venture
#

use nbt yeeee

sweet pike
#

any alternatives?

lost matrix
lost matrix
severe turret
#

anyway

quasi hornet
#

Is there a way to change the bungeecord chat type back to chat?

lost matrix
sweet pike
#

ah nvm, maybe i can do something with the bytes

glossy venture
#

read with buffer and then write that

lost matrix
glossy venture
#
byte[] buf = new byte[1024];
while (input.read(buf) != 0) {
    output.write(buf);
}
#

idk if thats how that works but whatverr

#

might have to change the condition to smth else

lost matrix
#

eh. buffering. I'd just read all bytes and then write them in one batch

glossy venture
#

that might use a lot of memory depending on file size

limpid bronze
# lost matrix How?

Depends on the type of Recipe, if it's a ShapedRecipe I create a list of possible of positions and verify for every position if all the items is positioned good, if it's not we go into another position and do the same thing, if no position matched we can't do a craft, if a position matched we set the result slot
To verify if the item is good, I do: (specifiedItemStack and neededItemStack are null/air || specifiedItemStack and neededItemStack are similar) && specifiedItemStack's amount is higher or equal to neededItemStack's amount

glossy venture
#

and this works too
i think this is how the transferTo method is implemented internally

lost matrix
glossy venture
#

yes

#

nah but for other files you may need to copy buffering is the way to go

#

might want to copy an icon or image or smth

#

or extract a native

lost matrix
glossy venture
#

for a default crafting inventory

#

the code is on github

#

could take a look at it

limpid bronze
lost matrix
# limpid bronze No, do I have to use that?

A multi material choice could look like this
[STONE, COBBLESTONE, ANDESITE]
When you just get it as an ItemStack then it will be only
STONE
Checking on equality by simply calling isSimilar() on this ItemStack ignores the other two.

lost matrix
#

Create an Inventory.
In a manager you define a Map<UUID, YourInventory>
When someone opens the ender chest you check if they have a mapped inventory and open it instead.
You can map 2 UUIDs to the same Inventory instance.

limpid bronze
lost matrix
#

Which are of type Predicate<ItemStack>

#

Huh?

#

ok...

glossy venture
#

use a multimap for infinite ender chests

#

per player

minor fox
#

Does anyone have experience synchronizing inventories across multiple server instances?

limpid bronze
lost matrix
limpid bronze
#

No what

minor fox
#

concurrent could potentially work too

lost matrix
# minor fox Data transfer

You would need to serialize the inventory and store it in a place that is accessible for every instance.
For example a DB.

minor fox
#

Are there any built in solutions when it comes to serializing it?

lost matrix
#

There is just one big issue with transferring between instances because the writing into a DB is slower than the actual transfer

lost matrix
limpid bronze
lost matrix
# limpid bronze No what

Its not a list of ItemStacks or Materials.
getChoiceMap() returns a Map<Character, RecipeChoice>

quaint mantle
#

I'm trying to add a new item into the game called TNT Wand, with an enchantment glint. I added the code with no errors, following a tutorial, and the is listed in /help , but when I type /givewand , it shows up in chat, and isn't showing the suggested usage

minor fox
#

Yeah I'm worried the player changes server before the DB is updated... I've thought about doing a server switch cooldown whenever their inventory is updated, but not sure if that's the only approach

quaint mantle
#
commands:
  givewand:
    description: Gives a wand to the player
    usage: /<command>
``` like is this the problem?
lost matrix
quaint mantle
#

ok I checked the logs, and my server is registering the command

#

the problem is that its not spawning in the item

lost matrix
#

Those are the two approaches

river oracle
brave goblet
#

why does HumanEntity exist? when u could just have player

river oracle
#

an advanced NPC could utilize all methods provided by HumanEntity to open inventories and more

brave goblet
#

Ah fun

#

so could i cast human entity to player?

river oracle
#

The question is the likely hood of such an event occuring if your thinking about casting its generally safe to automatically cast blindly, but I generally wouldn't advise it

#

your kind of just playing the odds with that one

lost matrix
brave goblet
quaint mantle
#

ItemManager.java

package com.kyle.myplugin.items;

import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import java.util.ArrayList;
import java.util.List;

public class ItemManager {
    public static ItemStack wand;

    public static void init() {
        createWand();
    }

    private static void createWand() {
        System.out.println("createWand()");
        ItemStack item = new ItemStack(Material.STICK, 1);
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName("§4T§fN§4T §fWand");
        List<String> lore = new ArrayList<>();
        lore.add("This wand will summon an");
        lore.add("§4Explosion §rWhenever you");
        lore.add("use it!");
        meta.setLore(lore);
        item.addEnchantment((item.getType() == Material.BOW) ? Enchantment.PROTECTION_ENVIRONMENTAL : Enchantment.ARROW_INFINITE, 1);
        meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
        item.setItemMeta(meta);
        wand = item;
    }
}
#

Commands.java

package com.kyle.myplugin.commands;

import com.kyle.myplugin.items.ItemManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class Commands implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        System.out.println("onCommand()");
        if(!(sender instanceof Player)) {
            sender.sendMessage("Only players can use that command!");
            return true;
        }
        Player player = (Player) sender;
        if(cmd.getName().equalsIgnoreCase("givewand")) {
            System.out.println("command = givewand");
            player.getInventory().addItem(ItemManager.wand);
        }

        return true;
    }
}
#

plugin.yml

name: MyPlugin
version: 1.0
author: Kyle
main: com.kyle.myplugin.MyPlugin
api-version: 1.13
commands:
  givewand:
    description: Gives a wand to the player
    usage: /<command>
#

using IntelliJ editor

#

video is here

#

github is here

quaint mantle
#

I'm 14 min into the video

#

hope thats enough information! 🙂

limber marten
#

What is the new equivalent to read nbt data from a file? NBTInputStream doesn't exist anymore. I'm trying to read a schematic file.

    FileInputStream stream = new FileInputStream(file);
    NBTInputStream nbtStream = new NBTInputStream(new GZIPInputStream(stream));
    CompoundTag nbtdata = (CompoundTag) nbtStream.readTag();
limpid bronze
naive bolt
#

How can i get players in a certine radius of a location

quaint mantle
#

anyone have good guide on 1.8.8 custom items?

river oracle
#

yea I got you gimme a second

lost matrix
river oracle
#

he just wants enchant glow lol, but that item builder though lmao

#

thats the weirdest singleton I've seen in my life

lost matrix
naive bolt
#

How do i get a BoundingBox

lost matrix
naive bolt
#

do i just give it a block radius

lost matrix
# naive bolt
Collection<Entity> players = world.getNearbyEntities(location, radius, radius, radius, entity -> entity instanceof Player);
#
  public Collection<Entity> getPlayersAround(Location location, double radius) {
    World world = location.getWorld();
    return world.getNearbyEntities(location, radius, radius, radius, entity -> entity instanceof Player);
  }
heady spruce
#

Does anybody know how to play Sounds using PluginMessaging with Bungeecord?

lost matrix
quaint mantle
#

cant even do that

naive bolt
#

how can i make an entity a player

quaint mantle
naive bolt
#

says i cant give it an entity

lost matrix
quaint mantle
#

like its registering the commands

naive bolt
#

needs to be player

quaint mantle
#
(Entity) player
naive bolt
lost matrix
#

and addPlayer((Player) player)

naive bolt
#

ty ty

#

can i edit a bossbar too

lost matrix
#

You mean the text and progress?

naive bolt
#

yea

lost matrix
#

Sure... just set the text and progress

naive bolt
#

how do i know the bossbar key

#

im wanting to change it in a diffrent event

#

so on death it is removed

lost matrix
#

Keep track of the BossBar

naive bolt
#

so i can use the entity id and store the bossbar with it

#

smart

lost matrix
#

Google what "uuid" is an acronym for

naive bolt
#

i figured

pastel relic
#

Hey, so I get this error https://srcb.in/FwO1qBonSM and i can't seem to fix it, I tried checking if target returns null or not, I tried checking if the users is offline / online but nothing worked, I am still getting the same error. Can anyone help?

tardy delta
#

show code

#

my first guess it that youre doing if (Bukkit.getPlayer("name").isOnline())

brave goblet
#
public void InvClickEvent(InventoryClickEvent event){
    System.out.println("Fired");
}```
This doesn't fire if i swap hotbars but if I add 
```java
if (event.getAction() == InventoryAction.HOTBAR_SWAP || event.getAction() == InventoryAction.HOTBAR_MOVE_AND_READD || event.getAction() == InventoryAction.MOVE_TO_OTHER_INVENTORY) {
    System.out.println("Fired");
}```
This does fire why is this happening?
pastel relic
#

something like that

#

wait

#

This is just the code I'm using

tardy delta
#

Bukkit.getPlayerExact is returning null

#

and i guess you utils method doesnt lik that

#

also args[0] can never be null

pastel relic
#

I tried Bukkit.getPlayer and it did the same thing

tardy delta
#

null too lol

pastel relic
#

oh

tardy delta
#

you should check if the target is null instead of args0

pastel relic
#

I did

#

it didnt work

crimson terrace
#

is there any way to change the path created by ConfigurationSerialization to a different name without moving packages?

tardy delta
#
Player target = Bukkit.getPlayerExact(args[0]);
if (target == null) {
  sender.sendMessage("target isnt online");
} else {
  Location safespot = Utils.findSafeLocationFor(target);

  // other stuff
}```
#

@pastel relic

pastel relic
#

thats what I did

#
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.getWorld()" because "player" is null
        at me.nikolakrzheski.deluxertp.utilities.TeleportUtils.generateLocation(TeleportUtils.java:59) ~[DeluxeRtp-3.1.jar:?]
        at me.nikolakrzheski.deluxertp.utilities.TeleportUtils.findSafeLocation(TeleportUtils.java:68) ~[DeluxeRtp-3.1.jar:?]
        at me.nikolakrzheski.deluxertp.commands.RTP.onCommand(RTP.java:55) ~[DeluxeRtp-3.1.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        ... 21 more
earnest forum
#

wheres the code

tardy delta
#

player is null lol

#

doesnt make sense if you did what i told

earnest forum
#

which line

#

is the error

tardy delta
#

your utils method accesses a possibly null object

#

not the if else

pastel relic
#

oh

earnest forum
#

move this into ur else

pastel relic
#

ok wait

naive bolt
#

how do i get the health of an entity on entitydamage event

mortal hare
#

this.changedSlots = Int2ObjectMaps.unmodifiable(modifiedStacks);

#

one FUCKING LINE

earnest forum
mortal hare
#

just for this immutability

#

i need to do reflections for this bullshit

river oracle
#

what u doing

pastel relic
#

oh, that worked

mortal hare
#

packet manipulation

pastel relic
#

ty @tardy delta & @earnest forum

mortal hare
#

im building ui lib

river oracle
#

what type of packet manip you doing

rough drift
#

can you remove the text before a log, like [time] [main/INFO] Something

earnest forum
#

yes

#

use the system.out.println

rough drift
#

I need it to print some text based ui on start

earnest forum
#

instead of logger

rough drift
#

it adds even more text

river oracle
#

remove the servers logger

#

just get rid of it

rough drift
#

yeet

river oracle
#

simple enough

rough drift
#

well no tbf I just need to bypass that in certain scenarios

river oracle
#

little bit of reflection and boom its gone

rough drift
#

well I need it to be there

#

just not always

#

actually I am fine with the logger, I just don't want the text behind it

river oracle
#

well i'd just remove it 100% of the time for maximum effectiveness

#

the date and time?

rough drift
#

date, time, server thread and plugin which printed from

mortal hare
#

why would you want to do that

rough drift
#

I need to make a clean text based UI

#

and that thing is not great for it

mortal hare
#

but these are logging data

river oracle
mortal hare
#

nots some public chat

#

its useful for debugging

rough drift
#

not latest.log

river oracle
#

again reformat the latest.log and reformat it

rough drift
#

what?

river oracle
#

its so easy to reformat it and trail real time as well

#

sending commands is also easy if you use something like tmux or screen

rough drift
#

wdym reformat

river oracle
#

if you trail the latest.log you can remove and add whatever the fuck you want to the lines put in the log file

#

no messing with the server required

rough drift
#

How would that help me print to the cmd/terminal the server is running in...?

old sail
#

Why doesn't Skeleton entity have GENERIC_ATTACK_SPEED attribute?

rough drift
#

and the bow has a fixed attack speed

old sail
#

So there isn't any way to speed it up?

rough drift
#

not really

#

there might be some events

river oracle
#

its in python but its my server panel that I scrapped together

old sail
rough drift
#

I am talking from a plugin's perspective, no extra software

pastel relic
#

can you make args show up when you type a command without using subcmds?

rough drift
#

can I just print A to the console without the extra stuff

river oracle
rough drift
#

I don't want to remove the entire logger, it should still be used

river oracle
#

I wouldn't see another way to do it

rough drift
#

I just don't want the extra stuff

#

maybe using terminal thingy

#

like move back to start of line and \b the shit out of it

river oracle
#

seems like a hastle for literally little to no gain if I wanted a nice format I'd use my own panel as I do

twilit roost
rough drift
mortal hare
#

i wonder how protocollib solves issues with paper's packet limiter

mortal hare
#

since it listens for packets before it reaches paper's packet limiter

naive bolt
#

say i have the health of an entity at 70.75172519683838 and i want to set a bossbar to the health how can i make the number between 0 and 1.0

#

using the starting health of the mob

rough drift
#

num / 100

#

would move it to .7

tardy delta
pastel relic
#

I didn't know what it was called ^^

tardy delta
#

override TabCompletor#onTabComplete to return a list which the options

#

depending on the args length

pastel relic
#

and how do I do that?

tardy delta
#

look at some post

#

forum post

pastel relic
#

okay, thx again

subtle folio
#
for (Player player : Bukkit.getOnlinePlayers()) {
            for (String permission : permissions) {
                if (!player.hasPermission(permission)) {
                    players.add(player);
                    break;
                }
            }
        }``` Will this `break` break from both for loops or just the nested one?
mortal hare
#

it would break from nested one

subtle folio
#

got it

naive bolt
earnest forum
tardy delta
#

time to go to my graduation smh

naive bolt
#

what if i have the health of like 489

subtle folio
#

what is this code

#

so much repeating code Cry

tardy delta
#

shut

tardy delta
#

im using command framework now

subtle folio
#

did you make the framework

vernal abyss
#

I am doing in a SignChangeEvent ```java
Block block = event.getBlock();
Sign sign = (Sign) block;

```[18:39:47 ERROR]: Could not pass event SignChangeEvent to PixliesCore v2.0.0
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.CraftBlock cannot be cast to class org.bukkit.block.Sign (org.bukkit.craftbukkit.v1_19_R1.block.CraftBlock and org.bukkit.block.Sign are in unnamed module of loader java.net.URLClassLoader @759ebb3d)```
event.getBlock() should give me an org.bukkit.block.Block, not an org.bukkit.craftbukkit.v1_19_R1.block.CraftBlock so I don't know what's going on.
subtle folio
#

or r u bad

tardy delta
#

hehehe die

#

undocumented code hehehe

subtle folio
#

bro

#

i shouldve never came here

rough drift
mortal hare
#

i see nothing wrong with this approach of command managing, its just that its hardcoded more

tardy delta
#

lmao its from my old plugin

mortal hare
#

but the performance is way better

#

than iterating nodes of command args

rough drift
#

I just make my command framework use hashmaps

#

won't be as fast as raw if's

#

but it's fast enough

subtle folio
#

enough

naive bolt
#

if i have a big health of like 400

#

i will get 4 and it has to be between 0 and 1

subtle folio
#

how I do commands

rough drift
#

I'll show you mine

#

tho i gotta write it in disc not yet pushed

subtle folio
#

no cap

rough drift
#

which one do you want, the class based one or the non class based one

earnest forum
#

but divide 1 by the max health

#

and then multiply by the current health

rough drift
#

k

subtle folio
#

non class based is kinda cringe imo

naive bolt
#

i hate math

subtle folio
#

just gets super messy

rough drift
#

Eh i have it because I can

subtle folio
#

yk

rough drift
#

for small things it's useful

subtle folio
#

well yeah i can see that

#

but if you've heard of crazy crates

#

i think they have like a 2k line comand listener

#

a bunch of commands

rough drift
#

o no

subtle folio
#

just in if else's

rough drift
subtle folio
#

not even switch 😢

mortal hare
rough drift
#

that's an example implementation

#

not everything is 100% finished

mortal hare
#

just make sure that the max health wont have 0 in it

rough drift
#

command system is still a WIP

mortal hare
#

otherwise your computer will blow up

naive bolt
earnest forum
#

dont need the *100 part but yeah

mortal hare
subtle folio
#

good commit

rough drift
#

yes

#

I sometimes just make mega commits

#

they are 20+ files changed in one commit

subtle folio
#

why is there a new package for each class?!?!

rough drift
#

it's a new package for each command tree

subtle folio
#

ah I se

rough drift
#

it's neatly organized

subtle folio
#

thats cool

#

very neat

rough drift
mortal hare
#

(450 current health warden/500 max health warden) * 100 would you return 90 health for you

earnest forum
#

hes using bossbar so *100 isnt needed

heady spruce
mortal hare
#

ok

subtle folio
mortal hare
#

then yea dont add * 100

rough drift
#

lifesteal is basically just an implementation of a bunch of abstract classes and interfaces

#

and a couple annotations

subtle folio
#

i see

rough drift
#

this is how I handle configs

subtle folio
#

why does it have so many stars

rough drift
#

great question

subtle folio
#

Ⓜ️

rough drift
#

tho the 29 forks

subtle folio
#

mhm

#

what do you use to host it?

#

maven central? Jitpack?

rough drift
#

nothing yet