#help-development

1 messages · Page 1814 of 1

noble lantern
#

not one bit

misty current
#

iirc an anti cheat used to have a crash command and had to remove it

patent wadi
#

I know this is a stupid direction for many, but what would be the non nbt way of doing this please.
CraftLadder bRot = (CraftLadder) blok.getState().getBlockData();
In order to get the getFacing() method.

quaint mantle
#

backdoor confirmed...

#

md will not think that this idea is so good

sullen marlin
patent wadi
#

so cast the block's state to Directional?

woeful crescent
#

anyone know if spigot will load a plugin automatically (from the plugins folder) if it has already been loaded manually?

quaint mantle
#

h?

sullen marlin
patent wadi
#

ty

woeful crescent
# sullen marlin What do you mean

If I've loaded a plugin using Bukkit.getPluginManager().loadPlugin(myJar) before the plugin loads, will bukkit try to load it again anyways, like it usually does?

sullen marlin
#

Load it again when

woeful crescent
#

When the server loads all its plugins

sullen marlin
#

Idk

#

Try and see

woeful crescent
#

For some reason, I was getting an NPE because some stupid class loaded before my main plugin loaded and tried to get the instance

patent wadi
#

I don't think so, if you have 2 copies of the same jar it wont load both if they both register with the same name

woeful crescent
#

So I did this?JAVA public static Plugin getInstance(){ if(instance == null){ File thisJar = new File(PATH); try{ return Bukkit.getPluginManager().loadPlugin(thisJar); }catch(InvalidPluginException | InvalidDescriptionException e){ e.printStackTrace(); return null; } }else return instance; }

patent wadi
#

I suspect that mechanism would stop it

young knoll
#

Why are you

#

What

eternal night
#

you might want to assign the instance that you return 😅

#

also soft depend is a thing

woeful crescent
#

yeah, whoops

#

nah, because of complications I couldn't use softdepend

#

the class loading was kind of unreliable and I had no idea what caused it

#

But I'm gonna try this, hopefully it works

patent wadi
#

making a module loader for a plugin?

junior briar
#

i'd like to associate all the source codes of the server in BuildTools directory to my spigot dependency so that investigations on game details will become easier.
could someone tell is this doable?

woeful crescent
#

Yep

#

What IDE?

junior briar
#

eclipse

#

the latest 2021-09 i think

sullen marlin
#

Sure, just import the maven into eclipse and run from that

junior briar
#

ty!

peak granite
#

how can i hide all item flags

quaint mantle
#

hmm?

#

hide enchantments?

peak granite
#

no

#

like attack damage

#

etc

woeful crescent
#

ItemStack#addItemFlags(ItemFlag.HIDE_ATTRIBUTES)

quaint mantle
#

check vanilla flags

woeful crescent
#

would that work?

quaint mantle
#

yeah that would work

#

lemme see wiki

peak granite
#

(Material.DIAMOND_SWORD.addItemFlags(ItemFlag.HIDE_ATTRIBUTES)) ?

quaint mantle
#

mc wiki

woeful crescent
#

uhh

#

also it's gotta actually be an item

#

not just a material

#

So, to construct an item: new ItemStack(Material.DIAMOND_SWORD)

#

An ItemStack is an actual item; a Material is just an item type

#

To get ItemMeta (what you're trying to modify): ItemMeta meta = yourItem.getItemMeta();

quaint mantle
woeful crescent
#

And .addItemFlags() is under ItemMeta

quaint mantle
woeful crescent
#

So you would use meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES)

woeful crescent
#

ItemFlags is the spigot way to do it I'm pretty sure

peak granite
#
        if (item == null) return null;
        ItemMeta meta = item.getItemMeta();
        if (meta == null) {
            return item;
        }
        meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
        meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
        meta.addItemFlags(ItemFlag.HIDE_DESTROYS);
        meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
        meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
        item.setItemMeta(meta);
        return item;
    }```
#

?

quaint mantle
#

i think meta never gonna be null?

woeful crescent
#

You can also use .hasItemMeta() to check if the item has meta

woeful crescent
young knoll
#

Air has null meta

quaint mantle
#

air is item..?

young knoll
#

Also addItemFlags is a varargs

#

So you can pass them all at once

woeful crescent
#

Yes

ivory sleet
#

Some of the block exclusive materials don’t have an ItemMeta I believe

young knoll
#

True

woeful crescent
young knoll
#

But they shouldn’t be an itemstack in the first place

ivory sleet
#

Indeed

#

Would be quite cursed derp

woeful crescent
#

(values() returns all values in an enum, which is what ItemFlag is)

#

or wait

#

actually whatever i just realized there might be non--hiding item flags

#

lol

young knoll
#

Can you explicitly pass an array to varargs?

woeful crescent
#

yep

ivory sleet
#

ya

#

Think they have the same signature

young knoll
#

Nice

ivory sleet
junior briar
tender shard
#

run buildtools

undone axleBOT
tender shard
#

?bt

#

also wtf why are you compiling against 1.17 instead of 1.17.1

junior briar
#

i've run BuildTools already.
oof, it is 1.17.1. 😮

tender shard
#

you got 1.17 in your pom instead of 1.17.1

junior briar
#

corrected that. now it's going right.

#

ty

tender shard
#

:3

young knoll
#

Some people really do use 1.17.0

tender shard
#

there's even people still running 1.8

#

lol

buoyant viper
#

some even use 1.7.10...

tender shard
#

watch out

#

LeGuernic is using 1.4.6

#

but I think he got banned on spigotmc

proud basin
#

hi

#

I still haven't figured out this scoreboard stuff lmao

junior briar
tender shard
#

if you're using spigot: it has no docs. add spigot-api as well

junior briar
tender shard
#

NMS of course has no docs at all

proud basin
#

How do I stop rendering the scoreboard?

junior briar
#

docs no need. source attachment is good enough.

tender shard
#

idk what you mean with source attachment sorry

#

but you can easily view the decompiled source of any class

#

e.g. CTRL+B in IntelliJ

proud basin
#

How can I stop this from rendering

tender shard
#

did you choose those poor variable names yourself or is that some kind of decompiled code from another plugin @proud basin?

proud basin
#

no

#

none of them

#

That's mojang for ya

#

I'm in GuiInGame class

tender shard
proud basin
#

It's a class made by mojang

junior briar
#

i'm running in eclipse. however if it's doable in intellij, it should do in eclipse too.

tender shard
proud basin
#

This isn't a server jar

tender shard
proud basin
#

client jar

tender shard
proud basin
#

It's not a plugin

tender shard
#

oh okay, maybe you should seek some help on another discord then. this channel is for spigot development

proud basin
#

No it's not

tender shard
#

It is, read the channel description

proud basin
#

It says Ask other questions here

#

this is a "other" question

tender shard
#

yeah okay but you won't get any answer here probably

sullen marlin
#

I'm not sure why it says that

#

Maybe it was from 1.17

proud basin
#

Don't know where else I would go

sullen marlin
#

I can't recall

proud basin
#

Forge would yell at me for using mixins

#

Worth a try here though, you never know someone may be smart

tender shard
#

I just wanted to point out that this channel was supposed to be for spigot dev questions, even when the descriptions might suggest otherwise. Most of the people here probably never looked at the client code

proud basin
#

I mean it's not that hard to understand

#

it's basically like a server jar

junior briar
#

in eclipse, when sources are attached, their class names, methods or fields become available to be searched. also u can check their declarations from codes invokes them.

tender shard
# proud basin I mean it's not that hard to understand

if it's so easy you wouldn't be asking here. As said, probably noone here knows. And tbh I still think you at least have a typo in "GuilnGame" because that doesn'T sound like any name someone would name a class like

#

I might be wrong though ofc

young knoll
#

Go to fabric

proud basin
#

I never said It's easy

#

I said it's not hard to understand

young knoll
#

Or a genetic mod dev discord like MC Ideas Academy

proud basin
#

I feel like they would yell at me too Coll

tender shard
tender shard
hasty prawn
#

So instead of going to a fabric/forge discord for client side stuff you came here expecting to get more answers? Thonk

proud basin
#

yes

tender shard
proud basin
#

I understand

#

but it's worth a shot

tender shard
#

true, but probably indeed noone here knows. that's all I wanted to say 😛

hasty prawn
#

True, but you're definitely going to have more luck in one of those other Discords.

proud basin
#

I almost got banned from forge for asking a question...

#

and it was because I was using mixins

#

they don't like it

tender shard
#

there's probably a bit more to that story lol

proud basin
#

no

#

literally go ask a question about mixins there and see what happens

tender shard
#

okay

#

you got a link to their discord?

proud basin
#

no

tender shard
#

then I can't help

proud basin
#

🤷‍♂️

#

unfortunate

tender shard
#

good luck though

junior briar
tender shard
#

All I can say is that IntelliJ handles it fine

#

might be a time to switch 😛

#

if you're using maven or gradle, switching is a no-brainer

sullen marlin
#

Are you trying to fix a bug in the server

#

If not surely this is unnecessary

#

There are javadocs for the api

#

?jd

junior briar
#

no, just trying to understand some game logic details.

sullen marlin
#

Spigot source doesn't have all classes anyway

#

It only has about 600 out of like 3000

junior briar
#

that should be enough for me actually 🙂

tender shard
junior briar
# tender shard that's... bad

i would say that's reasonable.
decompiling for all classes takes a lot of resources and the result is different from the sources. for example it loses the docs.
it is not necessary if u already have the sources.

tender shard
#

maybe I misunderstood what you're talking about

#

I just wanted to say you can select any classname in IntelliJ and have it decompiled immediately. It does not decompile all your dependencies at once if that's what you're talking about

junior briar
#

then how would the ide know if some certain fields, methods or classes are invoked by it?

tender shard
#

it doesn't, as said I misunderstood your question

#

however you could just decompile the whole .jar and then open that in your IDE or sth?

proud basin
tender shard
hasty prawn
#

CurseForge and Forge aren't the same thing

proud basin
#

^

tender shard
#

wait

young knoll
#

Lul

tender shard
#

you want to tell me that curseforge = fabric?

hasty prawn
#

No, thats also different

tender shard
#

ugh

#

I'm so glad I don't have to deal with client mods lmao

hasty prawn
proud basin
#

bully

tender shard
#

client mods are the worst thing ever lol

junior briar
#

it's truely a work around, but no docs make me feel a little bad 🤷‍♂️

tender shard
#

20 different projects, 30 different websites lol

young knoll
#

What

proud basin
#

It's great practice though

young knoll
#

There’s like 2

hasty prawn
young knoll
#

Forge and fabric

proud basin
#

well

#

time to visit fabric

young knoll
#

Curseforge and modrinth

hasty prawn
#

Forge's documentation is "ok here's how to install. goodluck idiot"

tender shard
# young knoll Forge and fabric

yeah and when you google "forge discord" you end up at "curseforge" discord which apperently has nothing to do with forge according to the messages above

young knoll
#

Lol

#

Nice

tender shard
#

so yeah

#

fuck all those client mod garbage lmao

hasty prawn
#

Doesn't help that they have basically the same logo too

tender shard
#

ikr?

#

it's like someone making a project called "cursespigot" with a spigot as logo and then getting upset when people confuse both

hasty prawn
#

Heh, kinda sounds like Paper

#

With the logo exception

tender shard
#

and the different name^^

paper viper
#

thats why u search papermc

#

instead of paper

tender shard
#

and the fact that paper includes 100% of spigot

#

or lets say 99%

#

but yeah I really dont understand all those forks anyway

#

if they think they can do stuff better, why dont they create PRs instead of getting their own fork

paper viper
#

some forks have different goals than others

#

not like everyone will agree to it

tender shard
#

yeah of course

#

I'm fine with paper and spigot

#

everything else will be gone in 2 years anyway I guess

hasty prawn
#

Whys that

tender shard
#

just speaking out of what I've seen

#

I might be wrong, time will tell

#

anyway I doubt that any real large server will use some obscure fork that just came up and might be gone next year

#

but that's a bit offtopic anyway

young knoll
#

90% of servers are on spigot or paper

paper viper
#

you know what would be good

#

if we had a server that wouldnt rely on stupid bukkit code

young knoll
#

That’s called fabric

tender shard
#

and it sucks

paper viper
#

Yeah, but people are lazy

tender shard
#

I disagree strongly on the fact that bukkit should not be used in favor of fabric

tender shard
young knoll
#

Fabric doesn’t have anywhere near the same API equivalent as Bukkit

#

Maybe one day it will

tender shard
hasty prawn
#

TacoSpigot pog

paper viper
#

i really wish hybrid server impl would die

tender shard
hasty prawn
paper viper
#

no

tender shard
paper viper
#

not sponge

#

Mohist

#

and other shit

#

Sponge is fine

hasty prawn
#

Idk what that is

tender shard
#

mohist ist just cra

#

p

paper viper
#

the devs are also super toxic

#

codebase is shit

tender shard
#

mohist tries to unify bukkit and some other API

#

but its bugged like hell

#

in one version it didnt even call PlayerDeathEvent when a player dies

#

I got soooo many bug reports

#

until I finally found out it's a mohist issue

hasty prawn
paper viper
#

hint

#

its fake

#

Lol

#

No good solid software would ever have that 😂

hasty prawn
tender shard
#

lmao

paper viper
tender shard
#

whoever has the need to put things like "solid code" or "Code grade A++" into the README has shitty code

tender shard
hasty prawn
#

??

tender shard
#

idk if its true, but if it is: very stupid

hasty prawn
#

Yeah that's stupid af

tender shard
#

going to sleep, have a nice day everyone 🙂

hasty prawn
#

You too peepoSleep

paper viper
#

if u go onto essentialsx

#

they made an public announcement abt it

hasty prawn
#

Ohhhhh yeah I remember seeing that now

tender shard
#

yeah they say "DONT USE MOHIST" lol

quaint mantle
#

anyone know what the alternative to Material.isTransparent is?

tender shard
#

and I agree on that

tender shard
quaint mantle
#

dont want them looking thru walls

hasty prawn
#

What's wrong with isTransparent though

sullen marlin
#

World#rayTraceEntities

#

But idk why you need alternative

#

What's wrong with the method

hasty prawn
#

It is deprecated for some reason

proud basin
#

I figured it out all by myself

#

HA

#
@Inject(method = "renderScoreboard", at = @At(value = "INVOKE"), cancellable = true)
    private void renderScoreboard(CallbackInfo ci) {
            ci.cancel();
       }
``` here yall go
pliant tundra
#

i have an enchantment that conflicts with mending
when i add mending to an item with the custom enchantment, it doesnt work because it conflicts (which should happen)
but when i do it the other way around it does work
how can i fix this

hasty prawn
#

Use addUnsafeEnchantment

junior briar
quaint mantle
#

Air

noble lantern
#

someone just make a jar using raw mc protocol

#

server jar*

junior briar
#

i notice the server will check and move the spawn location to avoid choking.

while (avoidSuffocation && !worldserver1.getCubes(entityplayer1) && entityplayer1.locY() < (double) worldserver1.getMaxBuildHeight()) {
    entityplayer1.setPosition(entityplayer1.locX(), entityplayer1.locY() + 1.0D, entityplayer1.locZ());
}

do we have sth similar in the api?

gaunt saffron
#
    private void sendServer(Player player, String server) {
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);
        try {
            dataOutputStream.writeUTF("connect");
            dataOutputStream.writeUTF(server);
        } catch (IOException e) {
            e.printStackTrace();
        }
        player.sendPluginMessage(this.getServer(), "bungeecord", byteArrayOutputStream.toByteArray());
    }

my player does not support "sendPluginMessage"
is there a way to rewrite that? or write a function that does that? im not using spigot/bukkit but still need the functionality

ping me !

quasi flint
#

TF U using then?

#

Frickin Vanilla or what

gaunt saffron
#

im looking for the sendPluginMessage definition but cant find it

quasi flint
#

What is limbo?

gaunt saffron
quasi flint
#

Gl getting help with that

gaunt saffron
#

im pretty sure the function can be rewritten

#
    public void sendPluginMessage(@NotNull Plugin source, @NotNull String channel, @NotNull byte[] message);

    /**
     * Gets a set containing all the Plugin Channels that this client is
     * listening on.
     *
     * @return Set containing all the channels that this client may accept.
     */
    @NotNull
    public Set<String> getListeningPluginChannels();

thats the only thing i found...

languid dome
#

So i got a question, I save a deserialized itemstack in a config and i noticed from 1.17 to 1.18 that a variable in it changed and was wondering what it even is. My plugin compares the itemstack someone has to the one saved in the config and it isnt working properly because of the different variable. The variable in question is just called v, Here is a piece of the config for reference

  itemstack:
    v: 2730 (1.18 changed it to 2860)
    type: DIAMOND_SWORD
    meta:
      ==: ItemMeta
      meta-type: UNSPECIFIC
      Damage: 2
sullen marlin
languid dome
flint parcel
#

Hi you don't know of any good boss or pet plugins?

wide solstice
#

When making a bungee/spigot plugin, do you guys normally recommend one uber jar or one for the proxy and one for the servers?

flint parcel
#

spigot

sullen marlin
flint parcel
pearl hollow
#

my friend said that the entity hurt method does not full kb. Is this true?

#

im using it for a pvp plugin thats why

worn tundra
pearl hollow
worn tundra
#

?

#

Why don't you try it?

pearl hollow
#

ok i dont really take kb

flint parcel
worn tundra
#

lmao

#

Because it seems like you are unable to make an extremely simple Google query for spigot pet plugins.

quaint mantle
#

Use Bing, yields better results👌

junior briar
#

about org.bukkit.HeightMap.WORLD_SURFACE_WG, what's the meaning of "for worldgen"?

junior briar
#

well, no.
i think i got the "for worldgen" words just from the docs.

worn tundra
#

Suggests that a world generator may have a different highest non-air block

quaint mantle
#

not rly asking for a spoonfeed

#

but if anyone knows a cool resource for generating nice spheres like worldedit's

#

id like to know

#

too many ugly/inefficient methods out there 😦

eternal oxide
#

Look at teh FAWE source

#

its ugly code, but efficient

kind hatch
#

So I have a lot of files that I need to copy to the plugin's directory while also maintaining the directory structure. Is there a quick way to do this? I know #saveResource() exists, but is there a better way to do it than a bunch of save statements?

solar plinth
kind hatch
#

Wdym by dynamically?

eternal oxide
#

saveResource is teh most efficient

solar plinth
#

I guess when your plugin version changes, your filename does too, so you should hardcore your filename

#

I think the Api of the JavaPlugin has a method for that

kind hatch
#

Did some quick searching about saveResource and haven't found a way to bulk copy without just writing it for each file. Which I really don't want to do. That'll be over 300 lines of what is essentially bullshit.

lavish hemlock
#

NIO

#

oh wait

#

this is resource shit

eternal oxide
kind hatch
#

Can you give an example?

eternal oxide
#

specify the root source and programatically extract everything in that package

kind hatch
#

Ok, but what would I use to extract everything?

eternal oxide
#

saveResource

#

it would probably be around 10 lines of code

#

I can help you with it in about 30 minutes if you can't do it. Morning ablutions first.

kind hatch
languid dome
sullen marlin
#

just to get clear, you are using getItemStack, right?

quaint mantle
kind hatch
#

Fast Async World Edit

languid dome
# sullen marlin just to get clear, you are using getItemStack, right?

I am comparing the itemstacks themselves with the itemstack from the config being serialized. Here is my code

    private ItemStack checkPlayerHasItem(Player player, Shop shop) {
        ItemStack item = shop.getItemStack();
        if(player.getInventory().containsAtLeast(item, shop.getAmount())) {
            ItemStack[] items = player.getInventory().getContents();
            for(ItemStack invitem : items) {
                if(invitem == null) continue;
                if(invitem.getType().equals(item.getType())) {
                    ItemStack sellitem = invitem.clone();
                    sellitem.setAmount(shop.getAmount());
                    if(sellitem.equals(item))
                        return sellitem;
                }
            }
        }
        return null;
    }```
languid dome
sullen marlin
#

Uh

#

No

#

Use getItemStack

zealous crow
#

hello there I have a for loop that start like this:

for (String shop: ShopUtil.ccShop.get().getKeys(false))
            {

it loops inside shops in "normal" order from first to last element in the array. Can someone help me on a proper way to do the loop in reverse? from last to first element?

kind hatch
#

If ccShop.get() returns a list, you could copy it to a new list, reverse it with Collections#reversed() and then iterate over that. Ofc, that all depends on what the #get() method returns.

zealous crow
#

ty i'll try that

#

i wanted to prevent copying the list tho

kind hatch
#

I think you'd have to regardless, that get() method might return an immutable object in which case, copying is the only thing you can really do.

zealous crow
#

humm maybe i can try reversing the data from the list when it's created at it's origin.. will be better

quaint mantle
#

simple solution would be just to use worldedit but i kinda want to learn

kind hatch
quaint mantle
#

ill look now ty

quaint mantle
#

ty

kind hatch
#

@eternal oxide You still around? I still need some help with these files.

lean gull
#

does anyone know how i could start with world gen? (NOTE: i'm pretty basic in java and spigot)

eternal oxide
kind hatch
#

Bet

quaint mantle
kind hatch
#

It's quite literally a drop in replacement. 😛

quaint mantle
#

wym

kind hatch
#

FAWE was created because normal WorldEdit

  1. Blocks the main thread when performing tasks.
  2. Only works on the main thread, making it painfully slow to work with when dealing with larger operations
  3. Missing basic features past 1.12 (tab completion, better message formatting, etc)

FAWE does the exact same thing as normal WorldEdit, but does it better.
It's multithreaded, works with world files directly, and is easier to work with.

#

@quaint mantle

spiral light
#

Anyone knows something about the Biome-Noise that is new in Minecraft 1.18 ? It allows the biome selection by 7 different values - but it will not work with custom collections of biomes :/ I think somewhere it needs to be registered

kind hatch
#

@quaint mantle FAWE is to WorldEdit as PlotSquared is to PlotMe, both are better because they offer more and innovate on the base ideas of their original.

quaint mantle
#

idk i guess my struggle is idk how they make such perfect circle shapes

#

if i could see the maths or how they do it i could learn but im pretty lost when reading it all

kind hatch
#

Well, are you trying to create one in game or replicate the functionality in a plugin?

quaint mantle
#

i want to generate sphere around a location in game

#

so ye plugin i guess

#

dont rly wanna import it though

#

as id rather learn from this

kind hatch
#

Well there is a sphere command. You can get the usage by typing //sphere, but it's pretty straight forward. //sphere <materal> <size>. The actual syntax may differ, but iirc, that's one way to do it.

#

There is also an //hsphere command which will create a hollow sphere.

quaint mantle
#

i wanna automate it

#

in my plugin

#

is what i meant soz

kind hatch
#

Ah, well looks like you will either have to replicate the functionality yourself or call upon the API to create one. (If it has such functionality)

#

Automate how?

quaint mantle
#

game starts

#

generate random water orbs

#

to jump and parkour in

#

at random centers

kind hatch
#

I'd recommend looking into both the WorldEdit api and FAWE api to see if one of them has a method available to create spheres.

eternal oxide
#

FAWE does

#

its terrible to read but its well optimized

languid dome
# sullen marlin Use getItemStack

just tested it by using a command to save the item in the config so its forsure the right item then had it check it with my function and it worked then changed the v in the config to how it is in 1.17 and tested it again and getInventory().containsAtLeast() is returning false. And i used getItemStack this time

lean gull
#

i have this tutorial on bukkit.fandom.com about making world gen in bukkit, would it work if i use the spigot api or do i need to like import something

quaint mantle
#

Only spigot API suffices

lean gull
#

so i can't?

#

i'm not quite sure what suffices mean

grim ice
#

you probably should get the config info on enable

#

then store them

#

then use them

quaint mantle
#

Just note that it was written before the material rewrite so it may not Work 100%

quaint mantle
lean gull
#

oh so i can?

grim ice
#

but it doesnt matter that much so u can get ur stuff working then u do that

quaint mantle
#

Well, technically you only need bukkit API but you cannot get it nowadays, so you'd want to use spigot-api

lean gull
#

wait i think i understand, bukkit is the default and then spigot adds everything bukkit has but changes it?

#

did i get that right

quaint mantle
#

Yes

lean gull
#

oh, so i can use bukkit anyway

quaint mantle
#

Though spigot is the default, you cannot get bukkit in 1.16+

lean gull
#

ok

quaint mantle
#

And If we are talking about bukkit.org bukkit (which is the Bukkit the guide was originally made for), it does not exist since 2014 or so

lean gull
#

ok i still need help with the world gen, this tutorial is outdated (literally the first method they said to put has something deprecated)

quaint mantle
#

Why is it deprecated? Perhaps the docs suggest an alternative

lean gull
#

this wiki page is in progress anyway

quaint mantle
#

Also, you might want to try datapacks instead

lean gull
#

idk how to do datapacks

quaint mantle
#

The Future is datapacks though, you cannot really stay with worldgen Plugins forever

lean gull
#

is it bad to use the same dependency for the spigot api in 2 plugins?

#

like the same file

quaint mantle
#

Huh? Like shading a 3rd Party depend in two Plugins or depending on the same plugin?

#

If it is Just something Compiler time, no

lean gull
#

i have the spigot api jar file in my dependency folder, i'm currently using it for a plugin, but i just made a new one. should i use the same jar file for it or should i make a new one for just that plugin

quaint mantle
#

I recommend using maven or gradle. But No, Not an issue to Point to the same jar .... For now

lean gull
#

i use maven

#

but the default thingie doesn't have everything

#

so i need to import the BuildTools spigot api into my modules tab or whatever

quiet heron
#

How would I go about cancelling placing of blocks from my custom ItemStack. They open GUI:s so i dont want them to get placed when right clicked.

quaint mantle
#

you dont want ur custom items to get place?

#

just get a pdc on it

kind hatch
#

Check if the item they are holding is a custom item that meets criteria. You can do this in a number of ways:

  • Check it item name and lore is the same
  • Custom NBT
  • PersistentDataContainer
  • LocalizedName (Quick and dirty, pretty sure this isn't supposed to be use for this though)
quaint mantle
#

then every blockplaceevent

#

check the pdc

#

if it contains the pdc

#

then cancel it

quiet heron
#

When i try to do "event.setCancelled(true);", i get a bunch of errors in console

#

and the block gets placed anyway

kind hatch
#

You listening for the BlockPlaceEvent?

quiet heron
#

Can i send pastebin links here?

kind hatch
#

Yes

quiet heron
kind hatch
#

@eternal oxide Any luck? Or do you think I should post this to the forums? Cause I'm still not finding anything useful for it.

eternal oxide
quiet heron
#

I'm a total noob to java development, I got started yesterday so dont judge my poor skills ;)

kind hatch
#

Yikes, why isn't there something for this. lol

quaint mantle
#

anyone had experience with pulling players to a center? trying to make it require as much force as is required instead of going overkill

#

i.e if player is 7 blocks away, pull them 7 blocks in, if theyre only 3, just whatevers required for 3

kind hatch
#

@quiet heron What's your console errors?

quiet heron
undone axleBOT
quiet heron
#

oh wait thats the old one

kind hatch
#

Well I have a hunch the new one might suffer from this as well.
java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because the return value of "org.bukkit.inventory.ItemStack.getItemMeta()" is null

#

Second line in your error. You need to add a null check for itemmeta

#
if (itemStack.getItemMeta() == null) {
  return
}
quiet heron
#

Hold up, with the new one i dont get any errors in console, the block just places

quaint mantle
#

anyone know how to cancel swimming?

#

(i tried player.setSwimming(false) and it does not work)

kind hatch
#

@quiet heron You might be able to get away with ItemStack#isSimilar() for your comparison. Instead of event.getItemInHand() == (ItemManager.pct) you should try event.getItemInMainHand().isSimilar(ItemManager.pct)

quaint mantle
buoyant viper
#

they want that pre 1.13 swimming 😎

kind hatch
#

Can't imagine.

quaint mantle
#

imagine.... 1.8x - 1.18x

buoyant viper
#

imagine 1.19

quaint mantle
#

welp i mean they are right

#

they can cause client issue with pre 1.13 if they support that

quiet heron
#

My programming class just ended but ill get back to it once i get home…

buoyant viper
#

@quaint mantle try setting sprinting to false instead of swimming, got a hunch that might do what ur trying to do

quaint mantle
#

nvm it turns out

#

pretty much client sided

#

im pre sure

#

like even if i cancel it which i did, they swim just as fast even tho it doesnt look proper to other ppl

#

just gotta figure out how to make the velocity apropriate

quaint mantle
#

no we cant? welp you might need to look at spigot api, apis in spigotmc resources, or create one urself with nms

#

1.17 only btw

kind hatch
#

@eternal oxide Posted it on the forums, hopefully someone knows a way to get it working properly.

quaint mantle
#

uhhh

kind hatch
#

@eternal oxide Appreciate the help though.

quaint mantle
#

Class.class.getResource("*.txt")

#

wonder if that will work lol

#

wait

#

just read ur post again

#

guess you will need to do that urself :sadge:
or look at other resources?

kind hatch
#

I've been searching for a while for posts about it. Not aware of any other plugin that do this. Most of them use databases for it, which I will eventually add, but I want a stable file system that can act as a backup or just by default. Allows end users to not have to worry about database setup if they don't want/need it.

spiral light
quaint mantle
#

that as welll

#

i was trying to find it lol

rough basin
#

Is there a way to prevent entities from collided and pushed back?

#

Like each Entity's Mass?

kind hatch
#

LivingEntity#setCollidable should work.

rough basin
#

Thanks :)

lean gull
frosty tinsel
#

Hi, is there any reason, to store BukkitTask instead of BukkitRunnable, when all the methods on BukkitTask after on BukkitRunnable as well?

spiral light
lean gull
#

i want it to be like simple perlin noise generation that is quite flat and keeps on close to a y level

#

the craters would make the ground go up a little in a curve in the shape of a rough circle, and then go down and center

quaint mantle
lean gull
#

just gonna ignore you

quaint mantle
#

Sorry we wouldnt spoonfeed you

glossy venture
#

there is no way to access the default minecraft world generator

#

if you want to modify existent terrian i recommend the api

lean gull
#

i don't want the default one, i wanna make my own one

glossy venture
#

okay

lean gull
#

just like a very simple thing

#

of noise and craters

glossy venture
#

you can use simplex noise

#

included with bukkit

#

and for craters use world decorators

lean gull
#

i don't even know where to start, can you explain this to me or send me a known article about it?

glossy venture
#

what

#

im recommending something

#

how is that wrong lol

#

that doesnt even make sense language wise

spiral light
#

No about no way to edit vanilla one

glossy venture
#

well u can use like IChunkAccess from nms or something

#

but you cant modify it

junior briar
#

hi guys, i'd like to know after which event a new player will be considered hasPlayedBefore?

glossy venture
#

probably after login

#

might be discarded when the server is force terminated tho

#

without /stop

junior briar
#

how do i stop them from joining before their data being stored?

kind hatch
quaint mantle
#

Spigot is used to run bukkit plugins right ? If I wanted to learn plugin programming I should learn bukkit ?

kind hatch
#

You should learn Java first. That way you will have a far greater understanding of how the Spigot API works.

quaint mantle
#

I already know java and java OOP that's why I am here asking

#

still a junior developer though to be honest

kind hatch
#

Oh, well in that case, they only thing you need to learn is the Spigot API.

hollow spindle
#

Yeah just go with the spigot api

regal dew
#

Spigot is an extension on the bukkit api

quaint mantle
kind hatch
#

Yes

regal dew
#

googling "how to do x on spigot" usually gets you far enough if you click on spigot forums links for simple stuff

quaint mantle
#

👍 thank you

regal dew
#

but the real challenge is to break your problem down to what you actually want to do, like googling I want to make an auctionhouse plugin will ofc not work

lean gull
#

i made a rough sketch

lean gull
regal dew
#

but, something like "How to schedule a task 20 ticks later" will

quaint mantle
#

I'm planning to go to uni and get a licence in cs so don't worry about that, the objective is to learn while applying myself and using logic and solving problems, while making a project

hollow spindle
#

license?

quaint mantle
#

sorry more like masters degree

kind hatch
#

@quaint mantle Keep in mind that you can always ask people for help with your problems here and on the forums. Spigot Plugin Development is the dev help section you would want to post in.

hollow spindle
#

Ah you going for masters?

quaint mantle
#

well I mean I hope I can 😅

#

This is my only ticket to leaving the island I live on

quaint berry
#

Is this where I go for help?

hollow spindle
kind hatch
#

Development help yea

hollow spindle
#

plugin dev help yes

quaint berry
#

Ok

#

How to I make my plugin create a config file

#

I have no Idea

junior briar
hollow spindle
quaint berry
#

Thanks

iron vector
#

What is the best way for backwards/forwards compatability? Do I have to package the plugin for Every Version I wish to support? Or is it poosible to support multiple Versions in one jar?

hollow spindle
#

Which part are you stuck with?

quaint berry
#

The generating of the file in the folder part

#

(The config.yml)

hollow spindle
#

I have the following in my main class.

saveDefaultConfig(); // Most likely want this part since this is the one that copies the default config.yml over.
config.options().copyDefaults(true);
kind hatch
# iron vector What is the best way for backwards/forwards compatability? Do I have to package ...

Two ways exist. Reflection and Abstraction.

Reflection works decently well for some things, but may not work long term. It relies on fields not changing names for a long time.
Abstraction gives you more control, but you have to keep up with dependencies and learn the differences between versions. (Could have difficulty making backwards support if things are not well documented)

As for which is better, I'm in the Abstraction camp. However, both have their use cases.

iron vector
quaint mantle
#

Better yet: don't use any API which does not honor SemVer

kind hatch
hybrid spoke
quaint mantle
#

would you recommend a recent version of the api or an older version to learn it ? since it goes from 1.10 to 1.18 apparently

kind hatch
#

Learn the most recent

summer scroll
#

latest ofc

hybrid spoke
#

start with 1.2

kind hatch
#

It will be easier as things that exist in it might not in older versions.

#

Makes your life easier

junior briar
rough basin
spiral light
kind hatch
glossy venture
hybrid spoke
kind hatch
#

JavaPlugin#saveResource

spiral light
rough basin
#

oh it was an example 🤦

#

Thanks guys

kind hatch
nocturne sinew
#

is there any other way of moving blocks smoothly instead of using armor stand ,falling block and shulker. (the players should be able to stand on that blocks )

spiral light
hollow spindle
#

I'm planning to create my own mine generating area as part of a feature in my core plugin. I have in my head 3 for loops to handle x, y and z blocks and I might create a block in that 3D space. However i'm a little concerned to performance and other issues that may arise with this plan. Any suggestions on how I should go? (It will be handled in a separate async thread)

lapis lark
#

Could anyone help? Whats name of PacketPlayOutEntityMetadata in remapped-mojang?

#

There is no something like ClientboundEntityMetadata

eternal night
#

ClientboundSetEntityDataPacket

iron vector
lapis lark
gaunt saffron
#

is there a good waay to check if player is touching water?
i tried this;
if (ploc.subtract(0,1,0).getBlock().getType() == Material.WATER | ploc.subtract(0,0,0).getBlock().getType() == Material.WATER)
and it sucks
I'd like to check if player is touching water anyhow

kind hatch
# iron vector Do I even have to do that on very Simple plugins? My Plugin basically only runs ...

No, not on simple plugins. You would only have to do something like that if you are dealing with something that the spigot api doesn't already support or doesn't have enough support for. Things like item creation are pretty straight forward using the default api, however if you were using modern 1.18+ items and wanted to support backwards, you would need something in place to prevent errors from being thrown on 1.17 servers that say "Hey, that material isn't found".

gaunt saffron
#

no idea, lmme chheck

eternal night
#

pretty sure that method exists

gaunt saffron
#

there is ...

iron vector
gaunt saffron
#

testing...

spiral light
sacred ice
#

for support older versions and new, legacy is checking if plugin running under >= 1.13 and the plugin is compiled in 1.16+ so its support 1.7-1.18

gaunt saffron
sacred ice
#

example

lapis lark
spiral light
kind hatch
# iron vector So on a simple plugin like that I just compile against the oldest API my code su...

Yes. You would actually be compiling against the newest api and it would support back to whenever the api call was added to the game.

IIRC, good title support wasn't added to the api until 1.11. So when I was making a plugin for 1.9 and 1.10 I created a Title class that would handle sending the title and subtitle packets to players. Then 1.11 came along and added a nice little method called #sendTitle() and it nullified the need for my abstraction classes.

lapis lark
#

Hm, today working

#

Strange page

#

OK, thank you again 😄

spiral light
lapis lark
#

I think it was lagging 2 days ago because of my 9302839347324 opened chrome pages about maven

kind hatch
#

@iron vector Ultimately, you are going to want to test your plugin on every version you want to support. Best part of making multi-version support is you get to choose which versions you want to support. Don't let people force you into supporting versions that will make your life harder. I see plugins that still support 1.8 even though they also support 1.18. Not sure if they fully capable of backwards compatibility, depends on featureset, but at a point, it might become a bit much to support large version gaps.

spiral light
iron vector
spiral light
kind hatch
lapis lark
#

What that could really tell? Marked pom? All works, but 1.17 contains crossed out pom

#

Logic same as another modules

kind hatch
#

@iron vector Second question, what versions do you want to support with your plugin?

lapis lark
graceful fractal
#

What does the simulation-distance in server.properties in 1.18 refer to? I set the viewdistance to 5 and the simulation distance to 10, but I still can only see the chunk with a radius of 5

kind hatch
#

Simulation distance is a new feature that gives you control over how close one needs to be to certain things in order for them to animate properly. Things like mobs, water, redstone will stop working and freeze if players are outside of the range. This is a performance setting.

#

In your case, it's working as intended. Players can only see 5 chunks in front of them, but things are likely happening 10 chunks out from them.

graceful fractal
#

oh, ok

#

thanks

iron vector
kind hatch
#

Also, 1.10 is a little old. I'm not sure of many people still running it. According to bstats, 1.10 isn't even being run anymore.

#

Ofc this only applies to servers that have metrics enabled, but a good place to check every once in a while.

iron vector
kind hatch
#

Hell you could do that in one class if you really wanted to.

iron vector
#

OK. The plugin.yml contains an API-Version. What should I put there

iron vector
kind hatch
#

You will want to put in the latest version of the game.

worn tundra
#

Functional programming pog

iron vector
kind hatch
#

api-version was added in 1.13 due to all the material names turning into strings from ids. If you don't put it in or put something invalid, the plugin will still work, it's just that the server will enable legacy item support which isn't ideal.

kind hatch
iron vector
#

Ok. I dont need that then.

#

For shits and giggles: Is there a spigot API for pre 1.8 minecraft? Those dont seem to be on the maven repo....

kind hatch
#

I don't think they have anything older than 1.8. In the old days, craftbukkit reigned supreme and everyone developed for that. It got DMCA'ed and everyone flocked to Spigot. Spigot is based off of craftbukkit, but there aren't any jars you can readily download due to the DMCA takedown. You might be able to compile it yourself with BuildTools, but I'm not 100% sure about the really old versions.

iron vector
#

Ill try that later....

kind hatch
#

Yea, BuildTools only goes back to 1.8. There might be a way to get 1.7 files, but I'm not aware nor interested in finding them.

chrome beacon
#

There is no good way of getting 1.7 or older files

orchid cove
#

hmm i want to do a private chat toggle but i don't have any code idea someone help

misty current
#

I understand why people would care about 1.8

#

But 1.7...

burnt current
#

Hey I have a quick question about attribute modifers. I try to change the attack speed of a sword in the ItemMeta with an attribute modifier. Unfortunately, based on what I found on the Internet, I still don't understand how it actually works or how I have to specify everything there. Anyone who happens to be able to help me with an example?

chrome beacon
#

Or have fun with chat packets

kind hatch
quaint mantle
#

What file/files am I meant to download in /repositories/snapshots/org/spigotmc/spigot-api to get started ?

kind hatch
#

Are you using maven?

quaint mantle
#

I guess I should use maven

#

I see some maven files in there

kind hatch
#

If you aren't you can use the spigot.jar file created by BuildTools. You just have to add it as a dependency.

#

If you're using maven, it'll download the files automatically once you configure your pom.xml.

#
<repositories>
    <repository>
      <id>spigot-repo</id>
      <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>org.spigotmc</groupId>
      <artifactId>spigot</artifactId>
      <version>1.18-R0.1-SNAPSHOT</version>
      <classifier>remapped-mojang</classifier>
      <scope>provided</scope>
    </dependency>
  </dependencies>

If you aren't using or don't want to use the remapped version, your dependency would be this instead.

<dependency>
  <groupId>org.spigotmc</groupId>
  <artifactId>spigot-api</artifactId>
  <version>1.18-R0.1-SNAPSHOT</version>
  <scope>provided</scope>
</dependency>
quaint mantle
#

trying to download the dependences through intellij but doesn't seem to be working, probably just ide issue

kind hatch
ivory sleet
undone axleBOT
quaint mantle
#

its done thanks

#

currently downloading dependencies

iron vector
#

If I dont have the api of a version in maven, can I just compile against the server jar for that version?

#

The bukkit server jar of course

#

Or spigot that is

kind hatch
#

Not sure I fully understand. Can you explain a bit more?

iron vector
kind hatch
#

Unlikely

lusty dust
#

Is there a way to delete a resource from spigot?

candid galleon
#

Report it asking for such

kind hatch
quaint mantle
#

does spigot 1.18 api require jdk 17 ?

kind hatch
#

The jar requires it.

#

Probably a good idea to compile against it as well,

quaint mantle
#

I was using 11, have to install 17

orchid cove
#

lmao everyone who know how to make toggle staff chat help me

frosty tinsel
chrome beacon
frosty tinsel
#

Yeah xD

gleaming breach
#

Hello, I am developing a plugin for 1.8.8 that can change a player's skin to one from a preset enum of skins. Everything is working fine, but when the skin gets refreshed it applies for like half a second and then turns back normal as how it was before the change... I haven't found anything on spigot or anywhere about this issue... Could someone please help me with this? Thanks.

#

Here's the code I use to change the skin:

public static void setSkin(Player player, SkinEnum skin){
        String texture = skin.getTexture();
        String signature = skin.getSignature();
        CraftPlayer craftPlayer = (CraftPlayer) player;

        Bukkit.getOnlinePlayers().forEach(o -> { ((CraftPlayer)o).getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, ((CraftPlayer) player).getHandle())); });

        craftPlayer.getHandle().getProfile().getProperties().removeAll("textures");
        craftPlayer.getHandle().getProfile().getProperties().put("textures", new Property("textures", texture, signature));

        Bukkit.getOnlinePlayers().forEach(o -> {((CraftPlayer)o).getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, ((CraftPlayer) player).getHandle()));});

        Bukkit.getScheduler().runTaskLater(PluginMain.getInstance(), () -> Bukkit.getOnlinePlayers().forEach(o -> o.hidePlayer(player)), 0);
        Bukkit.getScheduler().runTaskLater(PluginMain.getInstance(), () -> Bukkit.getOnlinePlayers().forEach(o -> o.showPlayer(player)), 15);

        craftPlayer.getHandle().playerConnection.sendPacket(new PacketPlayOutRespawn(craftPlayer.getHandle().getWorld().worldProvider.getDimension(), craftPlayer.getHandle().getWorld().getDifficulty(), craftPlayer.getHandle().getWorld().getWorldData().getType(), WorldSettings.EnumGamemode.valueOf(craftPlayer.getGameMode().toString())));

        craftPlayer.getHandle().playerConnection.teleport(new Location(player.getWorld(),craftPlayer.getHandle().locX, craftPlayer.getHandle().locY, craftPlayer.getHandle().locZ, craftPlayer.getHandle().yaw, craftPlayer.getHandle().pitch));

        PalermoSkinMap.put(player.getUniqueId(), skin);
    }
chrome beacon
#

NMS is generally unsupported

frosty tinsel
gleaming breach
quaint mantle
quaint mantle
#

yeah

gleaming breach
frosty tinsel
quasi flint
#

or like 1.13+

frosty tinsel
#

Yeah

quasi flint
#

pvp doesnt count

#

there are plugins for that

frosty tinsel
#

It does

gleaming breach
gleaming breach
quasi flint
#

oldpvpmechanics plugin

#

good one 😄

gleaming breach
quasi flint
#

well i wont help long dead versions

#

so good luck

gleaming breach
#

It worked for alot of people before so I can make it work too.

quaint mantle
#

although you are on your own

frosty tinsel
#

And show

#

Or just try to do just the skin part

#

Independently

gleaming breach
frosty tinsel
#

Alright

gleaming breach
#

If I rejoin the server with the account... the skin changes back too.. it does the same thing. I can show you a footage of how it looks

frosty tinsel
#

Change skin

quasi flint
#

the video is privat

#

badonk

frosty tinsel
#

Use the thread please

lean gull
#

anyone know how to make simple world gen?

fierce quail
#

I have a Java Library, thats basically a jar with static public useful functions on my local drive, how can i import that using maven? And yes, i googled a lot and those stupid forums dont help, caus ewhenever someone got it right, they didnt thought it would be cool to share their solution

eternal oxide
#

does your jar have its own pom to build it?

fierce quail
eternal oxide
#

does it have a pom to build it?

fierce quail
#

It has a pom.xml, yes, both have one

#

Becasue thats what plugins have and i wanna mention bukkit code in my lib

eternal oxide
#

mvn deploy:deploy-file -DpomFile=file:///path/to/yourproject/repo/pom -Dfile=mylib-1.0.jar

#

however, if it has its own pom you could just run install

fierce quail
#

So thats for the pom.xml? Doesnt the pom.xml only contain additional packages for the source code? I hate Java... Anyways, thanks ill try that

eternal oxide
#

your pom contains all teh info needed to build your plugin

#

you usually run clean package

#

if you run install it will add it to yoru local maven repo

fierce quail
#

Ty

#

mvn deploy:deploy-file -DpomFile=file:///C:/.../IdeaProjects/SulfuriumLib/pom.xml -Dfile=file:///C:/.../IdeaProjects/SulfuriumLib/target/SulfuriumLib-1.0.jar

just throws an error The parameters 'url' for goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file are missing or invalid

eternal oxide
#

you only want teh actual jar name for the Dfile

#

whats with all teh ///

fierce quail
#

Thats the usage of using a file

fierce quail
eternal oxide
#

yes

#

-Dfile=yourPlugin.jar

fierce quail
#

I need to add the url param according to the error and the maven docs

iron vector
#

Soo... the guy with the backward Compatibility questions is back xD
When running my Plugin, I get (via Reflection since the API changed a while back) the PlayerList (getServer().getOnlinePlayers()).
The Problem is, that earlier versions returned an Array, while the recent versions return a Collection of Players.
Now I tried to convert the Player Collection to an Array, but I can't cast the Array returned by java.util.Collection.toArray() (the instance method) to org.bukkit.Player, bc the Runtime Type is org.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer.
But I don't know how that is possible, since its a Collection<org.bukkit.entity.Player>, so those two have to be related to each other.
Any Idea how I could convert a [Lorg.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer to [Lorg.bukkti.entity.Player?

eternal oxide
#

teh repo should be local

fierce quail
#

Whats even a repo? I HATE MAVEN ALL THIS BULLS* MAN I JUST WANT MY F * JAR TO BE ACCESSED IN MY F* PLUGIN WHO EVVEN WROTE THAT S* THAT THERE IS NO PROPER WAY OF DOING THIS FOR IDOTS LIKE ME

chrome beacon
#

Sounds like you need a break to calm down

fierce quail
#

I tried this S* for two days straight

chrome beacon
#

All you need to do in run mvn install in the first project. Then in the second project put info from first project as a dependency

iron vector
iron vector
#

Maven might not like it, but for now that works

chrome beacon
#

Use what Elgar said instead of that

fierce quail
chrome beacon
#

Maven will use the local repo on your system. No need to add one to project pom

eternal oxide
#

your local repo would be (probably) c:\Users\%USER%\.m2

fierce quail
#

Im a bit stupid, how would the exact command look like? with my normal IntelliJ project?

chrome beacon
#

mvn install

eternal oxide
#

^

fierce quail
#

Ty

#

It worked

#

Nice

ivory sleet
#

Because it hasn’t been an array for a very long time

fierce quail
#

@chrome beacon and @eternal oxide You helped me such much, thanks! 🏅 <-- Medal

ivory sleet
#

Equally important, it’s a Collection<? extends Player> (type parameter is not just Player) which makes it a bit complicated.

iron vector
#

Get org.bukkit.entity.Player Array from the Player Collection

mortal hare
#

Does Entity implementation object after death goes stale?

#

for example i spawn an entity

ivory sleet
#

It varies

mortal hare
#

with #World.spawnEntity()

#

does it get stale after death

#

or is it safe to store this

ivory sleet
#

But most entities can be considered "stale" post death

#

However this is not the case for Player implementation

mortal hare
#

I thought like this too, it wouldnt make sense to create EntityHuman object all over again

ivory sleet
#

So yes to answer your question, it’s probably unwise to store it after its death

proud basin
#

Is it possible to inject renderScoreboard to modify RED?

proud basin
#

Yea

late sonnet
#

not sure what are you talking xd

slim cairn
#

How would I force people to be put into adventure mode if they arent? Basically an IF statement if a player is in a different gamemode then adventure

blablabla

if (IsGamemode) != Adventure
{
  Player.Gamemode set minecraft:gamemode.Adventure
}
else
{
  return null;
}

Something like that

ivory sleet
#

well in principle you could just set their gamemode to be adventure whenever it changes

mortal hare
late sonnet
#

or use the forcegamemode in server properties

slim cairn
proud basin
slim cairn
#
  • It puts me into adventure every single time I join, i'm trying to make it so that when you have a certain permission it doesnt affect you
mortal hare
late sonnet
mortal hare
#

Objective values can be changed, but not their appearance (chat formatting wouldnt work)

slim cairn
#

?

grim ice
#

if(player.hasPermission("urpermission"){
// do stuff
}

late sonnet
grim ice
#

lol

slim cairn
slim cairn
late sonnet
slim cairn
#

Sorry, I think we're having a missunderstanding

late sonnet
visual tide
#

is the spigot repo down? im getting a DependencyResolutionException

#

when trying to mvn install

ivory sleet
#

Hmm works for me

visual tide
#

hm

#

Failed to execute goal on project API: Could not resolve dependencies for project me.outsparkled.eframemining:API:jar:1.0: Failed to collect dependencies at org.spigotmc:spigot-api:jar:1.8.8-R0.1-SNAPSHOT -> net.md-5:bungeecord-chat:jar:1.8-SNAPSHOT: Failed to read artifact descriptor for net.md-5:bungeecord-chat:jar:1.8-SNAPSHOT: Failure to find net.md-5:bungeecord-parent:pom:1.8-20160221.214544-128 in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of spigot-repo has elapsed or updates are forced -> [Help 1]

late sonnet
#

loading for me

visual tide
#

gah

#

when i doubt, run buildtools again

ivory sleet
#

Tried invalidating caches?

visual tide
ivory sleet
#

Yuh, it usually solves some issues I experienced with gradle from time to time at least

visual tide
#

iNdEXiNg

#

index faster

#

still the same error 😐

slim cairn
visual tide
#

as string

late sonnet
ivory sleet
#

Hmm lvj is your project on GitHub or something? I guess I could try cloning it and see if I get the same issue

late sonnet
#

make a ACTION in github for test if they can build xd

visual tide
slim cairn
late sonnet
visual tide
#

ima check if i can build another project

#

andd that worked

#

bruh

#

might actually run bt again

late sonnet
# slim cairn Yes I am.

ok if you use luckperms then you can use the method Player#hasPermission("customperms.canByPassAdventure") you can edit this permission in LuckPerms (user/group)

slim cairn
#

I know. Thank you 🙂

old pendant
wide solstice
#

Hey guys I'm developing a core plugin and I have a few questions about spigot and bungee working together. Please don't be harsh it's my first time ever using bungee. My project structure is as follows:

core-api - Contains API for external plugins to interact with
core-common - Contains common code between the different implementation modules
core-bukkit - Bukkit implementation of common/api
core-bungee - Bungee stuff? Not sure what this will have in it yet...
core-distribution - Just a pom file, shades everything together

  1. Right now my setup is to shade everything into an uber jar file, is this common practice? Or do you guys normally create separate jars for each platform?
  2. When would I ever register a command through bungeecord, rather than bukkit?
  3. What would be the best way to share context between the bungee module and the implementation modules? I've seen the plugin messaging platform and redis used, just wondering which you guys recommend.

Thanks

old pendant
onyx shale
#

well mostly plugins are the only real way of using it

#

and they already have full control pretty much

slim cairn
late sonnet
#

its .
i use # for what i make in docs xd

quaint mantle
chrome beacon
slim cairn
#

Also I get this Cannot resolve method 'hasPermission' in 'RingItem' However, when I create it. Nothing happens

chrome beacon
wide solstice
#

Alright, thanks guys

slim cairn
#

Im just using the quick fix from IntellIJ since I have no idea how to work with Java for the most things hehe

chrome beacon
#

?learnjava Time for this

undone axleBOT
grim ice
#

why does ur method have 1

chrome beacon
#

As for the issue use hasPermission on an object that can have one

slim cairn
#

I dont want to learn the entirety of Java. I'm just trying to make a force gamemode thingy ;-;

chrome beacon
#

...

#

Learn it

grim ice
#

@slim cairn so you dont want to be a developer?

slim cairn
chrome beacon
#

Yeah

slim cairn
grim ice
#

so you want to?

slim cairn
#

What

#

I dont want to so I want to?

grim ice
#

okay so

#

do I code it for you?

slim cairn
#

If you wanted to, but you dont have to since you're not spoonfeeding me.

grim ice
#

it wouldnt take more than 5 minutes lol

slim cairn
#

Again, its your choice

grim ice
#

alr

#

imma do it cuz im bored

#

why does ur method name end with 1

slim cairn
#

Im just making a server for me and my friends and I'm trying to force them into adventure, thats litterally all 🙂

iron vector
#

Minecraft 1.18 added the minecraft option Online > Allow Server Listings <On/Off>. This seems like a privacy thing. What does that mean exactly and should Plugin Devs respect that option?

slim cairn
#

1.17.1

grim ice
#

paper or spigot

#

just wondering

slim cairn
#

Spig

grim ice
#

make it paper

iron vector
grim ice
#

why do u not use paper lol

#

its better

slim cairn
slim cairn
# grim ice its better

Not in my opinion. I prefer working with Spigot. I also already have a code around it so I'm just trying to make this thing fit into it

grim ice
#

paper plugins dont work in spigot

late sonnet
slim cairn
#

I already have a lot of other plugins okay, I'm not trying to change everythint right now in the heat of the moment

iron vector
grim ice
#

im talking about making ur server paper, it will be able to understand both spigot and paper plugins

grim ice
#

oh okay

grim ice
#

i think

ivory sleet
#

2Hex no need to glorify paper here

slim cairn
grim ice
#

sorry if u cant notice "imo" in the conversation

ivory sleet
#

Anyways I’m not going to argue over it.

grim ice
#

anyways @slim cairn it doesnt matter

#

do you want the permission to be fixed?

slim cairn
#

Well, yes?

grim ice
#

ok

#

what should it be?

slim cairn
#

ringitem.excludegamemode if the player doesnt have this and they arent in survival they will be put into adventure

iron vector
slim cairn
#

reason its ringitem is because thats my overall plugin name

#

Basically I'm trying to combine it with a different plugin ya know

grim ice
#

what if they have ringitem.excludegamemode but are not in survival

late sonnet
slim cairn
#

wait no

#

If they have the permission it simply doesnt do anything

grim ice
#

cool

#

ill dm u the plugin

#

u can decompile it if u want

#

thats literally 90% of the code lol

#
  @EventHandler
    public void onModeChange(PlayerGameModeChangeEvent event) {

        if (event.getPlayer().hasPermission("ringitem.excludegamemode")) return;
        event.getPlayer().setGameMode(GameMode.ADVENTURE);

    }```
#

Solved, if you have a problem you can say it here

slim cairn
#

Just ignore it?

late sonnet
#

yeah

grim ice
#

what

#

you have a problem

grim ice
#

it shouldnt say that

hybrid spoke
#

yes, ignore it.

grim ice
#

cipher wtf

#

it means u dont have @EventHandler probably