#help-development

1 messages · Page 193 of 1

eternal oxide
#

move the sysout in the listener above the isNewChunk test

raw prairie
#

k

eternal oxide
#

You are going to have to change how you load that Structure as you are currently saving it to your plugin folder.

torn shuttle
#

shared loot tables are a hassle to make

eternal oxide
#

default load is from the world folder, so you need to use the load method that allows you to specify a path

raw prairie
#

Oh

#

mb

#

mb

#

@eternal oxide

#

i already did it

#

plugin.saveResource("backrooms.nbt", false);

eternal oxide
#

load

#

not save

#

this.backroom = Bukkit.getStructureManager().loadStructure(new NamespacedKey(plugin, "backrooms"));Needs to load from yoru plugin folder

#

as saveResource defaults to your plugin folder

raw prairie
eternal oxide
#

No

raw prairie
eternal oxide
#

this.backroom = Bukkit.getStructureManager().loadStructure(new NamespacedKey(plugin, "backrooms"));Change that

#

there is another load method which takes a path

raw prairie
eternal oxide
#

File

#

instead of NamespacedKey

#

or I guess you could just InputStream from teh jar itself

torn shuttle
#

making a loot need / greed system is such a hassle

eternal oxide
#

new File(plugin.getDataFolder(), "backrooms.nbt")

raw prairie
eternal oxide
#

is there a file in your data folder called rooms.nbt?

raw prairie
eternal oxide
#

in your data folder?

raw prairie
#

its for load structure btw

#

its in resources

eternal oxide
#

You are not answering what I am asking

raw prairie
eternal oxide
#

no, that is your project not your server

raw prairie
#

oh

quaint mantle
#

what's the thing that you can create a "region"?

#

i forgot

#

xD

eternal oxide
#

your server has a plugins folder...

raw prairie
eternal oxide
#

inside teh plugins folder you have a folder for each plugin, IF you saved a config or created the folder

raw prairie
#

lol

#

Haven't created it

eternal oxide
#

calling saveResource tries to put the resource in your plugins data folder

#

then in onEnable this.getDataFolder().mkdirs()

#

before you saveResource

raw prairie
#

Its in there

eternal oxide
#

ok

#

then your new File shoudl not throw an IOException

eternal oxide
#

so long as the name is correct

quaint mantle
#

i totally forgot

#

trying to remember

eternal oxide
#

thats a warning. hover over it and select wrap in a try/catch

quaint mantle
#

but cant

remote swallow
#

worldguard?

quaint mantle
#

nah

#

its in the spigot api

eternal oxide
#

BoundingBox

quaint mantle
#

YES

#

thank you

floral drum
#

hello friends

quaint mantle
#

not sure why i totally forgot that :(

raw prairie
#

Its in a try/catch

torn shuttle
#

is there a way in the API to add an item to a player in a way that will drop it if the inventory is full by default?

#

I know it's easy to do it manually, just wondering

eternal oxide
#

add to the inventory returns a Map of everythign which didn;t fit

raw prairie
eternal oxide
#

did you move the sysout above the isNewChunk test?

torn shuttle
#

I already wrote the workaround, was just wondering if there was an api method for it

eternal oxide
#

then it looks like you can;t run at startup

#

as teh listener never registers

remote swallow
#

is the event even registering with it not being in getServer().getPluginManager().registerEvents

eternal oxide
#

oh very good point. I hadn't noticed

eternal oxide
#

getServer().getPluginManager().registerEvents(new BackroomsListener(this));

#

silly mistake. probably mine for not noticing

raw prairie
eternal oxide
#

yes

ocean ginkgo
#

im having a really weird bug in my code and I cannot for the life of me figure it out...

 @EventHandler
    public static void playerPunch(PlayerInteractEvent event){
        Player player = event.getPlayer();
        if(event.getAction() == Action.LEFT_CLICK_AIR){




            if(shiftTime.get(player.getUniqueId())>5){

                int range = 100;
                Location loc = player.getEyeLocation();
                for (int r = 0; r < range; r++) {


                    /**
                    Block block = loc.getWorld().getBlockAt(loc);
                    if(block.getType()!= Material.AIR){
                        r = range;
                    }
                    **/


                    List<Entity> entities = (List<Entity>) player.getWorld().getNearbyEntities(loc,2,2,2);
                    for(int e = 0; e < entities.size(); e++){
                        LivingEntity entity = (LivingEntity) entities.get(e);
                        if(entity!=player) {
                            entity.damage(9);
                            entity.setFireTicks(60);

                        }
                    }

                    shiftTime.put(player.getUniqueId(),0);
                    //isFireShot.put(player.getUniqueId(),false);
                    player.getWorld().spawnParticle(Particle.SMALL_FLAME, loc, 15, 0.03, 0.03, 0.03, 0, null, false);
                    loc = loc.add(player.getEyeLocation().getDirection().multiply(0.5));


                }
            }



        }

    }

shiftTime is a map of ints, i have another method in order to iterate it for every tick a player is sneaking, and reset when release.

I have detection for if the ray runs into a block, but it is commented out.

my bug is that after I kill an entity, the place where the entity died will stop the ray.

its as if a barrier is blocking the ray.

vocal cloud
#

Stop using sysout MeguREE

eternal oxide
#

replace the line it's from

#

use sysout as much as you want for debug

#

Its only paper asses that don;t like it

remote swallow
#

Bukkit.broadcastMessage better imo

vocal cloud
#

Or people who like to know where a message is coming from

eternal oxide
#

if it's your plugin and you are doing debug it's perfectly suited

raw prairie
#

@eternal oxide erooor

remote swallow
#

show

raw prairie
remote swallow
#

new BackroomsListener(this), this

#

prob

eternal oxide
#

yep

raw prairie
#

tysm

#

ily bbg

vocal cloud
river oracle
#
public class TotemPouchCache extends CacheLoader<UUID, TotemPouchItem> {

    public TotemPouchCache() {
    }

    @Override
    public TotemPouchItem load(UUID key) throws Exception {
        return new TotemPouchItem(TotemPouchType.POUCH_SMALL);
    }

}``` I feel like I'm totally misinterpreting how a cache should work, but its not clicking for me. 
I want to allow multiple totem sizes in the cache. the docs for load say `Computes or retrieves the value corresponding to key.`, but shouldn't the cache be the one handling the storage of the value attached to the key. It seems counter productive to  have to pull from my database and construct a new object every time I want to load from the cache. Honestly to me it seems like it defeats the sole purpose of a cache. again likely me just being dumb
raw prairie
#

@eternal oxide

#

even then

#

no erooor

#

but nooo backroooms

eternal oxide
#

do your sysouts now print?

raw prairie
#

oh wiat

#

i didnt update plugin 😅

#

@eternal oxide

#

[ERROR] Error occurred while enabling Backrooms v1.0-SNAPSHOT (Is it up to date?)

java.lang.RuntimeException: java.util.zip.ZipException: Not in GZIP format

at backrooms.backrooms.BackroomsListener.<init>(BackroomsListener.java:28) ~[?:?]

at backrooms.backrooms.Backrooms.onEnable(Backrooms.java:15) ~[?:?]

eternal oxide
#

?paste full error

undone axleBOT
raw prairie
eternal oxide
#

corrupt jar?

#

no corrupt backrooms.nbt

#

BackroomsListener.java:28 probably where it tries to load the Structure

#

delete teh backrooms.nbt from your server

#

let the plugin create a new one

raw prairie
#

@eternal oxide

#

teh debug works

#

[INFO] Hi, this means that the code for structure placement works, sort of!

[INFO] Hi, this means that the code for structure placement works, sort of!

[INFO] Hi, this means that the code for structure placement works, sort of!

[INFO] Hi, this means that the code for structure placement works, sort of!

[INFO] Hi, this means that the code for structure placement works, sort of!

[INFO] Hi, this means that the code for structure placement works, sort of!

[INFO] Hi, this means that the code for structure placement works, sort of!

[INFO] Hi, this means that the code for structure placement works, sort of!

[INFO] Hi, this means that the code for structure placement works, sort of!

eternal oxide
#

delete the world and startup

#

see if any Structures are spawned

#

you can remove the debugs now

raw prairie
#

@eternal oxide

#

no structures spawned

raw prairie
eternal oxide
#

you can't delete teh world with the server running

#

so stop server, delete world, startup

raw prairie
#

or

#

the main

eternal oxide
#

I thought you were testing all this in the main world "world"

raw prairie
eternal oxide
#

ah ok, then delete Backrooms

#

when you teleport to the new Backrooms world be sure you goto 0,0

raw prairie
#

@eternal oxide

#

[ERROR] Error occurred while enabling Backrooms v1.0-SNAPSHOT (Is it up to date?)

java.lang.RuntimeException: java.util.zip.ZipException: Not in GZIP format

at backrooms.backrooms.BackroomsListener.<init>(BackroomsListener.java:28) ~[?:?]

#

when i deleted it it didnt regenreate the nbt

eternal oxide
#

it only creates it when you start the server

raw prairie
eternal oxide
#

also that error seems to say it created an empty file

#

it didn;t copy the actual resource

raw prairie
eternal oxide
#

or the resource you put in the jar is an empty file

#

check the file has contents

raw prairie
eternal oxide
#

send me the file

#

drop in here

raw prairie
eternal oxide
#

its a valid zip

raw prairie
eternal oxide
#

it also has contents, but its a lot of nulls

#

No clue why you are getting a zip error. its fine

raw prairie
eternal oxide
#

nope I just checked the file is fine

raw prairie
eternal oxide
#

show me your current BackroomsListener

raw prairie
# eternal oxide show me your current BackroomsListener

public class BackroomsListener implements Listener {

    Structure backroom;
    Plugin plugin;

    public BackroomsListener(Plugin plugin) {
        this.plugin = plugin;
        try {
            this.backroom = Bukkit.getStructureManager().loadStructure(new File(plugin.getDataFolder(), "backrooms.nbt"));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }


    }
    @EventHandler

    public void BackroomsGenLoad (ChunkLoadEvent e){
        if(e.isNewChunk()){
            Bukkit.getScheduler().runTask(plugin, () -> {
                    Location loc = new Location(e.getWorld(), e.getChunk().getX() * 16, 40, e.getChunk().getZ() * 16);
                    backroom.place(loc, false, StructureRotation.NONE, Mirror.NONE, 0, 1, new Random());
            });
        }
    }

}
eternal oxide
#

what is line 28?

#

is it the loadStructure or the place thats throwing the error?

#

you could try this.backroom = Bukkit.getStructureManager().loadStructure(plugin.getResource("backrooms.nbt");

#

that shoudl load it straight from your jar, so no saving to file needed

raw prairie
#

@eternal oxide

eternal oxide
#

then you need to test it or ignore the warning

raw prairie
eternal oxide
#

yes

raw prairie
#

@eternal oxide

#

same eroor

eternal oxide
#

no clue then. There has to be something wrong with your Structure file

#

I've not tried loading it myself but it looks ok

#

I'm starting my IDE to test it

eternal oxide
fading spindle
#

how do i check every player on the server's killstreak at, basically like it constantly scans all online players killstreak

delicate lynx
#

you'll have to track killstreaks yourself

fading spindle
#

like how?

delicate lynx
#

check when a player kills another player, and reset to 0 if they die

fading spindle
#

ok

#

i could use a little help with that

fading spindle
remote swallow
#

player death event probably

fading spindle
#

in a while loop?

remote swallow
#

on player death event add the killer to something you can track, each time they kill someone add one to their kill streak, if they die remove their kill streak

fading spindle
#

ok

#

tysm! :)

#

for helping

marsh burrow
#

Hey mates, would anyone know of a way to spawn an arrow where it doesnt trigger a EntityLaunchProjectileEvent, or apply PersistentData before spawning the arrow? Im trying to spawn a double/triple arrow, but since im spawning it in the projectile shoot event, it gets called infinitely. Any ideas?

vocal cloud
#

Why not apply PDC to the extra arrows so that you can check for it and not spawn more arrows?

marsh burrow
vocal cloud
#

It definitely should not

marsh burrow
#

I created something that worked, like an ignore list, but that only works for one arrow duplication, I want to be able to create 3, 4 or 6 shot varients

vocal cloud
#

What about a custom arrow. You can then instanceof check it

marsh burrow
#

huh, thats possible?

vocal cloud
#

Should be

marsh burrow
#

that would totally work if I knew how to do that xD

#

I just make a class and Extend the bukkit Arrow class?

vocal cloud
#

Probably something you'd have to do through NMS

#

The only other solution I can think of is spawn the other arrows 1 tick after using a sync runnable

shadow zinc
#

Why do I get incompatible types: java.lang.Class<com.neomechanical.neoperformance.version.halt.HaltWrapperLEGACY> cannot be converted to java.lang.Class<? extends com.neomechanical.neoutils.version.VersionWrapper> every time I try to compile for these classes?

#
package com.neomechanical.neoperformance.version.halt;

import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.server.ServerCommandEvent;

public class HaltWrapperLEGACY implements IHaltWrapper {
}```
#
package com.neomechanical.neoperformance.version.halt;

import com.neomechanical.neoutils.version.VersionWrapper;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.server.ServerCommandEvent;

public interface IHaltWrapper extends VersionWrapper {}
#

the ide doesn't warn me either

#

this only started happening when I changed my pom, my current one is:

#

my older one used the embedded neoutils on line 83

river oracle
#

holy it can

#

didn't know that 🤔 crazy

river oracle
#

that could be partially your issue

#

nvm I have no fucking clue what I'm talking about apparently did research

hoary wing
#

hi

#

Hello, please help, I made it send me a message when I entered a portal, but when I entered, it spammed me, how do I make it so that I only send it once?

hoary wing
#

@EventHandler
public void portal(PlayerPortalEvent event) {
Player p = event.getPlayer();
p.sendMessage("Hola!");
p.playSound(p.getLocation(), Sound.VILLAGER_YES, 10, 2);
}

hoary wing
sleek moon
hoary wing
# civic wind Show code

@EventHandler
public void portal(PlayerPortalEvent event) {
Player p = event.getPlayer();
p.sendMessage("Hola!");
p.playSound(p.getLocation(), Sound.VILLAGER_YES, 10, 2);
}

civic wind
#

Yeah make an arraylist, add player to it, and then check if theyre in arraylist

fringe hull
#

Hi, I want to ask, I use ArmorStandTools and I do not know what and how about WorldGuard, someone please help me?

tiny tangle
#

How to remove "This message has been modified by the server"

fringe hull
hoary wing
#

Hello, please help, I made it send me a message when I entered a portal, but when I entered, it spammed me, how do I make it so that I only send it once?

low temple
#

else make it add the player to the hashmap and add the current time in miliseconds

#

@hoary wing

HashMap<String, Long> playersInPortal = new HashMap<>();
    @EventHandler
    public void portal(PlayerPortalEvent event) {
        Player p = event.getPlayer();
        if (playersInPortal.containsKey(p.getUniqueId().toString()) && (System.currentTimeMillis() - playersInPortal.get(p.getUniqueId().toString())) < 1000)
            return;
        
        p.sendMessage("Hola!");
        p.playSound(p.getLocation(), Sound.VILLAGER_YES, 10, 2);
        playersInPortal.put(p.getUniqueId().toString(), System.currentTimeMillis());
    }

this should work

kindred valley
#

Stop using statics and itll all be fine

low temple
kindred valley
#

General advice ^^

low temple
#

“Static abuse” is rarely an issue but sure

#

If it makes sense for a variable to be static then make it static, otherwise don’t

wet breach
kindred valley
#

Agreed

wet breach
#

also, don't use statics if you don't know the implications of using them are

#

its not a make sense thing

low temple
#

Like if u make ur plugin instance into a static variable

wet breach
#

Yes that is allowed because the main class follows the rules in what is acceptable to be static

low temple
#

What’s an example of a static variable being problematic?

wet breach
#

static prevents objects/classes from being GC'ed so if you were expecting to have multiple instances instead of 1, that would be a problem

low temple
#

GC’d?

wet breach
#

garbage collected

#

its how objects die

#

and go away

low temple
#

Oh yeah true

wet breach
#

there is other implications like getting null variables from invoking static methods in classes because they are not setup appropriately to handle being static

#

I am not saying statics should never be used, just if you have no knowledge of them or how they can be bad, it is better to just not use them

#

then to use them and then encounter all kinds of problems all because of using static incorrectly lol

quaint mantle
#

Hi guys, I'm working on 1.19.2 version but sometimes, the plugin is null (I don't know why)
Caused by: java.lang.NoSuchFieldError: plugin
Below photo is more detail about it

kindred valley
#

Woww

#

What font is that

#

Cant read damn letter

#

And paste it via

undone axleBOT
slim kernel
#

When I restart my bungeecord server it changes one part of my config (plots.root) to {} even tho I never set that anywhere. That doesnt happen on my spigot server. Through what could that happen?

#

The only time I set plots.root is in a command

civic wind
#

Hey so i made a plugin which allows a creeper egg to launch like a snowball, all works great apart from i'm struggling with the explosion part for impact on block and/or entity, I've tried it a few ways, the nearest i got was explosion on entity only

#

I know this is very wrong, it was the last attempt i done, just showing it so you can see what i'm getting at it

quaint mantle
#

?paste

undone axleBOT
low temple
#

within the ProjectileCollideEvent you'd check the type of the entity (snowball) and then check if it has the data (use persistent data containers)

#

if it does you can prob spawn TNT at that location with a fuse of 0 and it should insta-detonate

civic wind
#

I just need to check for block hit and hit entity but how i had it was only working for hit entity, i can make explosion world#createExplosion

low temple
#

id assume you dont want all snowballs to create an explosion right?

low temple
civic wind
#

This works for entity's hit but I need it on block impact too, also I'm adding checks for meta to make sure it's only specific item, or will use pdc

#

Just trying to get it to work before i add that

low temple
hard socket
#

it keeps setting the data

civic wind
#

So the actual item in the inv is a creeper egg, its the event on right click that changes everything

low temple
# hard socket

Is this for the persistent data container for a hopper?

hard socket
#

yes

low temple
#

make sure u run the .update() function after u set it

hard socket
#

oh thx

#

forgot that

low temple
# civic wind

Ah I see now. Is the problem that an explosion isnt happening?

low temple
# civic wind

I think the ProjectileHitEvent only triggers on entities

#

try ProjectileCollideEvent

civic wind
#

Ahhh okay will give this a go

grim oak
#

Hi im getting an error with the following code. The input items is of class ItemStack[], so why does this throw an error when it tries to cast the the resulting Object[] to ItemStack[] and how can i make it so that it works

bold copper
#

Hi, I'm trying to get my boat (MyBoat extends net.minecraft.world.entity.vehicle.EntityBoat) move. However, when the player is sitting in the boat,
calling super.move(EnumMoveType.a, new Vec3(0,0.3, 0)) does not lead to anything. Please tell me how I can move the boat in which the player is sitting?

chrome beacon
grim oak
#

thanks!

chrome beacon
#

also why use obfuscated nms 🙃

dire marsh
#

player controls vehicle movement iirc

chrome beacon
#

^^

dire marsh
#

i think setting velocity works

bold copper
bold copper
grim ice
#

uh

#

am i hallucinating

#

or is nitro being sold at literally 1.9 usd rn

echo basalt
#

probably localized pricing

remote swallow
main barn
#

how would i check if args = player

#

and set smth to the args

drowsy helm
#

Args being a command argument?

main barn
#

yep

#

im v new so idfk half these things

drowsy helm
#

Bukkit.getPlayer(args[n])

#

N being args number

young knoll
#

Then null check

drowsy helm
#

Obviously have null checks etc

main barn
#

soo 0 for 1st

drowsy helm
#

Yup

wet breach
#

arrays in java start at 0

#

unless you are using some lib where it creates arrays with indexes at 1 instead lol

drowsy helm
#

Luacore

main barn
#

wait so once i get the player do i do smth like Player p = Bukkit.getPlayer(args[0])

#

orer

#

orr

drowsy helm
#

Yeah

#

But check if it’s null

main barn
#

i did i think

drowsy helm
#

And check if args[0] exists

main barn
#

i did if (args == null){

#

ah

#

i didnt do that#

#

wait nvm i did

bold copper
drowsy helm
#

Args.length >= 1

tardy delta
#

Bukkit.getPlayerExact 🥺

main barn
#

i did if (args.length == 0){

drowsy helm
#

Early returns?

young knoll
#

getPlayerExact is smelly

drowsy helm
#

Nice nice

main barn
#

i got "method invocation "setHealth" may produce NullPointerException" even tho i did null checks

drowsy helm
#

Show ur code

main barn
#

how

#

icant screenshot it

drowsy helm
#

?paste

undone axleBOT
wet breach
main barn
#

so does it matter

#

or doesnt it

wet breach
#

did you compile and test it?

main barn
#

no cos i ghave some { errors i needa fix

drowsy helm
#

Depends on how correct the warning is

wet breach
#

not all warnings from the IDE are correct

main barn
#

i have 3 warnings

#

Condition 'args == null' is always 'false'

#

Implicit call to 'toString()' on array 'args'

#

Method invocation 'setHealth' may produce 'NullPointerException'

#

thats itr

wet breach
#

you should check if args is empty

#

instead of null

main barn
#

i alr have a cvheck if args

#

is 0

young knoll
#

getPlayer may return null

#

Did you null check the player ?

#

Also args will never be null, but it can be empty

main barn
#

how would i check for empty

#

args.lenght == 0

#

?

wet breach
#

args.isEmpty()

drowsy helm
#

Length == 0

wet breach
#

or length

#

which ever it is

main barn
#

but i alr have if args = 0

#

i wanna check if the player is real

#

and online

drowsy helm
#

Check if null

wet breach
#

args == 0 is not the same as args.length == 0

drowsy helm
#

Wont return offline players

#

Theres a method specifically for offline players

main barn
#

ok done that

#

Condition 'args == null' is always 'false'

wet breach
#

don't check for null....obviously

main barn
#

okk

wet breach
#

remove it o.O

wet breach
#

not sure why we are having to repeat this

main barn
#

i did remove it

#

only 1 warn

#

'class' or 'interface' expected

#

at last }

#

wait no thats an error not warn

wet breach
#

you missing a closing bracket or semicolon somewhere

dire marsh
#

as I said try setting the velocity on the vehicle

wet breach
#

just don't sent a high number for velocity

main barn
#

ok all fixed

wet breach
#

unless you like to see it disappear into the distance 😄

main barn
#

also is there a way of auto-completing args to be tabbed to ojnline players?

#

if u get me

young knoll
#

Yes

bold copper
young knoll
#

Implement TabCompleter

main barn
#

into the public final class

#

orr

main barn
#

only warnings ima try run it

young knoll
#

I mean you need code inside the method

bold copper
main barn
#

ok ity all works just when the /kill is not a player it says internal servere error

#

so i just need a msg fo that

native ruin
#

is it possible to save variables without using a config file?

young knoll
#

You could use a database

#

Or json, txt file, pretty much anything

native ruin
#

so not possible without something external

#

thanks for info

young knoll
#

PDC is an option

#

?pdc

main barn
#

how do i fix Class 'Feed' must either be declared abstract or implement abstract method 'onTabComplete(CommandSender, Command, String, String[])' in 'TabCompleter'

young knoll
#

Implement the method

main barn
#

how tho

#

lmfaoo

#

oh wait

young knoll
#

Usually your ide has a button to do it

main barn
#

i gotta use the method

#

ah

#

figured out

#

nvm

#

Casting 'Bukkit.getPlayer(...)' to 'Player' is redundant

#

how to fix dat

#

if i can

earnest forum
#

why do u need to cast it

young knoll
#

Don’t cast it

main barn
#

Player p = (Player) Bukkit.getPlayer(args[0]);

#

thats my code

bold copper
main barn
#

im watching a tutorial but its outdated so im tryna do it myself 💀

earnest forum
#

do you know what redundant means

#

it means useless

#

instead of asking simple questions try and do some problem solving

bold copper
earnest forum
#

no reason to make a plugin if u dont understand why it works

#

you'll just run into more problems later

main barn
#

im just doing it for fun cos i have nunn better to do

wet breach
#

that doesn't mean we like to help with useless things because you chosen to not to do your part either

bold copper
tardy delta
#

how's the christmas cat

sturdy spoke
#

hello

#

I have a problem with teleportation

#

PlayerTeleportEvent may only be triggered synchronously

bold copper
sturdy spoke
#

But the teleport doesn't work

bold copper
#

use bukkit tasks

sturdy spoke
#

BukkitScheduler?

#

can you show an example?

bold copper
#

for example, run the desired task synchronously, after a certain time

bold copper
sturdy spoke
#

please show me, I'm just starting to learn the spigot api))

sturdy spoke
#

th

#

так ты русский

#

😂

young knoll
#

?scheduling

undone axleBOT
bold copper
sturdy spoke
#

спасибо

#

delay тоже в мс?

bold copper
# sturdy spoke так ты русский

да, но тут не принято использовать локальные языки .. используй как все, английский, чтобы другие нас понимали

sturdy spoke
#

ok

bold copper
sturdy spoke
#

th

sturdy spoke
#

🥶

grim oak
#

Hi, I have the following code and it works perfectly fine but i feel like its quite clunky, is the a way i could do the same stuff but shorten it down? it seems a little unnessary repeating it twice, and the condition is quite long, but its not as simple as setting a Arrays.stream(items).filter(/*CONDITION*/) to a variable because it throws an error that the stream is closed or consumed

if (Arrays.stream(items).filter(/*CONDITION*/) != null)
            items = Arrays.stream(items).filter(/*CONDITION*/).toArray(ItemStack[]::new);```
main barn
#

how would i give the player 64 of an itemstack

crimson terrace
#

Setamount

main barn
#

inventory.addItem(new ItemStack(Material.getMaterial(item))); i have that

crimson terrace
#

yeah a ,64 will do nicely

main barn
#

would i add ,64 after item or after the ) next to item

crimson terrace
main barn
#

kk

#

think it worked

tardy delta
#

just pass in a big filter ig

main barn
#
            Player p = (Player) sender;
            p.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "ESSREVAMPED " + ChatColor.RED + "Please select an item to give to you!");
        }else if (args != null){
            String item = args[0];
            Player p = (Player) sender;
            PlayerInventory inventory = p.getInventory();
            inventory.addItem(new ItemStack(Material.getMaterial(item),64));``` thats my code for the item thing
hazy parrot
#

if there are no items matching condition, you would just get empty array

main barn
#

?

chrome beacon
quaint mantle
#

yo, exists a method to create a countdown without scheduling?

chrome beacon
#

No use the scheduler

quaint mantle
#

okay thanks

crimson terrace
frail gale
#

what do you prefer?

#

Reflection or Making a class for every version?

chrome beacon
#

I usually do both

frail gale
#

same

chrome beacon
#

Version for each class and reflection as fallback should the version not be supported

frail gale
#

but for now I do only Reflection

#

but if I wanna do custom Entities via NMS then I will need each version class because you cannot extend classes with Reflection

main barn
#

Caused by: java.lang.IllegalArgumentException: Material cannot be null

#

but i alr checked for null

#

so what tf am i meant to do

quaint mantle
#

send code

crimson terrace
#

try Material.valueOf()

crimson terrace
#

and make sure its all in upper case

quaint mantle
main barn
#

i did the value of

crimson terrace
#

valueOf() needs all Uppercase letters I believe in order to get the value

main barn
#

what so VALUEOF

#

orr

#

lmfao

crimson terrace
#

bruh

#

Material.valueOf()

opal juniper
#

valueOf("STONE");

crimson terrace
#

I think the rest should be googleable

main barn
#

inventory.addItem(new ItemStack(Material.valueOf(item),64));

#

all i got is that

#

and the item is set to arg

crimson terrace
#

item.toUpperCase()

main barn
#

ok

#

will try now

crimson terrace
#

and then it should work if you type in stone just as well as with STONE

frail gale
#

memorizing the methods of a class xD

main barn
crimson terrace
#

ye there is

crimson terrace
#

you can use Material.values() to get all values

summer scroll
#

Use Material#values

frail gale
#

also when using Material values

crimson terrace
#

then a simple stream to convert them to strings

frail gale
#

after that check if the Material#isItem

main barn
#

would i have to implement tabcompletions im guessing

frail gale
#

it will get all the items and Item Blocks

#

if you do not filter it then there will be some items which are gonna be BlockStates

#

and they're are not gonna be certainly items

#

they're gonna be like AIR

main barn
#

where do i put the onTabComplete in the code

#

i dont usually use tab complete

frail gale
main barn
#

kk

frail gale
#

I have made myself a custom Command Handler with a lot of shortcuts

glossy venture
#

im trying to use forgegradle for 1.12.2, but im getting this error when reloading the project (build.gradle https://pastes.dev/eB1scqKxz9), gradle version 7.3 @ java 17

Caused by: org.gradle.api.artifacts.UnknownConfigurationException: Configuration with name 'compile' not found.
    at net.minecraftforge.gradle.user.UserBasePlugin.configureCompilation(UserBasePlugin.java:526)
    at net.minecraftforge.gradle.user.UserBasePlugin.applyPlugin(UserBasePlugin.java:158)
    at net.minecraftforge.gradle.common.BasePlugin.apply(BasePlugin.java:213)
    at net.minecraftforge.gradle.common.BasePlugin.apply(BasePlugin.java:90)
main barn
#

got dang 40 mins

frail gale
frail gale
glossy venture
keen basin
#

I have 10GB ram with 27 plugins but the ram when the player joins the server the ram goes up when the player leaves the ram does not go down (The ram never goes down i need to restart the server) can some one help me ?

glossy venture
#

all information should be in the build.gradle paste i sent

frail gale
# glossy venture

Please use older Java Version and Gradle v2 or something like this

#

I use Java 8 and Gradle 2.3 I believe

glossy venture
#

alr

#

ill use java 11 and 2.3

frail gale
glossy venture
#

might be better

#

ill try 2.3 first

#

nah got to use 4.9

frail gale
#

yeah

glossy venture
#

hmm

#

do you have an example build.gradle i could try

frail gale
#

yes

#

Do you want DM? because this section is for plugins not mods

glossy venture
#

oh yeah true

#

alr

main barn
#
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;

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

public class GiveTabComp implements TabCompleter {

    @Override
    public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {

        if (args.length == 1){
            List<String> playerNames = new ArrayList<>();
            Player[] players = new Player[Bukkit.getServer().getOnlinePlayers().size()];
            Bukkit.getServer().getOnlinePlayers().toArray(players);
            for (int i = 0; i < players.length; i++){
                playerNames.add(players[i].getName());
            }

            return playerNames;
        }

        return null;
    }
}``` how do i convert this into a block array not player
#

i just copied tt tbh

remote swallow
#

change the stuff in the if(args.legnth == 1) if statement

bold copper
undone axleBOT
frail gale
hazy parrot
#

array of all blocks i assume

twilit roost
wet breach
#

if it hasn't changed it is enough to use reflection to just point to the appropriate class

frail gale
#

yeah

wet breach
#

a good way to point to appropriate versions is to make use of Enums

#

what I mean is, you can put class names into enums

frail gale
#

yeah

#

but how to extend them?

#

within enum

frail gale
wet breach
#

enums can implement interfaces

#

you can't extend enums

frail gale
#

yeah ik for this

#

but if I add a method which is for getting the class

#

so it will be like ENUM.SOME_VALUE.getClazz()

wet breach
#

basically

frail gale
#

basically this will work?

wet breach
#

enums are a powerful tool if used right 🙂

frail gale
#

bro if this is right

#

you opened a whole new thing to me

#

how I can find more of this information

wet breach
#

not entirely sure of decent resources on like everything enum

#

most of my information is because I have been using Java ever since it came out 😉

#

just following the specs and what not

wind blaze
#

How can I add a player to a luckperms group by code? Just give him group.(name) permission or?

wet breach
#

well two ways exist for that

#

I am fairly certain luck perms has an API component you could use

#

or make your plugin invoke a command for given plugin

#

typically recommended to use an API if there is one

wet breach
frail gale
#

the resource you posted is for Enums to extend Enums I believe

#

but still I don't know if its possible to Java Class extend Enum.VALUE.getClazzFromTheEnumValue()

wet breach
#

You can't extend enums, however the appropriate way to extend an enum is to have an enum implement an interface instead

frail gale
#

but this is only for Enums

#

I don't if it is possible for classes

wet breach
#

not sure what it is you are saying

#

Java classes can not extend enum....so not sure what exactly you are asking that is or is not possible

river oracle
#

honestly if you are in a scenario where you would find yourself wanting to extend an enum you are probably structuring something incorrectly

wet breach
#

that doesn't use reflection

frail gale
#

okay

wet breach
#

this particular enum that is linked, is dynamic

#

it is dynamic because of the code below, more specifically at the end of the enum class

#

You can use reflection however, to simply remove the end method and just stuff what you wanted into the enum itself

#

very handy for version specific things that only apply at say runtime

frail gale
#

Yeah I use reflection in the Enum Value

wet breach
#

instead of an overloaded enum, you could simply just have 1 value in the enum and said value is created at runtime 😄

frail gale
#

yep

#

but my question firstly was

#

not certainly a question

#

but that if you want to create a custom NMS mob which extends NMS mob you will need to make it for each version because as far as I know Java cannot extend a Class which is got from runtime

#

also is it problem to use private in the Enum variables?

#

and final

wet breach
#

you don't have to make it for each version unless it changed

frail gale
wet breach
#

even before you didn't have to either

frail gale
wet breach
#

you can call stuff by their complete path instead

#

in doing so you can use reflection to update that path

frail gale
#

but you cannot update the path of a Class when extending it

#

right :D?

wet breach
#

don't see why you couldn't

#

so here is an example

#

public class Zombie extends net.minecraft.entity.1_18.Zombie {  }
#

now you don't need an import

#

and reflection can change it

frail gale
#

how actually Reflection can change it?

#

I didn't also know that this was possible wow

wet breach
#

also you can instatiate objects

#

with their full path too

frail gale
#

for Object I know but can you show me how to edit the path of this example above

wet breach
#

I am trying to find a good resource

#

but google isn't really liking me right now

wind blaze
frail gale
#

this is really complex

wet breach
#

lol

river oracle
#

?paste

undone axleBOT
wet breach
#

but it does make me happy though when I can impart knowledge that blows someone's mind away

river oracle
#

I could be understanding you totally incorrectly but I think you are going about this in the wrong way https://paste.md-5.net/biqarocoma.java I think a model like such would be a much better model for something like this. Now you can implement every version and you don't really have as much nasty reflection to deal with. I don't really think there is an issue with dealing with impl for multiple versions in this way either as you'll be dealing with that issue either way

frail gale
frail gale
ivory sleet
wind blaze
#

RegisteredServiceProvider<LuckPerms> lpprovider = Bukkit.getServicesManager().getRegistration(LuckPerms.class);
if (lpprovider!=null){
LuckPerms api = lpprovider.getProvider();
}

#

how would i add a player to a group by code now?

river oracle
#

Tracking items is tricky lol. Is there any way I can tell if an Item has despawned?

ivory sleet
#

iirc its LuckPermsApiProvider.get() or sth

#

Maybe im in the wrong

fierce whale
#

How can I solve this error : java.io.StreamCorruptedException: invalid stream header.

Here is my code:

    public void setObject(String path, Object obj) {
        try {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream(baos);
            oos.writeObject(obj);
            oos.close();
            byte[] btarray = baos.toByteArray();
            String data = new String(btarray);
            getConfig().set(path, data);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    public Object getObject(String path) {
        try {
            byte[] buf = getConfig().getString(path).getBytes();
            ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(buf));
            Object obj = ois.readObject();
            ois.close();
            return obj;
        } catch (IOException | ClassNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    }```
ivory sleet
#

I was wrong

#

use LuckPerms api = LuckPermsProvider.get();

#

and make sure ur plugin enables after LuckPerms

wind blaze
#

👍

wind blaze
ivory sleet
#

sure

wind blaze
#

do you know how to by any chance? seems to be buggy for me idk

tardy delta
#

check their wiki

wind blaze
#

i did and i couldnt find how to exactly add a player to a group

ivory sleet
#

get the node map

#

and apply an inheritance node

wind blaze
#

just pieces i picked up and it didnbt rly work

ivory sleet
#

iirc

wind blaze
#

public static void addPermission(UUID uuid, String permission) {
// Add the permission
LuckPermsProvider.get().getUserManager().loadUser(uuid);
User user = LuckPermsProvider.get().getUserManager().getUser(uuid);
user.data().add(Node.builder(permission).build());

    // Now we need to save changes.
    LuckPermsProvider.get().getUserManager().saveUser(user);
}
#

this is what i got rn but it doesnt seem to work most of the time

#

and to remove i just change "add" but that doesnt rly work either lol

#

^i put that together from pieces out of their wiki btw

rough knot
#

i might be being stupid but is there a way to put a block on another players head

#

for example, the /hat command. however, it doesnt work for other players

rough drift
#

@rough knot Can you explain a bit further?

rough knot
#

you know in essentials, the command that means you can put blocks or whatever on your head?

ivory sleet
rough drift
#

yeah

#

wait

#

thread time

rough knot
#

okay :)

wind blaze
rough drift
#

hat command

ivory sleet
wind blaze
#

do you know how it would work

ivory sleet
#
var um = LuckPermsProvider.get().getUserManager();
um.modifyUser(uuid, user -> {
  user.data().add(PermissionNode.builder("perm").build());
});

@wind blaze

#

iirc

wind blaze
#

ill try wait

#

and for removal i just exchange "add" with "remove" or?

ivory sleet
#

yes

#

if you want to do something after it has completed u can

#

modifyUser(bvlah).join();
codeThanRunsAfterTheOperation();

wind blaze
#

eh

#

doesnt work

#

wait

#

could that happen cuz i got version 5.3 on my server

floral drum
#

hi conc ❤️

wind blaze
#

tand 5.4 api?

ivory sleet
wind blaze
#

i want to use it within a spawn tag plugin and so its in entitydamageby entity event and i put checks before and after the addpermission so it should get called 100%

chrome beacon
#

Spawn tag?

river oracle
#

what event is triggered if an item burns in lava for some reason my EntityDeathListener isn't triggering

wind blaze
#

tagging up at spawn, otherwise you are not damageable

woven tide
#

hey guys how do I give the player's held item?

river oracle
#

Player#getInventory#getItemInMainHand

#

Player#getInventory#getItemInOffHand

woven tide
river oracle
#

please learn java

player.getInventory().getItemInMainHand();
player.getInventory().getItemInOffHand();
grim oak
bright cedar
#

Hi, how may I bump a player like 100 blocks in the direction he is looking ?

wet breach
fluid river
#

empty stream is not null

#

it's just empty

crimson terrace
#

you can get the direction using their Eye location iirc

wet breach
#

just be careful to not set their velocity too high

#

otherwise they be zooming XD

hard socket
#

how can i delete one of the materials here

tardy delta
#

thats a stringlist so remove it from the list and set it back

hard socket
#

wdym

tardy delta
#
List<String> materials = config.getStringList("ItemHoppers");
materials.remove("Diamond");
config.set("ItemHoppers", materials);
#

iirc

hard socket
#

ohh will try that thx

shadow gate
#

Tell me what it might be related to. The message with the text "Test" is sent twice, although the action in the code is recorded once and must be performed once.

tardy delta
#

why am i seeing only one | there

hard socket
#

I am assuming cause the if check

#

you using | and they are both fired

river oracle
#

How would I check if an Item entity dies? EntityDeathEvent -> only works with living entities doesn't work and I don't seem to be getting anywhere with EntityDamageEvent

    @EventHandler
    public void onPouchDeath(EntityDamageEvent e) {
        if (!(e.getEntity() instanceof Item)) {
            System.out.println("not item");
            return;
        }

        final Item item = (Item) e.getEntity();
        if(!item.isDead()) {
            System.out.println("item is not dead yet");
            return;
        }
        System.out.println("Item is dead");
   }
#

I get 2 hits of Item is not dead yet, but no death notification possibly because the final hit doesn't mean its technically "dead" yet, but Item entities have no health attribute

remote swallow
#

are you only checking for despawn?

river oracle
#

me?

remote swallow
#

yeah

river oracle
#

Despawn event is different

shadow gate
river oracle
#

I want to know when the item will die, but items don't have any health attribute so I can't be certain and it wouldn't be good if I got a double event trigger on my database

#

if I remove it on the first damage I am opening the possability for a dupe too

#

I could always do a map to check if the item has been damaged already and if it has act on it 🤔 but I'm not sure that would be the best way in this situation

fluid river
#

oh shit im not on ru bukkit

river oracle
#

👀 be careful guys optic is scarry

fluid river
#

use english

#

tho

#

no russian here

shadow gate
#

I found a mistake. It also reacts to the player's resource pack
Is there any way to exclude this?
so that only on the server

fluid river
#

are you sure it's cuz of players' resuourcepack

#

try removing if check on ACCEPTED

#

Just leave SUCCESSFULLY LOADED

minor garnet
#

Rotate 3 locations on 90 graus

fluid river
#

aslo use logical operator ||

#

not binary |

tardy delta
#

ye

wet breach
shadow gate
river oracle
# wet breach you sure they don't have health?

I'm only like 50% sure when I try to do Item#getHealth or Entity#getHealth I don't get anything I'd have to double check the docs but maybe getHealth is an attribute of LivingEntity?

fluid river
river oracle
#

seems like it Item isn't a LivingEntity and LivingEntity extends Damageable

wet breach
fluid river
#

and second time when resourcepack downloaded i guess

wet breach
#

items have a health of 5

river oracle
wet breach
#

the exception to this is nether stars

river oracle
#

is there a list of metadata keys for Item entities

#

i see Item#getMetadata

wet breach
#
 Age: The number of ticks the item has been "untouched". After 6000 ticks (5 minutes) the item is destroyed. If set to -32768, the Age does not increase, preventing the item from despawning automatically.
 
 Health: The health of the item, which starts at 5. Items take damage from fire, lava, falling anvils,‌[Java Edition only] and explosions. The item is destroyed when its health reaches 0.
 
Item: The inventory item, without the Slot tag.

    Tags common to all items[

    ]

 Owner: If present, only the player with this UUID can pick up the item. Used by the give command (and can be set in a summon command) to prevent the wrong player from picking up the spawned item entity.
 
 PickupDelay: The number of ticks the item cannot be picked up. Decreases by 1 per tick. If set to 32767, the PickupDelay does not decrease, preventing the item from being picked up.
 
 Thrower: The UUID of the player who dropped the item. Not present if the item was not dropped by a player.

Entity Data for Items

grim oak
#

or even do .toArray()

tardy delta
#

you can?

fluid river
#

you can

grim oak
#

can i?

wet breach
#

yes

grim oak
#

mb thanks

fluid river
#

just try and see 🙂

wet breach
#

?tas

undone axleBOT
tardy delta
#

Arrays.stream(new ItemStack[0]).toArray(ItemStack[]::new) will return an ItemStack[0]

#

kinda stupid this but just to show

river oracle
wet breach
#

generally nbt tags are

river oracle
#

this may sound stupid, but I wonder if I could obtain it via NMS I mean I couldn't really find anything in the api

#

I mean I definitly can lol

wet breach
#

you should be able to with NMS don't see it being difficult either lol

river oracle
#

yea Its just slightly annoying for multi versioning xD

#

welp if thats what I gotta settle on its what I'lld o

wet breach
#

might make a pr for updating EntityDamageEvent

#

to include items

#

also a pr to update the item interface to have getHealth()

river oracle
#

isn't it illegal to assign that agreement if I'm under 18

#

why I never have pr'd

wet breach
river oracle
#

US

wet breach
#

also, you used ItemMeta right?

river oracle
#

oh shit no I used the entities data

#

let me check the item meta

#

though I feel like that'd be a weird place to have its health

eternal night
#

isn't the health of the item entity exposed to the API ?

#

i could have sworn I saw that exposed

#

oh

#

|| paper only kekw ||

river oracle
#

😂

wet breach
#

hence I may just make a pr

#

or maybe see if choco would do it 😛

river oracle
#

welp NMS time :)

wet breach
eternal night
#

should be really easy with nms yea

river oracle
#

does ItemStack even have metadata anymore

eternal night
#

the metadata system ?

#

no

river oracle
#

yea I figured it was replaced

eternal night
#

they never were Metadatable

river oracle
#

hmm 🤔 idk why I thought they were

wet breach
eternal night
#

they don't have a unique identifier which is what you need to be Metadatable

#

like, for block its just their location

#

entity, their uuid

#

etc

river oracle
wet breach
#

could see what it does

eternal night
#

I mean, an item stack and the entity item are two very different hings

wet breach
#

we know this

river oracle
#

might as well

eternal night
#

the attribute modifiers of the item stack have nothing to do with the item entity itself

river oracle
#

I'm just going to make my NMS handle

wind blaze
#

Can someone please help me with adding players to luckperm groups per code?

bright cedar
#

Hi, I managed to make a giant zombie appear and get my player to climb on it, but he's in the zombie's head and can't see anything. How can I fix this?

chrome beacon
#

You can add more passengers on to the giant

#

So the player is higher up

bright cedar
#

So for example I make invisible armor stands appear on my zombie and put the player on them?

chrome beacon
#

Yes

river oracle
eternal night
#

hm ?

#

item entities certainly have health

river oracle
#

hmmm I'm so confused maybe looking in the wrong places

wet breach
honest badge
#

kinda random, but can anybody recommend a tutorial for working with particles

river oracle
#

oh okay

#

I wasn't doing that

river oracle
#

💀 reflection

eternal night
#

yea but like

#

not too bad

river oracle
#

yea lol

#

not that bad

tardy delta
#

wondering how a sandal can scream

native ruin
#

can you ask questions about java here aswell?

twilit roost
native ruin
#

is there a way to declare method variables later (so that the (Player) sender can be set later in the onCommand method)

sterile token
#

First of all, why are u using Method?

native ruin
sterile token
native ruin
#

not really, more to make it easily expandable

sterile token
#

I dont still understand what you want do

#

Sorry i think im not able to help you

native ruin
#

let me show you an example

sterile token
#

ok...

hoary wing
#

Hello, how do you use an api so that when you put /join, it sends me a game of bedwars

sterile token
#

First of all u need to check if the plugin has an APi

#

and if yes, check their docs to see how to implement it

native ruin
sonic barn
#

Hi, is here someone who can explain to me problem with new NMS ? 😄 I've looked everywhere I could ... I run BuildTools with --remmaped flag... I change things in my pom.xml file... I could after hours access NMS... but after I tried to code something and added this thing:

new ClientboundAddPlayerPacket(sp)

this error shows up:

java.lang.NoClassDefFoundError: net/minecraft/world/entity/player/Player

any idea ? 😄
I'm trying to spawn npc

remote swallow
hasty prawn
#

The maven plugin can do that I believe

sonic barn
hasty prawn
#

Uh md5 has a thread about it somewhere on the forums I just don't remember what it's called

hasty prawn
#

Yeah that's the manual way, there's a maven plugin that can do it also I believe.

sonic barn
#

okay... thanks a lot... I'll try to make it work 😄

sonic barn
remote swallow
#
<plugin>
    <groupId>net.md-5</groupId>
    <artifactId>specialsource-maven-plugin</artifactId>
    <version>1.2.2</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>remap</goal>
            </goals>
            <id>remap-obf</id>
            <configuration>
                <srgIn>org.spigotmc:minecraft-server:1.17-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
                <reverse>true</reverse>
                <remappedDependencies>org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
                <remappedArtifactAttached>true</remappedArtifactAttached>
                <remappedClassifierName>remapped-obf</remappedClassifierName>
            </configuration>
        </execution>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>remap</goal>
            </goals>
            <id>remap-spigot</id>
            <configuration>
                <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
                <srgIn>org.spigotmc:minecraft-server:1.17-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
                <remappedDependencies>org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
            </configuration>
        </execution>
    </executions>
</plugin>
undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

remote swallow
native ruin
hasty prawn
barren peak
#

Thanks

sonic barn
hasty prawn
#

I'm not sure how the plugin works tbh, I don't use Maven.

#

My guess is that you're not applying it correctly or something.

sonic barn
#

yeah I already thougt about that... I can't just find anything on the internet 😄 and I tried a lot 😄 ... I will just keep trying 😄

remote swallow
sonic barn
#

I have it there 😕

#

for 1.19.2

#

and I build it through "build artifacts" to the plugin folder on server

wet breach
#

you need to follow the links as well

#

literally tells you how everything needs to be setup

sonic barn
#

I did it... when I started the project 😕 I hope I have everything

wet breach
#

then it should remap

sonic barn
#

but just one thing... I find it interesting that it shows error on Player and not ServerPlayer from nms 😕

sonic barn
wet breach
#

are you depending on the appropriate jar from buildtools?

remote swallow
#

?paste your pom

undone axleBOT
sonic barn
#

if I delete this... everything goes just fine

wet breach
#

did you depend on the appropriate jar?

#

in this post, if you had read the post above you would get to this post

#

it tells you the commands you need to run for buildtools

#

and then it should spit out an appropriate jar for you to depend on

sonic barn
#

I run build tools only with java -jar BuildTools.jar --remapped

wet breach
#

then shouldn't be getting a noclassdeffound if everything is setup correctly for player o.O

sonic barn
#

😭

#

I'll just delete everything and do it again

#

😄

wet breach
#

well wouldn't hurt I suppose

#

unless you are using the wrong versions

#

which is the only thing I could think of

wind blaze
#

are there any plugins compatible with luckperms, which help changing player name tags like scoreboard teams do?

sonic barn
remote swallow
wind blaze
#

name tags as in f5 abov ehad

#

that works w essentials?

remote swallow
#

TAB can do it

#

iirc

wind blaze
#

ill download and try, thanks a lot

remote swallow
wind blaze
#

thanks

quaint mantle
#

would it be bad to create a task everytime the player moves

#

wanting to use it for this

#

since it'll probably be looping alot of bounds

#

im guessing it'll be best to make another task (thread) for this

#

but idk

sterile token
#

Its obviously the reason, you cannot open 2 things on the same port

#

What can cause deserialization exception when u working with serializable objects?

errant snow
#

Hey so I'm making an instance of a class that takes a BiConsumer as part of the constructor parameters, I want to access a method inside the created class from the biconsumer, any idea of how I can do this? I know that you can't access methods in the constructor because the class isn't instantiated yet, but is there a cheaty way I can do this inside of the BiConsumer?

torn badge
#

No

errant snow
#

Here's what I'm trying to do:

MaterialListMenu(
    "&aSelect an icon for ${region.getId()}",
    onMaterialClick = { onClick, material ->
        onClick.isCancelled = true
        region.setIcon(material)
        back(it.whoClicked) // This is the method I'm trying to access
    },
    previousMenu = this
).show(it.whoClicked)
torn badge
#

You need to change your design

errant snow
#

Alright I figured, thanks

ivory sleet
#

I mean

torn badge
#

Set it afterwards

ivory sleet
#

you can have a triconsumer

#

where a third parameter is the instance

#

and then

#

TriConsumer:::accept(..., ..., this)

torn badge
#

That’s really messy

ivory sleet
#

yeah

#

possibly you group the three args to a context object

#

and use a simple consumer

torn badge
#

Why not just set the consumer after it’s been instantiated?

ivory sleet
#

meh, Id advocate against mutations

torn badge
#

Or make the class call its method by itself

torn badge
#

That’s how OOP works