#help-development

1 messages · Page 2160 of 1

reef lagoon
#

oh wait

fallow violet
#

xd

mellow edge
#

look at my invisible char:

#


#


#


#


bold copper
#

hi, tell me how to put a player a personal spawn point?

#

code that will be equivalent to the /spawnpoint command

bold copper
#

who would have thought that the method name contains a bed...

sacred mountain
#

i havent got a great understanding of lambda, but is it a quick foreach? or for every value in collection also supplying variable

crisp steeple
#

not really

sacred mountain
#

so instead of looping through a list and sending it as a normal for loop i could do

messageList.forEach(message -> p.sendMessage(message));

#

oh

crisp steeple
#

a lambda is used in the case of foreach

#

but that isn’t it’s only purpose

#

you can think of it as an interface with only one method, but just shorter syntax

golden turret
#

mine better

crisp steeple
wet breach
# sacred mountain oh

it is still a loop, just because you use lambda doesn't mean it changes how the code is executed, instead it changes how it looks and in some cases to be more compact

#

have to sometimes be careful when using lambda's as while it can make the code shorter, it does hide away some of that verbosity to understand what is really going on with the code.

wet breach
#

I personally don't use lambda's as I don't like them

sacred mountain
golden turret
#

yo guys

#

i have the following code

sacred mountain
#

nice

golden turret
#

and when i get the data back, it is empty

sacred mountain
#

get better theme

clever sapphire
#

I remember reading that lambda code is also slower then just normal loops

sacred mountain
#

is olddata null

wet breach
#

still executes normal code stuff

#

it is just hidden away out of view

sacred mountain
#

opinions on lombok

dark arrow
#

is it possible to change the spawing rate of a specific mob

clever sapphire
sacred mountain
#

where is that from tho

crimson terrace
#

if you wanna increase I guess you have to double spawn mobs with a certain chance?

sacred mountain
#

isnt there an event for spawning

crimson terrace
#

CreatureSpawnEvent

sacred mountain
#

can you call that

crimson terrace
#

god Ive done like everything with that

#

Bukkit.callEvent

dark arrow
sacred mountain
#

so you want

#

2 zombies to spawn

crimson terrace
sacred mountain
#

not increased spawn chances

crimson terrace
#

you just listen to the CreatureSpawnEvent

dark arrow
#

ok

crimson terrace
#

and then you could with a 50% chance spawn another one

#

you would have to make it not be able to spawn another one on the extra zombie spawn tho

dark arrow
#

ok

granite owl
#

does someone know how to inject new items to the item list that the vanilla /give command is using?

crisp steeple
#

i would probably just make my own command for that

#

you can override vanilla commands

granite owl
#

and i did before

#

but i dont wanna rewrite the give command

crisp steeple
#

i mean, it seems like less work to do that than inject into the /give command

#

that would probably require lots of nms and shouldn’t really be done in the first place

#

if you’re making custom items, you should make custom commands to get them as well

eternal night
#

Pretty sure give pulls from the item registry

#

Those are frozen soo gl Injecting anything

#

And even then that might cause other issues

crisp steeple
#

yea

granite owl
crisp steeple
#

injecting directly into registries seems more like modding, not plugin making

granite owl
#

so

#

where can i find that field

crisp steeple
#

it’s much more complicated than just one field

#

i’m just telling you straight up, it’ll be way easier to just make your own command than to inject custom items into nms registries

wet breach
#

however, the JVM will still execute things in native code the same way

#

for some things in regards to lambda

#

occasionally it will do it differently

midnight shore
#

how can i delete every document from a collection?

granite owl
#

okay i guess im stupid but why does this return 0.0 instead of 0.33

#
int a = 3;
            int b = 9;
            double c = a / b;
            Bukkit.broadcastMessage("c: " + Double.toString(c));
#

i thought a double is a 64 bit value

#

as if this is being hit by the diminishing accuracy lmao

tepid ore
#

The result of the division is an int

granite owl
#

so i forgot to cast the result into a double ig

#

okay time for a break for me lmao

tepid ore
#

Just cast one of the ints

#

And it will return a double

#

not the expression

granite owl
#

just used it for this

#
Inventory inv = Bukkit.createInventory(null, 9 * ((debugMenuList.size() > 0) ? (int)Math.ceil((double) debugMenuList.size() / 9) : 1), ChatColor.GREEN + "ItemControl Debug Menu");
#

so the debug item list increments its size by itself

#

when i inject new items into the list xD

ivory sleet
crisp steeple
#

lombok attempts to be kotlin in java

sacred mountain
#

best feature?

sacred mountain
ivory sleet
#

Not having Lombok in your project

#

That’s the best feature of it pretty much, I’ve had terrible experiences with lombok fyi lol

crisp steeple
#

it’s just java but less boilerplate and more qol really

ivory sleet
#

Kotlin compiles to java virtual machine compatible bytecode

#

Thus it can run on the jvm

crisp steeple
#

yeah

sacred mountain
eternal night
#

tho you need to either shade or define the kotlin std as a lib

ivory sleet
#

Oh yeah ^ that’s a good point

sacred mountain
ivory sleet
#

@Getter is nice until you realize it’s not

eternal night
#

the only thing I really appreciated about lombok was @Delegate

ivory sleet
#

I do appreciate the Builder one but it’s also a bit too much, yeah delegate is fine

quaint mantle
#

How do I prevent this from generating in my build directory? I just want my jar.

sacred mountain
#

what about @hoary knollThrows

crisp steeple
sacred mountain
#

sneakythrows

#

bruh

#

sorry for whoever i pinged

ivory sleet
#

Sneaky throws are evil

sacred mountain
#

lmao

eternal night
#

I mean it all is pretty buggy

ivory sleet
#

Don’t sneaky throw unless you got seriously good reasons to sneaky throw

eternal night
#

hence why I stopped using it

#

lol

ivory sleet
#

✌️

sacred mountain
#

looks like i'll be using a normal getter from now

odd adder
#

Is it possible to get a UUID from a online player?

wet breach
#

yep

ivory sleet
#

Entity::getUniqueId

wet breach
#

player.getUUID()

odd adder
#

hmm... my IDE says no this function.

hot vortex
#

is it possible to add a plugin to a cracked server that doesnt allow cracked players except for a select few user names? so like the whole server is premium but only a few cracked players can join

eternal night
#

getUUID does not exist

ivory sleet
#

Yes because it’s named getUniqueId

eternal night
#

use getUniqueId like conclure linked

ivory sleet
hot vortex
#

im just asking if its possible

#

dont need a life lesson

eternal night
#

I mean, would not mean anything ? you can change the username to anything anyway

#

because, ya know, cracked

hot vortex
#

select ip then.

#

selected

eternal night
#

I mean I am sure you can code that up

#

will you get help from a lot of people doing so ?

#

probably not

hot vortex
#

alright thank you

sacred mountain
#

what procedure/connection does cracked miss out? just askin

odd adder
#

is the UUID got from getUniqueId is a UUID from mojang database?

eternal night
#

yes

#

if you are in online mode

odd adder
#

ok

eternal night
#

but that should be a given

ivory sleet
manic furnace
#

I have to save an object to an mysql db which contains a list of players. What is the best way to do that?

vague swallow
#

What event get's triggered if a player shots a crossbow?

crimson terrace
#

ProjectileLaunchEvent I believe

vague swallow
#

ty

crimson terrace
#

that one is for sure, not sure if there is a more specific one

vague swallow
wet breach
#

or does it contain more?

manic furnace
#

It contains other strings but i can save them easily

wet breach
#

can you show what the object layout looks like?

manic furnace
#
private ArrayList<UUID> players;
    private GuildColor color;
    private GuildColor tagColor;
    private String name;
    private String tag;
    private UUID head;
    private GuildMetadata guildMetadata;
wet breach
#

ok give me a bit

#

in a game and then I can help

sacred mountain
#

I have a couple things, whats the best way to loop through a list of some sort without having to use list.size() - 1 as the limiter. srcond thing is whats the best way to replace placeholders (not placeholderapi) within my plugin if i have multiple placeholders

crimson terrace
vague swallow
crimson terrace
#

Projectile has a getShooter() method

manic furnace
patent horizon
#

is there any way to remove the lore content of the bundle? the slots and storage count

wet breach
#

what is guildmetadata?

kind hatch
#

IIRC, no as the item slots are something unaccounted for in the api. You’re more than welcome to try all of the ItemFlags and see if it removes it. However bundles have been untouched for a while.

#

They were never complete in the first place either.

#

@patent horizon

wet breach
# manic furnace Ok thanks
create table players (
    playerUUID varchar(36) primary key,
    playerName varchar(48),
    playerhead varchar(255)
);
create table guild (
    guildUUID varchar(36) primary key,
    playerUUID varchar(36) not null,
    guildName varchar(48),
    guildTag varchar(4),
    guildColor char(10),
    guildMeta blob,
    constraint fk_guildUUID_playerUUID foreign key (playerUUID) references players(playerUUID)
);
#

that is how I would create the DB

kind hatch
#

UUIDs only need a varchar of 36 right? Isn’t 64 just extra?

wet breach
#

64 if you include the dashes

#

or it could be 36 I don't remember

#

doesn't matter as long as you just make it large enough to hold the UUID 😛

kind hatch
#

True. I think the UUIDs are 32 chars long and 36 with the dashes.

fallow violet
#

what is returned if a is true? return a ? "Yes" : "No";?

kind hatch
#

Yes is returned.

fallow violet
#

thanks

quaint mantle
#

question for a texture pack, if file which the texture pack linked changes its contents. Do i need to change the SHA1 as well?

wet breach
#

yes

kind hatch
#

Yes. If the pack changes then you will have to rehash.

quaint mantle
#

as for player.setResourcePack(texturepack, hash)

#

which hash should i be sending?

#

the new one?

kind hatch
#

The hash of the pack?

quaint mantle
#

yeah

wet breach
#

whatever the hash of the pack is

#

if the pack updated, send updated hash

kind hatch
#

Take your pack, hash it and use that hash.

quaint mantle
#

then would this update the server properties as well?

wet breach
#

no

kind hatch
#

No, you would have to update that yourself.

quaint mantle
#

so if i don't update it, everytime they join. it would automatically download it agian even if it was similar

#

what counts really is just the verification of the hash

wet breach
#

if you don't update it, it won't download again

quaint mantle
#

as in i don't update either the resource pack or the sha1

#

i see, does spigot load server properties into memory? or does it retrieve it from the file everytime it is needed

#

cause if in memory i need to use spigot api to update it

wet breach
#

if you don't update the sha1 in the server.properties or send it to the client, the client will not download the pack again.

#

sha1 doesn't change for the pack unless you update something in the pack

quaint mantle
#

gotcha

kind hatch
#

I think it’s loaded into memory.

quaint mantle
#

mh alright, ima look into javadocs then

#

thanks for replying my barrage of questions!

ivory sleet
#

yes

#

its loaded into memory

quaint mantle
#

can't seem to find the java docs for editing the server.properties in spigot

tardy delta
#

iirc its nms stuff

sacred mountain
#

I have a couple things, whats the best way to loop through a list of some sort without having to use list.size() - 1 as the limiter. srcond thing is whats the best way to replace placeholders (not placeholderapi) within my plugin if i have multiple placeholders

eternal oxide
#

you can't alter the properties via the API

quaint mantle
#

ah i see

#

then you would have to reload the properties after editing the real file?

eternal oxide
#

yes

granite owl
#

aint shapeless recipes working with RecipeChoice.ExactChoice as material?

#

tried to do it but it worked with any and all

mighty pier
#
        if(e.getMessage().equalsIgnoreCase("//calc") || e.getMessage().equalsIgnoreCase("//calculate")) {
            e.setCancelled(true);
        }
    }``` why does it not work?
tardy delta
#

do you have a eventhandler annotation and is it registered?

mighty pier
#

yes

#

i sent a message to the console after i canceled the evenrt

humble tulip
mighty pier
#

?

humble tulip
#

That you sent to the console

#

Does it print?

mighty pier
#

i added code that sent a message after the event was cancelled and i removed it

#

it did send

humble tulip
#

Well comething else is probably uncancelling it

#

Set the priority to something higher

#

Like highest or monitor

patent horizon
#

i wanna store a list of custom enchants (strings) in the persistent data of an item, but it doesn't look like persistendata supports string arrays. what's the next best alternative?

midnight shore
#

Use mfnalex’s library

patent horizon
#

im not looking to add a library

midnight shore
patent horizon
#

is TAG_CONTAINER_ARRAY like a map?

midnight shore
#

I highly recommend using a library, it contains also itemstack serialization and a bunch of other stuff you should use

#

But if you don’t, use a normal string and split every entry with a \n character

patent horizon
#

actually that library doesnt look too bad

fallen agate
#

How do I generate a completely flat world with a custom floor?

patent horizon
#

worldcreator?

fallen agate
#

is there an example

tender shard
#

it's basically a PDC itself

patent horizon
#

oh hi alex

tender shard
#

like a nested PDC 😄

tender shard
patent horizon
#

how would i shade your lib in gradle

tender shard
#

hm I don't really know but I guess you simply set it to "compileOnly" and then run the "shadowJar" goal or however it's called

#

I never use gradle myself

patent horizon
#

ah alr

tender shard
eternal night
#

for-each loop ?

#

if you don't care about the index

tender shard
patent horizon
#

is there not a plugin jar for your lib?

tender shard
patent horizon
#

ah

tender shard
#

it's not a standalone plugin

patent horizon
#

snazzy ;-;

eternal night
#

making it a plugin would be annoying, people would have to install it 5Head

patent horizon
#

yeh but gradle intimidates me

#

plugin only bugs me

tender shard
#

yeah I always hate it myself when I download some plugin that "requires eco and vaut and mythiblib and whatever and protocllib and this and that" lol

eternal night
#

oh xD

sacred mountain
quaint mantle
#

String#replace or replaceAll ig

patent horizon
eternal night
#

nah I haven't worked with placeholder api

#

I just use mini message :>

sacred mountain
quaint mantle
#

he said not papi

eternal night
#

oh

#

lol

patent horizon
tender shard
#

replaceAll is for regex stuff

eternal night
#

or do something like java message format

#

tho those are effort

tender shard
#

as said I really have no idea about grade

#

I use maven all the time

eternal night
#

shadow will shade dependencies marked as implementation yea

#

but you need to define the plugin

tender shard
#

as said, just copy the needed parts from oraxen's buid.gradle lol

#

then simpy replace "CustomBlockData" with "MorePersistentDataTypes" and it shoud work then I guess lol

eternal night
#

yikes not using kotlin gradle dsl?

patent horizon
#

no i am

#

and theyre not

eternal night
#

I mean, converting between the two is pretty easy

patent horizon
#

i need a plugin for shading dont i

hasty prawn
#

IntelliJ even does it if you copy Maven dependency into a build.gradle lol

eternal night
#

yes this

#

id 'com.github.johnrengelman.shadow' version '7.0.0'

tender shard
#

wait wtf?

#

grade cannot do that on its own?

eternal night
#

no

tender shard
#

ugh

hasty prawn
#

No, it's stupid lol

eternal night
#

gradle cannot do java on its own either

#

you also define a plugin for it

#

that is kind of the point

tender shard
#

well maven needs a plugin too but after all it's a plugin made by apache themselves lol, not some random github person

eternal night
#

I mean I wouln't call them random 😅

tender shard
#

he does look like a friendly dude lol

eternal night
#

xD but yea the plugin is the absolute industry standard

hasty prawn
#

It's still a bit silly, it's like if Spigot needed a plugin for events.

tender shard
#

yeah lol

patent horizon
#

imve hit roadblock

#

i got the shadowJar plugin installed, just not sure why shadowJar isnt working

#

doesn't look like there's anything in oraxen's gradle build that i've missed for it to work

dark arrow
#

how can i get radius around aplayer

patent horizon
#

vector

#

are you coming from skript?

dark arrow
#

?

tender shard
tender shard
patent horizon
tender shard
#

did you add the shadow plugin?

patent horizon
#

yes

tender shard
#

hm then I have no idea

#

just switch to maven already lol

patent horizon
#

cant

dark arrow
# tender shard get radius? whut?

i am creating a algorithm to spawn my special mobs around player so i want to get a radius of 20 blocks around player to spawn them randomly

patent horizon
#

im working on a server with a few other devs with a bit too much ocd

tender shard
tender shard
#

can you paste your whole build.gradle

patent horizon
tender shard
#

RIp my intellij became nothing but a black bar

patent horizon
#

it became a coffee shop

tender shard
#

and in the other window, all menus are empty lol

patent horizon
#

that theme omfg

mellow edge
#

why doesn't thatcode work?

tender shard
mellow edge
#
    public static Portal getPortalByLocation(Block b) {
        for(Portal p : CreatePortal.validPortals) {
            if(p.getBlocks().contains(b)) {
                return p;
            }
        }
        return null;
    }
tender shard
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

patent horizon
#

does not working

#

kek

mellow edge
#

I haven't finished

left swift
#

When I add the NoAI:1b tag when I summon an entity via command it uses the setNoAI() method?
Or is there any other mechanics?

patent horizon
#

treat this discord like stackoverflow

tender shard
mellow edge
#

when I use this code inside an event it doesn't find the Portal object:

patent horizon
mellow edge
#
    @EventHandler
    public void onGlobalPlayerMove(PlayerMoveEvent e) {
        Portal portal = Portal.getPortalByLocation(Objects.requireNonNull(e.getTo()).getBlock());
        System.out.println("portalcek");
        if(portal == null) return;
        System.out.println("passed portal check");
        portal.triggerTeleport(e.getPlayer());

    }
patent horizon
#

you should look into nms and code obfuscations if youre interested in those kinds of questions

#

it basically goes nms -> craftbukkit -> spigot

tender shard
patent horizon
tender shard
#

sorry wrong quote

#

I always quote the wrong person

patent horizon
#

yeh me

left swift
mellow edge
#

but why isn't it working

#

should it work

tender shard
patent horizon
#

second line?

tender shard
patent horizon
#

looks like smth built into kotlin

#

cus the origin class is called BuiltInPluginIDExtensions.kt

granite owl
#

any way to get RecipeChoice.ExactChoice workablefor shapeless recipes?

tender shard
#

well you can use workarounds like listening to the CraftItemPrepareEvent or however it's called

granite owl
#

i guess i can be happy it works for smelting already xD

tender shard
#

yeah the crafting API is a bit weird :<

granite owl
#

well exact choice does work for smelting recipes

#

xD

#

but not shapeless lol...

tender shard
#

yeah md_5 was probably drunk when he wrote this part

#

or it's a vanilla limitation, idk lol

zenith spire
#

How can i get the player from the InventoryMoveItemEvent?

tender shard
granite owl
tender shard
granite owl
#

theres no real reason

#

anyways

#

time to write a workaround

patent horizon
granite owl
#

i suppose i can not create anvil recipes xD

tender shard
patent horizon
#

yeh

tender shard
#

well I didn't update my kotlin plugin but it's definitely installed

zenith spire
tender shard
zenith spire
analog patrol
#

why i cant send images

#

bruh

#

anyways i cant change versions from any other then 1.12-R0.1-SNAPSHOT it shows me to click the 1.12 but when i try 1.8 it dosent wanna work it just stays red

tender shard
#

?verification

#

hm

#

well you need to get verified

analog patrol
#

?verify

#

umm

tender shard
#

there's a channel for it

#

I can't see it anymore because I am already verified

analog patrol
#

i dont have forum

#

wtf

#

i have to make forum account

tender shard
#

then just create an account

analog patrol
#

bruh

tender shard
#

it only takes like 1 minute

crisp steeple
#

guess you gotta use ascii art then

analog patrol
#

alr

#

done xd

#

it shows me like its only for this version

#

@tender shard

humble tulip
#

Just change it to 1.8.8-R0.1-SNAPSHOT

#

And reload the pom

analog patrol
#

Dependency 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT' not found

ivory sleet
#

did you declare the correct repository?

analog patrol
#

nvm

golden turret
#

why i can set the string into it but i cant get it back?

analog patrol
#

i did this and it works rn

#

xd

analog patrol
ancient plank
#

?paste

undone axleBOT
granite owl
#

why are PDC values having an extra 'b' letter at the end after loading them from a player file?

granite owl
#

they do

tender shard
#

no

#

they don't, this is just how minecraft shows it to you

granite owl
#

but they are not identical

#

to the directly from memory version

#

when i get a custom item and logoff logon / compare it to one generated from memory

tender shard
#

how are you even reading them? I guess you're using NBTAPI or something instead of PDC?

granite owl
#

i use pdc

tender shard
#

what's your code to store items?

granite owl
#

store?

#

u mean the values?

tender shard
#

I thought you were storing a whole itemstack

granite owl
#

what no i modify an itemstack like this

tender shard
#

yeah anyway, just ?paste your code

granite owl
#
public class DiamondDust
{
    protected static ItemWrapper item = null;
    
    static
    {
        ItemStack is = new ItemStack(Material.EMERALD, 1);
        
        ItemMeta meta = is.getItemMeta();
        meta.setDisplayName(ChatColor.RESET + "Diamond Dust");
        meta.setCustomModelData(2);
        is.setItemMeta(meta);
        
        item = new ItemWrapper(is, "diamond_dust");
        item.setItemTag("version", "1");
        item.setSmithable(Access.FALSE);
    }
    
    public static void register(main plugin)
    {
        DebugMenuCommand.debugMenuList.add(item.getItemStack());
        
        ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(plugin, "recipe_diamond_dust"), item.getItemStack());
        recipe.shape("AAA", "AAA", "AAA");
        recipe.setIngredient('A', new RecipeChoice.ExactChoice(new ItemStack(Material.COAL_BLOCK)));
        Bukkit.addRecipe(recipe);
    }
    
    public static ItemWrapper getItemWrapper()
    {
        return item;
    }
    
    public static ItemStack getItemStack()
    {
        return item.getItemStack();
    }
}
#

the itemwrapper is just a QoL wrapper to add pdc values

#

and read pdc values

humble tulip
#

If i made a better alternative to a plugin, can i post that my plugin is better than the other plugin?

humble tulip
#

So no?

tender shard
#

so just read the spigotmc rules

humble tulip
#

Ah ok will do

granite owl
#

@tender shard how can it be that one and the same item is no longer identical after login

tender shard
granite owl
#

with the one i store in memory

tender shard
granite owl
#
24.05 19:10:06 [Server] Async Chat Thread - #13/INFO [Admin]TheTimeee: OLD ORB
24.05 19:10:08 [Server] Server thread/INFO Key: version
24.05 19:10:08 [Server] Server thread/INFO Namespace: itemcontrol
24.05 19:10:08 [Server] Server thread/INFO Key: smithable
24.05 19:10:08 [Server] Server thread/INFO Namespace: itemcontrol
24.05 19:10:08 [Server] Server thread/INFO Key: item_type
24.05 19:10:08 [Server] Server thread/INFO Namespace: itemcontrol
24.05 19:10:08 [Server] Server thread/INFO Full Item Meta: UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"light_purple","text":"Everburning Orb"}],"text":""}, lore=[{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"white","text":"Requires Titanium Mantle."}],"text":""}, {"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"white","text":"Can be combined to Burning Blade."}],"text":""}], custom-model-data=10002, PublicBukkitValues={itemcontrol:item_type=everburning_orb, itemcontrol:version=1, itemcontrol:smithable=0b}}
#
24.05 19:10:15 [Server] Async Chat Thread - #13/INFO [Admin]TheTimeee: NEW ORB
24.05 19:10:20 [Server] Server thread/INFO Key: version
24.05 19:10:20 [Server] Server thread/INFO Namespace: itemcontrol
24.05 19:10:20 [Server] Server thread/INFO Key: smithable
24.05 19:10:20 [Server] Server thread/INFO Namespace: itemcontrol
24.05 19:10:20 [Server] Server thread/INFO Key: item_type
24.05 19:10:20 [Server] Server thread/INFO Namespace: itemcontrol
24.05 19:10:20 [Server] Server thread/INFO Full Item Meta: UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"light_purple","text":"Everburning Orb"}],"text":""}, lore=[{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"white","text":"Requires Titanium Mantle."}],"text":""}, {"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"white","text":"Can be combined to Burning Blade."}],"text":""}], custom-model-data=10002, PublicBukkitValues={itemcontrol:item_type=everburning_orb, itemcontrol:version=1, itemcontrol:smithable=false}}
#

not a prob

#

ive output the whole content to the console

tender shard
#

how are you comparing the items

granite owl
#
public static void register(main plugin)
    {
        DebugMenuCommand.debugMenuList.add(item.getItemStack());
        
        ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(plugin, "recipe_diamond_dust"), item.getItemStack());
        recipe.shape("AAA", "AAA", "AAA");
        recipe.setIngredient('A', new RecipeChoice.ExactChoice(new ItemStack(Material.COAL_BLOCK)));
        Bukkit.addRecipe(recipe);
    }
#

i dont compare them at runtime

#

i compare them with the recipe choice

buoyant viper
#

bumping this issue bc it will be a thorn in my side unless i just dont try to support the 3 types im having issues with

tender shard
#

wait why does "smitable" say false? what PDC type do you use

granite owl
#

i can show u

#
public boolean setSmithable(Access access)
    {
        switch (access)
        {
        case TRUE:
            this.setItemTag("smithable", "true");
            return true;
        case FALSE:
            this.setItemTag("smithable", "false");
            return true;
        case SIMILAR:
            this.setItemTag("smithable", "similar");
            return true;
        default:
            return false;
        }
    }
    
    public Access isSmithable()
    {
        switch (this.getItemTag("smithable"))
        {
        case "true":
            return Access.TRUE;
        case "false":
            return Access.FALSE;
        case "similar":
            return Access.SIMILAR;
        case "":
            return Access.TRUE;
        default:
            return Access.TRUE;
        }
    }
tender shard
#

IIRC yes

granite owl
#
public boolean setItemTag(String key, String value)
    {
        if (this.is != null)
        {
            if (this.is.hasItemMeta())
            {
                ItemMeta meta = this.is.getItemMeta();
                meta.getPersistentDataContainer().set(new NamespacedKey(main.getPlugin(main.class), key), PersistentDataType.STRING, value);
                this.is.setItemMeta(meta);
                return true;
            }
        }
        
        return false;
    }
    
    public String getItemTag(String key)
    {
        if (this.is != null)
        {
            if (this.is.hasItemMeta())
            {
                PersistentDataContainer pdc = this.is.getItemMeta().getPersistentDataContainer();
                NamespacedKey nKey = new NamespacedKey(main.getPlugin(main.class), key);
                
                if (pdc.has(nKey, PersistentDataType.STRING))
                {
                    return pdc.get(nKey, PersistentDataType.STRING);
                }
            }
        }
        
        return "";
    }
tender shard
#

you should use a byte instead of a string to store stuff like "true/false"

granite owl
#

ik but that comes later

#

so

tender shard
#

no I mean

#

that's why it's not working

granite owl
#

why

tender shard
#

the code to parse NBT tags is a bit weird

granite owl
#

i need to store things like the type as string though

#

to get which custom item it is

tender shard
#

you can easily do that but you get in trouble if you want to store "true" or "false" directly as string iirc

granite owl
#

still

buoyant viper
granite owl
#

why do the 2 items differ

tender shard
# buoyant viper pain

I am not sure. better just print out the type and see for yourself. sometimes what I say is just wrong lol

buoyant viper
#

bc it works just fine for short, int, long, double, boolean, and String

#

iirc

midnight shore
#

alex could i ask you a thing?

granite owl
#

oh now i see it

buoyant viper
granite owl
#

itemcontrol:smithable=0b

#

itemcontrol:smithable=false}}

tender shard
buoyant viper
#

so ur right that it is turning them into <Object>

granite owl
#

@tender shard wtf why does PDC change my values at will?

tender shard
granite owl
#

so its a vanilla flaw

#

that true and false strings get typecasted?

tender shard
#

yes I once opened an issue about this on jira

granite owl
#

ok ty at least now i know how to fix it

midnight shore
# tender shard just ask

how does your lib for data type work? i understand it serializes to byte but i'll like to make a serialization for my own classes so i'll love if you can tell me how does it work

granite owl
#

although this is stupid

#

so the vanilla serializer when i logoff

#

is janking my items?

#

xD

tender shard
granite owl
#

if ive got that right

tender shard
#

just take a look at my lib for example, e.g. at the ItemStack datatype

eternal night
#

it is a spigot flaw with the "true" string becomes a byte issue

#

a failure in implementation

#

there is an open issue about it but like

#

not a lot of people run into it because they just use the proper types

#

and It also only happens using the spigot yaml thing

#

which like

#

using that for item storage is kind of meh anyway

buoyant viper
#

yaml does seem to get a bit... Quirky... afterhours

tender shard
#

That was about it failing when parsing strings that look like json

eternal night
#

Yeaaaa

#

I just don't use yaml

#

thank god for paper item to byte

tender shard
#

Yeah spigot should add that too

eternal night
#

there is a PR that nearly does that

tender shard
#

If i only knew how to properly add pull requests to spigot lol

eternal night
#

I mean, plain copying paper code is also just

#

not very nice

buoyant viper
#

i mean

#

if its compatible with the license... 😎

eternal night
#

Yea sure you can do it

#

a lot of our stuff is MIT

tender shard
#

yeah I don't see problems with "stealing" code when the license allows it, because well that's what the license is for

eternal night
#

but you would have to recognise it

#

which is something I don't think spigot wants ?

#

like, they would have to include an MIT licence for the changes

tender shard
#

paper uses MIT? didnt know that

eternal night
#

some patches do

#

most don't

granite owl
#

changed datatypes working now beyond relog-ins ty

eternal night
#

some authors just decide to publish under MIT

tender shard
#

actually most of the time I give a shit about the license lol

granite owl
#

btw i doubt there are "correct" data types in PDC actually

#

because in the end everything is just a wrapper for String

#

xD

tender shard
#

well

#

more like a wrapper for byte[]

buoyant viper
#

all fun n games til somebody publishes their code under The Unlicense

granite owl
#

yea i mean like u give a byte array but its actually stored as string

#

same with ints

#

etc

crisp steeple
granite owl
#

the api just typecasts the string for u

tender shard
#

no it's stored as binary

#

that's why it's called NBT

eternal night
granite owl
#

well like ive said changed datatypes working now

buoyant viper
#

maybe it should Name some Bitches Then

granite owl
#

beyond relogs

#

xD

granite owl
#

cause the data doesnt get janked no more

tender shard
buoyant viper
#

what

tender shard
#

i don't know lol

#

non binary something

crisp steeple
buoyant viper
#

no binary transgender fenderbender

granite owl
#

also i need a ticket for the fact that Shapeless recipes dont work with ExactChoices which makes no sense to me

tender shard
eternal night
#

Well an exploit with this would be hard

tender shard
eternal night
#

Just a bug

crisp steeple
#

well

granite owl
#

i mean lets be honest i can just use a shaped recipe as dummy until the shapeless thing gets fixed eventually

tender shard
#

or fix it yourself and submit a PR 😛

left swift
#

Hi! I'm registering my custom entity type with armorstand model. I want now to create all properties that has an armorstand and currently everything works, but nor setSmall. I created all needed dataaccessors and I set it to small like normal armorstand, but doesnt work. Importaint info is that the Mob uses the same dataaccessor (15) and the same bit mask (1) to disable AI, so i overrided the isNoAi mothod that returns always false, but Idk why setsmall doesn't work :/

private static final EntityDataAccessor<Byte> DATA_CLIENT_FLAGS = EntityDataSerializers.BYTE.createAccessor(15);

    @Override
    public void setSmall(boolean small) { // TODO fix
        this.entityData.set(DATA_CLIENT_FLAGS, this.setBit(this.entityData.get(DATA_CLIENT_FLAGS), 1, small));
    }``` Other properties uses that dataaccessor (15) too, and works good.
granite owl
#

its just less convenient

crisp steeple
#

if you expected a string and instead got a byte/bool, it could cause some issues probably

#

unless getString sort of just implicitly casts it as well

buoyant viper
#

be me, expect a Byte[], get a fuckin Object[]

tender shard
#

and then it'll work fine

buoyant viper
#

in actuality i could probably just manually cast the items in the array to byte but

eternal night
#

Yea you are not getting a byte you just get nothing

buoyant viper
#

hhhh

eternal night
#

So the item won’t work

tender shard
#

the only problems I ever encountered is when a YAML is parsed, but that's more like a bug in the YAML<>PDC code and not in PDC itself I guess

eternal night
#

Or whatever

#

It is ^^

buoyant viper
#

mine issue is with normal yaml config stuff not items 😔

spiral hinge
#

Hey I need help because I am getting an error with an example for a dependency I am using for TOML.

The code:

    @SuppressWarnings("ResultOfMethodCallIgnored")
    public Toml loadConfig() {
        if(!getDataFolder().exists()) {
            getDataFolder().mkdirs(); // Creating the directory as it may not exist
        }
        File file = new File(getDataFolder(), "config.toml"); // Assign a variable to the file
        if(!file.exists()) {
            try {
                Files.copy(getResource("config.toml"), file.toPath()); // Copy the file out of our jar into our plugins Data Folder
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
        return new Toml(
                new Toml().read(getResource("config.toml"))) // We'll use our internal file as default to prevent errors
                .read(file); // Reads the file from the Data Folder of our plugin
    }

Error:

Cannot resolve method 'copy(InputStream, Path)'
crisp steeple
#

still cant remember half the time if its called a persistentdatacontainer or a personaldatacontainer

buoyant viper
#

persistent

tender shard
spiral hinge
tender shard
#

or wait, it's part of Files.copy right? then maybe your apache commons is simply too old to support this method

crisp steeple
eternal night
#

👀

tender shard
#

every itemstack has it's own personaldatacontainer

buoyant viper
#

honestly i wouldnt doubt that theres an NIO method to do it instead of apache

patent horizon
#

is there any way i could manually change the time it takes before the fish bubbles appear while fishing

buoyant viper
#

hehe fish

#

sorry that was automatic

tender shard
granite beacon
#

When trying to pass something like the instance of your plugin into another class what's the better practice?

  1. Creating a private static variable in the main and then making a public static method to get it
  2. Create an argument in the classes constructor and pass it thru there
spiral hinge
granite beacon
#

It should be #2 right?

tender shard
#

what's the import you used for the Files class?

tender shard
spiral hinge
tender shard
#

other people however say the first option is better because it's easier to use etc

granite beacon
granite beacon
#

It's more annoying but I feel like it's better

tender shard
#

in the end both are fine and you have to decide for yourself. I wrote a tiny blog post about it and from an "architectural" standpoint I agree that using a constructor to pass it is better, but I don't want to do thiy myself everytime so I simply use a static getInstance() method

tender shard
#

one sec

granite beacon
#

I'd love to read it

tender shard
#

it's really nothing interesting, I just wrote it for people who don't know about those two methods anyway yet

#

so there's nothing you'd be learning from it but I'll send it anyway 😄

granite beacon
#

😄

tardy delta
#

?di lol

undone axleBOT
tender shard
#

people keep saying "static getters are bad because it violates OOP stuff" and similar things but imho that's bullshit

#

I mean it's true but there's also nothing wrong in violating rules sometimes because well if doing something differently is easier and doesn't have any disadvantages, then there's no reason to stick to this rule in this specific case

granite beacon
granite owl
#
public static void registerUniqueRecipesTempFix(main plugin, String name, ItemStack precursor1, ItemStack precursor2, ItemStack result)
    {
        ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(plugin, "recipe_" + name + "_0"), result);
        recipe.shape("ABC", "CCC", "CCC");
        recipe.setIngredient('A', new RecipeChoice.ExactChoice(precursor1));
        recipe.setIngredient('B', new RecipeChoice.ExactChoice(precursor2));
        recipe.setIngredient('C', new RecipeChoice.ExactChoice(new ItemStack(Material.AIR)));
        Bukkit.addRecipe(recipe);
        
        recipe = new ShapedRecipe(new NamespacedKey(plugin, "recipe_" + name + "_1"), result);
        recipe.shape("ABC", "CCC", "CCC");
        recipe.setIngredient('A', new RecipeChoice.ExactChoice(precursor2));
        recipe.setIngredient('B', new RecipeChoice.ExactChoice(precursor1));
        recipe.setIngredient('C', new RecipeChoice.ExactChoice(new ItemStack(Material.AIR)));
        Bukkit.addRecipe(recipe);
        
        recipe = new ShapedRecipe(new NamespacedKey(plugin, "recipe_" + name + "_2"), result);
        recipe.shape("ABC", "CCC", "CCC");
        recipe.setIngredient('A', new RecipeChoice.ExactChoice(precursor1));
        recipe.setIngredient('B', new RecipeChoice.ExactChoice(StarDust.getItemStack()));
        recipe.setIngredient('C', new RecipeChoice.ExactChoice(new ItemStack(Material.AIR)));
        Bukkit.addRecipe(recipe);
        
        recipe = new ShapedRecipe(new NamespacedKey(plugin, "recipe_" + name + "_3"), result);
        recipe.shape("ABC", "CCC", "CCC");
        recipe.setIngredient('A', new RecipeChoice.ExactChoice(precursor2));
        recipe.setIngredient('B', new RecipeChoice.ExactChoice(StarDust.getItemStack()));
        recipe.setIngredient('C', new RecipeChoice.ExactChoice(new ItemStack(Material.AIR)));
        Bukkit.addRecipe(recipe);
    }
```behold my solution to fix the shapeless recipe until md_5 fixes shapeless recipes lol
#

thats so disgusting

tender shard
#

TL;DR my opinion is this

Choose one of the methods mentioned above. If you ask what’s better: in terms of OOP, Method #2 is cleaner. Some people might argue that this doesn’t matter, and that Method #1 is more comfortable. Both statements are true, so choose whatever you like.

granite beacon
#

Yeah I saw it

buoyant viper
#

FUK conventions, do what makes u happy

tender shard
#

for example I started out with passing the instance in the constructor and I got tired of doing this. If I pass it to any class anyway, why not just use a static getter in the first place. The real question should be "why do you even need your main instance everywhere? you shouldn't be needing it in most cases"

ivory sleet
#

I mean

#

for most spigot plugins going with the DI wont be of any help unless you might scale your project to other platforms

#

Ig if you start testing, then using DI will help

tender shard
#

true

#

thank god mockbukkit exists lol

ivory sleet
#

indeed

granite beacon
buoyant viper
#

persistent? sorry, we call it personal now

tender shard
tender shard
granite beacon
#

quick refactor

buoyant viper
#

and breaking about a lot of plugins

tender shard
#

"This build of spigot breaks all plugins that wrongly refer to the PersonalDataContainer by the old, wrong name, that was never intended to be used. It doesn't add any functionality beyond this. Have fun everyone updating your plugins"

granite beacon
tender shard
granite beacon
#

It was sarcasm

buoyant viper
#

forks Spigot, calls it Spigot-Personal, only change is PersistentDataContainer -> PersonalDataContainer

tender shard
#

well you wouldn't believe how many people don't understand why OOP is so awesome and they write huge weird classes every day

tender shard
tardy delta
#

:)

ivory sleet
#

x(

buoyant viper
#

change access to all fields to public

#

hmm

granite beacon
tardy delta
#

ye Bukkit.commandMap.get(uuid) would be great

tender shard
#

why the heck

#

I don't understand this error

#

never seen it before

#

also everyone pls be happy, I'm using darkmode in intellij again

ivory sleet
#

🙌

buoyant viper
tender shard
#

hm well it doesn't though

granite beacon
#

dracula > all other themes

tender shard
buoyant viper
#

i swear its called darcula

#

yes thank u hell

tender shard
#

no problem u heaven

granite beacon
#

It's not

buoyant viper
#

theres like an identical theme called dracula but the intellij version is called darcula

#

look in ur preferences

tender shard
#

included version is darcula

ivory sleet
#

anyway deep ocean is also quite nice and comfortable to code with

buoyant viper
#

@ancient plank is comfy to code with

tender shard
#

I just installed it and the font is huge

ivory sleet
#

lol

#

is it?

tender shard
#

yeah it's way bigger than in my previous screenshot

granite beacon
#

Oh I use the material version

quaint mantle
ivory sleet
#

dont think thats the themes fault

tender shard
#

hm weird

buoyant viper
tender shard
#

I simply entered that name in the intellij plugins window and used the default thing that it installed

quaint mantle
buoyant viper
#

some languages look good in it

quaint mantle
#

rust

buoyant viper
#

yeah that looks fine

tender shard
#

I just googled the "class loading deadlock" warning and it says this:

12

The deadlock can only occur if you have 2 threads and one starts to load User and one starts to load NonRegisteredUser. There are synchronizations in place that will cause a deadlock, but then it requires separate threads. If the loading happens in a single thread, there is no deadlock as the thread owns both locks.

Hence the might in the message. However deadlocks usually do tend to require a specific environment, so there's nothing weird about that.
Guess I'm fine then

#

also where's my money lebowski?

buoyant viper
#

hmm

tender shard
#

no it's spelt "hnnh"

#

RIP you cannot spell your own name

buoyant viper
#

give me a few more days ill probably be able to change it again

tender shard
#

oki no problem. we all do mistakes from time to time. except for me, everything I do is always correct and 100% perfect etc

fallow violet
#

this chat xd

left swift
#

Hi! I'm registering my custom entity type with armorstand model. I want now to create all properties that has an armorstand and currently everything works, but nor setSmall. I created all needed dataaccessors and I set it to small like normal armorstand, but doesnt work. Importaint info is that the Mob uses the same dataaccessor (15) and the same bit mask (1) to disable AI, so i overrided the isNoAi mothod that returns always false, but Idk why setsmall doesn't work :/

private static final EntityDataAccessor<Byte> DATA_CLIENT_FLAGS = EntityDataSerializers.BYTE.createAccessor(15);

    @Override
    public void setSmall(boolean small) { // TODO fix
        this.entityData.set(DATA_CLIENT_FLAGS, this.setBit(this.entityData.get(DATA_CLIENT_FLAGS), 1, small));
    }``` Other properties uses that dataaccessor (15) too, and works good.
buoyant viper
#

ASM is BSD-3-clause?! damn..

tardy delta
#

i once installed this whole thing aaaaa

buoyant viper
pearl wolf
#

hello everyone
in VSCode how to show the description of a method?
i sow somebody get the description of the methods if he hover to a method like getName() but in my VSCode it's just giving me the Import Path.

buoyant viper
#

make sure u have the Java extension pack downloaded and/or read the docs instead

tardy delta
#

not using vsc would be a good start

buoyant viper
#

?jd-s

undone axleBOT
quaint mantle
#

How to create an npc protocollib?

river oracle
#

If you use the jqva extension pack otherwise its no better than a notepad

#

Provides as many features as you need

tardy delta
#

mwoaa

golden turret
#

im using BukkitObjectOutputStream and BukkitObjectInputStream

tender shard
#

what exception is thrown?

#

@golden turret

golden turret
#

the EOFException

#

like

#

it deserializes the location

#

but it cant deserilize the string

#

here is me creating the streams

#

this is executed right after the creation of the inputstream

#

and it works fine

#

and next, a location is deserialized and also works

#

but the next string doesnt

#

?paste

undone axleBOT
golden turret
ivory sleet
#

yeah eof is usually when you read the wrong thing

#

out.writeUTF(infos.get(0).getWorld());
for (BlockDataInfo info : infos) {
out.writeObject(info.location());
out.writeUTF(info.data().getAsString());
}

#

here

#

write an int that tells the length of infos

#

and then read that int where you loop that many times

golden turret
#

the writing works fine

sterile token
#

Why the heck the shity mongo doesnt detect enum types?

ivory sleet
#

nah thats not the issue

golden turret
#

and the first string (infos.get(0).getWorld()) and the first location works fine too

ivory sleet
#

the issue is that the format is inconsistent

golden turret
#
String 1 - the world name

Location 1 - first location
String 2 - first string referent to the first location <--- error here```
sterile token
#

Why you still using PMC when you have redis or ws?

ivory sleet
#

//write
writeInt(infos.size())
for (var info : infos) {
  writeObject(info)
}

//read
var size = readInt(info.size())
for (int i = 0; i < size; i++) {
  info.add(readObject())
}
#

basically

golden turret
#

i will try that

ivory sleet
sterile token
#

And why mongo doesnt support enums?

tender shard
golden turret
#

because it is a string

tender shard
#

hm I always simply use readObject as conclure sent above

#

so no idea

spiral hinge
#

Hey so for some reason I cannot build my project with Maven because its saying that a dependency I am using doesn't exist or something.

Dependency section of my pom.xml

    <dependencies>
        <dependency>
            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.18.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.moandjiezana.toml</groupId>
            <artifactId>toml4j</artifactId>
            <version>0.7.2</version>
            <scope>shade</scope>
        </dependency>
    </dependencies>

Error:

package com.moandjiezana.toml does not exist
river oracle
#

just means that package don't exist maybe you aren't importing the repo ASakashrug

#

or your have the dependency set up wrong

#

only real 2 issues you could have

spiral hinge
#

Well it was working and stuff in my code because it auto suggested importing classes and what not

chrome beacon
#

How are you packaging the jar

river oracle
#

^ oh true thats important

#

Is there a delay for using OfflinePlayer? Just wondering as I'm creating player skulls and I don't want lagging while opening an inventory

#

checked docs but there wasn't really explanation ont here

tender shard
chrome beacon
#

^^

river oracle
#

player name cringe ASlaugh

tender shard
#

then you're fine. I do it like that too and at least noone ever complained lol

river oracle
#

player skulls are a pain

sterile token
river oracle
#

I'm shooting myself in the leg here

tender shard
sterile token
#

Sorry but i dont really know much about spigot

tender shard
#

so the plugin author themselves would have to make this run async

river oracle
#

you might beable to run that async but i'm not sure

#

eh you can theres your answer

tender shard
#

^

sterile token
#

I thought they have all offline uuid pre-catched

#

So then you dont have troubles with blocking

river oracle
#

what if you want a player thats never joined your server

tender shard
#

you can ALWAYS create an offline player object by UUID with no delay but as said, if you get them by name, the server has to check "to what UUID does this name belong"

sterile token
#

I know

#

But https are async so they cannot be blocking

#

🤔

river oracle
#

uhm

tender shard
#

I think you misunderstood something

ivory sleet
#

thats just not true verano

sterile token
#

I was told every http request = async, so then you dont block the main thread

tender shard
#

no

#

that's how you should do it

ivory sleet
#

^

tender shard
#

not how it's automatically done

ivory sleet
#

well in true programs there is no main thread

#

async is always subjective/relative

tender shard
#

for example ikevoodo's plugin did update checks every 5 minutes, blocking the main thread for like half a year lol

sterile token
#

Atleast that what does okiHttp

river oracle
#

most of the time you would want to request HTTP info on a different thread

#

so you don't block your main program

sterile token
#

😂

#

Isnt the same

river oracle
#

you can do this with offline player idk what your even asking at this point

tender shard
ivory sleet
#

http requests has no inherent notion of asynchronous dispatching

tender shard
#

also OkHttp is weird

ivory sleet
#

thats up to the developer

sterile token
#

You have better things!!!!

#

Http url connection its like comparing a ferrari with a fitito

tender shard
#

I always use HttpUrlConnections, there's nothing wrong with using them

sterile token
#

You dont have any object, nothing

#

Too much ass pain

tender shard
#

whut

#

are you drunk again lol

sterile token
#

Also with my friends we are experimenting shity problems, because we use custom reponse code

tender shard
#

of course you have an object, which is the HttpUrlConnection

sterile token
#

So while he send a code not provided by default, the f**d exceptions its trown

sterile token
tender shard
#

of course you have. it returns an InputStreamReader

sterile token
#

And sorry for being really ass pain

sterile token
quaint mantle
#
public class PlayerJoinListener implements Listener {

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent Event){
        System.out.println("plr join");
        Player P = Event.getPlayer();
        Inventory Inv = P.getInventory();

        ItemStack Settings = new ItemStack(Material.COMPARATOR,1);
        ItemMeta SettingsMeta = Settings.getItemMeta();

        SettingsMeta.setDisplayName(ChatColor.DARK_RED + "" + ChatColor.BOLD + "Settings");

        ArrayList<String> lore = new ArrayList<String>();

        Settings.setItemMeta(SettingsMeta);

        Inv.setItem(9, (ItemStack) SettingsMeta);

    }

}

i'm trying to give a player an item when they join but it isn't working can anyone help me

sterile token
#

?not-working

tender shard
tender shard
sterile token
#

Oh thanks

#

mfalex, so any answer to using custom http response code?

left swift
#

Hi! I'm registering my custom entity type with armorstand model. I want now to create all properties that has an armorstand and currently everything works, but nor setSmall. I created all needed dataaccessors and I set it to small like normal armorstand, but doesnt work. Importaint info is that the Mob uses the same dataaccessor (15) and the same bit mask (1) to disable AI, so i overrided the isNoAi mothod that returns always false, but Idk why setsmall doesn't work :/

private static final EntityDataAccessor<Byte> DATA_CLIENT_FLAGS = EntityDataSerializers.BYTE.createAccessor(15);

    @Override
    public void setSmall(boolean small) { // TODO fix
        this.entityData.set(DATA_CLIENT_FLAGS, this.setBit(this.entityData.get(DATA_CLIENT_FLAGS), 1, small));
    }``` Other properties uses that dataaccessor (15) too, and works good.
sterile token
tender shard
quaint mantle
#
public final class CallousPvP extends JavaPlugin {

    @Override
    public void onEnable() {

        getServer().broadcastMessage("callous pvp started");
        getServer().getPluginManager().registerEvents(new PlayerJoinListener(), this);

    }

}
tender shard
# quaint mantle no

did you check whether that line appears in the console? I'm not talking about the ingame chat

tender shard
quaint mantle
#

cuz im using pebble host for the server

river oracle
#

is your plugin loading properly

tender shard
quaint mantle
#

yes

tender shard
#

in green?

quaint mantle
#

yes

tender shard
# quaint mantle yes

then I guess you're not using the proper .jar or something because the code should at least always print "plr joined" when some joins if you don't get any errors

#

you can add tags to entities or sth like that

quaint mantle
#

do i use the snapshot jar or the original jar

tender shard
#

yes you can use Entity#addScoreboardTag("somestring") and then check in EntityDamageByEntityEvent if the damager has this tag, and if yes, cancel the event

#

oh wait

#

a better way would be to use Entity#setMetadata

#

then you don't need scoreboard tags

#

that's what I actually meant

river oracle
#

how do I make it so parameter names stick when I deploy my API with maven

#

wait nvm I'ma just look this up

#

lmfao

tender shard
river oracle
tender shard
rotund pond
#

And you cast your itemmeta as an itemstack for no reason

river oracle
#

?paste

undone axleBOT
tender shard
quaint mantle
#

pebblehost is stupid

#

i think AyUniz is right

tender shard
#

google "maven attach deploy sources" or sth

river oracle
#

yea idk why i didn't just look it up lol

tender shard
#

although tbh I thought that parameter names will be kept even without attaching sources

#

attaching sources unfortunately is very tedious if you have a multiple-module pom

sterile token
#

why the hell any java http library support custom reponse codes?

tender shard
#

but you don't use modules so just attach the sources and then you're fine

tender shard
#

the response code is just an int

#

why would any library NOT support it

#

i use custom response codes all the time

sterile token
#

I dont know

#

Its explote

#

Explote in the way of causing an exception

#

And we endup with the cause of it where the custom reponse codes

tender shard
#

I suggest to simply use a HttpUrlConnection and catch the IOException that it might throw

sterile token
#

But its really harcoded

#

And we dont like harcoding with my friend

#

Bu t in fact thanks

tender shard
#

hardcode what?

river oracle
#

Stupid question but PlayerHeads have skull meta correct?

tender shard
river oracle
tender shard
#

PlayerProfile was added in 1.18.2 or 1.18.1 and it's basically just a wrapper for the NMS "GameProfile" class

#

so actually using a PlayerProfile does the same thing

#

e.g. check out line 48. you have to create a new GameProfile with a random UUID, then you can set it's textures field to some base64 value and then just use the Skull class to set the owning player

river oracle
#

?paste

undone axleBOT
river oracle
tender shard
#

oh you use URLs directly

river oracle
#

idk I just found it tbh

tender shard
#

I wouldn't do that. for example on mcskins or what's it called, you can simply copy paste the base64 directly

river oracle
#

I was looking for something that used skin urls but this won't work

tender shard
#

one second I'll send a link

#

scroll down to the second lowest field ("value")

#

its just a base64 string that translates directly to the json string that contains the url
{"textures":{"SKIN":{"url":"http://textures.minecraft.net/texture/7f21052d18a1ed6e7073384830e7b285310a7dc0a80b36431db654d3e3dae8d0"}}}

#

you can directly use this base64 encoded string in a new GameProfile

#

and yeah that's how I always do it. since admins are used to use base64 strings for textures anyway

quaint mantle
humble tulip
#

Is it common practice to make my spigot plugin have a bungee counterpart to talk to other servers?

tender shard
#

most plugins don't need anything like that

humble tulip
#

It's one that'll allow chatting across servers but it also has some gui stuff

#

I also need to knownif the player received the message

tender shard
#

well if it's a "cross-server-chat" then obviously you want to create a bungee plugin lol

humble tulip
#

So i guess this is a valid usecase to have both a spigot and bungee plugin?

tender shard
#

just use the plugin message channel to send messages to the other servers

tender shard
#

you definitely need a spigot plugin for the gui and stuff

#

the chat itself could easily be bungee-only

#

unless you also want to allow it to run on normal spigot servers

humble tulip
#

Yep i do

tender shard
#

btw you can create a .jar file that runs on both spigot and bungee. simply create a plugin.yml that has points to your spigot main class and also a bungee.yml that points to your bungee main class. then you can use the same .jar on both spigot and bungee

humble tulip
#

Ik

tender shard
#

oh ok

humble tulip
#

Bungee.yml and plugin.yml

tender shard
#

yeah

#

many people don't know that so I always mention it 😄

humble tulip
#

Haha thanks tho

river oracle
tender shard
#

also you should probably decide whether you want to use stuff like redis or if you only rely on spigot plugin messaging. if you go the plugin messaging way than you can always only send messages to servers who have any online players, which might be bad if you also want console to be able to read the chat messages, even if noone is online on tha tserver

humble tulip
#

Well not solely chat but idc abt empty servers

tender shard
#

after all the admin could still just open the bungee console instead

tender shard
river oracle
humble tulip
tender shard
#

imagine you have lobby, survival and skyblock

humble tulip
#

Ye

tender shard
#

the admin looks at the skyblock console while noone is online there

#

now someone chats on the survival server, which normally would be broadcasted to the skyblock server too

#

but the admin who only looks at the skyblock console cannot see the message now

#

that's what I meant

humble tulip
#

Creating logs as well

tender shard
#

yes

humble tulip
#

?pdc

humble tulip
#

What exactly you mean by metadata?

tender shard
#

no

#

only have entities have "metadata"

#

pdc is similar to metadata

#

and even better

#

but ItemStacks do NOT have metadata

#

no idea

eternal night
#

no

river oracle
#

nah

tender shard
#

that versions is like 100 years old

river oracle
#

atleast its not 1.8 guys

#

look on the bright side

tender shard
#

you have to use NBT tags on 1.12

river oracle
#

why are you using 1.12 since you have no pvp gripe with it

tender shard
#

either with NMS or use a library like NBTAPI

#

If I was you, I'd first think about why I do 1.12 plugins in 2022 and then after that I'd just use NBTAPI

river oracle
#

1.12

tender shard
#

1.12*

#

typo

river oracle
#

atleast with 1.8 they can argue something but 1.12 I don't get

tender shard
#

many servers stopped upgrading after 1.12 because 1.13 broke so many old plugins

river oracle
#

1.13 have some major nms changes?

tender shard
#

1.13 got rid of all the numeric item IDs

humble tulip
#

Has major api changes as well

river oracle
#

ohhh yea