#help-development

1 messages · Page 712 of 1

kindred sentinel
#

yeah

#

sorry

#

yeah it's ok, it's enum so i need to manually change hex to rgb

#

._,

pseudo hazel
#

cant you just convert the color string into an int?

#

and then use Color.fromRGB with the single int

#

like Integer.decode("0xffffff")

#

but you have to convert your hex string from #color to 0xcolor

wet breach
#

you could always use bitshifting too for this

echo basalt
dawn flower
#

is it possible to create an empty PlayerInventory without a player object?

echo basalt
#

Uhh no

#

Why would you want that

dawn flower
#

how about with an Inventory object?

echo basalt
#

Bukkit.createInventory

#

Still no clue why you want that

dawn flower
#

what if i do java Bukkit.createInventory(null, InventoryType.PLAYER)

#

would that work

drowsy helm
#

yes

sullen marlin
#

Loc is immutable, store/assign return value

#

Maybe idk I.forget

thin iris
#

it was actually the update method i had that was manipulating the loc variable

#

so i just cloned it inside the method

wet breach
#

lol

dawn flower
# drowsy helm yes

no it doesnt if i do PlayerInventory inventory = (PlayerInventory) Bukkit.createInventory(null, InventoryType.PLAYER); it still throws the same ClassCastException

wet breach
dawn flower
wet breach
#

Inventory inventory = Bukkit.createInventory(null, InventoryType.PLAYER)

dawn flower
#

i need a PlayerInventory tho

#

wait

#

can i do

#

inventory.getClass().getDeclaredMethod("getArmorContents") to get the armor contents?

#

since its technically a player inventory

wet breach
#

if you need an actual real player inventory

#

then you need to get the inventory from the player object

#

not create one

sullen marlin
#

?xy

undone axleBOT
dawn flower
#

i need an empty one without a player object

wet breach
#

because when you create one there is no inventory holder

#

unless you specify who the holder is, but the armor contents is something that only entities and players have and thus you would need a holder to at minimum be some kind of entity

dawn flower
#

cant i like just create an empty one without an inventory holder?

wet breach
#

not if you are wanting armor contents

dawn flower
#

what if i dont want armor contents

#

but a PlayerInventory object not Inventory object

sullen marlin
#

?xy

undone axleBOT
dawn flower
#

uh

#

my attempted solutions

#

are

sullen marlin
#

what is your problem

#

what exactly are you trying to do and why

dawn flower
#

i want to create an empty player inventory with no holder

wet breach
#

^

sullen marlin
#

to do what

dawn flower
#

cuz it creates it in the onEnable method

sullen marlin
#

what will this help you achieve

dawn flower
#

i want it to save it before the server restarts and then get it after the server starts from a yml file (im serializing it btw)

#

basically a persistent PlayerInventory variable

wet breach
#

so far you haven't explained why you need these inventories or what it is you are trying to accomplish overall. Why do you need player inventories to save from and to a yaml file. Inventories of players and entities are already saved by the server

sullen marlin
#

why does it need to be this type? I dont think you can have a PlayerInventory without a player

#

but an inventory is just an array of items

dawn flower
#

im just setting their inventory contents to the invetory contents in a hashmaap

tribal quarry
# dawn flower i need it so i can invsee offline players incase they scam an item and just leav...
    public void processOfflinePlayer(OfflinePlayer offline) {
        // Ensure player has data

        if (!offline.hasPlayedBefore()) {
            return;
        }

        // Create a profile and entity to load the player data
        // See net.minecraft.server.PlayerList#attemptLogin

        MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
        GameProfile profile = new GameProfile(offline.getUniqueId(), offline.getName() != null ?
                offline.getName() : offline.getUniqueId().toString());

        server.getAllLevels().forEach(level -> {

            Player onlinePlayer = Bukkit.getPlayer(profile.getId());

            if (onlinePlayer != null && onlinePlayer.isOnline()) {
                ServerPlayer handle = ((CraftPlayer) onlinePlayer).getHandle();

                processRemoval(handle.getInventory());
                processRemoval(handle.getEnderChestInventory());
            } else {
                ServerPlayer offlinePlayer = new ServerPlayer(server, level, profile);
                PlayerDataStorage storage = offlinePlayer.server.playerDataStorage;

                // Load data
                storage.load(offlinePlayer);

                processRemoval(offlinePlayer.getInventory());
                processRemoval(offlinePlayer.getEnderChestInventory());

                // Save data
                storage.save(offlinePlayer);
            }
        });
    }

use NMS

remote swallow
#

Yeah ur over complicating this

#

All you need is an item stack array

#

Items at the start, offhand then armor

tribal quarry
#

you can use NBT reader plugins for IDEA

#

its much easier

#

just goto levelworld/playerdata/uuid.dat

#

copy the file

#

and open it in IDEA

#

it also supports gzip

#

minecraft already saves these stuff for you

dawn flower
tribal quarry
dawn flower
#

cool

#

supports armor?

tribal quarry
#

armor is a part of player inventory, and inventory is a player data

#

so, yes

dawn flower
#

sick

#

tankt

tribal quarry
#

and for sure, don't over-complicate stuff

white root
#

Im aware this might sound stupid, but how do I tell the server that a player chatted something?
i.e. if I want Notch to say "I won!" in chat, but have any chat formatting plugins still do their thing, how would I do this?

dawn flower
#

ik i couldve used an itemstack array but i got lazy and when i was trying to get an empty playerinventory i completely forgot that i couldve used it

sullen marlin
#

you could call AsyncPlayerChatEvent yourself

remote swallow
wet breach
#

its not overly complex. Also you can do as the previous and just read the data file yourself

dawn flower
#

speaking of that does Bukkit.dispatchCommand call the PlayerCommandPreproccessEvent and PlayerCommandSendEvent or do i call it manually

white root
tribal quarry
wet breach
tribal quarry
#

playerdatastorage has its own method for that (saving and reading)

dawn flower
#

uh

wet breach
dawn flower
#

what method name is Server#getAllLevels in craftbukkit 1_19_R2

tribal quarry
tribal quarry
dawn flower
#

one target player

tribal quarry
#

so, please read the function name

#

getAllLevels

#

you don't need the worlds

dawn flower
#

thats literally the code u sent me

tribal quarry
#

get the level world, and get the player data

dawn flower
#

k

tribal quarry
dawn flower
#

ServerPlayer is just EntityPlayer right?

tribal quarry
# dawn flower k
World bukkitMainWorld = Bukkit.getWorlds().get(0);

You can get it like that so

tribal quarry
dawn flower
#

k

tribal quarry
#

or for NMS (based on what frostalf sent of OpenInv's code):

ServerLevel mainWorld = server.getLevel(Level.OVERWORLD);
#

I couldn't understand minecraft

#

why they just not saving the data in server directory?

#

or maybe its because each client world has its own data? so they move the world to the server and launch it easier?

dawn flower
#

is getInventory just fE?

#

it returns PlayerInventory

tribal quarry
wet breach
dawn flower
#

ok last question does proccessRemoval just remove the items / modify the items from the inventory only or does it have to do something else?

tribal quarry
tribal quarry
dawn flower
#

k

robust shuttle
#

can anyone help me with a bug?

#
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
  int maxHealth = (int) player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue();
  ItemStack heldItem = player.getInventory().getItemInMainHand();
  Player player = event.getPlayer();

  if (!(heldItem.isSimilar(ItemManagerHeart.Heart)) || !(event.getAction().name().contains("RIGHT_CLICK")))
    return;

  if (maxHealth >= 40) {
    player.sendMessage("§8[§4✕§8] You have reached the maximum amount of hearts!");
    return;
  }

  player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(maxHealth + 2);
  player.sendMessage("§8[§a✓§8] You have gained 1 heart!");
  heldItem.setAmount(heldItem.getAmount() - 1);
}
#

The item equips twice when clicked once

brazen isle
#

how to off combat with mobs

#

??

#

@vital token

robust shuttle
sullen marlin
#

Yes

lost matrix
robust shuttle
lost matrix
robust shuttle
#

ohhhhhh

lost matrix
#

You need to check for which hand the event was fired

#

And then you can simply get the used item from the event

sullen marlin
#

event.getHand()

robust shuttle
#

sorry, still pretty new to Java

sullen marlin
#

Yes

#

If hand equals main hamd

#

Hand

#

?learnjava

undone axleBOT
brazen isle
#

how to off combat with mobs please tell

brazen isle
#

cant understand can you tell @lost matrix

lost matrix
robust shuttle
brazen isle
#

no i used your combat log plugging but in that when i hit with any mob and taken fall damage i come in combatlog i nedd only combat in with hitting with a player @lost matrix pls help bro

lost matrix
robust shuttle
#

okay, back to the drawing board

robust shuttle
lost matrix
lost matrix
lost matrix
# robust shuttle It seems to be working

The solution is

public void onInteract(PlayerInteractEvent event) {
  if(event.getHand() == EquipmentSlot.OFF_HAND) {
    return;
  }
  // Continue with your code otherwise
}
#

For enums you can use ==. Otherwise you should prefer .equals()

robust shuttle
#

Can I replace OFF_HAND with HAND? Because I only want to equip the item when its in the players main hand

#

well

#

since its returning, it doesnt matter right?

lost matrix
#

Do you know what return does?

robust shuttle
#

Yeah, I was being stupid

lost matrix
#

This is called an early escape and makes your code cleaner. Use it often for events.

robust shuttle
#

okay

#

thanks for the tip

#

Yep, still works! thanks for the help!

#

Wait, one more question that a diffrent bug

#

So I have it to where when a player dies, they get banned off the server, then when a player uses a certaint item, it pardons them

#

the only problem is that when the player rejoins the server, they get both the items that they had, and the items that were on the ground from their death

#

any ideas on how to make it to where it clears the banned player so it doesnt dupe the items?

lost matrix
robust shuttle
#

Thats the thing, its banning them before the death registers

lost matrix
#

Then ban them afterwards

robust shuttle
#

I am

#

but it doesnt work

#

here, 1 sec

#
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player player = event.getPlayer();
        Player victim = event.getPlayer();
        Player killer = victim.getKiller();
        int valp = (int) player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue();
        if (killer != null) {
            int valk = (int) killer.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue();
            int valv = (int) victim.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue();
            victim.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue((double) (valv - 2));
            if (victim.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue() <= 1.0) {
                victim.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue((double) (6));
                victim.kickPlayer("§cYou have run out of hearts!");
                victim.banPlayer("§cYou have run out of hearts!");
            }
            if (valk >= 40 && killer != victim) {
                killer.getInventory().addItem(new ItemStack[]{ItemManagerHeart.Heart});
            } else if (killer != victim){
                killer.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue((double)(valk + 2));
            }
        } else {
            player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue((double)(valp - 2));
            if (player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue() <= 1.0) {
                player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue((double) (6));
                player.kickPlayer("§cYou have run out of hearts!");
                player.banPlayer("§cYou have run out of hearts!");
            }
        }
    }
lost matrix
#

kick them one tick later

robust shuttle
#

how do I do that?

lost matrix
#

?scheduling

undone axleBOT
robust shuttle
#

uhh

#

it technically worked

lost matrix
#

both the items that they had, and the items that were on the ground from their death
What does this even mean? Did they duplicate their items?

robust shuttle
robust shuttle
lost matrix
#

Do you use essentials?

robust shuttle
#

the mod or the plugin?

lost matrix
#

-.-

robust shuttle
#

EssentialsX?

lost matrix
#

Yes

robust shuttle
#

no

#

umm

#

do you know how to fix that error?

lost matrix
robust shuttle
#

Nothing, it was a bug in my code that failed

dire jewel
#

how many network_compression_threshold use for network with many players like 300+? 256/512/1024?

tacit drift
#

Can someone help me on registering commands on runtime?
If i register the command in onEnable it works as normal but after that the command seems to get registered only for the console sender

chrome beacon
#

?ask

undone axleBOT
#

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

tacit drift
#

?paste

undone axleBOT
tacit drift
#

first class contains only the method to register the command and to update the commands list for every player online

second class is what the "main command" class contains and seems to work just fine if used in the onEnable method

third class is what the the command that the main command registers if ran at anytime and is pretty much the exact same thing

last thing is the plugin's onEnable method

tacit drift
#

fixed it

upbeat fog
#

Hi! I need some help making a system where every 30 seconds a boss switches between a "minigame" and a normal phase, my current method seems to crash the server 😂

#
boolean minigamePhase = true;

new BukkitRunnable(){
             @Override
             public void run(){
                 if(boss.isDead()){
                     hellBossManager.handleDeath(boss);
                     return;
                 }

                 if(minigamePhase = false){
                     normalPhase();
                 } else if (minigamePhase = true) {
                     Minigamephase();
                 }

             }
         }.runTaskTimer(HalalBoxCustomBosses.getInstance(),0l,20l);


         new BukkitRunnable(){
             @Override
             public void run(){
                if(minigamePhase == true){
                    Bukkit.broadcastMessage("Minigamephase: true");
                    minigamePhase = false;
                    boss.setAI(true);
                    boss.setInvulnerable(false);
                    boss.getWorld().spawnParticle(Particle.PORTAL,boss.getLocation(),1);
                    boss.getWorld().playSound(boss.getLocation(), Sound.ENTITY_ENDERMAN_TELEPORT,1,1);
                    boss.teleport(HalalBoxCustomBosses.getInstance().HellBossSpawnLocation);

                } else if (!minigamePhase == false){
                    Bukkit.broadcastMessage("Minigamephase: false");
                    minigamePhase = true;
                    boss.setAI(false);
                    boss.setInvulnerable(true);
                }

                 if(boss.isDead()){
                     return;
                 }
             }
         }.runTaskTimer(HalalBoxCustomBosses.getInstance(),0l,5*20l);

#
public void normalPhase(){
         while(minigamePhase = false){
                 if (boss.getTarget() == null) {
                     for (Entity entity : boss.getNearbyEntities(100, 100, 100)) {
                         if (entity instanceof Player) {
                             boss.setTarget((Player) entity);
                         }
                     }
                 }
             }
     }

     public void Minigamephase(){
         BlockData blockData = Bukkit.createBlockData(Material.BLACK_CONCRETE);
         Location location = boss.getLocation();
         location.setY(1.75);


         while(minigamePhase == true){
             for(Entity entity : boss.getNearbyEntities(3,3,3)){
                 if(entity instanceof Player){
                     Vector launchDirection = entity.getLocation().toVector().add(entity.getLocation().toVector().multiply(-1));
                     launchDirection.setY(1);
                     entity.setVelocity(launchDirection);
                 }
             }

             HalalBoxCustomBosses.getInstance().drawCircleWithData(location,Particle.BLOCK_MARKER,3,blockData);

         }
     }
maiden kiln
#

net.minecraft.world.entity.EntityEvent is seemingly entirely missing from NMS - I can find it as usual using Paper's system, mapping websites, etc., but when using BuildTools and importing Mojang-mapped NMS into a project it seems to be entirely missing

#

Am I missing something? or should I open a bug report?

shadow night
#

how can I set the power of a fireball or tnt in 1.8? Was that not a thing or will I have to do it on some kind of explosion event?

upbeat fog
shadow night
#

thanks

lilac dagger
#

instead of if?

#

while in your case will trigger a thread freeze

upbeat fog
#

I tried if

#

and it wouldnt switch

#

but thats I think because of the menthod I used to switch

#

yeah I removed that now cuz I already called if in a runnable

lilac dagger
#

it can be solved with if

#

don't use while in this case

#

it's for looping, not for condition checking

upbeat fog
#

yeah thats a good point

#

what about the switching part of the code?

#

I'll send it again hold on

#
new BukkitRunnable(){
             @Override
             public void run(){
                if(minigamePhase == true){
                    Bukkit.broadcastMessage("Minigamephase: true");
                    minigamePhase = false;
                    boss.setAI(true);
                    boss.setInvulnerable(false);
                    boss.getWorld().spawnParticle(Particle.PORTAL,boss.getLocation(),1);
                    boss.getWorld().playSound(boss.getLocation(), Sound.ENTITY_ENDERMAN_TELEPORT,1,1);
                    boss.teleport(HalalBoxCustomBosses.getInstance().HellBossSpawnLocation);


                } else if (!minigamePhase == false){
                    Bukkit.broadcastMessage("Minigamephase: false");
                    minigamePhase = true;
                    boss.setAI(false);
                    boss.setInvulnerable(true);
                }

                 if(boss.isDead()){
                     return;
                 }
             }
         }.runTaskTimer(HalalBoxCustomBosses.getInstance(),0l,5*20l);
lilac dagger
#

you're using ! and == false

upbeat fog
#

yeah

#

I just saw that

lilac dagger
#

which means you're having 2 double 0 negatives

#

they just cancel out

upbeat fog
#

so in theory this should work now

lilac dagger
#

yes

#

also

#

don't use == false

#

or == true

#

use if (minigamePhase) or if (!minigamePhase)

#

this is how you see code basically everywhere

#

so it's best to keep it like this

upbeat fog
#

yeah I changed it

#

aight I'll test it

magic glacier
#

I want java to see a unique message and the bedrock to see another unique message which is different from the other

I asked geyser project lead, they told me that it's something related to spigot api

#

Ex.

If I type meow, the bedrock players see it I'm a cat

While java players see it I'm not a cat

It refers to the edited message by
e.setMessage.

drowsy helm
#

Then send accordingly

maiden kiln
upbeat fog
#

@lilac dagger everything is working now, thank you. Except theres one little problem: boss.setInvulnerable(true); doesnt work.

#

Is there a way to fix it?

magic glacier
#

Mention me on answering please

upbeat fog
#

he already answered it

magic glacier
#

Where

magic glacier
#

I can't see the message

upbeat fog
#

Use geyser api to get the session and check it the player is bedrock
Then send accordingly

#

thats what he said

magic glacier
#

I have reloaded discord

#

because I want to edit the message to show to the bedrock as a message in chat , and to show another unique message for java in chat also

#

Or is that not possible?

shadow night
#

It should be possible, but I don't think anybody here can give a code sample

magic glacier
shadow night
#

Ig something like what you need could either be done with geyser api if it has the correct tools or packetry

magic glacier
shadow night
#

¯_(ツ)_/¯

sullen marlin
#

I dont see how making a plugin that shows different stuff to geyser players is a spigot api issue?

#

spigot api doesn't know about bedrock

shadow night
#

Yep

#

Does mc send a packet to each player when a message is sent?

sullen marlin
#

Yes

shadow night
#

So, you can just track outgoing packets, and if a message packet is going to a bedrock user (check through geyser api ig) modify it?

jagged thicket
#

ranker = (Player) Bukkit.getOfflinePlayer(args[1]);

#

can i use this to get offline player as player

shadow night
#

Why would you want to have a player objebt of an offline player?

jagged thicket
#

and i want to manipulate offline player data

shadow night
#

I would guess, since the player doesn't exist in the server currently, that wouldn't do it

sullen marlin
#

Change your SQL stuff to rely on offline player then

#

Or just uuid

shadow night
#

Yep, uuid is always the way

maiden kiln
#

Mainly unsure if it's an issue on my end or a bug I should report

jagged thicket
lilac dagger
#

i'm not sure if setinvulnerable works for every entity

upbeat fog
#

and it doesnt work 💀

lilac dagger
#

check by entity uuid

upbeat fog
#

I did, I even tried with persistant data container, or without any check

#

I was still able to hit him

shadow night
#

Sounds like you didn't register your event

upbeat fog
#

the whole class is registered

#

otherwise the damage leaderboard wouldn't show up

#

its weird

abstract iron
#

@tender shard Tagging you here so its not in general
I heard that some people use an extension "Minecraft Development"? Is that recommonded?

lilac dagger
#

at where you cancel it

#

btw this does nothing

#

at least cancel the task

upbeat fog
#

yeah I use cancel() now

lilac dagger
#

and move it on top

upbeat fog
#

its on top everywhere

lilac dagger
#

but it's not best to have it in a task

#

but in a entity death event

upbeat fog
thin iris
tender shard
#

I would suggest to just create your project using a proper maven archetype, e.g. mine
https://github.com/mfnalex/spigot-plugin-archetype

it also has a fancy gui:
https://github.com/JEFF-Media-GbR/Spigot-Plugin-Generator

GitHub

Highly configurable maven archetype for Spigot plugins - GitHub - mfnalex/spigot-plugin-archetype: Highly configurable maven archetype for Spigot plugins

GitHub

Contribute to JEFF-Media-GbR/Spigot-Plugin-Generator development by creating an account on GitHub.

#

ofc you can also use gradle instead, but gradle has a much harder learning curve imho while adding 0 advantage when just doing simple projects

magic glacier
worn flume
#

Hey, idk if this is the right channel but:
I'm trying to generate a world with more ores, and I was looking for simple solutions as this is not the main focus of my project.
I have been looking for solutions, but nothing really fit me: either it's not working, or it have to be overly configured and I dont really want to spend a lot of time doing this.

All I want is to "override" minecraft's default ore generation, but with -way- more ores.
I tried using ChunkGenerator which kinda worked, but all it did was to generate more ores in the walls, which is not exactly what I want.
I also couldn't make OrePopulator work properly, even though it seems like its the way to go.
Can you help me with this ?

tender shard
#

it has a method isNewChunk() which well, gets called if this is a new chunk

#

then you can add you ores there

#

the proper solution however would indeed be to use a custom OrePopulator - you say it "didnt work properly" - what do you mean with that?

thin iris
#

is there a way to mimic like swinging on a rope from point a to point b with velocity

livid orbit
#

hey guys, i know im probably gonna get shot on site for this, but I am running a server that uses bungeecord for minecraft 1.5.2, and I need to address a super slow memory leak present in it

#

i backported the spark plugin to it to check, but since its such a slow memory leak, itll still be tough to narrow down

shadow night
#

oh hi

livid orbit
#

im very much willing to patch it myself

#

oh hi

#

it runs out of memory after a couple months

#

where it just straight up hangs, after erroring for a few incoming connections

#

which is annoying and i COULD just have it auto restart every 24hrs but thats LAME

#

so tl;dr need to narrow down and patch (myself) the memory leak source

#

but would appreciate some help especially if anyone has any insight about any memory leaks since 1.5.2 bungeecord

chrome beacon
#

And see what objects are in memory

#

If your Bungeecord crashed with an out of memory error there should already be one in the folder

livid orbit
#

i just checked, there's nothing in the folder related to dumps

#

but itll be tough since the memory leaks take so long to actually happen

#

i have a friend who made a fork of bungeecord 1.5.2 for a different purpose (eaglercraft); I mght be able to ask them if they encountered/patched any memory leaks when making their fork

ivory sleet
warm mica
remote swallow
ivory sleet
#

yea 👍

tacit drift
livid orbit
#

i mean, one of my bukkit servers auto restarts every 4 hours anyways...

#

the other one runs 24/7 tho

livid orbit
#

but the bungee i dont really want to auto restart

#

specifically since i'd have to 1) sync up server crashes/restarts with the bungee

#

and 2) the 2nd server that runs 24/7 would be affected whenever bungee restarts

tacit drift
#

If you don't want to automatically restart it, just create a memory dump after one month or when the memory it's full

jagged thicket
#

how do i equate [sus] and sus

#

string

livid orbit
#

wdym

worn flume
#

But now the issue is that I dont really understand how does ore generating work

smoky oak
#

does IJ have an indicator that changes have been made since the last time you have built? I've just realized i couldnt remember if i ended yesterday with building or fixing some code

#

uh alright more pressing question, why does it take more than a second to register a max health attribute change on localhost?
goddammit its a visual bug

lilac dagger
#

yes

#

right click the project

#

show local history

smoky oak
#

ah i see

lilac dagger
#

you have no idea how useful this feature is

#

probably pushing your project to git would do the same but...

tender shard
#

git clone a normal gradle project and you can sit down and wait for at least 10 minutes

#

it's because gradle thinks that "maven local isn't good enough"

#

"i only use maven local if it was declared using mavenLocal() in the repositories { } closure"

earnest socket
#

Can someone please explain why this is happening. Ignore the fact that I am using the package path in a method. Just trying to figure out why I can't import it

#

It seems like all biome related classes are gone in 1.20 nms

undone axleBOT
tender shard
#

or build.gradle if using gradle

earnest socket
#

All of it or just the spigot nms dependency

#

?

#

Could the mojang mappings be the issue?

#

That was it apparently

#

I've no idea why the classes are not present with them though

icy beacon
#

use the mappings to see what class you're looking for btw

#

?nms

icy beacon
#

wrong

#

1 sec

tender shard
icy beacon
#

i thought capcreeper already got the mappings?

tender shard
# earnest socket Can someone please explain why this is happening. Ignore the fact that I am usin...

yep, BiomeBase is the spigot name. the Mojang mapped name for that class is just "net.minecraft.world.level.biome.Biome"

https://blog.jeff-media.com/switching-from-spigot-mappings-to-mojang-mappings/

If you are switching from Spigot’s mappings (with class names like EntityZombie, WorldServer, PacketPlayOutSpawnEntity…) to Mojang mappings, you will notice that many of the classes you were using can’t be found anymore, since they now have different names. You will have to change all your references to those classes to their new names. Setup Mo...

earnest socket
#

that makes sense

tender shard
#

See the above linked buide on how to switch from obf/spigot mappings to moj maps:

earnest socket
#

I feel kinda stupid now

tender shard
#

?switchmappings

remote swallow
#

screaming sandles is deprecated

#

?mappings

undone axleBOT
smoky oak
#

If i add a custom logger handler and do not remove the default handler:

  1. does it just call the handler's publish method every time something is written to the logs?
  2. does it have to handle the log level manually?
#

goddammit it doesnt

#

alright

#

how do loggers work

#

maybe im printing to the wrong location

#

i cant tell if its not calling it or if it's not outputting anything. I'm assuming system.out.println is the wrong output stream, but idk where to go from here

eternal oxide
#

log4j is a bitch with logging level

smoky oak
#

I'd need to get the logger working in the first place lol

eternal oxide
#

sysout is purely for debugging, don;t use it in a production plugin

smoky oak
#

ah

#

its not calling it in the first place

#

i just put a bukkit broadcast into it

#

no output

eternal oxide
#

are you hooking the bukkit logger or your plugin logger?

smoky oak
#

uh

#

OnEnable getLogger().addHandler(new GGPLogHandler());
Handler: ```
@Override
public void publish(LogRecord record) {
System.out.println("GGP Handler");
Bukkit.broadcastMessage("GGP Logger \n"+record.getMessage());
}

eternal oxide
#

Bukkit.getLogger or Plugin#getLogger ?

smoky oak
#

that'd be plugin

#

yea

#

thats probably the issue

#

oh that's curious

#

exception log records dont contain the stack trace

eternal oxide
#

its been a while since I played with the logger but I know when it switched to log4j it was a pain in the ass

smoky oak
#

hm

#

I'm trying to extract the cause message from throwable, but i only get the text 'test' which is the command I'm throwing a runtimeException

chilly hearth
#

e

smoky oak
#

getStackTrace just spits out the actual stack trace

warm mica
eternal oxide
smoky oak
#

i dont think i have access to the exception

#

im getting the Throwable cause

#

also does the logger not clean out previous handlers on restart?

eternal oxide
#

no

#

remove them in onDisable

eternal oxide
#

EntityEvent is an abstract class.

smoky oak
#

what kind of breakpoint is this lol

eternal oxide
#

stop I'd assume

smoky oak
#

huh

#

'no executable code found'

#

so if true {} doesnt work as a java breakpoint

#

noted

#

welp im out of ideas

#

the stacktrace in test is just everything EXCEPT the caused by

smoky oak
eternal oxide
#

At any point you can obtain the current stack by creating a new Throwable

smoky oak
#

rly?

#

imma try that

#

wait a throwable aint a exception

#

i have the throwable

#

its just not containing the stuff i need

eternal oxide
#

What do you need from it? it has many components

smoky oak
#

alright u crashed my server

#

?paste

undone axleBOT
smoky oak
eternal oxide
#

getMessage(), getStackTrace() and getCause()

smoky oak
#

oh you edited ur message

eternal oxide
#

I often do, for typos

smoky oak
#

both new Throwable and new Exception crash the server

eternal oxide
#

you can;t get a cAUSEDbY IF THE tHROWNABLE HAS NOT BEEN tHROWN

#

err caps, I'm not editing that

#

ie, you can create a Throwable which has a null cause as it's not been thrown

smoky oak
#

throw is a keyword???

#

ah right

#

im dumb

smoky oak
eternal oxide
#

ie `throw YourThrowable

smoky oak
#

I'm trying to catch exceptions and print the cause to the chat

eternal oxide
#

caught in a try catch would have a cause

smoky oak
#

ah

#

yea im trying to get around try/catch

#

by using the message when it's printed to the logger

eternal oxide
#

new Throwable().getCause() would not

#

if you toString on teh Throwable you can see all it has

smoky oak
#

but why is that only the exception?

#

is it printed to the console in two separate messages?

eternal oxide
#

not sure

smoky oak
#

im pretty sure i need the stacktrace

#

but the stacktrace isnt the caused by

#

or at least not the right one

eternal oxide
#

nope, it's just a list of all calls

maiden kiln
eternal oxide
#

yes

maiden kiln
#

If so, please read my message - I'm talking about an NMS class

#

net.minecraft.world.entity.EntityEvent

eternal oxide
#

it will nto be called tht on the live server

#

?mappings

undone axleBOT
maiden kiln
#

I know, please read my message ;-; - the issue there was that it seems to be entirely missing when importing NMS into a project

eternal oxide
#

read what message?

smoky oak
#

'no such instance field'
.......
are java classes handled differently?

#

its a non-static field and a non-static method

maiden kiln
#

That NMS class seems to be entirely missing when running BuildTools and importing NMS into a project, (but definitely exists, as it's both on mapping websites & works fine in Paper's NMS tooling), so not sure why is it missing when using BuildTools & if it's an issue on my end or a bug

eternal oxide
maiden kiln
#

Yep (I know the API has an enum for that, but it doesn't include everything & all I really need is to use the constant from there instead of hard-coding in the id)

eternal oxide
#

no clue, it shoudl be there but it seems its not

worldly ingot
#

Looks like a class filled with constants and no methods. All constants are probably inlined by the compiler and the decompiler was just like "lol whatever" and discarded the class because it was empty

eternal oxide
#

ah

worldly ingot
#

So, decompiler "bug" I guess

#

You could use EntityEffect.CONSTANT.getData() if you don't want to hardcode something

#

The names might not be precise but the ids should all be there

#

Or Effect.CONSTANT. Depends on which ones you need

#

Reason it exists in Paper btw is because they use ForgeFlower iirc which is a Fernflower fork that probably forces that class to exist

maiden kiln
#

I think they might use Vineflower now? or are going to at least

worldly ingot
#

Something like that. Some fork of Fernflower

maiden kiln
#

But ye makes sense, EntityEffect is missing some sadly so can't really use that - I guess hard-coding one number isn't too bad for now if this isn't something that can be easily fixed

worldly ingot
#

As an aside though, if we are missing some constants in EntityEffect or Effect, please do either make a bug report or create a pull request

#

We'll happily get them added. Super easy to do

thin iris
#

is it possible to replicate a swinging rope animation with a player, if so how 😭

worldly ingot
#

It's hard to keep up with them

maiden kiln
#

Ye I think Paper had some PR for that - can't make Spigot PRs sadly, but I'll open an issue soon

worldly ingot
#

An issue would be fine. I or someone else on the frequent contributors list can tackle it

#

Like I said, easy to add so it's not that big of a deal

#

I'd do it myself but I'm still away on vacation. No access to BT lol

remote swallow
#

you have access to BT

#

on ur gfs computer

worldly ingot
#

Nah I don't wanna run BT and install a bunch of dependencies

earnest socket
worldly ingot
#

Probably registryAccess()

maiden kiln
#

oop

worldly ingot
#

Then b() is likely getRegistry() or getRegistryOrThrow()

earnest socket
#

It doesn't seem like it's either

fossil flax
#

someone know how to create an action bar?

earnest socket
#

It does work when I replace WritableRegistry with a normal Registry

#

but idk if it'll work for the rest of the code

maiden kiln
earnest socket
#

Nvm Writable registries changed it 1.19.3

green prism
#

Hello!

I hope you're doing well. I'm currently working on implementing ATMs in my project, and I've typically stored "blocks" within the configuration file by saving and loading raw location data (x, y, z, world). Then, I've checked for block interactions by verifying if the list contained those clicked block coordinates. However, I'm interested in improving my code and wanted to get your opinion on a more efficient approach. Do you have any suggestions or ideas to enhance this aspect of my code?

worldly ingot
#

To be quite honest, using something simple like a List is probably totally fine. The time it would take to iterate that list and compare positions with the amount of ATMs that would be in the world at any given time is probably negligible.

#

The better way, however, would be to use a Map of some sort to map positions to some ATM object instance which should be an O(1) operation as opposed to the List which would be an O(n) operation (worst case)

green prism
#

Thank you so much!

dry forum
#

what would i use to check when a zombie walks on carpet

smoky oak
#

I'm going to consolidate the issue I've been trying to solve into one message:
I've created a new Handler (java.util.logging) to print out the type of exception and causedBy messages to chat so i can quickly go back into the code and find the spot that's causing issues.
The problem is that while the Throwable in the LogRecord contains the stackTrace, it doesn't seem to contain the causedBy, but as far as i can tell, it is all printed to the chat (Stack trace and exception origin) to the console in one message

smoky oak
dry forum
#

which event though

smoky oak
#

depends when you need to check

wary remnant
#

Preferably an asynchronous scheduler that checks the current location of all Zombies periodically

tacit drift
#

how much data can PDC carry on an item?

wary remnant
#

(or a specific chunk of them every n ticks)

dry forum
#

so theres no event to check when an entity/zombie moves?

echo basalt
#

good luck doing block checks async without creating a whole snapshot

echo basalt
#

or lag the server by just encoding

#

(iirc)

wary remnant
tacit drift
#

updating an item's PDC for every block break would be bad for performance?

smoky oak
#

illusion'S kind of right, kind of wrong. theoretically infinite, but if it's ever sent to the player and above ~3MB / ~20MB (version dependent) it kicks the player

shadow night
worldly ingot
#

It's fine

tacit drift
#

cool

last echo
#

maybe i'm dumb a bit, but is there a way to disable this two messages?

#

oh

#

can't attach a photo

#

SpigotLibraryLoader to be exact

echo basalt
#

my pc about to explode

smoky oak
#

ah i made that mistake once

half wyvern
#

Hello
I have a question: why doesn't buildtools install any files to the local repository?

smoky oak
#

it does

#

it just goes to C\users\you\.m2

half wyvern
#

Well, the problem is that I don't want to install Bukkit and I don't know if it's supposed to be like that or if there's an error

earnest socket
#

Is there any way to get a custom biome from a namespace and key and use it in a BiomeProvider?

river oracle
#

confused on your issue

#

seems like a non issue to me buildtools is working as expected

half wyvern
remote swallow
#

might be quiltflower

echo basalt
#

it was decompiling rather than using sources

#

it's fine now

river oracle
#

seems rather useless

#

I mean granted spigot builds craftbukkit jar if for some reason you'd ever want that

digital ridge
#

Hello guys, i have a wildtp plugin and i wanna let the normal players do the command /wild bcz its only works for the op players.
does anyone know how can i enable it for the normal players ?

river oracle
digital ridge
#

ok

half wyvern
remote swallow
#

yes you can, im pretty sure it mvn install its when running anyway

#

i dont think bukkit can even run as a server on its own

#

you have to use craftbukkit

worldly ingot
#

Unsure why it's prefixed with SpigotLibraryLoader though. Definitely not something we added. Probably a Paper addition

remote swallow
#

paper

#

its probably to have them not get screamed at for "breaking maven central tos"

remote swallow
#

if you really really dont want those lines use libby

twilit basalt
#

When is getAddress from Player supposed to return null?

worldly ingot
#

Probably during login

#

That would be it

last echo
remote swallow
#

it will happen with all libraries

twilit basalt
last echo
#

So understandable

worldly ingot
#

It will most definitely be available in join and quit, yeah

twilit basalt
#

okay thanks

remote swallow
#

https://github.com/The-Epic/libby this is a fork of libby which does the same thing but with 1 line message only on download, all the fork does is modify some of the messages and make it download it to the server libraries folder instead of the plugins data folder

worldly ingot
#

Oh, I was wondering how there were 25 forks but zero stars

#

I guess GitHub displays the forks of the parent for some reason

remote swallow
#

its a fork of a fork

fossil flax
#

how can i add hex color support in a plugin? (for command output and player messages)

river oracle
#

its easiest that way. Though if you're doing the proper thing and parsing from configs I'd suggest just using something like MineDown or MiniMessage

worldly ingot
#

If you want things to be more clear, just a few more variables would be fine

sage patio
#

then why isn't?

#

ig its more than 50 too maybe

worldly ingot
#
public static String getHUDHealth(Player player, String full, String empty) {
    double healthPercentage = player.getHealth() / player.getMaxHealth(); // (should technically be using attributes here)
    int fullCharacters = (int) (50 * healthPercentage);
    int emptyCharacters = 50 - fullCharacters;
    return full.repeat(fullCharacters) + empty.repeat(emptyCharacters) + " " + player.getHealth();
}```
#

I mean just mathematically it's impossible to be more than 50 characters. So what you're seeing on screen is probably 50 characters

#

If you want less, reduce the amount of characters I suppose

smoky oak
#

how's that hud thing handled? I'm curious how it's beind displayed

remote swallow
#

boss bar and negative and positive space

worldly ingot
#

Yep

smoky oak
#

that doesnt look like a bossbar lol

worldly ingot
#

Well no of course it doesn't

#

It's a resource pack lol

remote swallow
#

the bossbar has no texture

smoky oak
#

ah

#

yea i'm looking into HUDs without RPs rn

remote swallow
#

you can do it with action bar too

smoky oak
#

I'm also looking for help with loggers but apparantly nobody knows about those

smoky oak
remote swallow
#

except you have to also account for other peoples action bars and adding dynamically doing the space math

sage patio
remote swallow
sage patio
#

lemme test

remote swallow
#

you can use negative and positive space in action bars too, to get water on a hud

#

it just takes a lot of work to try and dynamically add the negative/positive spacing according to char length

sage patio
remote swallow
#

damn

sage patio
#

but i use shaders to move it into top-left

remote swallow
#

i thought it was bossbar

sage patio
#

nope

#

bossbar is a nice idea too but for updating its very heavy

#

it has a lot of cpu usage on the server

sage patio
#

but for more lines and icons, you need resourcepacks

smoky oak
#

with bossbar specifically you mean?

sage patio
#

yea

smoky oak
#

pretty sure you can have multiple bossbars visible at once

sage patio
#

for mine its an actionbar

#

you can use bossbar too but its limited to 1 line

#

also you can't allign it in top-left always

#

half of the text goes behind the game screen

#

thats why i use resourcepacks for icons and multi lined text

quaint mantle
#

Can someone provide some guidance on gaining traction on your plugin?

drowsy helm
onyx fjord
#

can i get bukkit color directly from hex?

eternal oxide
#

md_5 import ChatColor.of(...

unkempt chasm
#

how do i secure my bungee network

remote swallow
#

same answer you got in the other 2 channels

opal carbon
#

sometimes the spigot developement help forums confuse me

#

like if ur gonna make a listener and have to register it why not just make a listener???

thin iris
#

im trying to make my players velocity be set like a pendulum

#

but its like

#

not working 😭

#

like its shooting me in a direction really high

#
 if (!player.isOnGround() && !player.isSneaking() && anchored) {
            double angle = Math.PI / 4;
            double angleV = 0;
            double angleA = 0;
            double len = 15; // Length of the "rope"

            double gravity = 0.01;
            double force = gravity * Math.sin(angle);
            angleA = (-1 * force) / len;
            angleV -= angleA;
            angle += angleV;

            double velocityX = len * Math.sin(angle);
            double velocityY = len * Math.cos(angle);

            player.setVelocity(new Vector(velocityX, velocityY, player.getVelocity().getZ()));
        }```
dark jolt
echo basalt
#

You don't seem to be doing anything with the json

smoky oak
#

also y is up

#

not z

thin iris
smoky oak
#

speed?

#

your calculations look like they're done under the assumption of distance per second

#

youre setting distance per 50ms however

thin iris
#

i translated thecodingtrains sing pendulum from js to spigot

smoky oak
#

it aint loading for me

thin iris
#

what isnt

smoky oak
#

the code example

#

oh i think i know what it is
the code is calculating the pendulum's position, not velocity
so since you're using speed instead of position, the players move much too far

#

either figure out some calculation for the pendulum speed or use the distance from the previous to the current position of the 'pendulum' each tick as speed

#

@thin iris

wary harness
#

so I am building reward system when player is fishing
I figurate out how to get item which is caught thru event
but problem is player can throw that fish on floor and spam it again

#

abusing the system

smoky oak
#

thats how normal fishing works too aint it

wary harness
#

I only want for reward to be executed when fresh fish is caught

wary harness
smoky oak
#

wait

wary harness
#

like you can drop item stack

#

to floor

smoky oak
#

well yea

wary harness
#

capture it again

smoky oak
#

but that's not a fish event

#

is it?

wary harness
#

PlayerFishingEvent

smoky oak
#

ah

#

yea simple

#

check if the entity in the event's anything u dont want and return

wary harness
#

my bad

#

I figurate it out there is state

#

when fish is caught

smoky oak
#

or that

dark jolt
tender shard
#

also it needs to download itself, usually 100-150mb lol

#

gradle is great and stuff but it's not perfect and some things are definitely upper bullshit

dark jolt
#

Is there a way to make a advancement description use minecraft scoreboards?

remote swallow
opal juniper
#

often user error

bleak nacelle
#

anyone experienced in python or more specifically sqlite3?

#

I have a python script that loop through thousand of json files and saves them to multiple tables inside sqlite3 database by using 5-6 insert into queries but its so slow (only 4-5 file is read and saved in database each second) how to make this queries faster by executing them all at once or some other approach? I can show you the code with anydesk help is appreciated

chrome beacon
#

I'd use a different programming language like Dart

#

If you're worried about speed Python isn't the way to go

warm mica
ivory sleet
#

I mean

#

General programming questions aren’t prohibited per say

trim creek
#

Java != Python-nal
Spigot == Java-val

#

.-.

#

sounds about right but this is still Spigot

opal carbon
#

"Serious Spigot and Bungeecord programming/development help"

#

thats the channel description

trim creek
#

oh yeah

#

so I won the war 🤣

#

thanks Cooleg

opal carbon
#

yw babe

remote swallow
#

nop

#

you missed the / development help bit

smoky oak
#

well, its not spaced

#

so it is bungeecord programming and bungeecord developement

#

not bungeecord progranning or developement help

remote swallow
#

true

echo basalt
bleak nacelle
#

i need help if anyone knows python and sqlite3

quaint mantle
#

if i make online-mode false they plugin author can't they plugin check for updates?

echo basalt
#

Maybe learn a bit about what that method does

quaint mantle
#

bruh boomer

#

i just want an answer why you have to be rude?

tender shard
trim creek
#

Turning off online mode won't kill plugin updaters what

remote swallow
#

bc its per project

tender shard
#

just checked it, can't find anything

remote swallow
#

some stuff might be user home .gradle

quaint mantle
trim creek
#

yes if the plugin provides the method to disable it

#

otherwise no

#

simply dont have op permissions, and dont add update notification permissions

#

and there you go

tender shard
quaint mantle
trim creek
#

what

remote swallow
#

is it a pirated plugin by chance

quaint mantle
#

no

remote swallow
#

i feel like it is

trim creek
#

then they cant access your server

#

unless its a slutty plugin

tender shard
#

a pluign can do anything it wants to do

#

if it has a backdoor, it has a backdoor

quaint mantle
#

so there is not a way to disable access his plugin on my server?

tender shard
#

correct

quaint mantle
#

sad

tender shard
#

well you can uninstall the plugin

#

or check the source code, line by line

#

no trusted plugin dev would add any backdoor whatsoever

quaint mantle
#

or i can make my server online-mode false and disconnect my internet ?

tender shard
#

online-mode has nothing to do with that

remote swallow
#

if you disconnect internet people cant join it

quaint mantle
#

its local host so

remote swallow
#

online-mode specifies if it should verify accounts with mojang auth servers

quaint mantle
#

i dont care

tender shard
#

and disabling online mode means EVERYONE join pretending to be notch or whatsoever

quaint mantle
#

i have it for my personal use

tender shard
#

then you can disconnect internet, sure

trim creek
#

whats the point?

tender shard
#

i have no clue

trim creek
#

if the plugin has an exploit that can run in bg

#

and when it can reach internet

tender shard
#

they don't trust a plugin but still wanna use it

trim creek
#

it will activate

tender shard
#

rule 1: do not download / run .jar files if you don't trust them

trim creek
#

absolutely

tender shard
#

rule 2 is the same

trim creek
#

i'll have to replace every downloaded jar on my private server

#

then run no other

#

XD

tender shard
trim creek
#

XDDDD

#

you seem tired Alex

#

isnt it like 1am

quaint mantle
#
public void onJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        plugin.playerManager.put(player.getUniqueId(), new PlayerManager(player.getUniqueId()));
        System.out.println("Added player to hashmap");

        ItemStack kitSelectorBow = new ItemStack(Material.BOW);
        ItemMeta meta = kitSelectorBow.getItemMeta();
        meta.setDisplayName(ChatColor.GREEN + "Kit Selector" + ChatColor.GRAY + " (Right Click)");
        kitSelectorBow.setItemMeta(meta);

        player.getInventory().clear();

        player.getInventory().setItem(0, kitSelectorBow);

        player.updateInventory();
    }```
#

stupid question but

#

this doesnt give me the bow and i have literally no idea why

#

the only roadblock ive hit so far in this entire pluginb

lost matrix
#

Forgot to register the event or forgot the EventHandler annotation?

quaint mantle
#
        getServer().getPluginManager().registerEvents(new JoinLeaveEvent(), this);
#

nope

trim creek
trim creek
#

does it exists?

quaint mantle
#

yes it does

#

and the print happens aswell

#

imnot braindead im just like

#

the code is sentient or something not following lines

trim creek
#

i mean it seems completely fine

#

maybe .clear is an issue tho

lost matrix
#

Whats up with the updateInventory call?

trim creek
#

and why is updateInventory needed?

quaint mantle
#

i read that if you dont have updateinventory then it wont replicate clientside

trim creek
#

it should

#

no matter what it should

#

or your client is bad

lost matrix
#

That is only the case for out of sync inventory events

trim creek
#

I usually use an update inventory there

quaint mantle
#

removed clear and workjed

#

sorry4 wasting time

#

cheers friends!

trim creek
#

np tho

#

you prooobably are better to clearn inventory upon quitting

quaint mantle
#

tru

trim creek
#

that way your issue won't be found anymore

#

or make a little delay then give the kit selector on join if you wanna clear inv on join

lost matrix
#

Could be a problem on server crashes. On login is probably safer.

trim creek
#

I actually never tought ot it

quaint mantle
#

cheers

#

aswell for minigames

#

i should just make the server be the minigame "game" and then throw it in like .. bungeecord?

#

and that handles lobbies and stuff?

echo basalt
#

Depends

#

As always

quaint mantle
#

brutal

echo basalt
#

What hypixel does is have "mini" servers with their small minigames

#

(and their game system is so modular they just toss all games in their "mini" core)

#

And run 1 game / server based on demand

#

And then lobby servers are separate

quaint mantle
#

so,,,

#

make minigame and think about lobbies after?

echo basalt
#

Somewhat

#

Minigames are hard to write if you don't know what you're doing

quaint mantle
#

this is my first time touching java

#

but ive done c++ for a few years now so it's not too bad

trim creek
echo basalt
#

yeah lmfao

trim creek
#

until I realized what I've fucked up

#

XD

#

but now it works

echo basalt
#

I can write a minigame in like 30 minutes now

quaint mantle
#

i'm recreating an old hypixel gamemode that was removed

trim creek
#

and I generally can make hardcoded minigames very well finally

#

sooo

echo basalt
#

But that takes a core that took me like 10+ hours to write

trim creek
#

im gud

smoky oak
fossil flax
#

i got this problem with args, how can i fix it? (i just started learning java)

trim creek
#

Yes

#

If you are offline you can't get messages

#

and your console will be spammed

trim creek
#

and if you plugin is public, no public debug will be available

smoky oak
#

autocomplete can be weird

sullen canyon
trim creek
#

replace last "string" to args

#

why the fuck does the reply keeps going away?!

quaint mantle
sullen canyon
tender shard
smoky oak
#

ah i meant like a non-perm bound command

#

so i can log in, check on stuff, and leave without having to rely on logs

#

thats also why im so pissed off about loggers atm

tender shard
#

oh you mean, you send the debug messages to yourself if that UUID is online?

smoky oak
#

basically yes

tender shard
#

I wouldn't do that, I'd rather make it configurable for the admin to enable or disable the logging

smoky oak
#

i mean thats a simple addition

#

but it would need to WORK first

#

urgh

tender shard
#

many anti malware thingies check for hardcoded player names / UUIDs

smoky oak
#

fuckin loggers

#

huh didnt know that

#

do u have any experience with loggers btw?

trim creek
smoky oak
#

I've been ripping my hair out all day

smoky oak
#

*the other java server

#

@tender shard ?

tender shard
smoky oak
#

you have a long ass name

tender shard
#

my name is Alexander Christian Majka, if that helps?

trim creek
#

🤔

#

Majka... 🤔

tender shard
#

yeaht he last name is polish

trim creek
#

That's.. A Hungarian musician

tender shard
#

my grandpa was from poland and my grandma was from russia

#

the other side was german

tender shard
#

Spigot uses Log4j to log console output, hence making it easy to listen to incoming console messages, or to block certain console messages from appearing. Prequisities You need to have Log4J on your classpath. We simply add the dependency to our pom.xml using the provided scope, as Spigot already contains those classes on runtime: Create...

smoky oak
#

oh that one

tender shard
#

not sure if this helps you or anything, I don't really know what you're trying to do

smoky oak
#

get the 'caused by' message

tender shard
#

oh yeah I read that

smoky oak
#

for some reason i only get the stacktrace

tender shard
#

I dont have IJ open right now, but take a look at Throwable#printStackTrace() (the decompiled code of that)

#

how does it look like?

smoky oak
#

1sec

tender shard
#

it seems to also loop over the "enclosed" stacktrace

#

are you catching the exception and then throwing it into the logger?

#

if so, you can use printStackTrace(InputStream) and throw the loggers stream into that method

smoky oak
#

no, im just doing 'throw new runtimeException'

#

i want to generally catch all exceptions, then figure out if my plugin caused em

#

for that i need the caused by

tender shard
#

huh

smoky oak
#

cuz i doubt my name is in any other plugin lol

tender shard
#

yeah tbf you could actually follow my blog post for that

#

then check for incoming log messages that contain your plugin's package name

smoky oak
#

iirc the formatted message doesnt have that

#

lmc

trim creek
#

the stack trace should show the the the the the i cant remember what the fuck forrás is in english

#

but it should show the classes

#

so

#

it already shows if its urs or not

smoky oak
#

can i put a stringbuilder as a output stream?

#

i want to check on something

#

printwriter/printstream

#

ah i got it

tender shard
#

I don't know if that's possible. you could write your own PrintWriter that shoves all the input into a strinbguilder ofc

smoky oak
#

now i need 3 minutes and a server

#

@tender shard GUESS WHAT I FUCKIN FOUND

#

Object test = thrown.getStackTrace();
THIS is the StackTrace

#
StringWriter out = new StringWriter();
PrintWriter out2 = new PrintWriter(out);
thrown.printStackTrace(out2);
String wtf = out.getBuffer().toString();

And THIS is the SAME DAMN THING BUT includes the CAUSED BY

#

WTF BUKKIT

#

im so mad

#

any idea why this nonsense happens, anyone?

tender shard
#

oh well that's not a bukkit issue

#

it does surprise me that getStackTrace includes the "caused by" though

smoky oak
#

i mean its gotta be somewhere

tender shard
#

I would have assumed that StackTrace has a separate method for the caused by thingy

#

because getStackTrace only returns an array of StackTraceElement, doesn't it?

trim creek
#

wont return the whole shit for sure

#

i already tried it

#

didnt work

#

but i was ok with it lmao

smoky oak
#

well yes but... those elements are the string parts of the stacktrace encapsulated

#

thats it

#

see the image i posted

smoky oak
smoky oak
# fallen lily what is thrown
org.bukkit.command.CommandException: Unhandled exception executing command 'test' in plugin GreekGodsPlugin v1.0.0
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:875) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3859-Spigot-94e187b-f70a7b6]
    at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchServerCommand(CraftServer.java:860) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3859-Spigot-94e187b-f70a7b6]
    at net.minecraft.server.dedicated.DedicatedServer.bf(DedicatedServer.java:413) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3859-Spigot-94e187b-f70a7b6]
    at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:389) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3859-Spigot-94e187b-f70a7b6]
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1198) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3859-Spigot-94e187b-f70a7b6]
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1015) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3859-Spigot-94e187b-f70a7b6]
    at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3859-Spigot-94e187b-f70a7b6]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.RuntimeException: Test
    at io.github.moterius.GreekGodsPlugin.Command.CommandTest.onCommand(CommandTest.java:30) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]```
fallen lily
#

what exactly are you trying to do

smoky oak
#

oh i figured it out

smoky oak
fallen lily
#

a stack trace must manually have it's cause initialized

#

well

#

a throwable

smoky oak
#

at this point its already initialized cuz it's printing the full error to the console

#

i was just pulling out my hair over the fact the fuckin log didnt seem to have the full error

fallen lily
#

perhaps you were doing the forbidden RuntimeException(underlying)

#

which hides the trace

smoky oak
#

thats got nothing to do with that

#

the proble is the formatting of the stacktrace in the log

fallen lily
#

uh

#

that won't change..

sullen canyon
tender shard
#

I think I was the only one from my family to have visited the US

#

but that's a long time ago, I think 2010 was the last time I visited US

thin iris
#

hallo

#

bonjour

#

hello

#

i’m fluent!

sullen canyon
tender shard
placid anvil
#

Does anyone know of a reliable way to listen for when an Openable block is opened or closed, or at least a door or trapdoor? Listening for PlayerInteractEvent sort of works but I have to manually check for a lot of conditions that could change between Minecraft versions myself and I have to listen for it being changed by redstone separately

#

There appears to be no other standard event to do so

stuck flax
#

I was on this server and they have this massive hologram, does anyone know how they could've done it?

dark jolt
#

?paste

undone axleBOT