#help-development

1 messages ยท Page 1453 of 1

tranquil viper
#

...

wraith rapids
#

you had something adding it in before that

#

it wasn't empty when we started

tranquil viper
#

it was where i was executing it from

#

anyways

wraith rapids
#

yeah i don't fucking know use a set or something

tranquil viper
#

I see no reason why it shouldnt be working lol

tardy delta
#
if (cmdName.equals("lock")) {
            if (args.length == 1) {
                if (args[0].equalsIgnoreCase("set")) {
                    MagmaBuildNetwork.playersWantingLock.add(p.getUniqueId());
                    sender.sendMessage(ChatColor.DARK_GREEN + "Right click a block to lock it!\nOr type /lock cancel to cancel");

                } else if (args[0].equalsIgnoreCase("cancel")) {
                    MagmaBuildNetwork.playersWantingLock.remove(p.getUniqueId());
                    p.sendMessage(ChatColor.DARK_GREEN + "Cancelled!");

                } else if (args[0].equalsIgnoreCase("remove")) {
                    // TODO add method to make container public (lock.remove)
                }
            }
        }

for some reason it just returns this when i do /lock set

wraith rapids
#

it's not an identity list so it should be fine

#

you're probably returning false

tardy delta
#

yea but where?

wraith rapids
#

in the command executor

#

returning false has the command usage printed to the sender

tardy delta
#

lmao i'm stupid

wraith rapids
#

if you haven't set a command usage, the command's name is printed instead

tardy delta
#

renamed the command and forgot to rename it there ๐Ÿ™„

#

but yea thanks for your hulp

outer crane
#

use an api such as CLOUD, Brigadier or Commodre

tacit drift
#

what does it mean

#

how do i give a statick key using namespacedkey

#

:)))

wraith rapids
#

what

tacit drift
#

i don't understand

#

what is a namespacedkey

#

i am trying to make that error disappear from a older plugin

wraith rapids
#

namespacedkey is a NamespacedKey

#

it represents a key with a namespace

#

f.e minecraft:dirt is a namespaced key

#

minecraft is the namespace, dirt is the key

tacit drift
#

ok thx

tardy delta
#

with which event would i check if someone rightclicks on a block that is instanceof Lockable?

#

PlayerInteractEvent?

worldly ingot
#

yes

tardy delta
#

oki

quaint mantle
#

Class - xTagEvent: ```java
@EventHandler
public void onItemPickup(EntityPickupItemEvent event) {
if (!(tagItem.isTagItem(event.getItem().getItemStack()))) return;
<more code here>
}

Class - tagItem: ```java
    public boolean isTagItem(ItemStack itemStack) {
        try {
            boolean result = (itemStack.equals(Material.NAME_TAG) && itemStack.getEnchantments().containsKey(Enchantment.MENDING) && itemStack.getItemMeta().getDisplayName().contains("ยงcTag!"));
            return result;
        } catch (Exception e) {
            return false;
        }
    }

Error: (attached)

sage swift
#

?paste

queen dragonBOT
sage swift
#

good stuff

quaint mantle
#

It works ๐Ÿ™‚

#

dw, all info you need is there, and it's formatted

sage swift
#

line 46

quaint mantle
#
        if (!(tagItem.isTagItem(event.getItem().getItemStack()))) return;
sage swift
#

also oh my god that is the worst way to check for a custom item dude

#

holy fucking shit

quaint mantle
#

How should I check then? ๐Ÿ˜„

sage swift
#

i have never seen anything worse

#

itemStack cannot equal Material.NAME_TAG

quaint mantle
#

I'd say it works but it doesn't sooo

wraith rapids
#

lmao

open vapor
#

how do i make a const or switch with a ChatColor

quaint mantle
#

I'll excuse myself out of here..

#

I'm an idiot.

sage swift
#

use this for identifying custom items

#

best way

tacit drift
#

If on older ver

quaint mantle
#

pog

tacit drift
#

NBTApi

quaint mantle
#

1.16.5

#

dw

sage swift
#

dont use older versions. simple.

tacit drift
#

oh ok

wraith rapids
#

supposedly nbtapi still has some advantages over pdc

#

namely not having to clone the itemmeta for every check

#

but that isn't really worth using an external library usually

quaint mantle
#

I can run it async, so time isn't that bad tbh

open vapor
#

what about blocks

wraith rapids
#

it's doubtful whether you can run it async

#

it's the pickup event

quaint mantle
#

I'll figure out a way ๐Ÿ™‚

open vapor
#

holding persistent data in blocks

wraith rapids
#

tile entities are also persistent data holders

wraith rapids
#

inb4 it checks every block every tick

open vapor
#

thanks

wraith rapids
#

if you're working with tile entities, use the PDC

sage swift
#

you wish it checked every tick

wraith rapids
#

as it doesn't involve listening to 300 events

sage swift
#

but it does break lol

wraith rapids
#

and doesn't explode when other plugins delete or move the blocks

sage swift
#

just randomly desyncs from the db file

wraith rapids
#

is the db file a .txt

paper viper
#

๐Ÿคก

wicked remnant
#

why tf might it be null

wraith rapids
#

literally impossible to tell

#

we don't know where it's from

#

presumably the method you're getting it with is nullable

wicked remnant
#

ah nvm its cause serverSection might be null

#

sorry I was getting frustrated with the javadoc cause I didnt think about the ConfigurationSection object

tired spoke
#

hellp

#

i want to start developing minecraft plugins with IntelliJ Idea, what year and version do you reccomend to do a bedwars plugin?

#

on my c i have 2020.3.2

wraith rapids
#

doesn't matter

#

use notepad and javac like a real man

tired spoke
#

Javac?

#

Is better than intellij?

quaint mantle
#

xdd

eternal night
#

the latest IntelliJ version should do great

#

those unverified people in this channel, can never trust them smh

quaint mantle
#

i dont think it matters

tired spoke
#

because i have installed the minecraft development on intellij

#

i have to install the 2021 for a great work?

eternal night
#

I mean no, but updating is never a bad idea

quaint mantle
#

depends on the plugin requirements

tired spoke
#

2021 community edition i download?

eternal night
#

sure

quaint mantle
#

yes

tired spoke
#

i use an IJ IDEA pl named minecraft development, it has some mc versions witha premade code an pl.yml made

eternal night
#

that plugin works on the latest version of intellij

tired spoke
#

ok

#

can i do a backport of the pl? because i want them from 1.8 to 1.12

#

if i start doing 1.12 is possible?

eternal night
#

your IDE has nothing to do with how you code a plugin

tired spoke
eternal night
#

oh

tired spoke
#

if i do the required files i can do?

flint elk
#

How can I open a "Book GUI" for a player?

eternal night
#

sure you can create a plugin that runs on all servers between 1.8 and 1.12

tired spoke
#

can you link me a site with all the bukkit api?

#

to help me in coding

#

or a link to the most important mc plugin codes

#

like private void

#

or cmd

eternal night
#

there

#

a list of all available versions

#

of the spigot api

tired spoke
#

ok

tired spoke
#

and are the same with paper?

minor vapor
#

Yes.

tired spoke
#

because i do a paper-spigot pl

eternal night
#

gl

tired spoke
#

for performance because i do a very high and heavy plugin

eternal night
#

that sounds great!

tired spoke
#

i take all the best features of all the bw plugins that exists on spigot and i create an unique custom pl

eternal night
#

awesome

quaint mantle
#

how can I get entities in a radius of a location? I thought there was something like Location#getNearbyEntities(radius) but I can't seem to find it

minor vapor
#

World#.getNearbyEntities();

eternal night
quaint mantle
#

Oh it's World.

#

Yeah that makes sense.

tired spoke
eternal night
#

no

minor vapor
#

Just ask in this channel and somebody will help you

tired spoke
#

ok

minor vapor
#

Keep in mind this is related to Bungee and Spigot only, nothing else.

tired spoke
#

i finis installing the 2021 and i start work

#

i have a lot of work to do

#

i start by thinking and organize the features (12 features ca.)

sage swift
#

questions are not allowed.

tired spoke
#

ok

ivory sleet
tired spoke
#

ok

#

can someone link me how to add support to other plugins (like PAPI or Citizens)

chrome beacon
#

Are you using maven, gradle or built in compiler

tired spoke
#

i use an intellij plugin named minecraft-development

#

i can gove you the plugin link

chrome beacon
#

I know what that is

tired spoke
#

is not bad

#

for me that i am new on intellij and sometimes not load the spigot jar

torn oyster
#

how do i generate a vanilla world using worldcreator

#

do i just not set the generator?

eternal night
#

that plugin usually uses maven btw

#

and yes, not setting a generator defaults to vanilla generation

kind coral
#

anyone?

chrome beacon
#

Screenshot of code kekwhyper

kind coral
#

hold on i'll send you paste

#

?paste

queen dragonBOT
quaint mantle
#

code & error: https://paste.md-5.net/setugicabi.coffeescript
Issue is cast whenever any item is picked up, running the createitem works perfectly and gives an item.

Anyone has any advice?

Console error refers to if (!(tagItem.isTagItem(event.getItem().getItemStack()))) return;

kind coral
#

i don't know what your line 46 is because of how you made it

quaint mantle
#

updated message

#

line 46 is if (!(tagItem.isTagItem(event.getItem().getItemStack()))) return;

kind coral
#

check if item != null

quaint mantle
#

How can Item be null?

kind coral
#

idk ._.

quaint mantle
#

it's cast when an item is picked up

kind coral
#

mostly of the time theese are the common problems

quaint mantle
#

I'll try ๐Ÿ™‚
but doubt it

#

It will never be null...

kind coral
#

it gives you nullpointer so idk ๐Ÿ™‚

quaint mantle
#

...

#

The issue most likely is in the persistentdatacontainer

#

but I don't really see it myself...

rotund ravine
#

getItem is probably annotated with @urban grotto and

#

I suppose it's EntityPickupItemEvent

#

meaning it will never be null

#

cause it needs an item to do the event.

quaint mantle
rotund ravine
#

Ohh

#

he was the tag

#

Well he could just change his name

#

smh

quaint mantle
#

yeah$

#

anyways

#

it's kinda annoying that I can't seem to save it

#

I mean, i can just check the name and call it a day

#

but I do wish to use this method, it seems... best practice

urban grotto
#

seriously

torn oyster
#

how would i delete a world

urban grotto
#

I think java must change his annotion name for that

torn oyster
#

why did u name urself after an annotation

quaint mantle
#

regardless.

tribal holly
#

Hi is there a way to avoid player which placeBlockEvent is canceled but with a macro can still pose a block and get up on it ?

#

is it only client side ?

opal juniper
#

Sorry what

tribal holly
#

Je suis un chat dans la citรฉ des รฉlรฉments

Ma boutique :โ–บ https://www.moteefe.com/store/aypierre

Participez au giveaway de jeu chaque mois ici :โ–บ https://www.instant-gaming.com/fr/l/ayepierre?igr=aypierre

โ–บ Intro par Tib : http://youtube.com/tib8tib
โ–บ Montage par okamedia : https://www.okamedia.fr/

Accรฉdez ร  toutes mes rediffs de stream :โ–บ ...

โ–ถ Play video
wraith rapids
#

what a gay language

tribal holly
#

haha

#

do you see what i mean know ?

wraith rapids
#

not really

#

you mean when you place a block and then jump on top of it

#

you need an anticheat plugin for that

wraith rapids
#

player velocity is entirely clientside

#

the player can start flying if the player wants to fly

tribal holly
#

well

wraith rapids
#

the vanilla server does some super rudimentary and shitty checks to try and prevent it but they're notoriously bad

topaz atlas
#

How can you get the refrenced jar files from a jar file. Basically you know how you add the spigot server inside your plugin right. I need to get that from an existing jar file. I want to see what It is because I want to make some changes to multiverse and maybe push it to their repo.

wraith rapids
#

the spigot server does not go in a plugin

quaint mantle
#

I'm still having the issue where I'm clearing a person's inventory & then teleporting them to a diff world, not sure if that's related, but in this case 1 of their previous items persists

tribal holly
#

ok thx for the info

wraith rapids
#

the plugin references the spigot server

#

the spigot server is provided by the runtime

tired spoke
#

someone can give me a link of how to add placeholders on mine plugin

wraith rapids
#

the jar itself does not contain information about what "jars" the code in it references

tired spoke
#

(with papi adding support)

wraith rapids
#

it only contains information about what classes are referenced

#

these classes could come from any jar

#

what you are looking for is a maven/gradle project where in the project file, pom.xml for maven, the involved dependencies and their artifact information is listed

torn oyster
#
        World active = Objects.requireNonNull(Bukkit.getWorld("world_active"));
        Bukkit.unloadWorld(active, false);
        try {
            FileUtils.deleteDirectory(active.getWorldFolder());
        } catch (IOException e) {
            e.printStackTrace();
        }```
#

why does this not do the thing

#

delete world

topaz atlas
#

Where else will you import the events and listiners from

eternal night
#

you wanna know what dependencies multiverse has ?

topaz atlas
#

Yes

eternal night
#

either you attempt to go by package names inside the jar or (the more reasonable way) check out their source code?

topaz atlas
#

Wait so do I just need the core plugins in my server plugins folder

#

or do I need to add it. Eclipse gives you an option to add externals jar for importing stuff from it

eternal night
#

what

#

if you are trying to work on multiverse you clone their repo

#

I don't know what your goal is here

wraith rapids
#

they seem extremely confused

topaz atlas
#

How am I supposed to test it?

wraith rapids
#

you build it

eternal night
#

compile it ?

#

it is literally a plugin like any other you coded before

quaint mantle
#

Ok waiting 2 ticks after the event to clear their inventory seems to have fixed the ghost item.

eternal night
#

just now there is already source code

topaz atlas
#

But will I need to add the dependinces inside my plugin

wraith rapids
#

yes

eternal night
#

no

#

wat

#

maven will shade them automatically

wraith rapids
#

yes, you will use maven to add them

eternal night
#

eclipse maven should also automatically import then

wraith rapids
#

and by use I mean maven will read multiverse's pom.xml and do it automatically

eternal night
#

is he not trying to code on multiverse

#

ah

#

yes

topaz atlas
#

How do I check If maven is on my eclipse project

eternal night
#

oh boy

wraith rapids
#

like i explained at first

topaz atlas
#

or is it added by default?

wraith rapids
#

the information isn't in the jar

quaint mantle
#

oh boy

wraith rapids
#

it's in the project

topaz atlas
#

ok thanks

eternal night
#

I believe eclipse is clever enough to automatically detect everything

#

believe

torn oyster
#
        World active = Objects.requireNonNull(Bukkit.getWorld("world_active"));
        Bukkit.unloadWorld(active, false);
        try {
            FileUtils.deleteDirectory(active.getWorldFolder());
        } catch (IOException e) {
            e.printStackTrace();
        }```
#

why isnt that deleting the world

eternal night
#

are you getting an exception

torn oyster
#

yes

#

cannot delete raids.dat

#

or something

eternal night
#

sweet

torn oyster
#

cannot save

eternal night
#

seems like unloadWorld does not finish directly

#

but takes some time

wraith rapids
#

keep in mind that the main world cannot be unloaded

torn oyster
#

it isnt the main world

#

its world_active

wraith rapids
#

it also takes a while for chunk io and shit to be flushed to disk

#

there is no good api way of figuring out when the unload is actually done

#

which is a big issue for autosave/backup plugins

eternal night
#

๐Ÿ˜ฆ

quaint mantle
#

is there a difference between private final int a; and final private int a;

eternal night
#

yes

#

the order

#

that is it xD

quaint mantle
#

oh okay

#

lmao

torn oyster
#

would this work

#
        World active = Objects.requireNonNull(Bukkit.getWorld("world_active"));
        Bukkit.unloadWorld(active, false);
        Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
            try {
                FileUtils.deleteDirectory(active.getWorldFolder());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }, 100L);```
#

if the active world

#

isnt that big

#

and nobody is on it

eternal night
#

ยฏ_(ใƒ„)_/ยฏ

topaz atlas
#

The pom.xml goes to to exact root of the directory?

#

?

opal juniper
compact haven
#

How can I store an entire itemstack in a bytearray, including name, enchants, lore, flags, attributes, nbt, etc etc

eternal oxide
#

Itemstack#serialize()

compact haven
#

I dont know if that includes the custom nbt and persistent data and all

#

also it returns a Map<String, Object> which isnt exactly easily made into bytes

eternal night
#

you basically pass it into a BukkitObjectOutputStream

#

you can also go full NMS

#

and use nms.ItemStack#save(NBTTagCompound)

compact haven
#

this is from code that I wrote a long time ago

    public static byte[] toByteArray(ItemStack item) {
        try {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            BukkitObjectOutputStream bout = new BukkitObjectOutputStream(baos);
            bout.writeObject(item);
            bout.flush();
            return baos.toByteArray();
        } catch (IOException e) {
            return new byte[0];
        }
    }

    public static ItemStack fromByteArray(byte[] arr) {
        try {
            ByteArrayInputStream bais = new ByteArrayInputStream(arr);
            BukkitObjectInputStream bois = new BukkitObjectInputStream(bais);
            return (ItemStack) bois.readObject();
        } catch (IOException | ClassNotFoundException e) {
            return new ItemStack(Material.AIR, 1);
        }
    }
#

that would serialize it all? ๐Ÿค”

eternal night
#

if it doesn't that should be reported afaik

#

the yml representation of an itemstack is supposed to fully represent it

compact haven
#

thank you ๐Ÿ˜„ I'll test it out

wraith rapids
#

if you were using paper you could just use ItemStack::serializeAsBytes

open vapor
#

how do i make an item have the enchantment glint without having enchantments. you can do this with nbt by having an empty enchantment list. How should i do this in spigot? you cant addEnchantment as null

wraith rapids
#

simplest way I think would be to add some unrelated enchantment and then add the hide enchantments flag

#

i don't think the api lets you create an empty enchant list

#

the yml representation of an itemstack has issues with version upgrades

#

don't be surprised if a serialized itemstack suddenly blows up after updating

#

i don't know whether the bukkit output stream uses a different serializer or if it has the same issues

eternal night
#

I believe it uses the same stuff

#

Yeah the paper method is neat ๐Ÿ˜ญ

#

someone recreate on upstream pls

wraith rapids
#

it's just like 10 lines or something anyway, would be an easy pr

#

it piggybacks off of nms serialization

eternal night
#

question is what licence that patch is under xD

wraith rapids
#

just change some of the var names

eternal night
#

๐Ÿ‘€ ๐Ÿ‘ฎ

wraith rapids
#

no like seriously you can't license the concept of using nms to serialize itemstacks

eternal night
#

Yeah xD

wraith rapids
#

and there aren't very many ways of going about doing it

eternal night
#

I mean if it is MIT you could also just casually take it

torn oyster
#

so i have a custom world for the game

#

called world_active

#

and i want people who come back from the nether

#

go to that world

#

instead of the normal "world"

wraith rapids
#

there are various portal events

torn oyster
#

what one would i listen to

#

ok how do i change where the portal is created

#

and where they teleport to

wraith rapids
#

i'm not seeing any setters for the target world on any of the events

#

there is a Vector you can set on entityexitportal, but that doesn't take a world

#

might want to look into how multiverse-portals does it

eternal oxide
#

getFrom, getTo, setTo

wraith rapids
#

oh, it inherits them from the player move event

#

interesting design choice

restive mango
#

i have a new interesting problem

#

Falling Blocks break easily

#

really easily

#

I'm trying to figure out how to make the blocks that spawn from the edges of things not break near-instantly on being created

hoary tiger
#

After I gat nearby entities with world.getNearbyEntities();, I got the collection. But How would I run a multiply command like a event function

wraith rapids
#

what

restive mango
#

@wraith rapids Talking to me or him?

opal juniper
#

I have been working with falling blocks a lot recently

#

To make them not break you have to get into packets cause they break no matter what

restive mango
#

Basically, when I create a fall block that is on a hill, it often breaks.

left swift
#

Hello, i spawn slime and armorstand with packet wrapper. Armorstand is a passenger of slime, and slime is passenger of player. I send the packets to all players, and owenr of armorstand/slime sees that entities as passengers, but other players sees armorstand riding on slime, but not on the player. Do you know why? This is element of code, which send packets to players:

        for (Player players : Bukkit.getOnlinePlayers()) {
            slimePacket.sendPacket(players);
            armorStandPacket.sendPacket(players);
            slimeMetadata.sendPacket(players);
            armorStandMetadata.sendPacket(players);
            slimeMount.sendPacket(players);
            playerMount.sendPacket(players);
        }```
restive mango
#

@opal juniper let me send you a video

opal juniper
#

Ok

opal juniper
left swift
subtle kite
#

I created a Itemstack.

how would I add to a players inv

player.getinv.additem() ect or something else

#

it's saying it's null in the server console

wraith rapids
#

player.getinv.additem() etc

subtle kite
#

nvm got it in the additem(class.item)

wraith rapids
#

๐Ÿ‘€

open vapor
#

carry all enchantments from one item to another

#

i have this

                    ItemMeta newMeta = stack.getItemMeta();
                    for (Enchantment enchantment : meta.getEnchants().keySet()) {
                        newMeta.addEnchant(enchantment, meta.getEnchants().get(enchantment).intValue(), false);
                    }
                    stack.setItemMeta(newMeta);

only 1 enchantment gets put on

#

?

wraith rapids
#

? is not a very good question

open vapor
#

im using getEnchants tho?

wraith rapids
#

yes, and the method you were linked to was getEnchantments

open vapor
#

ohh

#

it did nothing

wraith rapids
#

inb4 the item only has 1 enchant to begin with

open vapor
#

ohhhh

#

im dumb

#

i forgot i had that installed lol

wraith rapids
#

imagine if bukkit actually supported datapack shit

open vapor
#

its not like i expected that to work

#

i just forgot about them

quaint mantle
#

Can you adjust the force of which a spawned particle moves as my cloud particle looks like this

open vapor
#

im not sure how im going to detect if an enchantment is vanilla or not

open vapor
#

im resisting the urge to throw everything in a try catch

wraith rapids
#

check if bukkit supports it

open vapor
#

hmm there doesn't seem to be an api for the plugin

wraith rapids
#

which plugin are we talking about

open vapor
#

goldenEnchants

wraith rapids
#

is it shit

#

i need a not shit custom enchant plugin

#

i don't think I've tested or heard of that one

quaint mantle
#
                        world.spawnParticle(
                                particle,
                                randomPlayerLocationX + publicCircleX,
                                randomPlayerLocationY, randomPlayerLocationZ + publicCircleZ,
                                1, 0, 0, 0, 1);

                        world.spawnParticle(
                                particle,
                                randomPlayerLocationX + publicCircleX,
                                randomPlayerLocationY-10, randomPlayerLocationZ + publicCircleZ,
                                1, 0, 0, 0, 1);

open vapor
wraith rapids
#

quite high

open vapor
#

it's not like i expect anyone to help with that

#

well enchantment table support broke so its pretty bad

wraith rapids
#

is it open source

open vapor
#

yea

#

i was thinking going that way but idk

#

its not really worth it

wraith rapids
#

i don't particularly mind the enchanting table integration not working, mostly concerned about performance and balance

#

variety is a plus as well

open vapor
#

balance is okay

#

there are some super op ones like divine touch where you can mine a spawner and keep it

#

but its really rare

#

also some make zero sense

wraith rapids
#

my server already has tools for that so i suppose that should be fine by itself

open vapor
#

like one gives mining fatigue

#

but to the attacker

wraith rapids
#

had to rewrite spawner mechanics entirely with a plugin so as to not kill the server

open vapor
#

ah

wraith rapids
#

so far the plugin seems worth trying out

#

i'll lurk around the source for a bit and see if I can find any red flags

open vapor
#

its definitely one of the better ones

wraith rapids
#

strange that i haven't heard of it

#

ig i don't really keep an eye on plugins

#

but i don't remember seeing anyone using it

open vapor
#

for context, im running a small smp with a few friends and im making some plugins to make the experience better

#

i can probably wrap the whole thing in a trycatch and just creative in the enchants when they complain

#

this will only affect 1 item one time

quaint mantle
#

it works normally

wraith rapids
#

the enchants are probably getting copied

#

just the lore lines that display them aren't

quaint mantle
#

Yeah i know its weird

wraith rapids
#

it looks like the plugin uses the actual enchantment storage on the items to store the enchantments

quaint mantle
#

ah ok

#

very

wraith rapids
#

that is, the golden enchants are included in meta.getEnchants()

#

and can be differentiated via instanceof GoldenEnchant

#

you'd probably need to add this plugin as a dependency and invoke its methods and logic if you wanted to copy over the enchants properly

#

i'll have to implement that in slimefun autoenchanter code so fuck me i guess

#

fuck slimefun

#

fucking worst plugin ever

#

HNG

open vapor
#

oh thanks wow

#

i also realized there was a super simple solution i was overlooking where i wouldn't have to to that at all but it will be useful later

wraith rapids
#

the passive effects code could be improved a little performance wise but it should be fine

#

and by little i mean a shit ton

#

other than that it looks very good

#

source code is properly commented and the project structure looks pretty neat

open vapor
#

also, can anyone give me advice on how to handle extra custom crafting (requiring ItemStacks in recipies instead of just Materials)

wraith rapids
#

use ExactChoice instead of MaterialChoice

open vapor
#

?

#

how

wraith rapids
#

when defining the recipe

open vapor
#

ohhh

#

okay thanks

#

i was worried i would need to completely overhaul the crafting menu

vital tiger
#

Hey so was wondering how i would make a plugin function as both the a Bungeecord Messenger (sends out messages: bungee -> spigot) and like a spigot receiver

#

obviously its just checking a config.yml value to determine which one it would be but

open vapor
#

wait with MaterialChoice am i allowed to say i want a certain amount of an item?

#

i mean exactchoice

wraith rapids
#

you wouldn't check a config value

#

you would check whether your plugin was initialized through the bukkit main class or the bungee main class

#

no, crafting doesn't support stack sizes

vital tiger
#

oh okay

wraith rapids
#

ok i take it back

#

this shit depends on a library that is a plugin

vital tiger
#

oh

wraith rapids
#

there is zero legitimate reason for this dependency to be a standalone plugin

#

there is already someone complaining about two of this guy's plugins requiring 2 different versions of this dependency in the reviews

#

none of his projects use a build system or if they do, the configuration is not released along with the source

#

i'll fork and unfuck it i guess

quartz goblet
#

anyone know why this https://prnt.sc/13a98pd wouldnt actually change my damage value to 0? executing the damage has low event priority so shouldnt it execute after this?

wraith rapids
#

low executes first

quartz goblet
#

lmao thanks

#

no wonder its not working

wraith rapids
#

Please, ALWAYS replace the engine .jar from every plugin update.
fucking learn to shade

#

i hate these people

#

i'll review bomb this shit to the lowest hell

#

you literally ship the fucking dependency jar in a zip with your actual plugin

subtle vector
#

okay i have this weird issue this if(held_item_data.has(new NamespacedKey(Exstinctio_weapons.getPlugin(), "Sky"), PersistentDataType.STRING)){random code} doesnt work and its never true will this works even though the item has that data type that has that value. if(held_item_data.has(new NamespacedKey(Exstinctio_weapons.getPlugin(), "Blitz"), PersistentDataType.STRING)){//random code}. both items are being check in the if statement and the 1st doesnt works and idk why. I be holding the item that has that key in it. The same item in my hand has that key because the item has when its created using a command in this code ``` data.set(new NamespacedKey(Exstinctio_weapons.getPlugin(),"Sky"), PersistentDataType.STRING,"Sky");

wraith rapids
#

at least it's open source so I can just take it and make it not shit

#

but fuck, I actually thought for a moment that I had managed to find something that wasn't fucking trash

subtle vector
#

ok i have ab iten called skyblaster and when its created it has that data type. the if statement checks if the item has that PersistentDataType with a name

#

and its never true for some reason even though that item has it when its created

eternal grotto
#

Is org.sqlite relocated in the Spigot/CraftBukkit server?

sullen marlin
#

no

eternal grotto
#

My plugin uses the latest version of sqlite and it's throwing

java.lang.AbstractMethodError: Receiver class org.sqlite.Conn does not define or inherit an implementation
 of the resolved method 'abstract boolean isValid(int)' of interface java.sql.Connection.   

which makes me think there's a conflict of versions

#

And I can't relocate because the binary for the library contains strings that reference the original org.sqlite package

sullen marlin
#

your plugin cant package sqlite itself

#

it has to use the spigot version

eternal grotto
#

Is that the reason why?

sullen marlin
#

yes

eternal grotto
#

Is there any other way?

sullen marlin
#

you can try using the new libraries functionality in 1.16.5

#

but spigot packages a very recent version of sqlite anyway

#

why do you specifically need this version?

eternal grotto
#

I don't, I just keep all of my libraries up to date.

sullen marlin
#

stop packaging sqlite and forget about it then

eternal grotto
#

Actually, I am packaging it because Spigot 1.7 doesn't contain it I believe

sullen marlin
#

spigot 1.7 does

eternal grotto
#

I ran into a 1.7 specific error with CraftBukkit

sullen marlin
#

but also bloody hell, that's like 7 years old

sage swift
#

1.17 you mean

sullen marlin
#

no they mean 1.7

sage swift
#

remove versions less than half the current

eternal grotto
#

I am not able to drop 1.7 support

#

Thanks for the help, though.

sullen marlin
#

well there's nothing you can do for 1.7 then

#

if you want 7 year old things to work, then you need to code against 7 year old libraries

#

including sqlite

#

mfw pretty soon people who weren't born when 1.7 was released are gonna be in this discord

eternal grotto
#

My first version was 1.5...the days

#

well, If I can shade and relocate java.sql.Driver then I can package it...

#

maybe I'll do that

vital tiger
#

i still do need the config.yml so the spigot plugin knows wether or not the plugin is gonna be standalone or using message channels

wraith rapids
#

what the fuck

#

this library plugin shit actually contains a package org.jetbrains.annotations

#

with NotNull, Nullable and Range in it

#

literally what the fuck on this earth is this guy doing

eternal grotto
#

@sullen marlin I checked spigot's pom, and the version there is identical to the one I am using. Do you know of any reason why it would throw

java.lang.AbstractMethodError: Receiver class org.sqlite.Conn does not define or inherit an implementation
 of the resolved method 'abstract boolean isValid(int)' of interface java.sql.Connection.   
```? 
Perhaps it's a different version in craftbukkit/1.8? (because I am testing on 1.8)
topaz atlas
#

Does spigot detect pom.xml

#

at the directory

#

because the dependinces are not installing

drowsy helm
#

huh

#

spigot has nothing to do with your pom.xml

eternal grotto
#

pom.xml isn't included in your binary

hoary tiger
#

After I gat nearby entities with world.getNearbyEntities();, I got the collection. But How would I run a multiply command like a event function

sullen marlin
#

stop shading sqlite in your jar

#

you cant do it, its just not possible @eternal grotto

drowsy helm
#

so you want to multiply entities in a radius?

eternal grotto
#

I've seen this being used. Not sure how appending resources affects the jar since I don't use maven

<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
    <resource>META-INF/services/java.sql.Driver</resource>
</transformer>
hoary tiger
topaz atlas
#

Wait so how can I get the dependincies to work?

drowsy helm
#

spigot?

eternal grotto
topaz atlas
#

For what Im using

drowsy helm
#

and what is it that you are using?

topaz atlas
#

I am trying to use multiverse with my plugin

drowsy helm
#

you're asking a super vague question

#

can i see your pom.xml

topaz atlas
#

Well I want to fix a issue that has not been fixed for a long time with multiverse nether portals

#
The import com.onarandombox.MultiverseCore cannot be resolved
The import com.onarandombox.MultiverseCore cannot be resolved
MVPlugin cannot be resolved to a type
MultiverseCore cannot be resolved to a type
CommandHandler cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
CommandHandler cannot be resolved to a type
MultiverseCore cannot be resolved to a type
Command cannot be resolved to a type
CommandHandler cannot be resolved to a type
Command cannot be resolved to a type
CommandHandler cannot be resolved to a type
Command cannot be resolved to a type
Command cannot be resolved to a type
#
HelpCommand cannot be resolved to a type
CommandHandler cannot be resolved to a type
MultiversePortals cannot be resolved to a type
MultiversePortals cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
at com.onarandombox.MultiverseNetherPortals.MultiverseNetherPortals.<init>(MultiverseNetherPortals.java:7) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:?]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:?]
at java.lang.Class.newInstance(Unknown Source) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
... 7 more```
eternal grotto
#

If you are depending on the api using compileOnly/whatever the equiv in your pom, then it should all work

topaz atlas
#

^errors

#

pom.xml:

drowsy helm
#

do you have MultiverseCore in your plugins fodler

topaz atlas
#

Do I need it there?

drowsy helm
#

yes

eternal grotto
#

Yes. Also, that's not a valid stacktrace

topaz atlas
#

wydm?

eternal grotto
#

You're missing what the error actually is

#

You are just showing where it is

drowsy helm
#

that aswell

#

should be more to the error

eternal grotto
#

More above it

#

and below, but the above is more important

topaz atlas
#

I cant upload an image

drowsy helm
#

?paste

queen dragonBOT
eternal grotto
#

Just paste

#

yeah

topaz atlas
#

image

eternal grotto
#

paste

drowsy helm
#

what is the image of?

topaz atlas
#

I forgot to add

#

at the top there is

#

MVPlugin cannot be resolved to a type

drowsy helm
#

if its anything to do with development you can paste it

eternal grotto
#

Not that...

topaz atlas
#

Ok. So If i have multiverse core in my plugins folder it will work?

drowsy helm
#

well yes its a dependency

#

so in most cases if you're depending on a plugins api, you need the plugin aswell

#

the api is only the interface, the plugin still needs to function

eternal grotto
#

@sullen marlin What about an isolated classloader?

topaz atlas
#

Is the only point for a reference library in eclipse is to stop potential errors?

eternal grotto
#

Pretty much. Autocomplete, highlighting, and the #2 function of a compiler, tell you when you did something wrong.

topaz atlas
#

I keep on getting this error:

#
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:383) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:185) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:809) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.Error: Unresolved compilation problems:
The import com.onarandombox.MultiversePortals cannot be resolved
The import com.onarandombox.MultiverseCore cannot be resolved
The import com.onarandombox.commandhandler cannot be resolved
The import com.onarandombox.commandhandler cannot be resolved
The import com.onarandombox.MultiverseCore cannot be resolved
The import com.onarandombox.MultiverseCore cannot be resolved
MVPlugin cannot be resolved to a type
MultiverseCore cannot be resolved to a type
CommandHandler cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
#
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
CommandHandler cannot be resolved to a type
MultiverseCore cannot be resolved to a type
Command cannot be resolved to a type
CommandHandler cannot be resolved to a type
Command cannot be resolved to a type
CommandHandler cannot be resolved to a type
Command cannot be resolved to a type
Command cannot be resolved to a type
CommandHandler cannot be resolved to a type
HelpCommand cannot be resolved to a type
CommandHandler cannot be resolved to a type
MultiversePortals cannot be resolved to a type
MultiversePortals cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
MultiverseCore cannot be resolved to a type
at com.onarandombox.MultiverseNetherPortals.MultiverseNetherPortals.<init>(MultiverseNetherPortals.java:7) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:?]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:?]
at java.lang.Class.newInstance(Unknown Source) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
... 7 more```
#

How do I fix it?

sullen marlin
#

Caused by: java.lang.Error: Unresolved compilation problems:

#

your plugin isnt compiled correctly

#

fix all the errors in your ide and do a clean compile

topaz atlas
#

ah so like corrupted?

sullen marlin
#

no, just broken code

#

fix your code

hoary tiger
#

How to I kill a Craft Entity without it dropping anything?

eternal grotto
sage swift
#

Entity#remove

#

though you could also clear the drops in EntityDeathEvent after doing Entity#kill

#

if you need the death animation

wraith rapids
#

this plugin is worse than slimefun

#

it is an absolute crime that this hack of a fuck is selling plugins

midnight garden
#

Is there anyway to make tab-complete of command auto complete the text? For example: if I were to type up it would auto-complete as update

sage swift
#

who

wraith rapids
#

this guy who wrote goldencrates and goldenenchants

sage swift
#

oh lol

wraith rapids
#

literally the worst shit i have ever seen

sage swift
#

i use goldencrates

#

works just fine

wraith rapids
#

have you looked at the source

#

have you tried to do something with the source

sage swift
#

nope

wraith rapids
#

well keep it that way

#

they don't use any build system

#

their plugins all depend on some fucking horrible core library

#

that isn't a fucking library

sage swift
#

plugin.lang().Command_Give_Usage.getMsg();

wraith rapids
#

but rather an actual standalone plugin

#

meaning they can't shade it

#

meaning you need to update it every time you update one of their plugins

#

and meaning that you are outright fucked if two of your plugins need a different version of it

#

i've spent like the last hour trying to iron out the bullshit and mavenize and unfuck the golden enchants project

#

the plugin looks nice but I want to be able to work with it, which looks to be a total impossibility

#

i guess i'll have to write my own enchants plugin after all

sage swift
#

i made one

#

but you will be mean if i share it

#

lol

wraith rapids
#

lol

sage swift
#

eh you could probably find it anyways

wraith rapids
#

well it can't possibly be any worse than this

young knoll
#

Is that a challenge

wraith rapids
#

this is like slimefun on steroids

#

at least slimefun uses maven

young knoll
#

Youโ€™ve heard of maven, gradle, and even ant

sage swift
#

get ready for nexengine

young knoll
#

But what about building it by compiling each class one at a time and manually shoving them into a jar

wraith rapids
#

there is literally a fucking org.jetbrains.annotations package in nexengine

#

with NotNull Nullable and Range annotations in it

#

i have absolutely no fucking clue what the fuck

#

look at this shit

sage swift
#

did they just copy it

wraith rapids
#

yes

#

why depend on jetbrains annotations when you can copy jetbrains annotations into your project

paper viper
#

just copy the jdk in your project god damn

vital tiger
#

Hey so im getting Cannot resolve com.vexsoftware:nuvotifier-universal:2.6.0 error when trying to use nuvotifier as a dependency is it possible im doing something wrong or maybe the endpoint for the dependency is broken ?

topaz atlas
#

Hey how can I import another plugin inside mine? Like I am working on fixes to push to the multiverse nether portals repo and I get this error:

sage swift
#

latest version is 2.7.2, try that?

topaz atlas
#
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: com/onarandombox/MultiverseCore/api/MVPlugin
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:139) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:383) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:185) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:809) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.NoClassDefFoundError: com/onarandombox/MultiverseCore/api/MVPlugin
at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
at java.lang.ClassLoader.defineClass(Unknown Source) ~[?:?]
at java.security.SecureClassLoader.defineClass(Unknown Source) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:163) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:96) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
at java.lang.Class.forName0(Native Method) ~[?:?]
... 7 more```
sage swift
#

do you have multiverse core on the test server?

vital tiger
#

Could not find artifact com.vexsoftware:nuvotifier-universal:pom:2.7.2 in jitpack (https://jitpack.io)

vital tiger
#

also getting this when i try to compile ๐Ÿ˜› [WARNING] The POM for com.vexsoftware:nuvotifier-universal:jar:2.6.0 is missing, no dependency information available

vital tiger
#

bro wait patiently no one here is paid to help๐Ÿ˜‹

topaz atlas
#

I thought my message was drowned out. I am not forcing anyone.

next vector
#

hey

sage swift
#

your message is, like, drowning out everything else lmao

topaz atlas
#

xD

next vector
#

why is setCancelled(true) in projectileHitEvent not working?

queen dragonBOT
next vector
#

It's declared in the javadoc

sage swift
#

show the code

topaz atlas
#

Is that for me?

topaz atlas
sage swift
#

but also it might be that it's getting called multiple times?

next vector
#

Wait a min

topaz atlas
#

nvm

sage swift
next vector
#

How to upload images :/

sage swift
#

verify account

#

also just use the paste site

topaz atlas
sage swift
#

plugin yml

topaz atlas
#

Oh right. I will quickly do that

next vector
#

why can't i upload images?

sage swift
#

i told you six minutes ago.

next vector
#

Oh sorry

sage swift
#

bet you're not using 1.16

next vector
#

I missed that

#

Well

#

I check it

#

It 1.16.5

sage swift
#

and all the other event options show up?

next vector
#

Yes

#

Weird right

topaz atlas
#

anything else?

sage swift
#

1.16.5 spigot api or spigot?

next vector
#

It's spigot

#

sorry

#

where to download the api?

sage swift
#

ProjectileHitEvent may have only recently implemented Cancellable

#

you can re-run buildtools

next vector
sage swift
#

?paste your pom.xml

queen dragonBOT
next vector
#

nvm

young knoll
#

Something tells me they donโ€™t have one

next vector
#

I found my problem

sage swift
#

lmao

#

dont do that.

next vector
#

Sorry

sage swift
#

it's 1. illegal and 2. may be malicious

next vector
#

My bad

sage swift
#

that's the entire point of buildtools

#

which i just told you to re-run

next vector
#

Should have read the guide

#

Sorry guys

#

I'm so dumb

vital tiger
#

my turn my turn

#

why does nuvotifier work

#

:(

sage swift
#

well if it works there are no problems

vital tiger
#

doesn't*

#

you mind trying to use nuvotifier as a dependency yourself

#

I have no idea what I did wrong lol

topaz atlas
#

How can I upload an image?

#

I got another error

sage swift
#

verify account

topaz atlas
#

So I get this error Caused by: java.lang.ClassNotFoundException: com.onarandombox.MultiverseNetherPortals.MultiverseNetherPortals but the path is the same. I just got this error now. Proof:

#

Plugin.yml:

#

main: com.onarandombox.MultiverseNetherPortals.MultiverseNetherPortals

#

Just to clarify It worked alright a second ago

sullen marlin
#

I dont get it

#

isnt MultiverseNetherPortals already a plugin

#

If it is, what are you doing? If it isn't, why are you stealing their package name?

topaz atlas
#

Oh no. I am making some fixes that I will push to their repo once I finish testing it

#

Fixes about linking portals

#

I own no part of multiverse nether portals

#

@sullen marlin

sage swift
#

what did you change that their compiled version works and yours doesn't? lol

sullen marlin
#

they use maven, you should too

topaz atlas
#

Idk what happened. I decompiled there plugin then recompiled it on eclipes

#

I copied the pom.xml but I think the server ignores it.

#

Do you want me to send the jar?

sullen marlin
#

why would you decompile it

#

the source is on github

topaz atlas
#

Well I guess it does not matter anymore? I mean I have the same files

sullen marlin
#

decompilers arent perfect

#

and it seems like your source doesnt even compile

topaz atlas
#

I try use git

#

I downloaded it as a zip and it does not look much different

#

full plugin.yml:

#
name: multiverseNPpatch
version: 1.0
decription: patch
api-version: 1.16
depend: [Multiverse-Core, Multiverse-Portals]```
compact haven
#

compilers arent exactly translators, you can go from java to machine code and back and get the same result as what you put in

pseudo quiver
#

im having a config file like

Player 1:
 "playername"
 "playerip"
PLayer 2:
  "player2name"
  "player2ip"

How do i make it compare the name of the joining player with the name in the config file, then the ip of the joining player with the ip in the config file

cinder thistle
#

If the code is on GitHub you should just learn git

#

Or just how to click a few buttons like the page says

#

Or if you want you can even download the code in a zip

lucid bane
#

guys
is there any way to make custom recipes with enchanted/lored/displayname-changed items?

sage swift
#

yes

lucid bane
#

i want to put enchanted items ingredient

lucid bane
#

is there any examples of initializing RecipeChoice one?

sullen marlin
#

exactly the same as Material but new RecipeChoice.ExactChoice(item)

lucid bane
#

thx

topaz atlas
#

I looked in the api docs but I dont know how to log something with a plugin. Like you run a command and it will respond with "hello world" in the chat

topaz atlas
#

I dont see anything about sending a message in the chat

eternal oxide
#

sender.sendMessage

vagrant stratus
#

Player#sendMessage
Bukkit#broadcastMessage

Both easily find-able if you bother going through the available methods & javadocs m8

quiet ice
candid galleon
#

uHm AcTuallLy

topaz atlas
#

I am using 1.16 and import org.bukkit.event.server does not work because apprently its not a thing

#

bruh

eternal oxide
#

what?

vagrant stratus
#

you need to import the specific class too @topaz atlas

#

Might i suggest a java tutorial first instead of jumping head first into spigot development? ๐Ÿค”

topaz atlas
#

Huh. I thought It did not exist and I had the wrong version

eternal oxide
#

server is a package, not a class you can use.

topaz atlas
#

I am good

vagrant stratus
#

says the one who couldn't tell apart a package & class ๐Ÿ‘€

candid galleon
#

well

#

that tutorial covers installation

#

i imagine Spider might've already installed java

topaz atlas
#

Hmmm

candid galleon
#

wouldn't hurt to go over it though regardless, just to make sure you didn't make any mistakes or oversights

topaz atlas
#

my brain forgets from time to time

vagrant stratus
candid galleon
#

ah didn't see it was part of a playlist, yeah that would help perhaps

cinder thistle
#

You either know or donโ€™t know

topaz atlas
#
Class.forName("org.bukkit.TravelAgent");
event.getPortalTravelAgent().setCanCreatePortal(true);
``` Error: ```
The method getPortalTravelAgent() is undefined for the type EntityPortalEvent```
topaz atlas
#

Anyways

cinder thistle
#

But it does mean you have a lot to learn >.<

topaz atlas
#

I guess

cinder thistle
#

It tells you this

topaz atlas
#

for multiverse it does

cinder thistle
#

What spigot version are you on?

topaz atlas
#

1.16

cinder thistle
#

Canโ€™t help ya there

topaz atlas
#

What should I do?

cinder thistle
#

ยฏ_(ใƒ„)_/ยฏ

#

I just said I donโ€™t know what to do

eternal oxide
#

Why are you using reflection to find classes?

#

Bukkit does not expose teh TravelAgent

#

try using setAccessible.

sullen marlin
#

Class.forName("org.bukkit.TravelAgent"); wtf is this even meant to do

#

and honestly it seems like you dont know java

pseudo quiver
#

if my config file like this:

Player 1:
 name:
  - "PLAYER1NAME"
 ip:
  - "234.234.234.234"
PLayer 2:
 name:
  - "PLAYER2NAME"
  ip:
   - "123.123.123.123"

and my code are

@EventHandler
    public void playerjoin(PlayerJoinEvent event){

        String namepj = event.getPlayer().getName();
        String ippj = event.getPlayer().getAddress().getAddress().getHostAddress();

        if (getConfig().getString("Player 1", "name") == namepj){
            if (getConfig().getString("Player 1", "ip")== ippj){
                event.getPlayer().sendMessage(ChatColor.RED + "Welcome Playername");
            }
            else{
                ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
                Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "banip Playername");
            }
        }
        if (getConfig().getString("Player 2","name") == namepj){
            if(getConfig().getString("Player 2", "ip") == ippj){
                event.getPlayer().sendMessage(ChatColor.RED + "Welcome Playername");
            }
            else{
                ConsoleCommandSender conosle = Bukkit.getServer().getConsoleSender();
                Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "banip Playername");
            }
        }

    }

will it compare the name of current player with the player in the config, then compare the current player ip with the ip in the config, and banip the player if the ip not the same?

sullen marlin
#

dont use == on strings, it wont always work

#

use .equals

quiet ice
#

Likely they wanted something like

var agent = (org.bukkit.TravelAgent) event.getPortalTravelAgent();
agent.setCanCreatePortal(true);
quaint mantle
#

Hello! Goodmorning!

quiet ice
#

though afaik org.bukkit.TravelAgent is not exposed in the default buildpath, so idk what the hell is happening there

sullen marlin
#

and no your config code wont work either because you've made name/ip a list in your yaml example

pseudo quiver
#

how could i fix it

eternal oxide
#

Online server or offline?

quiet ice
#

Don't have it a list at all

sullen marlin
#

well idk what youre trying to do

#

is name and ip meant to be a list

quiet ice
#
Player 1:
 name: "PLAYER1NAME"
 ip: "234.234.234.234"
PLayer 2:
 name: "PLAYER2NAME"
  ip: "123.123.123.123"

is what I think it right

pseudo quiver
#

yes it is

quiet ice
#

that makes no sense

sage swift
#
  password: "password"``` while you're at it
pseudo quiver
#

so how could i fix it

eternal oxide
sage swift
eternal oxide
#

I'm assuming you are trying to ban players who log on with certain names from teh wrong IP

quiet ice
#

well, it is a little bit complicated without knowing the intentions as there are multiple ways of dealing this

quiet ice
#

in essence you might need #getStringList and iterate over it

pseudo quiver
#

cracked server have many people trying to log into staff account

eternal oxide
#

Well, there are a few problems with that. Names can change and so do IPs

#

Why not use an Auth plugin?

pseudo quiver
pseudo quiver
eternal oxide
#

I think your friend may be wrong

pseudo quiver
#

i will ask him once again

#

also thanks you guys

eternal oxide
sage swift
#

insanity is doing the same thing over again and expecting different results

eternal oxide
#

You should delete that message

sullen marlin
#

I mean all I'm going off is two lines you pasted butchered of context

eternal oxide
#

Two lines that anyone here who's semi competent with Java would know is never going to work.

quiet ice
#

All that Class.forName("org.bukkit.TravelAgent"); does is loading the class org/bukkit/TravelAgent or throwing an exception

#

But then, why would you need to play the classloader?

quiet ice
#

why are they playing the classloader then, could just as well listen to ClassDefNotFoundError

eternal oxide
#

They are using it to throw an exception, instead of just detecting if it exists. Not good practice to generate exceptions

tired spoke
#

Someone can link me how to setup the config yml

tired spoke
#

Thanks

high gulch
#

Do you need bukkit to let luckyperm work

dense goblet
#

hey, I want to store an ItemStack as NBT and then restore it at some point later. Is using PersistentDataType.TAG_CONTAINER the correct way to do this?

#

and if so, how do I go about restoring it to an ItemStack

sullen marlin
#

you can serialize an item to a Configuration

dense goblet
#

I need it stored as NBT on another item

#

i.e. one item holds another

sullen marlin
#

you can do that natively for things like chests, shulker boxes, etc

dense goblet
#

it has to be an arbitrary item so I'm trying to replicate the way they do it for those

sullen marlin
#

but there's no general method, you'd have to make that yourself using PersistentDataContainer

dense goblet
#

hm

#

and bukkit supports custom PDCs right

#

does the default persistentDataContainer for items store enough information to restore the ItemMeta?

sage swift
#

it'll be enough

#

it's stored in the world folder anyways

dense goblet
#

so I can write the NBT with:

setNBT(stack, LOADED_MAG_KEY, PersistentDataType.TAG_CONTAINER, ammoContainer.getPersistentDataContainer());
sage swift
#

no

#

ItemMeta#getPersistentDataContainer

dense goblet
#

yea ammoContainer is an ItemMeta

sage swift
#

so why not just set it in there

dense goblet
#

set what exactly?

sage swift
#

PersistentDataContainer#set

royal hawk
#

Who understand how link particle to player? I want:

sage swift
#

math

royal hawk
#

if im rotate

high gulch
#

Guys, I have luckyperms and essentials but members cant break blocks or use (eat) food??

dense goblet
#

I have a GunItem (a custom item) which should be able to store an ItemMeta (ammoContainer) as NBT, so that I can load a magazine into an itemstack of type GunItem and later take it out and restore the ammoContainer as a real item

quaint mantle
high gulch
#

how can I change it?

sage swift
high gulch
#

k

sage swift
dense goblet
#

my problem is with retrieving it from NBT, I need to create a new ItemStack which is formed from the gun's loaded magazine NBT key

sage swift
#

ok now im lost

earnest junco
#

If you want to store ammo on a weapon, why not simply store an integer in the PDC?

dense goblet
#

i.e.
ItemStack Gun NBT:
-CustomItemType: "toolTestGun"
-LoadedMagazine:
--<ammoContainer serialised into NBT>

dense goblet
#

I want the user to be able to load a magazine, fire a few shots, and when they take it out (i.e. to load a full one), the magazine is returned to the inventory with less ammo, and whatever other data that it had before should persist

earnest junco
#

I assume your ammo items are configurable/stored by you somewhere, yea?

dense goblet
#

yeah my ammo itemstacks are also custom items, so they have a CustomItemType (string) NBT and AmmoCount (int) nbt. All the properties of the ammunition are retrieved from the CustomItemType

earnest junco
#

So just store the ammo type as a string, retrieve your stored preset by that string and modify it to fit the new ammo count

#

no need to store the whole item

dense goblet
#

yeah I was thinking to do that but it may lead to problems when I want to add more per-itemstack properties to certain types of ammo

#

it's a bit limiting but an okay solution if restoring the full item is too much hassle

#

if I can get the original material from the stored PDC, I can just make a new stack and set the PDC on the new stack's meta to the stored PDC

earnest junco
#

probably less work to add more property storing pdc tags than to constantly serialize back and forth

#

i mean you can abuse the itemstack to string method everyone copy pastes, just not a great solution imo

dense goblet
#

nah nah itemstack serialisation is okay

#

it's string to itemstack which is the problem

#

or PDC rather than string

earnest junco
#

has both back and forth, still think you shouldn't do it, but ๐Ÿคทโ€โ™‚๏ธ

dense goblet
#

ah so serialise as string rather than to PDC hm

#

yeah you have a point

royal hawk
dense goblet
#

hm thought there would be a way to copy a PDC to a new item but that's not the case...

#

since you can't tell what type each key is and you also can't just do meta.setPDC() since there is no such function

#

guess I'll settle for storing just the info that is needed

sage swift
#

ItemMeta is a clone

earnest junco
dense goblet
#

in what way?

#

I tried both but I see no set pdc method, and the looping solution needs me to know the data type of each key and that is also not provided

dense goblet
# sage swift ItemMeta is a clone

yea I would setItemMeta afterwards on the stack
m = stack.getItemMeta();
//update m to have proper values
stack.setItemMeta(m);

the middle part is my problem

digital rain
#

uhh what event represents a map being used from empty map => filled map

earnest junco
keen kelp
#

is there a better way to remove the hunger thing better than cancelling event everytime a player is suppose to lose hunger?

digital rain
#

ty

earnest junco
#

that way his hunger bar doesn't repeatedly go up and down

keen kelp
#

that's less effective right?

earnest junco
#

eh, debatable

keen kelp
#

public void OnHunger(EntityExhaustionEvent event)
event.iscancelled(true);

earnest junco
#

Yeah that and uh FoodLevelChangeEvent iirc

keen kelp
#

I mean

#

if they never get any exhause points

#

they don't really need to cancel foodlevelchange right

dense goblet
digital rain
tardy delta
#

is it possible to show the luckperms prefix next to your displayname?

royal hawk
#

Who knows how to work with particles?

earnest junco
digital rain
#

ok then let me try

earnest junco
dense goblet
#

so doing the inverse of itemStack.getItemMeta().getPersistentDataContainer() is the issue

earnest junco
dense goblet
#

I don't know all data types

earnest junco
#

You do, you write them

dense goblet
#

not necessarily

#

there can also be data written by other plugins or other parts of my plugin

eternal oxide
#

You have to know what data you are putting in, so you know what to get back

dense goblet
#

I'm going for a different solution now though

keen kelp
#

how can I see how much an entity was suppose to heal?

#

like rn EntityRegainHealthEvent's .getAmount

#

gives how much they would regen

dense goblet
keen kelp
#

so it wouldn't show anything above max health

dense goblet
#

e.g. renaming and so on

keen kelp
#

and it would be 0 if the player was full health

dense goblet
#

or anything from foreign plugins which is more of an issue

keen kelp
#

but I want the original value

#

so I can display it properly

earnest junco
keen kelp
#

ik

#

but like

earnest junco
#

So that's your original value xD

keen kelp
#

I want the value

#

like if I splash a potion

#

instant health 2 let's say

#

they it was suppose to health 8

#

but the player is full health

#

so when I do event.getAmount it would be 0

earnest junco
#

Yes, but I think it would make more sense to actually display the actual value and not a value that's way above what you can do anyways

keen kelp
#

but I want to get 8

#

just for display

#

is it possible?

earnest junco
#

It's like display the amount of damage you would've taken if not for your armor, just makes no sense

keen kelp
#

Dont worry about the intensive man, just tell me how to do it

#

incentive

#

or however you spell it

#

just tell me if it's possible

earnest junco
keen kelp
#

sorry

#

But really I do have a purpose for it

#

is it possible to get the original amount before the limiting

quaint mantle
#

Plugin 'maven-shade-plugin:3.2.2' not found

#

what does this even mean

keen kelp
#

it means a hard dependency is not found

quaint mantle
#
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.2</version>
                <configuration>
                </configuration>
                <executions>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
keen kelp
#

named maven-shade-plugin

quaint mantle
#

its for mongodb

eternal night
#

Maybe specify the group id

#

Of the plugin

#
<groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>3.2.2</version>