#help-development

1 messages · Page 803 of 1

torn shuttle
#

that's nor gith

#

jesus christ I can't type

#

that's not right*

rotund ravine
#

You gotta use the exact class it is in for getDeclaredField to be used

dry hazel
#

yeah

torn shuttle
#

hrm

rotund ravine
#

You should also be caching the field

river oracle
#

honestly method handles would be nice here

rotund ravine
#

No need

torn shuttle
#

I've barely ever done this side of things before

#

so I'm a bit clueless

#

so I've got CraftEntity then?

dry hazel
#

get the handle and walk the super classes until you find the field

torn shuttle
#

craftentity implements entity

dry hazel
#

not the nms type though no?

twin venture
#

Hi , iam having an issuse :

iam trying to load WinEffect :

what iam doing wrong?
both of the WinEffects are in that path?

torn shuttle
#

sorry no hold on

#

I got twisted around

#

getHandle gets the nms entity

#

right, that makes more sense

#

so then I should be affecting the nms entity class

#

then why am I not accessing the field?

glad prawn
twin venture
#

for example , i would have so many win effects , kill effects etc etc

#

for example

eternal oxide
#

You are going insane

remote swallow
rotund ravine
#

Ur not

#

A Zombie nms class is not the Entity nms class

#

Even if it inherits Entity

torn shuttle
#

well yeah but I cast it to craftentity and get the handle

#

shouldn't that do the trick?

rotund ravine
#

Internally minecraft also has seperate entity classes

#

You need to call getDeclaredMethod on the nms “Entity” class not nms “Zombie” class

torn shuttle
#

which is why I cast it to craftentity

#

right

rotund ravine
#

.getClass is ur issue

#

Probably

#

Print it

torn shuttle
#
    @Override
    public boolean setCustomHitbox(Entity entity, float width, float height, boolean fixed) {
        if (entity == null) return false;
        return Hitbox.setCustomHitbox(((CraftEntity) entity).getHandle(), width, height, fixed);
    }
    public static boolean setCustomHitbox(Entity entity, float width, float height, boolean fixed) {
        EntityDimensions entityDimensions = new EntityDimensions(width, height, fixed);
        Class<?> entityClass = entity.getClass();
        try {
            Field field = entityClass.getDeclaredField("be");
            field.setAccessible(true);
            field.set(entity, entityDimensions);
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
            return false;
        } catch (IllegalAccessException e) {
            e.printStackTrace();
            return false;
        }
        entity.setBoundingBox(entityDimensions.makeBoundingBox(entity.position()));
        return true;
    }
rotund ravine
#

Print entityClass

torn shuttle
#

print what about it

rotund ravine
#

The name will be fine

grim hound
#

Why are you getting the fields by name

#

The nms fields at that

rotund ravine
#

Cause he can

grim hound
#

He can't

torn shuttle
#

because it's private

rotund ravine
#

He can

remote swallow
#

Private fields

torn shuttle
#

and I can

rotund ravine
#

He’s getting the obfuscated name properly so now worries

trim lake
#

Im doing this recipe and Im thinkig about best way to remove all 10 steak and coal from crafting inventory. Probably best way would be to cancel crafting event remove items and add crafted item to player inventory? 🤔 If I wont cancel event it will remove only 1 steak and 1 coal.

prisma steeple
#

I'm using intellij, lookie here:

prisma steeple
#

I can't get any version above 1.15.2

#

any ideas?

rotund ravine
#

What are you coding for

icy beacon
#

You can change the version later in the pom

prisma steeple
#

bukkit

#

aight so thats just a placeholder

rotund ravine
#

Don’t code for bukkit use spigot or smth else

icy beacon
#

It's either your Minecraft Development plugin is super outdated or something idk

prisma steeple
rotund ravine
#

No

icy beacon
#

No

river oracle
#

No Bukkit is dead

#

it has been dead for many years

rotund ravine
#

Spigot is pretty much bukkit nowadays

prisma steeple
#

i was aware it was practically the same thing but bukkit had more efficient method calls

river oracle
#

not at all

prisma steeple
#

But we still use

Bukkit.//whatever
#

or am i mistaken

river oracle
#

yes

#

spigot maintains CraftBukkit

torn shuttle
river oracle
#

no one really PRs to spigot anymore outside of a few things like Components

prisma steeple
#

makes sense

#

But regardless, if its giving me version 1.15.2

#

And I want to use 1.20.2

ivory sleet
#

The Bukkit.java class still exists, not exclusively bukkit specific :>

icy beacon
#

And also CraftBukkit != Bukkit where CraftBukkit is like the abstract layer and Bukkit is the impl (AFAIK!!!! Might be the other way around!)

icy beacon
#

After creating the porject

prisma steeple
#

Do I just change it to :

1.20.2-R0.1-SNAPSHOT
icy beacon
#

Yea

prisma steeple
#

in the pom.xml

torn shuttle
#

I'm suprised I can't force it to pass the entity object

#

well so I have to crawl?

prisma steeple
icy beacon
#

Reload the pom

trim lake
# rotund ravine Yes

thanks I was thinking if there is some esieast without canceling event and looks like is not

icy beacon
#

It gives you the error because 1.20.2 is not yet in your local m2 repository

#

After reloading it'll be downloaded

prisma steeple
#

ahhh

#

that makes a lot of sense

#

odd that it doesnt automatically install

icy beacon
#

Nah it makes perfect sense

#

It does not automatically know when you're done typing your new dependency, or version, or whatever

river oracle
prisma steeple
#

I'm just a little used to visual studio

rotund ravine
river oracle
prisma steeple
#

^

#

same with visual studio

icy beacon
river oracle
#

its my second favorite java IDE

torn shuttle
#

so how do I bypass this?

river oracle
#

if they made teh autocomplete faster I would switch back in a heartbeat

rotund ravine
#

So just Entity.class

icy beacon
#

I'll carry on coding gl everybody 🙂

dry hazel
#

or just walk the superclasses

torn shuttle
rotund ravine
#

U want

#

Entity classes field

#

So u will use Entity classes class instance.

river oracle
torn shuttle
#

testing this is miserable

#

alright so it didn't error this time

rotund ravine
#

Grats

torn shuttle
#

yeah it would be very impressive had it worked lol

#

I take that back, it's sort of working

#

I am guessing mojang has a weird hitbox system

#

great, so it works for dealing damage to me but it doesn't work for dealing damage to it nor does it seem to change the radius at which entities push

young knoll
#

Dealing damage to it is calculated client side

#

Pushing idk

torn shuttle
#

time to delve into the source

#

wish me luck

young knoll
#

?

#

I thought you said it dealing damage to you was the working one

torn shuttle
#

yeah

#

you just said that was client side

young knoll
#

Dealing damage to it is calculated client side

torn shuttle
#

hm

#

I need more coffee

torn shuttle
#

and custom aabb collision checks

#

I think that might be the only solution

#

fun

young knoll
#

Alternatively tell versions below 1.19.4 to get screwed and use an interaction entity

torn shuttle
#

what's an interaction entity actually

#

that's the one with the configurable hitbox?

young knoll
#

yes

torn shuttle
#

is that what it was called? couldn't remember it earlier

#

ah yeah

#

seems legit

#

neat

quaint mantle
#

is this a good way to do something?

storage.
ConfigStorageImpl (interface)
FileConfigStorage (impl ConfigStorageImpl)
ConfigStorage (wraps, caches, and provides async for the ConfigStorageImpl)

slate tinsel
#

Is it possible to teleport an entity with a player as Passenger somehow?

eternal oxide
#

no, have to dismount and mount again after

onyx fjord
#

is it possible to force a plugin to start first?

rotund ravine
#

Why

upper hazel
#

how change jar name without affecting the inner class only visually

#

like plugin-bukkit-1.0.0.jar

river oracle
#

Or do mixins

#

Or run some asm jar prior to server start

onyx fjord
# rotund ravine Why

im making a plugin that syncs files, i dont want other plugins to modify stuff before mine

river oracle
#

Pretty sure spigot has loadbefore just put every plugin in that list uwu

naive loom
#

Is there a way to detect when a player's inventory is updated (not just with pickup/drop and etc) without having to check every tick / every few ticks?

hushed spindle
#

why do you need that

naive loom
rough blaze
#

Im making a plugin that turns small fireballs into regular ones, and for some reason, my fireballs are all going in the southern direction. If anyone knows why, please help me 🙏
@EventHandler
public void onProjectileLaunch(ProjectileLaunchEvent event) {
Entity projectile = event.getEntity();

    if (projectile instanceof SmallFireball) {
        SmallFireball smallFireball = (SmallFireball) projectile;
        Location location = smallFireball.getLocation();
        Vector velocity = smallFireball.getVelocity();

        Fireball fireball = location.getWorld().spawn(location, Fireball.class);
        fireball.setVelocity(velocity);

        smallFireball.remove();
    }
}

}

naive loom
hushed spindle
#

im not sure why its not working

#

try cloning the smallfireball velocity, removing the smallfireball, and then spawning the large one a tick later

#

maybe they're interfering with eachother someway somehow

#

dont think normalizing would work though

naive loom
hushed spindle
#

it would affect the speed of the fireball though

#

the direction will be the same regardless of normalizing or not

naive loom
serene sigil
#

hi does anyone know if chunk tickets are persistent even after a restart?

rough blaze
hushed spindle
#

the ol beating into submission tactic

storm crystal
#

why would it produce null?

lost matrix
storm crystal
#

?

eternal oxide
#

ohnoes

lost matrix
# storm crystal ?

You declared a variable named sql but never assigned a value to it.
This means your variable will always contain a pointer to null

storm crystal
#

okay whatever will this work

eternal oxide
#

asList is immutable

lost matrix
storm crystal
eternal oxide
#

I wonder why

storm crystal
#

and fire them one after another

rotund ravine
#

?tryandsee

undone axleBOT
kind coral
#

does bungee have a subchannel for command execution?

eternal oxide
#

no

kind coral
#

guess i'll have to make a bridge

eternal oxide
#

there are a few pre-defined actions is all

kind coral
#

sad

storm crystal
#

whats this

#

first time seeing it

kind coral
#

just read

#

NoClassDefFound => No class was found

but for what?

me.grimek.rpg.utility.db.ConnectionManager

rotund ravine
#

Did u overwrite the plugin whilst the server was running

storm crystal
#

the class is literally there

kind coral
#

it cannot find that class!
why? idk probably just need to debug

kind coral
storm crystal
#

I built plugin

#

and then enabled server

zealous osprey
kind coral
rotund ravine
#

I think it’s 1 plugin spleed

kind coral
#

isn't he using an api or smthng

lost matrix
kind coral
#

ooh damn i tought he was using an api

storm crystal
#

it has none

#

its main class

kind coral
#

yoo smile pretty cool to see u discord helper instead of just having the server boost

#

xd

eternal oxide
#

He's a slave now

rotund ravine
storm crystal
#

thats literally

#

a spigot jar

eternal oxide
#

He's got the collar and everything

lost matrix
storm crystal
#

everything as is

kind coral
#

uh

#

i would suggest initializing inside the onEnable

lost matrix
#

^

storm crystal
#

its never been a problem

kind coral
#

and making those fields private, ik they are already by default but i would prefer to see them written

kind coral
eternal oxide
#

fresh startup your server

#

My bet is you did update with the server running and forgot

storm crystal
kind coral
#

why?

#

its in the same class lol

storm crystal
#

its literally inside onEnable method

rotund ravine
#

Cause he just copy pasted all of it into onEnable

kind coral
#

bro just change the scope of those fields?

eternal oxide
#

yep moved all fields to method variables

kind coral
#

like bring them out without initialization

lost matrix
kind coral
#

and initialize inside the onEnable

storm crystal
#

still same

rotund ravine
storm crystal
kind coral
#

InvalidPluginException

#

did you break your plugin.yml

lost matrix
storm crystal
#

no

kind coral
#

i would suggest placing all your code on paste.gg

#

so we can look at it better

rotund ravine
#

?paste

undone axleBOT
rotund ravine
#

Ur main class

storm crystal
lost matrix
kind coral
#

afaik InvalidPluginException shows up when the plugin.yml just dies

eternal oxide
#

I'll ask but getting an answer may be difficult
Do you have any static class initializers?

storm crystal
#

ConnectionManager connectionManager = new ConnectionManager();

kind coral
lost matrix
storm crystal
#

it literally worked yesterday

#

the same way

#

and day before yesterday

#

and so on

eternal oxide
#

?paste your ConnectionManager class

undone axleBOT
rotund ravine
#

We want the main one too

eternal oxide
#

his main likely wont help

lost matrix
eternal oxide
#

It's a NCF exception which means updated while live (wrong class loader, or there was an exception while loading the class, static error

lost matrix
#

Which will be revealed to us after he starts initializing in his onEnable

eternal oxide
#

probably not

#

it just throws a NCF if a static initializer/field errors while loading

lost matrix
#

If its still a NoClassDefFoundError then he either has a cyclic static reference, or an exception was thrown in a
static initializer

eternal oxide
#

yep

#

I'm guessing he has a static reference to RPG in his ConnectionManager

#

which is exploding

serene sigil
#

does anyone know how to stop 2 minecarts from coliding?

#
@EventHandler
    public void onEntityCollision(VehicleEntityCollisionEvent event) {
        Entity entity = event.getEntity();
        if (entity instanceof Player && event.getVehicle() instanceof Minecart) {
            event.setCancelled(true);
        }
    }```
rotund ravine
serene sigil
#

I wrote this code but it doesnt work

serene sigil
young knoll
#

Make one of em do a sick jump

lost matrix
#

Xplode them. Cant collide if its blown up

serene sigil
#

bro

#

but fr

eternal oxide
#

you want them to pass through each other?

lost matrix
#

Collision is hard coded in nms.
Probably only throgh a custom minecart nms implementation.

serene sigil
eternal oxide
#

probably only able through a resourcepack model as using the built in minecarts in any way will have client side issues

#

even as a custom entity

serene sigil
#

theres no way its not possible...

eternal oxide
#

Let us know if you find a way 🙂

serene sigil
#

but you can change the collision of players so why cant you with minecarts??

storm crystal
#

I cant even save it

pulsar wing
#

how would i store a chunk?, im trying to set a chunk to air, and when the player enters another command, it gets set back to default.

serene sigil
#

or material array

#

or idk

pulsar wing
serene sigil
#

ye

brazen badge
#

I would like to be given a block that cannot be placed, without nms. How can I do it?

pulsar wing
lost matrix
eternal oxide
storm crystal
#

well now there is just this exception

#

but it still wont let me load plugin at all

eternal oxide
#

I'd not make your RPG class final

storm crystal
#

it was like that in template

#

now exception is twice

lost matrix
storm crystal
#

when class doesnt have final

eternal oxide
#

Yeah, you are not stopping your server

lost matrix
#

Uh oh. I think he has two plugins which depend on each other without telling us

lost matrix
eternal oxide
#

one of those errors was from onDisable, the other was onEnable so you replaced jar while server was running and did a reload

storm crystal
#

xd

lost matrix
young knoll
#

Nope

#

That only works in adventure mode anyway

lost matrix
#

In that case: Just add a PDC tag to your item and check the BlockPlaceEvent

proud badge
#

Yo so I accidentally installed some maven dependancy on my intellij and now its causing errors, how do I remove it?
[ERROR] Failed to execute goal on project HeeseTroll: Could not resolve dependencies for project org.heesetroll:HeeseTroll:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: org.bukkit:bukkit:jar:1.20.1-R0.1-SNAPSHOT (absent): org.bukkit:bukkit:jar:1.20.1-R0.1-SNAPSHOT was not found in https://repo.papermc.io/repository/maven-public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of papermc-repo has elapsed or updates are forced

lost matrix
lost matrix
storm crystal
#

I had 2 more, in fact

#

I dont fucking get it

lost matrix
#

Alright, you are probably copying one of your plugins into another. This causes the classloader to get confused.

eternal oxide
#

?paste your pom

undone axleBOT
lost matrix
#

Lets hope he is not building artifacts

storm crystal
serene sigil
lost matrix
eternal oxide
storm crystal
#

this is just it

#

everything else is from template

lost matrix
storm crystal
#

I cant explain it better than with those pictures lol

#

I just click a button and it compiles

proud badge
#

also how could I get the block the player is looking at? whats the method for what

storm crystal
#

I get this all the time but it never bothered me cuz plugin always worked

lost matrix
#

Elgarl he is building artifacts and probably has jars added to the project by hand. You resolve this, i just got home after 10h of uni.

eternal oxide
#

🙂

eternal oxide
# storm crystal

Show a screenshot of your project structure with your dependencies/libraries entry expanded

storm crystal
eternal oxide
#

expand external libraries

storm crystal
eternal oxide
#

looks fine

remote swallow
#

Do a clean pacakge

#

Package

eternal oxide
#

right side of screen expand the mavem window (m)

storm crystal
eternal oxide
#

expand lifecycles and double click package

#

copy your jar and test when done

storm crystal
chrome beacon
#

Might want to not shade Lombok

eternal oxide
#

yep

#

set its scope in pom to provided not compile

storm crystal
#

on the other note, deleting any of those might have caused this perhaps?

glossy venture
#

ah yes slot index -5

storm crystal
#

just saying thats the only thing Ive done recently between opening projects

glossy venture
#

i dont think my gui lib completely works

storm crystal
#

like that?

eternal oxide
#

no

#

just provided

young knoll
#

😶

storm crystal
#

oh just provided

#

xdddddddddddddd

#

on the other note

#

this warning is not there anymore

eternal oxide
#

open your plugins jar with any archiver and see if your ConnectionManager class is in there

#

else throw your jar in here

storm crystal
eternal oxide
#

oh package is wrong

#

DB should be lower case

proud badge
#

import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.BlockIterator;
import org.bukkit.util.RayTraceResult;

public class LightningSword extends JavaPlugin implements Listener{
    @EventHandler
    public void onPlayerInteract(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        player.sendMessage("test");
        if(player.hasPermission("heese.lightningsword")) {
            if (event.getAction().name().contains("LEFT")) {
                player.sendMessage("test");
                if (player.getInventory().getItemInMainHand().getType() == Material.GOLDEN_SWORD) {
                    // Get the block the player is looking at with infinite range
                    Location targetLocation = (Location) player.getTargetBlock(null, 100);
                    player.getWorld().strikeLightning(targetLocation);
                    player.sendMessage("test");

                }
            }
        }
    }

    // Helper method to get the target location based on player's line of sight
}
``` What did I do wrong? why is my event not firing? And yes I did register the event in the main class ```getServer().getPluginManager().registerEvents(this, this);```
chrome beacon
#

Send the entire class in a paste

storm crystal
#

okay for future

chrome beacon
#

?paste

undone axleBOT
storm crystal
#

how do I rename packages safely

proud badge
#

both of them?

eternal oxide
proud badge
chrome beacon
#

That would be the problem

glossy venture
#

bro wtf

proud badge
#

hm?

glossy venture
#

wtf is this

dry hazel
glossy venture
#

and how did i cause this with the bukkit api

eternal oxide
proud badge
#

what do I extend it with then

final wharf
chrome beacon
glossy venture
#

methods

eternal oxide
#

thats what the error says

glossy venture
#

in the stack trace

#

at all

#

so idk how that would work

chrome beacon
#

also do register the events on the listener and not your main class

solemn willow
#

hi guys its very important i need this done ASAP
is it posibble to have runTaskTimer and BukkitTask at the same time?

eternal oxide
proud badge
#

updated plugin, nothing still runs


import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.BlockIterator;
import org.bukkit.util.RayTraceResult;

public class LightningSword implements Listener{
    @EventHandler
    public void onPlayerInteract(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        player.sendMessage("test");
        if(player.hasPermission("heese.lightningsword")) {
            if (event.getAction().name().contains("LEFT")) {
                player.sendMessage("test");
                if (player.getInventory().getItemInMainHand().getType() == Material.GOLDEN_SWORD) {
                    // Get the block the player is looking at with infinite range
                    Location targetLocation = (Location) player.getTargetBlock(null, 100);
                    player.getWorld().strikeLightning(targetLocation);
                    player.sendMessage("test");

                }
            }
        }
    }

    // Helper method to get the target location based on player's line of sight
}
eternal oxide
#

but it is 1.8 😛

proud badge
#

the "test" messages dont get sent

chrome beacon
glossy venture
#

ig this might be it

solemn willow
# rotund ravine Why

i have a plugin where every 30 seconds it spawn an whiter skeleton on an nether brick but when i destroy the block it keeps spawning, i have to fix that ASAP

eternal oxide
#

could be

#

not safe to mess with the player until join event has finished

rotund ravine
#

?paste

undone axleBOT
proud badge
#

so I put the onEnable in the LightningStrike class...? How do I register the events without the onEnable method

solemn willow
#

or how should i share my code with that?

#

i pasted my code in there and pressed save

rotund ravine
#

Then copy url and post it here

eternal oxide
#

copy the link it gives here, after clicking save

solemn willow
#

oh

glad prawn
chrome beacon
proud badge
#

ah

#

ok so getServer().getPluginManager().registerEvents(new LightningSword(), this);

dry hazel
#

yea

rotund ravine
dry hazel
#

no wait, is the order correct?

#

order of the parameters

proud badge
#

no?

solemn willow
rotund ravine
#

BukkitRunnable instead of ur scheduler line

chrome beacon
proud badge
#

Ok thanks

solemn willow
rotund ravine
eternal oxide
#

30 * 20

solemn willow
rotund ravine
#

Okay

solemn willow
#

i had to remove it temporarily from my server bc of that issue

storm crystal
#

yeah I found the exact issue

#

refactoring the name from db to DB didnt change package name inside plugin

eternal oxide
#

all package names should be lower case anyway

storm crystal
#

all package names in my case are uppercase

eternal oxide
#

You need a swift kick 🙂

proud badge
#

?paste

undone axleBOT
proud badge
rotund ravine
eternal oxide
#

block.getLocation()

rotund ravine
#

Here is a possible way to rewrite the spigot event to spawn a bukkitrunnable that checks the placed block is netherbricks in the nether, if so spawn a wither skeleton on top, every 30 seconds. The task rechecks before running if the block is still a netherbrick, if not it cancels itself and returns:

@EventHandler
public void onBlockPlace(BlockPlaceEvent event) {
    Block block = event.getBlock();
    World world = block.getWorld();

    if (block.getType() == Material.NETHER_BRICKS && world.getEnvironment() == World.Environment.NETHER) {
        BukkitTask task = new BukkitRunnable() {

            @Override
            public void run() {
                if (block.getType() == Material.NETHER_BRICKS) {
                    world.spawnEntity(block.getLocation().add(0,1,0), EntityType.WITHER_SKELETON);
                } else {
                    this.cancel();
                    return;
                }
            }
        }.runTaskTimer(this, 200l, 600l);

    }
}```
solemn willow
#

and it will respawn the whiter skeleton infinitly until the block is brocken?

rotund ravine
#

Yes

eternal oxide
#

no

rotund ravine
#

Sortof

solemn willow
proud badge
#
                    // Get the block the player is looking at with infinite range
                    Location targetLocation = (Location) player.getTargetBlock(null, 100);
                    player.getWorld().strikeLightning(targetLocation);

                }```
seems this part specifically doesnt work, any ideas why?
rotund ravine
#

Restarts and reloads = no

eternal oxide
#

placing a block will stop the first

#

as you only listen to BlockPlaceEvent

rotund ravine
#

Well atleast it gave him a BukkitTask this time he can interact with

clever lantern
#

how do i get a text from the book opened by Player#openBook()

eternal oxide
#

yep

solemn willow
#

@rotund ravine

#

i get an error

solemn willow
#

the last line of my code

rotund ravine
#

Fix the amount of indentation

solemn willow
rotund ravine
#

And brackets

#

Count them or smth

solemn willow
#

oh

#

ty

storm crystal
#

well your smartassness was actually helpful thanks

final wharf
eternal oxide
#

np, I help trolls now and then

storm crystal
#

😭

#

I may not be the smartest

eternal oxide
#

um use paste not some random site that looks like it's going to hack me

storm crystal
#

but god damn

final wharf
#

I'll send a normal screenie

eternal oxide
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

eternal oxide
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

final wharf
#

!verify iRazvan2745

undone axleBOT
#

Rate limited. Please try again later.

final wharf
#

wha

eternal oxide
#

lol

#

give it a minute

final wharf
#

i just needs embed perms

lost matrix
final wharf
#

just simple console on start

hazy parrot
#

why... dont you just send paste

eternal oxide
#

what are you trying to stop sending?

final wharf
eternal oxide
#

the Paper nag message?

rotund ravine
#

?paste

undone axleBOT
inner mulch
final wharf
hazy parrot
#

good for u

dry hazel
#

ok

rotund ravine
#

We don’t want pictures thank you

final wharf
#

oh okay, sory

eternal oxide
#

yeah you are seeing teh Paper nag message

final wharf
eternal oxide
#

not a Spigot thing, but use the Plugin logger instead of sysout

final wharf
#

how?

#

i just started

eternal oxide
#

in your main class, getLogger()

final wharf
#

ohhh

eternal oxide
#

so getLogger().info("blah");

final wharf
#

got it

#

thanks

dusky prawn
eternal oxide
#

Yeah we don;t do Skript here

dusky prawn
#

Yea, i dont see any skript-channels, so i thought all 'development' were in here

#

awh

lost matrix
# inner mulch Are you leaning to build robots? Or what exactly is being teaxhed in engineering...

Its a deviation of electrical engineering with more emphasis on computer science. Im in the machine learning branch.
We learn a ton of things. Designing analog and integrated circuits. Micro and nano electronics. Power electronics.
Automation and robotics. Systems engineering. Programming. Machine learning and visual computing. Digital signal processing.
Transmission and antenna technology. And ofc a ton of math.

eternal oxide
#

I believe they have their own discord

dusky prawn
#

oh, okay. Thanks

sullen marlin
#

I mean there's no rule against skript here

#

just most people don't use it

eternal oxide
#

yeah no one here uses it so we spit on those dweebs

young knoll
#

ByteSkript >

alpine flume
#

Heyho,
Can I Spawn a Pillager with Banner that gives me Bad Omen?

lost matrix
#

Because why would you touch skript if you could just write some java? 🙂

young knoll
#

It’s faster

#

To write that is

final wharf
#

Are Kody Simpson's plugin tutorials good? so i dont waste my time

eternal oxide
#

they are ok

final wharf
#

he is uses sys out

#

=i just went with that

#

but

eternal oxide
#

yes

final wharf
#

thanks for helping me use logger

eternal oxide
#

sysout is ok for dev work, but you should use the logger

final wharf
#

yep

#

thanks

eternal oxide
#

everyone used sysout until Paper added a nag a year or so back

final wharf
#

im making this plugin for simple stuff, and just jave fun with it

wicked crystal
#

hello i have a big problem with world edit

rotund ravine
#

I mean i still use Log4J on the old server i join /s

wicked crystal
#

can you help me?

lost matrix
alpine flume
#

yea

lost matrix
alpine flume
#

via Entity.setMetadata or how would I do that

#

xD

rotund ravine
#

Metadata is 🤮

lost matrix
wicked crystal
alpine flume
#

tyyy

wicked crystal
alpine flume
wicked crystal
#

you spoke italian? so I can make myself understood better @lost matrix

lost matrix
#

English only channel

wicked crystal
#

Okay not problem

lost matrix
#

Wait is this a coding related issue?

alpine flume
rotund ravine
#

Blamed

lost matrix
alpine flume
#

how?

lost matrix
#

?code

alpine flume
#

oh my bad

#

im

lost matrix
#

?codeblock

undone axleBOT
#

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

}

}```
Becomes:

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

    }
}```
alpine flume
#

brain afking

lost matrix
#

?paste

undone axleBOT
wicked crystal
#

So, wich the wand i select the bordere of the build, After i made the command //expand and After /schem save {name_schem}, so After i go to the Place when i can Place che build and i made the command /schem load {name_schem}, but After loading the build is cut, so the upper part is not glued @lost matrix

alpine flume
#
    private void spawnRaiders(Location location) {
        new BukkitRunnable() {
            @Override
            public void run() {
                for (int n = 0; n < 3; n++) {
                    for (int i = 0; i < 15; i++) {
                        Pillager pillager = (Pillager) location.getWorld().spawnEntity(location, EntityType.PILLAGER);
                        pillager.setPatrolLeader(true);
                        pillager.setCanJoinRaid(false);
                    }
                    for (int i = 0; i < 3; i++) {
                        location.getWorld().spawnEntity(location, EntityType.VINDICATOR);
                    }
                    for (int i = 0; i < 5; i++ ) {
                        location.getWorld().spawnEntity(location, EntityType.WITCH);
                    }
                }
            }
        }.runTaskLater(Main.instance, 20);

    }
rotund ravine
#

15 raid leaders nice

alpine flume
#

yea Im trying to make a Plugin wich simulates Raid Farms

lost matrix
wicked crystal
#

ah okay i'm so Sorry

lost matrix
alpine flume
#

sorry but I dont know what you mean by callback spawn method

lost matrix
inner mulch
#

Is it possible to cancel a player opening his own inventory?

lost matrix
inner mulch
#

okay, thanks for the quick response :)

wicked crystal
inner mulch
#

?

wicked crystal
#

perhaps I used a term that we only use in Italy, forget it

final wharf
lost matrix
young knoll
#

The random spawns aren’t part of a raid

lost matrix
#

Do they have flags? I dont play the game...

#

Right patrols can spawn without a raid

alpine flume
#

was it maybe an Illager

inner mulch
#

Would it be possible to listen for the advancement that occurs when a player opens his inv for the first time, then redirect the player to a bukkit made inv and then close it and reset the advancements?

(To stop players from opening their inventory?)

wicked crystal
alpine flume
inner mulch
#

ok

young knoll
#

Huh

#

Didn’t think of that

final wharf
young knoll
#

Wonder what could be done with that

inner mulch
#

you could use e to interact with stuff

young knoll
#

Could do a fully custom inventory

inner mulch
#

yeah

young knoll
#

Although you’d still have to sync it with the real inv

inner mulch
#

the question is can you disable the advancement popups?

#

those would be ugly to See everytime

rotund ravine
eternal oxide
#

client would probably get annoyed with toast messages

inner mulch
#

yeah you woudl probably need a texture pack

young knoll
#

You can just make a new advancement

#

With no toast

#

At least I think you can remove toasts

river oracle
young knoll
#

Nah you just gotta get a fancy conveyer toaster like they have at hotels

#

And then run it through backwards

sullen marlin
#

Give this man a nobel prize

river oracle
#

world peace through toast

young knoll
#

Better than world toast through peace

storm crystal
#

that's how my command to spawn custom mobs with custom max health, type and name looks like as for now, ill add spawn location and such later, but does that look okay so far? EntityPDC is method from static class to assign PDC to entity so that I dont have to write namespaced key etc. everytime, and Im using SQLite database's cache map that's taken on server enable to look for information

#

tl;dr asking how does it look like in terms of code

#

basically taking needed statistics from here

echo basalt
#

I'd put the spawning logic on your enemy stats class

storm crystal
echo basalt
#

¯_(ツ)_/¯

storm crystal
#

oh yeah something is inherently wrong with my plugin

#

whenever I rename package to something that was used earlier but isnt present

#

lets say I had "PlayerStats", deleted it and made new "playerstats" in plugin.jar the directory playerstats is all the time written as "PlayerStats"

hazy parrot
#

How do you build your project

brazen badge
#

I need a way to delete stacks of items from an inventory. The problem is that I have to eliminate 9 stacks, but if the player has 18 stacks I remove 18, if he has 17, I remove 9, so to speak. How can I do? Someone help me I'm running out

hazy parrot
#

Just remove (currentCount / 9) * 9

brazen badge
hazy parrot
#

What

inner mulch
#

cant you divide by 9 and convert the value to an int, so the decimals are gone?

hazy parrot
#

That expression is not lvalue

inner mulch
#

after taht you * 9

brazen badge
hazy parrot
#

With that, you get amount yo want to remove

brazen badge
inner mulch
#

workwolf

hazy parrot
#

That means you want to remove 9 items

inner mulch
hazy parrot
#

If you have 17

brazen badge
hazy parrot
#

17 / 9 = 1 * 9 still 9

#

So you again remove 9

#

That is what you wrote

#

Just make newAmount be (preAmount/9)*9

brazen badge
inner mulch
#

yes

brazen badge
#

it's 17 stack

#

after the command

rough drift
#

what do you want to do @brazen badge

hazy parrot
#

Man I literally told you what to do

brazen badge
hazy parrot
#

And you didn't

#

those two doesn't look same

sacred mountain
#

sounds mildly concerning not gonna lie

hazy parrot
#

ah sigsegv in java

brazen badge
#

your code

sacred mountain
#

ah yes the most understandabe

hazy parrot
#

show code

river oracle
#

how did you get a sigsegv in java

sacred mountain
#

i can replicate it

#

now

river oracle
#

I smell memory fuckery

sacred mountain
#

i love memory fuckery

#

i'm trying to run an exe through the runtime exec

#

using the wine thing

#

and things arent going to plan

#

[179.361s][warning][os] Loading hsdis library failed

#

um

hazy parrot
eternal oxide
#

thats going to be zero if preAmount is 9

hazy parrot
#

and it should

eternal oxide
#

k

hazy parrot
sacred mountain
#

oh no

#

famine

brazen badge
sacred mountain
#

:(

hazy parrot
#

there is 64 in stack and 63 is removed

rough drift
# brazen badge I need a way to delete stacks of items from an inventory. The problem is that I ...
final var removeCount = 9 * 64;

while(inventory.contains(Material.WHEAT, removeCount)) { // If the inventory has at least 9 * 64 wheat
  var total = 0;

  int first = 0;
  while((first = inventory.first(Material.WHEAT)) != -1 && total < removeCount) {
    var item = inventory.getItem(first);
    var toRemove = Math.max(Math.min(item.getAmount(), removeCount - total), 0);
    var newAmount = item.getAmount() - toRemove;
    if(newAmount <= 0) {
      inventory.clear(first);
    } else {
      item.setAmount(newAmount);
    }
    total += toRemove;
  }
}
```Slightly over-engineered piece of code
sacred mountain
#

what exactly odes this mean

#

anyone know

rough drift
sacred mountain
#

its literally just Runtime.getRuntime().exec(..) atm

#

with a path

#

i tried the wine thing and its a WIP so i reverted my changes

#

and now whenever i even run it normally

#

i get a fatal error

#

thats it

hazy parrot
#

I need a way to delete stacks of items from an inventory. The problem is that I have to eliminate 9 stacks, but if the player has 18 stacks I remove 18, if he has 17, I remove 9, so to speak. How can I do? Someone help me I'm running out
@brazen badge according to this, you said you want to remove only amount dividable by 9 , is that not true ?

rough drift
#

Player#getInventory

storm crystal
#

how can I get all primary keys from table and put them into a list?

rough drift
rough drift
#

if you need performance just do it by hand

sacred mountain
#

as i'm not using any special commands

#

but yes i'm going to just do some tests

brazen badge
sacred mountain
#

myabe ill go sleep and forget about my problems

storm crystal
inner mulch
#

there is only one primary key per table

storm crystal
#

I mean

#

uh

storm crystal
#

all values that are under primary keys

sacred mountain
#

oh dear

storm crystal
#

or like get amount of rows of database

sacred mountain
#

i've upgraded from fatal error to severe warning 😎

#

i'll take that

rough drift
#

@brazen badge sorry, updated

#

I made a mistake lol

brazen badge
rough drift
#

edited it again @brazen badge

#

I am not sure if it works tbh

brazen badge
#

ok, now it works

#

thank you so much

umbral ridge
#

Hey

rough drift
#

npnp

umbral ridge
#

Can you detect key presses on a gui

rough drift
#

not really?

umbral ridge
#

Eg. When user hovers an item and presses Q. Is that client side

rough drift
#

If Q is the drop button, then no

#

that is server-side

#

(I mean the client removes the item, then tells the server to drop it)

umbral ridge
#

Yeah so I need to cancel it and just remove an item from that specific gui

rough drift
#

yep

umbral ridge
#

Then it's possible?

#

😁

rough drift
#

yep, there's a DROP action which also has a slot

#

if the slot is -999 it means they picked up an item and dropped it from the edge of the screen

umbral ridge
#

Awesome

sleek estuary
#

I had done that, if that were the case it would have caused another error but anyway, I corrected it.

hazy parrot
#

that is amount of them

storm crystal
#

is SQLite language just SQL essentially?

rough drift
#

It is SQL

hazy parrot
#

there are some minor differences, if u are referring to mysql

rough drift
#

with differences

storm crystal
#

cuz I found pretty cool SQL guide

#

for syntax

hazy parrot
#

that is just on top of my head, there are probably more

rough drift
#

auto increment is in base SQL iirc

hazy parrot
#

sqlite use AUTOINCREMENT while in mysql its AUTO_INCREMENT

rough drift
#

ah

young knoll
#

:(

#

Why they gotta be different

sacred mountain
#

HI orange man

orchid gazelle
#

Hello. Any ideas how I could define a section of blocks which can include a lot of different shapes, not only squares? I tried using VoxelShapes but that seems weird. I also want it to be able to check if a player is inside it

rough drift
#

Look at polygons and checking if a point is in a poligon

orchid gazelle
#

well I'd just like to start with a simple solution which can do it efficiently

#

not some custom algorithms that take 100000s to process, just simple collide checks

rough drift
#

Yeah, point in polygon is pretty straight forward

orchid gazelle
#

isn't there some built-in boundingbox or aabb stuff which I could use?

rough drift
#

BoundingBox is a class

orchid gazelle
#

yes

rough drift
#

You can use that

orchid gazelle
#

I can make a BoundingBox out of just a square of blocks right?

#

do I just make my own impl. and write some algorithm to check if it collides with the boundingbox of a player?

#

I mean, that would make it hella inefficient but may do the job

rough drift
#

No, bounding box has a contains method

#

You can make a bounding box from two xyz coords

orchid gazelle
#

well then I only check against one boundingbox each

#

I gotta iterate through all and then .contains(playerBox)

rough drift
#

Yes

#

It accepts a single Location

orchid gazelle
#

well but if multiple boxes may intersect, that would cause issues

rough drift
#

Maybe use the center of the player's BB

#

BoundingBox#getCenter

orchid gazelle
#

so I gotta write methods to prevent that one I guess?

#

alright, thanks, I'll try to look into it

sterile token
#

anyone has experience with JFrame who can give me a small hand? Because im trying to apply colors but they get broken when i try to move them

rough drift
#

Np

#

To what component?

sterile token
rough drift
#

Mhm

sterile token
#

Can i send cap?

rough drift
#

Sure

sterile token
#

This is one

#

now i want to put another color on it, to emulate a navigation bar with a darker color

rough drift
#

Ok

#

You need another component or a custom renderer

sterile token
#

hmnn

#

How?

#

I try adding another panel to it, but doesnt seem to apply the color correctly

#

Thats how looks when trying to add another color with another panel

rough drift
#

You want one panel with a layout and then set the other panel to anchor top

#

I forgot the layout though

orchid gazelle
#

what is the difference between contains and overlaps in BoundingBox?

sterile token
#

I cant find info about it, because Java interface libraries are too shity

rough drift
rough drift
#

Lemme get it for you

sterile token
#

allright really thanks and sorry for taking your time

orchid gazelle
rough drift
rough drift
orchid gazelle
#

ah I see the difference

#

contains only triggers if it specially contains it, so yeah if for example the target would be bigger it would not trigger

sterile token
#

?paste

undone axleBOT
sterile token
#

any writting or reading operation to a database has to be async, thats what i learnt

#

Because both of them (writting and reading) are blocking operations

chrome beacon
#

Should be fine but do check how long your queries take

wet breach
#

Depends which type you want to use. In memory db doesnt necessarily mean in memory of same application that needs it lol

#

Also depending on your data you might not be able to hold it in memory only.

ivory sleet
#

That’s completely erroneous to assume, as frost said, in-mem DB doesn’t mean it uses the same memory as ur main app

quaint mantle
#

Does anyone know if there is any way to hide holograms when a player is x blocks away from the DecentHolograms plugin?

valid burrow
#

if i put a second nametag on an entity and make the real one invisible

#

will it fly higher

#

or on the hight the real one would be

wet breach
undone axleBOT
valid burrow
#

dont wanna code for 20 minutes if i can just ask

rotund ravine
#

Setting stuff as passenger is like 4 lines including spawning, an extra line to make one of them invis

valid burrow
#

plus turning on server exporting

#

plugin

#

figured its easier to ask

rotund ravine
#

Lazy smh

valid burrow
rotund ravine
#

No

#

I will dtill judge you tho

quaint mantle
#

Is there a show/hide api method from DecentHolograms? I'm making a plugin and I want so that the holograms hides and shows when a player is x blocks near the hologram or away from it.

rotund ravine
#

Idk go look at their documentation

wet breach
#

They might even have a discord as is the case with plugins these days

quaint mantle
quaint mantle
wet breach
#

Top result when i googled

#

Its even open source with a link to repo

#

😑

#

They have a wiki and discord server too

quaint mantle
#

I know, but I looked into it. I forgot that they had a discord server, and I already asked there. I looked into the open source, but couldn't find anything, so I just wanted to ask to make sure, so chill man. Its just a question.

twin venture
#

Hi . uhh iam wondering what would be the best database type to load a significnt amount of data for the player?

#

for example :

  • Solo:
    • kills
    • deaths
  • Double:
    • kills
    • deaths
  • cosmetics:
    • maybe selected Cosmetic?
      • selected kit
      • selected win dance
      • selected kill effect
inner mulch
#

I think if you want to store a lot of data mysql databases are going to be the best choice

twin venture
#

alright

inner mulch
#

You should probably Cache the data too

twin venture
#

iam kind of struggling with code structureing

#

as its huge plugin :L

inner mulch
#

Why?

#

Can i help you?

twin venture
#

no just let me know if iam doing somthing wrong

#

so for the stats i have an idea :
a HashMap :

  • SoloStats map
  • Double Stats map

with methods to add stats like
swUser.getSoloStats().put("kills", resultSet.getInt("solo_kills")
swUser.getDoublesStats().put("kills",resultSet.getInt("doubles_kills"));

inner mulch
#

ok how csn i help here?

terse ore
#

oneblock plugin recommendations?

terse ore
#

mb I missclicked

inner mulch
twin venture
#

what do you think about this?

#

i can do soloStats.get(uuid).get("soloKills").var it will send the solo kills

storm crystal
#

Why not make map out or UUID and Data Access Object?

#

That way you can mash both datatypes together

twin venture
#

i dont get what do you mean?

storm crystal
#

Class with setters and getters

twin venture
#

oh like a User class?

#

yeah i already have that

storm crystal
#

And make hash map <UUID, ThisClass>

valid burrow
twin venture
storm crystal
#

Idk why youd separate it like that

twin venture
#

Do you thing this is good aproch?

inner mulch
#

You saving the class object to the player roght?

twin venture
#

yeah

inner mulch
#

I might be wrong but cant you just Set the values in the clsss without a hashmap

#

You are saving to object so the numberd should remaim

#

swdata.getkills() which just Returns the int?

twin venture
#

yeah

inner mulch
#

I dont know it has any benefits tho

twin venture
#

isn't this better?

#

for the code design?

inner mulch
#

If you wamt to use a map you can, i dont think you need to tho

molten hearth
#

im sorry the arrows made me do it

twin venture
#

its alr

#

for some reason only the first player who joins the server his data will be loaded?

remote swallow
#

There is no reason for that if, just call put regardless

twin venture
#

still same

shadow zinc
#

how might I enable this get the threads within spigot, and not whatever its doing right now?

#
        ThreadFinder threadFinder = new ThreadFinder();
        ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
        ThreadInfo[] threadInfos = threadFinder.getThreads()
                .map(thread -> threadMXBean.getThreadInfo(thread.getId(), Integer.MAX_VALUE))
                .filter(Objects::nonNull)
                .toArray(ThreadInfo[]::new);
        for(ThreadInfo threadInfo : threadInfos) {
            MessageUtil.send(commandSender, threadInfo.getThreadName());
        }```
#
public final class ThreadFinder {

    private static final ThreadGroup ROOT_THREAD_GROUP;
    static {
        ThreadGroup rootGroup = Thread.currentThread().getThreadGroup();
        ThreadGroup parentGroup;
        while ((parentGroup = rootGroup.getParent()) != null) {
            rootGroup = parentGroup;
        }
        ROOT_THREAD_GROUP = rootGroup;
    }

    // cache the approx active count at the time of construction.
    // the usages of this class are likely to be somewhat short-lived, so it's good
    // enough to just cache a value on init.
    private int approxActiveCount = ROOT_THREAD_GROUP.activeCount();

    /**
     * Gets a stream of all known active threads.
     *
     * @return a stream of threads
     */
    public Stream<Thread> getThreads() {
        Thread[] threads = new Thread[this.approxActiveCount + 10]; // +10 to allow a bit of growth for newly created threads
        int len;
        while ((len = ROOT_THREAD_GROUP.enumerate(threads, true)) == threads.length) {
            threads = new Thread[threads.length * 2];
        }
        this.approxActiveCount = len;
        return Arrays.stream(threads, 0, len);
    }

}```
#

but its not actually returning all the threads in spigot

#

something that a spark profile would yield?

#

how might i actually get it to show spigot threads?

minor junco
minor junco
#

What was the issue

twin venture
echo basalt
#

Here's another issue - there's no guarantee that the user data will be loaded by the time playerjoin is called

minor junco
#

yeah what you can do is to create the player object on join with default values to then populate it with fresh data from the database, so you won't get nullpointers. You can do all of this on join asynchronously

brazen hollow
#

Hi! I want to access method parameter names in my code. Therefore I need to use javac -parameters, as I have learned from StackOverflow. How can I integrate that setting into my run configuration? I'm using the maven goal package to build my jar

minor junco
icy beacon
undone axleBOT
eternal oxide
#

sounds like you actually want to find/replace things like name and version when compiling, which Maven already supports with filtering resources.

brazen hollow
#

So thats what I want to execute:

        var routeWithParam = method.getParameterCount() > 0
                ? MessageFormat.format("{0}/<{1}>", route, method.getParameters()[0].getName())
                : route;

```. However, now the ```method.getParameters()[0].getName()``` always returns arg0, because the name isn't present in the classfile (see java.lang.reflect.Parameter::isNamePresent). To get the name into the classfile and use it in my code, I need to compile with the -paramaters arg (see https://docs.oracle.com/javase/tutorial/reflect/member/methodparameterreflection.html). How can I integrate this parameter into my inteliJ run configuration or can I do something in the pom.xml?
#

It's a maven / InteliJ question

minor junco
#

I think this explains how to do it

#

But honestly I think using annotations to describe your route segment is much more expressive than using the parameter name

eternal oxide
#

not sure why you would want to do any of that in a plugin.

#

requires a custom compile which bloats your jar

#

Wuold you by chance be trying to reflect using arg names for nms?

minor junco
#

That is exactly what he's doing

eternal oxide
#

if so, you can';t do it that way

brazen hollow
minor junco
brazen hollow
#

Yeah I know, but my routes work a bit different, but thanks anyway :D

rough drift
shadow zinc
#

thank you