#help-development

1 messages · Page 581 of 1

wet breach
#

well anyone can do it, just have to understand the stuff you have at your disposal is all. There was a lot of information that was not saved because it was unnecessary, so for example only coords were saved because they are smaller, and they were saved in a similar fashion mojang does which is yxz because in terms of looping, y is smaller and that is good for your outer loop

vital sandal
#

may I PM you for some more question about these stuffs?

wet breach
#

also, they were able to apply error correction too

#

the nifty part I love about memory mapping is that the OS will take care of saving your file if the application just suddenly quits 😛

quiet ice
#

Ah error correction is something I should really start implementing in my plugins

sage patio
#

i forgot how i can get a List of String from a configuration file like this:

test: 5
test2: 7
...
test82: 972

the list shold be like test, test2, ..., test82

#

iirc it was a configuration section or something

vital sandal
#

getKeys()

sage patio
#

false?

vital sandal
#

yeh

green prism
#

Well, this is not working for sure

    @EventHandler
    public void onInventoryDrag(InventoryDragEvent event) {
        Inventory draggedInventory = event.getInventory();
        Inventory topInventory = event.getView().getTopInventory();

        if(draggedInventory.getType() != InventoryType.PLAYER) return;
        if(topInventory.getType() == InventoryType.PLAYER) return;

        if(!KingUtil.isCrown(event.getOldCursor())) return;

        event.setCancelled(true);
    }
sage patio
#

thanks

wet breach
#

so not only will I still see it, but it allows others to provide input as well

vital sandal
livid dove
#

Thats Player, Action, Coordinate, Time etc

wet breach
#

yep

#

that was the other thing I showed them, was how to utilize bitmasking

#

to squeeze info down

livid dove
#

With my napkin maths and bumbling around, you could probs get a 10GB file down to less than 600Mb

wet breach
#

well depends how much overall info is in that 10GB

livid dove
#

*as in the current SQl based systems used by a lot of loggin plugins

wet breach
#

most of the time its 10GB because there is too much empty space everywhere

#

like bytes having only half the bits of information stored in it and not using an entire byte

#

in that case, you could squeeze 2 pieces of info in a single byte

livid dove
#

This is sort of the bit im a wee bit upset about in our communities (including paper). Noone has sat down and just... done it...

#

We still working on "really respectable and renown" plugins that, in reality, could be 10x better

wet breach
#

fyi, bukkit would have had auto correcting chunks if they accepted my PR some years ago when I was part of the bukkit dev staff 😛

#

they rejected it because they were lazy and didn't want to maintain it even though it wouldn't be difficult

livid dove
#

shrugs
Is what it is.

green prism
wet breach
#

the only more part about them rejecting my PR wasn't just they didn't want to maintain it, it was that they acknowledged it was a good idea to have it and that it should instead of the current implementation of just crashing like they had it

wet breach
vital sandal
#

still have no idea how to load a chunk :l to modify its block

wet breach
#

only thing that is annoying with messing with inventories depending on what you are trying to prevent lol

echo basalt
#

parity data go brr

green prism
# wet breach you need to also listen for the click event
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {

        if(event.getClickedInventory() == null) return;

        if(event.getCurrentItem() == null) return;

        if(event.getClickedInventory().getType() != InventoryType.PLAYER) return;

        if(KingUtil.isCrown(event.getCurrentItem())) {

            if (event.getAction() == InventoryAction.MOVE_TO_OTHER_INVENTORY) {
                event.setCurrentItem(null);

                if (!KingCycleTask.isRunning())
                    new KingCycleTask((int) KingCycleTask.DEFAULT_DURATION.getSeconds(), false);
            }
        }

    }
echo basalt
#

mhm static

#

fun!

green prism
green prism
wet breach
echo basalt
#

pretty sure I did some checks to move inv contents within their own invs

#

few months ago

wet breach
#

I am thinking its probably going to be something to do with their static methods

#

but I am not entirely sure

green prism
echo basalt
#

yeah that new KingCycleTask object

#

that's just.. weird

wet breach
#

Also, you are testing while in survival correct and not in creative mode?

echo basalt
#

yo frosty btw I did the extraction a couple hours ago

#

went fine

wet breach
#

sweet

echo basalt
#

got a stitch

#

gotta go back next week at like 10am

livid dove
echo basalt
#

no I had a tooth extraction

livid dove
#

oh eww

wet breach
echo basalt
#

for a badly broken tooth

#

am on painkillers now thumbsup

livid dove
echo basalt
#

gotta do the math but the whole procedure was like 100 bucks

livid dove
#

Oooft

echo basalt
#

they let me listen to music for the half hour it took

#

even put a mask over my eyes so I was comfy

#

8/10

livid dove
green prism
echo basalt
#

Nah it was no drill

livid dove
#

Oh shit they used an ice ccream scoop?

echo basalt
#

just anasthesia and some strong pliers

wet breach
#

Anyways, I would add some debug messages in your code for the events

echo basalt
#

they almost choked me out a couple times but I'm alive

#

their ice packs are garbage tho

livid dove
# wet breach just making sure

Might end up adding the smallest sanity check in and put a universal "if you do a command in creative mode, the server sends you a big obnoxious title reminding you you are in creative" lol

wet breach
#

so you can see what exactly is or is not being executed I would also temporarily just comment out your static methods so to be sure it isn't interfering

livid dove
#

Ohhhhhh

#

Frost we havent asked the first and most holy of questions

#

...

#

have you checked the console to see if you are getting errors

echo basalt
#

is shrek god?

livid dove
echo basalt
#

I gotta write a search index post about debugging and reading exceptions

#

I also gotta shave

#

and get some lunch

wet breach
echo basalt
#

aka literal soup because I can't eat anything else for the next couple days

livid dove
echo basalt
#

nah just like

#

how to read exceptions

#

and problem-solve

livid dove
wet breach
#

or even an error

echo basalt
#

futures

livid dove
#

True true.

MockBukkit it is then

echo basalt
#

lmao

quaint mantle
#

how do i set the final dmg in a dmg event

echo basalt
#

setFinalDamage or something

quaint mantle
#

cus i want to ignore armor aswell

green prism
# wet breach so you can see what exactly is or is not being executed I would also temporarily...
@EventHandler
    public void onInventoryDrag(InventoryDragEvent event) {
        Inventory draggedInventory = event.getInventory();
        Inventory topInventory = event.getView().getTopInventory();

        System.out.println("Dragged: 1");

        if(draggedInventory.getType() != InventoryType.PLAYER) return;


        System.out.println("Dragged: 2");

        if(topInventory.getType() == InventoryType.PLAYER) return;


        System.out.println("Dragged: 3");

        if(!KingUtil.isCrown(event.getOldCursor())) return;


        System.out.println("Dragged: 4");

        event.setCancelled(true);


        System.out.println("Dragged: 5");
    }


quaint mantle
wet breach
green prism
#

I think the problem is not the static-methods usage

echo basalt
livid dove
echo basalt
#

basically it returns the inventory that was clicked

vital sandal
#

Minecraft Chunk processing

livid dove
#

OH HAHAHAHA

#

Get TOP inventory

#

Chief

#

buddy

#

pal

#

Ur top inventory is never going to be a player

echo basalt
#

HAHAHAHA

#

grr

wet breach
quaint mantle
# quaint mantle

could just set the dmg and just set the health to current health - final dmg?

echo basalt
#
Inventory source;
Inventory target;
ItemStack item;

Inventory top = event.getView().getTopInventory();
Inventory bottom = event.getWhoClicked().getInventory();

if(event.isShiftClick()) {
  source = event.getInventory();
  target = (source == top ? bottom : top); // opposite
  item = event.getCurrentItem();
} else {
  target = event.getInventory();
  source = (target == top ? bottom : top); // opposite
  item = event.getCursor();
}
#

bit stupid

wet breach
#

the inventory you are trying to prevent dragging is the inventory that isn't the players correct?

green prism
livid dove
#

Its always going to be not a player

#

so returns

#

without doing jack shit

green prism
#

if(topInventory.getType() == InventoryType.PLAYER) return;

#

==

#

yeah, it's useless, but I was desperate

livid dove
#

Ohhh wait sorry I am an utter moron

#

ignore me

wet breach
#

remove the checks where you are returning unnecessarily

dry forum
#

would it be possible to make a 3x3 cube rotate

wet breach
#

becuse this can cause the rest of the block of code to not run

hard socket
#

I have my plugin.yml what?

chrome beacon
hard socket
#
version: '${project.version}'
main: me.psikuvit.betterdragonfight.BetterDragonFight
api-version: 1.13
livid dove
#

Yeah alos @green prism where is the crown code. I DEMAND CROWN CODE xD Lmao

chrome beacon
hard socket
#

artifact

chrome beacon
#

Use maven or gradle

hard socket
#

maven

#

this is the first I get this error in years

chrome beacon
#

Artifact isn't maven

#

Looks like it

quaint mantle
chrome beacon
#

Maven tab find package

#

And then click that

chrome beacon
hard socket
#

ok done

shadow night
#

,_,

green prism
# wet breach remove the checks where you are returning unnecessarily
    @EventHandler
    public void onInventoryDrag(InventoryDragEvent event) {
        Inventory draggedInventory = event.getInventory();
        Inventory topInventory = event.getView().getTopInventory();

        System.out.println("Dragged: 1");

        if(draggedInventory.getType() == InventoryType.PLAYER) return;

        System.out.println("Dragged: 3");

        //if(!KingUtil.isCrown(event.getOldCursor())) return;


        System.out.println("Dragged: 4");

        event.setCancelled(true);


        System.out.println("Dragged: 5");
    }
hard socket
echo basalt
#

oh yeah

#

welcome to InventoryDragEvent

#

where if you move a single pixel when dropping an item

#

it fuckin counts as a drag and clickevent doesnt fire

green prism
#

wtf

#

What can I do now? lmao

echo basalt
#

listen to the drag event and do crazy frog checks

green prism
#

lmao

quaint mantle
#

Lemme rephrase,
How do i set the final damage in a EntityDamageByEntity event,
i want to ignore armor and stuff like that.
Setting the dmg to 0 and just setting the health doesnt work well

wet breach
#

the current inventory in that gif, is a chest inventory not a player inventory

#

so you need to make use of the methods of checking bottom or top inventories

#

@livid dove see example right here where mockbukkit wouldn't catch this if this turns out to be the problem. The check coded is valid, just incorrect in what they need to check for 😛

wet breach
quaint mantle
#

?paste

undone axleBOT
quaint mantle
wet breach
#

or is it that the damage being applied is being hindered by the armor?

quaint mantle
#

this is the output when hitting someone with full netherite

wet breach
#

so final damage needs to be higher?

quaint mantle
#

yea

wet breach
#

then it would appear your math is flawed in that then

#

I am not sure how much higher it needs to be, but if it needs to be higher then the initial damage I would add a check in there to ensure final damage isn't equal or less then the initial

quaint mantle
#

ill show this

wet breach
#

to help with your math

quaint mantle
#

the math isnt wrong

#

its just that minecraft still applies modifiers after setting the damage

#

like armor and stuff

wet breach
#

that means your math is wrong because you are not factoring the modifiers

#

you can easily get these modifiers and counter said modifiers

quaint mantle
#

well thats the thing, i dont wanna factor in the modifiers

#

well fair

wet breach
#

well without modifying armor stats, you need to

patent fox
#

I want to make a custom player wrapper like this: public class CPlayer implements Player

But it wants me to implement all the methods.

Is there an easier way to make a wrapper for the Player object?

(So I can use CPlayer cplayer = (CPlayer) player)

quaint mantle
#

also

#

completetly different thing (kinda):
How do i make a weapon have a longer hit cooldown

wet breach
patent fox
#

it wants to implment all the methods in the player class

wet breach
#

thats fine?

patent fox
wet breach
#

also fine?

#

do you need them to return anything?

#

if so, make them return something

#

otherwise, leave them null lol

#

but you can just get those values from the initial player object

#

make your custom player object take in as a parameter the player object

wet breach
#

you mean the interval between swinging?

patent fox
#

For example after the implementition:

@Override
public String getName() {
    return null;
}
quaint mantle
quaint mantle
wet breach
#

you will have to modify the attributes or modifiers of the weapon to change its attack speed

#

attack speed should be higher I think to make it slower?

#

or maybe its lower, either way you need to change that

#

and I believe you will need NMS for that

wet breach
quaint mantle
#

this should set the attack speed to 0 right? if its a wooden sword (default 1.6)

wet breach
#

possibly, I haven't messed with attributes in a while

#

but I did forget that the API has some attributes related things

dire bluff
#

guys any idea how to add custom model data in crafting

#

bcs it doesnt work for me

quaint mantle
#

but what doesnt work

#

show an error or smt

dire bluff
#

wait this is what im doing

river oracle
dire bluff
#

im sure it is this model bcs i've putted this mode in gui

#

also

#

also there is no rename no lore

river oracle
#

the recipe in your screenshot is not the recipe in your code

#

they are different

dire bluff
#

yea this is also a peroblem

#

WTF

vast ledge
river oracle
#

I assume they know that?

livid dove
dire bluff
#

OH TRUE

dire bluff
sage patio
#

any idea how i can hide player name tags with permissions?

vast ledge
sage patio
#

the name tag on the players head right?

sage patio
dire bluff
#

even wurse it doesnt do anything xD

chrome beacon
wet breach
chrome beacon
#

You don't need packets for teams though

sage patio
#

yea right, thanks

chrome beacon
#

Spigot api can do what you want

livid dove
sage patio
wet breach
sage patio
#

i want to see the player names with permissions, for example if i have test.test permission i can see the names

livid dove
sage patio
livid dove
sage patio
livid dove
chrome beacon
livid dove
#

I call it "finding the triangle".

You're trying really hard to find the right shaped square to solve ur problem, when in reality, you might of been looking for a triangle all along

hard socket
#

how can I stop the ender dragon from going to 0, 0

#

this is EnderDragon class from nms

dire bluff
#

im rll confused why it doesnt work

#

can someone help me

chrome beacon
#

?conventions

chrome beacon
#

That should be throwing an error btw

#

You're not using a valid namespaced key

dire bluff
#

mine?

chrome beacon
#

Yes

#

Also follow naming conventions

dire bluff
chrome beacon
#

They should be lower case and they can't contain spaces

dire bluff
#

ooooooooooooooooohhh

#

ty

green plaza
vital sandal
chrome beacon
#

What part do you need help with

vital sandal
#

decode the chunk data :l

chrome beacon
#

You've already gotten all the information you need for that though?

vital sandal
#

I want to remove the layer 0-5

vital sandal
#

the reference above is every packet that player receive in a few seconds

green prism
carmine mica
#

it is consistently triggered

#

whenever the mouse moves 1 pixel between down and up

green prism
#

Nope

chrome beacon
#

It is

carmine mica
#

you just aren't being consistent with your clicks

green prism
carmine mica
#

you cannot move the mouse at all between mouse down and up if you don't want it to fire

chrome beacon
#

You're just clicking randomly

green prism
#
    @EventHandler
    public void onInventoryDrag(InventoryDragEvent event) {
        Inventory draggedInventory = event.getInventory();
        Inventory topInventory = event.getView().getTopInventory();

        //if(!KingUtil.isCrown(event.getOldCursor())) return;

        event.setCancelled(true);

    }
#

Should be always cancelled

carmine mica
#

are you also listening to the click event?

#

cause the drag event isn't fired if the mouse doesn't move

carmine mica
#

you have to listen to both events if you want to capture all inventory manipulation

green prism
# carmine mica you have to listen to both events if you want to capture all inventory manipulat...
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {

        if(event.getClickedInventory() == null) return;

        if(event.getCurrentItem() == null) return;

        if(event.getClickedInventory().getType() != InventoryType.PLAYER) return;

        if(KingUtil.isCrown(event.getCurrentItem())) {

            if (event.getAction() == InventoryAction.MOVE_TO_OTHER_INVENTORY) {
                event.setCurrentItem(null);

                if (!KingCycleTask.isRunning())
                    new KingCycleTask((int) KingCycleTask.DEFAULT_DURATION.getSeconds(), false);
            }
        }

    }


    @EventHandler
    public void onInventoryDrag(InventoryDragEvent event) {
        Inventory draggedInventory = event.getInventory();
        Inventory topInventory = event.getView().getTopInventory();

        if(draggedInventory.getType() == InventoryType.PLAYER) return;

        if(!KingUtil.isCrown(event.getOldCursor())) return;


        System.out.println("Dragged: 4");

        event.setCancelled(true);
    }

[18:38:08 INFO]: [CrownSystem] [STDOUT] Dragged: 4

carmine mica
#

right, and you are wondering why they aren't all canceled. its cause you aren't canceling the click event?

#

so its only cancelling the drag event

green prism
#

Click event cancels shift-drag clicks actually

#

I am trying to prevent players from dragging out of their inventory a specific item

carmine mica
#

yeah, I understand. but you also have to cancel the click event for that item, because they can move the item while only firing the click event

green prism
#

aw shit

#

thank you

green prism
# carmine mica yeah, I understand. but you also have to cancel the click event for that item, b...
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {

        if(event.getClickedInventory() == null) return;

        if(event.getCurrentItem() == null) return;

        if(event.getClickedInventory().getType() != InventoryType.PLAYER) return;

        if(KingUtil.isCrown(event.getCurrentItem())) {

            if (event.getAction() == InventoryAction.MOVE_TO_OTHER_INVENTORY) {
                event.setCurrentItem(null);
                event.setCancelled(true);

                if (!KingCycleTask.isRunning())
                    new KingCycleTask((int) KingCycleTask.DEFAULT_DURATION.getSeconds(), false);
            }
        }

    }


    @EventHandler
    public void onInventoryDrag(InventoryDragEvent event) {
        Inventory draggedInventory = event.getInventory();
        Inventory topInventory = event.getView().getTopInventory();

        if(draggedInventory.getType() == InventoryType.PLAYER) return;

        if(!KingUtil.isCrown(event.getOldCursor())) return;


        System.out.println("Dragged: 4");

        event.setCancelled(true);
    }
#

It works, sometimes

#

lmao

#

Any idea?

quaint mantle
#

?paste

undone axleBOT
chrome beacon
#

Add some debug messages

green prism
#

It works 2 times out of 10

worldly ingot
#

Because the drag event isn't a click event

green prism
#
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {

        if(event.getClickedInventory() == null) return;

        if(event.getCurrentItem() == null) return;

        if(event.getClickedInventory().getType() != InventoryType.PLAYER) return;

        if(KingUtil.isCrown(event.getCurrentItem())) {

            if (event.getAction() == InventoryAction.MOVE_TO_OTHER_INVENTORY) {
                event.setCurrentItem(null);
                event.setCancelled(true);

                if (!KingCycleTask.isRunning())
                    new KingCycleTask((int) KingCycleTask.DEFAULT_DURATION.getSeconds(), false);
            }
        }

    }
worldly ingot
#

A lot of what you're doing in that gif is clicking. The reason it only works 2 of 10 times is because you're likely accidentally sliding your mouse when placing it

#
if (!KingCycleTask.isRunning())
    new KingCycleTask((int) KingCycleTask.DEFAULT_DURATION.getSeconds(), false);```
This screams bad design
green prism
worldly ingot
#

Most things are covered by the click event with different actions

#

Though you really only need to be cancelling dragging and clicking

green prism
# worldly ingot Most things are covered by the click event with different actions

So... something like this?

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {

        if (event.getClickedInventory() == null) return;

        if (event.getCurrentItem() == null) return;
        
        if (KingUtil.isCrown(event.getCurrentItem()) && event.getClickedInventory().getType() != InventoryType.PLAYER) {

            //event.setCurrentItem(null);
            event.setCancelled(true);

           **Censored**
        }

    }
worldly ingot
#

If that's what you want to do then yeah

#

Still offput by the KIngCycleTask snippet

green prism
worldly ingot
#

Well #getClickedInventory() would give you that

#

How you choose to verify that is up to you

young knoll
#

(Don’t use holder)

green prism
# worldly ingot Well `#getClickedInventory()` would give you that

I would like to do the reverse thing, block the item transfer from the player's inventory to another inventory of another type but still make it possible to move within one's own (armor slot included)
This code does exactly the opposite unfortunately

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {

        if (event.getClickedInventory() == null) return;

        if (event.getCurrentItem() == null) return;

        if (KingUtil.isCrown(event.getCurrentItem()) && event.getClickedInventory().getType() != InventoryType.PLAYER) {

            //event.setCurrentItem(null);
            event.setCancelled(true);
        }

    }
vivid cave
#

how to check if an item has a tag ?

#

i wanna check if an itemstack has the org.bukkit.Tag.ITEMS_TRIMMABLE_ARMOR

young knoll
#

Tag#matches iirc

vivid cave
#

Tag#isTagged

#

i'm unsure of what parameter i pass tho tbh
it's indicated a generic type

#

Do i put ItemStack, Material ?

#

i guess itemstack

#

i'll try and see

#

doesn't work

young knoll
#

Material

vivid cave
#

ooo

#

thx

#

yeah im dumb

#

T refers to the type that is between <> for my specific tag

#

idk why sometimes my brain is in outer spac

keen mantle
#

Is SQLite good?

quartz valve
keen mantle
pseudo hazel
#

wdym

#

using a hashmap instead of a database?

#

thats a pretty weird comparison

#

better in what way? memory footprint? look up speed? code efficiency?

wet breach
keen mantle
#

ok, thnx

pseudo hazel
#

that too

#

but I thought that was the obvious part xD

wet breach
pseudo hazel
#

if you want permanent storage for a lot of data, use a database, if you just want to store some valuea at runtime use a hashmap

#

fair enough

keen mantle
#

ok

pseudo hazel
#

sometimes its hard to come up with obvious things that people have misunderstood though

keen mantle
#

just confused with that

#

understood, thnx

wet breach
#

well, you would use SQLite because you maybe want to save some information in a more permanent way IE if server restarts you can re-obtain it again

keen mantle
#

so SQLite for permanent big data storage.

#

hashmap for things that needed only for time

wet breach
#

While you could definitely put big data into an sqlite file, it generally suffers when you do so because it isn't designed for super large data sets

keen mantle
#

ok

tender shard
quaint mantle
#

ignoring armor modifiers and stuff

chrome beacon
#

Highly recommend just hooking an existing plugin and adding what you want

vivid cave
#

Why can't I cast ArmorMeta to ColorableArmorMeta ?

#

ColorableArmorMeta is a subinterface of ArmorMeta

worldly ingot
#

ColorableArmorMeta only applies to leather armour

#

So if you're not doing it to leather armour, it won't let you

wet breach
#

if it passes the instanceof check, you can cast it

#

otherwise if it fails you can't

vivid cave
worldly ingot
#

I don't know what you're trying to do lol. You didn't give us a goal

vivid cave
#

uhm ok hold on,

#

its hard to formulate haha

#

I want a class which is extremly alike ColorableArmorMeta, but compatible with non leather armour too (I specify myself what the methods getColor and setColor should do if they are not leather armor,)

worldly ingot
#

Okay, so like frostalf said, you can check if the meta is instanceof ColorableArmorMeta before casting and doing something with it

quaint mantle
#

How do I get an instace of a EntityDataSerializer for a SynchedEntityData#register

worldly ingot
#
public void setColor(Color color) {
    if (meta instanceof ColorableArmorMeta colorableMeta) {
        colorableMeta.setColor(color);
    } else {
        // Do something for non colorable armor if you want
    }
}```
vivid cave
#

so meta would be of type ArmorMeta

#

i see

vivid cave
tawdry monolith
#

how do I make multiple types of the same item in one crafting slot?

young knoll
#

meta does not change, no

#

colorableMeta is made as a new variable with type ColorableArmorMeta

dire bluff
#

how to make each material costs different quantry in the crafting table

vivid cave
#

so i need to keep track of 2 variables ?

#

meta & colorablemeta ?

young knoll
#

No

#
  if (meta instanceof ColorableArmorMeta colorableMeta) {
        colorableMeta.setColor(color);
  } else {
``` colorableMeta is only used in here
vivid cave
#

but whats the point of doing that if colorableMeta is lost after

young knoll
#

Because meta will still have the changes

worldly ingot
#
if (meta instanceof ColorableArmorMeta) {
    ColorableArmorMeta colorableMeta = (ColorableArmorMeta) meta;
    colorableMeta.setColor(color);
}```
#

Same thing, written differently

vivid cave
young knoll
worldly ingot
#

Yes, it's still the same instance

young knoll
#

The type of meta does not change

#

But the contents do

vivid cave
#

okay!!!

#

thanks all 🙂

worldly ingot
#

It's like when doing ((Player) entity).sendBlockChange() or something

wet breach
#

have fun

worldly ingot
#

You're just casting it temporarily because you know it's that type

vivid cave
#

ah okok

worldly ingot
young knoll
#

That also checks all other meta

worldly ingot
#

Yeah

#

Has to match exactly

young knoll
#

I wish we could make custom Recipe Choices 😔

river oracle
#

Be the change you wanna see??

young knoll
#

MD discussed this

hard socket
#

Why I get this error? I am use mojang mappings

young knoll
#

The problem is, what happens when said plugin gets disabled

hard socket
#

the server and project version are 1.19.4

young knoll
#

You didn't remap properly

quaint mantle
#

How do I get an instace of a EntityDataSerializer for a SynchedEntityData#register

hard socket
young knoll
#

Okay

#

Where is your remapping part

hard socket
#

wdym

young knoll
#

?nms

split lichen
#

Does anyone know how to display a player's skin in the tablist when working on a fake players plugin? I'm using protocollib to create and send the corresponding packets, and everything works fine, apart from the fact that I see a black square where the player's head is supposed to be (as seen in the screenshot)

torn shuttle
#

it only took me a week to before I lose my patience and symlinked my development plugins and rewired launching servers on my IDE so that I don't need 15 different windows open to make this

hard socket
young knoll
#

No

#

It's pretty much always R0.1

hard socket
#

why is that?

#

is it just a name?

young knoll
#

mhm

hard socket
#

what jar do I use?

young knoll
#

What are the options

hard socket
young knoll
#

remapped-obf

eternal oxide
#

thats impossible, you have 2 jars with the exact same name

young knoll
#

Magic

hard socket
eternal oxide
#

it is usually the top jar

#

not remapped

#

but it's not called original

young knoll
#

Is it? I thought it was the obf one

tender shard
#

wrong reply

#

ugh

eternal oxide
#

its usually one with the default name

tender shard
young knoll
#

Mm

#

I'll leave it to alex since he knows maven

#

:p

hard socket
eternal oxide
#

specialsource version too low

#

1.2.4? I think

tender shard
#

1.2.2 works fine

#

how did you compile? mvn package?

eternal oxide
#

you sure?

tender shard
#

run mvn clean package -X and ?paste the whole log

#

but yeah also can't hurt to upgrade the specialsource plugin to 1.2.4

hard socket
#
correct et réessayez.
Au caractère Ligne:1 : 1
+ mvn clean package -X
+ ~~~
    + CategoryInfo          : ObjectNotFound: (mvn:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
``` dont know why the hell it is in french
#

btw the default one is getting built then getting renamed to original etc...

tender shard
#

LANG=C mvn clean package -X

eternal oxide
#

also close the target folder you have open before you build

tender shard
#

wait, did you enter the command in powershell?

tender shard
#

you are supposed to run it in IJ

quiet ice
#

However yeah, running it in IJ is probably the better play here

tender shard
chrome beacon
#

The bundled maven is outdated

hard socket
#

I have to go now I will try later thanks

candid kindle
#

this is just a small style question

  • my plugin will have a few manager classes, which are instantiated in the main plugin class
  • i'm considering just passing the plugin instance and adding a getter to it for each manager, rather than passing each manager. is this problematic / bad style?
quiet ice
#

Managers are usually never instantiated

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

I am trying to use the remapped nms in 1.20.1, but it outputs error Could not find artifact org.spigotmc:spigot:jar:remapped-mojang:1.20.1-R0.1-SNAPSHOT in spigotmc-repo. I compiled the 1.20.1 buildtools.jar using java -jar buildtools.jar --remapped

quiet ice
#

i.e. all methods within managers should be static, unless you want to abstract away manager behaviour for certain purposes

remote swallow
#

dont set a ingredient for air, just have spaces there

#

ye

undone axleBOT
quaint mantle
#

I've found an exploit for RCE through Spigot Plugins on the host server, where do I report this to Spigot? PaperMC and Bukkit are also affected.

undone axleBOT
quaint mantle
#

I'd rather report it in private due to it being an exploit, directly to a verified developer of Spigot.

remote swallow
#

email support then

#

?support

undone axleBOT
quaint mantle
#

Alright, thanks.

torn shuttle
#

uh

#

is mc incapable of rendering some colors on models or something

#

teal is green

#

what are you doing mc

fallow latch
#

hi, i want to change a sword or any item's damage, but using attributes it will be like "When in main hand: +amount". I want it to be instead of plus, it just sets the damage literally. is there a way

torn shuttle
#

ok wtf

#

what secret sauce am I missing here

smoky anchor
#

Are you perhaps replacing an item that can have color?
Like leather horse armor, grass or potion?

torn shuttle
#

it is leather horse armor

smoky anchor
#

Try setting it to pure white

torn shuttle
#

hm

torn shuttle
smoky anchor
#

ColoredArmor or something

undone axleBOT
torn shuttle
#

there's a leatherarmormeta but it doesn't list horse armor

river oracle
#

looks like an emoji / custom font maybe

smoky anchor
#

Yes but you'd have to create font with every item

torn shuttle
smoky anchor
#

Dude idk lol.

#

Try it

torn shuttle
#

yeah it's rebooting with it rn

river oracle
#

well idk any other way you'd do that, natively there's no way to do that without a resource pack afaik

dire bluff
#

i have this custom recipe but i want to make it each craft cost stacks how to do it

torn shuttle
smoky anchor
#

Support what?

torn shuttle
#

alright just need to rescale it now

smoky anchor
#

Doubt?
Again, just a custom font. Can be done in spigot as well.
Just need a resource pack.

smoky anchor
#

What folder?
Pretty sure you can create one bitmap for the whole font.

smoky anchor
#

Not sure if that makes any sense.
Are you sure there is no resource pack?

#

Then I have no clue. Ask them how they did it then.

smoky anchor
#

Cause it is weird that they can do it without RP

shadow night
dreamy ridge
#

Anyone know something cool i could? (probably with packets) i want something that looks crazy/never really done on servers

shadow night
#

Make an enderpearl cannon which shoots 5 ender pearls which fly in random direction, explode on contact and after exploding teleport the shooter to where they are

dreamy ridge
#

no too normal

#

i want the people to see to be like "wtf...?"

shadow night
#

Hmm

dreamy ridge
#

stuff like the patched rain/thunder packet bug

shadow night
#

A wtf like: "Wtf oh my gosh" or "Wtf how?"

dreamy ridge
#

2nd one

shadow night
#

Hmm

#

You say you want some packetry stuff

dreamy ridge
#

if thats whats needed then sure

shadow night
#

Tbh I have no idea

dreamy ridge
#

tis a very difficult question for sure

torn shuttle
#

she's a beaut

shadow night
torn shuttle
#

there's literally a feature called wormholes in my plugin

shadow night
# torn shuttle she's a beaut

Wait, if you put a chest below that block (chests are usually smaller than blocks) can you make a remodelled chest?

#

Lmao

torn shuttle
dreamy ridge
shadow night
#

Wait, didn't you basically make tile entities but opposite way?

shadow night
#

Hmm, what about creating a completely chaotic dimension which will behave completely different from seed to seed and from client to client

pseudo hazel
#

I mean its good packet practise but an absolute nightmare

shadow night
#

It is very nightmare

quaint mantle
#

Whats the best way to add like a custom echest system? where would i save the items?

shadow night
#

I would guess PDC? But idk, let the experts answer

quaint mantle
quaint mantle
#

not saving it in a block or smt

pseudo hazel
#

in a file

#

is it just additional echest storage?

shadow night
#

Can't you save PDC for entities?

quaint mantle
#

yea fair enough if i dont wanna use a database

quaint mantle
quaint mantle
shadow night
pseudo hazel
#

I mean you would either save it in player pdc, in a file, or in a datbase

#

it doesnt

#

its called persistent

#

I think it will be saved in the player data file

quaint mantle
#

ah

#

well is pdc better or a seperate file

pseudo hazel
#

alongside the actual ender chest probably

#

idk

#

i its just an additional echest then pdc should be good enough

quaint mantle
#

your chat would be spammed to the horizon tho if u used that and used /data command

shadow night
#

Actual ender chests save data to the player too afaik so ig pdc would be the most enderchest-like(?)

quaint mantle
#

hmmm imma spin a wheel for it

shadow night
#

Makes sense ig

#

Now you can change it whenever you want lol

quaint mantle
#

yea

pseudo hazel
#

like I cant fit the data on my screen already

quaint mantle
#

can just get rid of someones storage just for the funny

pseudo hazel
#

I mean

#

you can do that with pdc too..

shadow night
#

Yeah

quaint mantle
#

well yea but like

#

idk

#

tbh

shadow night
#

You can do that anyways ig

quaint mantle
#

external files are more visible

#

or like easier to read/change

#

since its not in the player file

#

it doesnt matter just dont be a mean server owner

shadow night
#

Everything comes with cons and pros

quaint mantle
# quaint mantle

you shouldnt store plugin data in a player's pdc because even if the plugin is deleted the data will stay there unless manually removed

quaint mantle
#

okay step 1, remember how to save files and shit

shadow night
#

In a way that could actually have a use, like, if you remove the plugin and add it back

quaint mantle
#

yea but i dont know why you'd do that

#

if you want the plugin gone you want it gone

#

if you want the data to still be there, back it up before removing

#

yea

shadow night
#

Players would like to retrieve their stuff

quaint mantle
quaint mantle
noble lantern
#

IIRC You can reskin characters, theres a few vids on this

quaint mantle
#

Am I still supposed to use data watchers for npcs and stuff in 1.20? or is there a better solution

quaint mantle
#

im not surprised i havent updated it in a year

#

lol

#

wow thats a bad one

noble lantern
shadow night
#

Or method, whatever you call it

noble lantern
#

there it is

late sonnet
noble lantern
quaint mantle
#

am i doing something wrong or is intellij tripping

noble lantern
quaint mantle
#

galaxylib port comin a long nice

noble lantern
#

so it will be same thing here like you did with guis:))

quaint mantle
noble lantern
#

just add the font character to the action bar and should work thumbs

quaint mantle
#

7492ac0

noble lantern
#

or is main a tag

quaint mantle
#

it has no tags

quaint mantle
#

works for me

quaint mantle
quaint mantle
noble lantern
quaint mantle
#

com.github.imajindevon:BlueLib:7492ac0f65

#

had to use the full thing

noble lantern
#

jitpack works best with tags

quaint mantle
#

hey man i never even finished it

#

im workin on it

quaint mantle
noble lantern
#

you can make a tag rn 😛

quaint mantle
#

no

#

no

noble lantern
#

replace version with the commit he gave

quaint mantle
#

groupid is com.github.imajindevon artifact id BlueLib version the commit

#

got it

#

ok so how do i use this

#

well what do you wanna do first

#

we can go to my dms

#

or not

#

idc

#

thing i wanna do first is create the custom enderchest system

#

cus i need to be able to save SOMETHING

#

Does an Inventory save the items?

noble lantern
#

you can save items into yml

#

using the yml lib it has

#

(considering he added support for ItemStack :p im sure there is)

remote swallow
#

item stack yaml is normal spigot kekw

quaint mantle
#

well yea but i wanna also save the empty spaces in the storage

#

not JUST the items

#

if inventory is serializable then it works

#

cus i dont want them all to be sorted

noble lantern
quaint mantle
#

act no i just save the slot of the items

#

What i need is to save the Items + Slot index

noble lantern
#

yes

#

so save air/save empty slots

quaint mantle
#

i dont need to do i?

#

since an inv always has empty slots

noble lantern
#

unless you wanna just store where theyre at by indexs, but imo storing air is just easier

quaint mantle
#

nope just ItemStack[]

#

just indexes would work better no? less saving than also saving empty sltos

quaint mantle
pseudo hazel
#

null

noble lantern
#

null

quaint mantle
#

null

pseudo hazel
#

I mean what else do you want us to say

quaint mantle
#

i didnt want u to say anything tbh

#

u just said null

#

and i went with it

noble lantern
#

because air is normally null 😛

quaint mantle
#

well yea but
boolean a = ItemStack == null;

#

thats false

noble lantern
#

if (itemStack != null && itemStack.getType() == Material.AIR) { // do stuff because its air }

quaint mantle
#

but it could be getType.equals(Material.AIR) == air

#

wait why are we saying this

pseudo hazel
#

you started

quaint mantle
#

you started

#

u said null

pseudo hazel
#

you asked for how to save empty stacks

#

I answered

#

you save them as null

noble lantern
quaint mantle
#

fair enough

pseudo hazel
#

its also more memory efficient probably xD

quaint mantle
#

so saving null > saving air

pseudo hazel
#

but if its an array it doesnt really matter

quaint mantle
#

I have a few options:

  1. Save Slot Index + Item
  2. Save Air
  3. Save Null
#

but as you said null & air are easier/more efficient

#
public class PlayerEnderConfig implements ReflectiveConfig {
    public ItemStack[] itemSlots;

    public PlayerEnderConfig(int inventorySize) {
        this.itemSlots = new ItemStack[inventorySize];
    }
}
// when a player joins
PlayerEnderConfig reflectiveConfig = new PlayerEnderConfig(27); // assuming each ender chest has 27 slots

ConfigFile playerFile = ConfigFile.dumbLoad(plugin, player.getUniqueId().toString() + ".yml");
ReflectiveConfigInjector.getAndInject(reflectiveConfig, playerFile.getConfig(), true, true);
noble lantern
#

imajin

#

that wont store null/air slots

#

itll just be a list of contents from inventory if he passes getContents() into it

quaint mantle
#

like that im better off storing slots aswell

#

okay then use Map<Integer, ItemStack>

#

ye

quaint mantle
#

the last two lines yes

#

well the entire thing

#

dumbLoad im guessing makes/loads the file

#

yea

#

getAndInject does what exactly?

#

takes the values from the loaded config and puts them into the object

#

in this case, reflectiveConfig

#

then you can access the data like reflectiveConfig.itemSlots

#

and how do i save it again?

#

to the file i mean

torn shuttle
#

man I don't understand how blockbench is organizing texture IDs

quaint mantle
torn shuttle
#

I have a file where the ID of a texture is 11 but the texture listed for the uv is 0

quaint mantle
#

ive told you basically everything you need to know

torn shuttle
#

oh god

#

I know how it's doing it

#

oh no

quaint mantle
#

im curious

#

tell me

torn shuttle
#

each texture has an id

#

but it refuses to use that id

quaint mantle
#

then whats the point of the id lol

torn shuttle
#

so instead it uses the position in the texture list

#

it assigns ids as you add things to the list

#

but you can reshuffle textures in the list

#

so whether the id matches the place in the list is arbitrary

#

this sucks

#

now I have to reverse engineer this nonsense

#

which is a json map so I can't even use the literal order

dire bluff
#

guys im trying like 2 hours to find it i've made a custom recipe but i need each result cost stack of each material how can i do this

#

any idea please

#

will be mucth appriciated

quaint mantle
torn shuttle
#

it's a feature

quaint mantle
#

🤨 i still dont get the point of the id

torn shuttle
#

yeah neither does blockbench

#

the id is used for minecraft when you export it but I can't export this format

#

and blockbench has decided not to use the id in the first place it would seem

#

so it's a dead value

#

this is so dumb I'm going to have to test it more

quaint mantle
#

set the required amount for each ingredient, which ig would be item.setAmount(item.getMaxStackSize())

#

i forgot how u make a custom inventory in 1.20.1

#

bukkit.createinventory

#

oh yea me was being messy and create a whole nother class

torn shuttle
#

also blockbench does not cull any existing textures

late sonnet
torn shuttle
#

if you generated 1000 textures while working on a model then your id will be 1000

#

even if you deleted all previous ones

#

but the uv will point to 0 because it's the first place in a 0-indexed list

quaint mantle
dire bluff
#

/code

#

umm

torn shuttle
#

the most insane part of this is that it's a json map so while an order literally exists because it's written down in a json file I don't think I can read that order without doing custom parsing

#

it's not even a list

#

oh wait no I stand corrected it is a list of objects, thank god

#

alright that makes this easier

quaint mantle
#

i just wrote like 100 lines of code without testing, im sure it will be fineee right

shadow night
#

If it works, there is something wront

#

Wrong

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

if u are gonna post it in discord atleast use formatting

#

aint nobody reading that

late sonnet
#

but also try debug when this happen what is the reason.. maybe can be a bug damages has a minor bugs since 1.19

calm robin
#

@EventHandler public void onMeleeHit(EntityDamageByEntityEvent e){ if(e.getCause() == EntityDamageEvent.DamageCause.ENTITY_ATTACK){ e.setCancelled(true); Bukkit.getServer().getPluginManager().callEvent(new CustomDamageEvent((LivingEntity) e.getDamager(), (LivingEntity) e.getEntity(), 5, "Melee")); } }

Creates event, no logic in event

`//Custom Damage Listener
@EventHandler(priority = EventPriority.HIGHEST)
public void onCustomDamage(CustomDamageEvent e){

    double x = 5;
    e.getDefender().setHealth(e.getDefender().getHealth() - x);

}`

THIS CODE works when mobs attack players and when players attack mobs. This code does NOT work when players or mobs try to attack sheep, chickens, vexes, wolves, and maybe some other things I have not found yet. It is supposed to reduce the health of mobs when hit hence the event name "custom damage" but I cannot for the life of me figure out why it does not work when hitting the previously listed mobs. PLEASE help

glad prawn
calm robin
#

bro idk

#

just please if you know something i dont answer me

calm robin
#

this is 1.17.1

quaint mantle
#

im using imajin's library
but getting this error, it doesnt seem to create the file anywhere

#

this is the place where it happens:

playerEnderConfig = new PlayerEnderConfig(54);
        
        playerFile = ConfigFile.dumbLoad(TestPlugin.plugin, player.getUniqueId() + ".yml");

        try {
            ReflectiveConfigInjector.getAndInject(playerEnderConfig, playerFile.getConfig(), true, true);
        } catch (Exception exception) {
            exception.printStackTrace();
        }
remote swallow
#

why

quaint mantle
#

crazy

remote swallow
#

wrong channel for that

quaint mantle
#

im from the nl tho

quaint tapir
quaint mantle
#

was that meant for me

late sonnet
# calm robin this is 1.17.1

same try add debug for know what is the DamageCause in teory need to be ENTITY_ATTACK but first try debug this

calm robin
#

it works properly for everything except sheep, wolves, vexes and chickens

#

there is something about those mobs that i do not know about

#

also fish it doesnt work

quaint mantle
late sonnet
calm robin
#

it works on other things tho

#

it works on cows

#

but not on sheep

#

works on iron golems

#

not on chickens

#

thats the problem im having

#

and its very simple code

#

all of it i posted

late sonnet
#

in all cases the attacker is the same type of mob not?
the issue is when the "target" is chickens, sheeps, etc?

calm robin
#

look dms in 1 sec

#

nvm posting here

cinder abyss
#

Hello, how can I change the size of a BlockDisplay? I'm doing this :java BlockDisplay blockDisplay = player.getWorld().spawn(player.getLocation(), BlockDisplay.class); blockDisplay.setBlock(Material.REDSTONE_BLOCK.createBlockData()); blockDisplay.setDisplayWidth(5F); blockDisplay.setDisplayHeight(2F);But I get this:

#

squeezing?

#

yes

#

how can I do this ?

#

there isn't any squeeze method

glad prawn
#

?:D

young knoll
#

Width and height are only used for the clipping bounds

#

You need to set the transformation

#

One of the values in it is scale

cinder abyss
#

found !

#

I used :java blockDisplay.setTransformation(new Transformation(new Vector3f(0, 0, 0), new AxisAngle4f(0, 0, 0, 0), new Vector3f(0.5f, 0.5f, 0.5f), new AxisAngle4f(0, 0, 0, 0)));

shadow night
#

if I want to make a ticking block, how would I do it properly? I just want to make it run some code every tick and work even if I restarted the server

cinder abyss
vivid cave
#

Does PrepareSmithingEvent keeps triggering every few ticks in a similar manner than PrepareAnvilEvent ?

vocal cloud
#

Log it

vivid cave
#

i have a bad testing environment & my pc slow af

#

if anyone knows the answer it would be pretty handy

#

else i'll just tyas

#

Also, is there a way to allow to put anything in smithing table slots ?
I thought, maybe try to setCancelled(false) in InventoryClickEvent with the highest priority for when its the smithing table
But I'm not entirely sure, I could test but if someone knows the answer, or has a strong feeling, it would be very handy for me to know and would give me courage to actually test this

whole surge
#

Hello . Wtf is that?

pseudo hazel
#

private access?

#

try getLevel maybe?

#

idk your code

delicate lynx
#

that's not even the right line

worldly ingot
#

Those are uses, not declarations lol

whole surge
worldly ingot
#

Could be some remapping/access transformer issue, so yeah, if you have a getLevel() method instead, best to use it

whole surge
#

Ok. Let me try

#
[ERROR] /home/sanya/govno/plugins port/Foxis/TamableFoxes/1_20_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_20_R1/pathfinding/FoxPathfinderGoalSleepWithOwner.java:[45,49] cannot find symbol
[ERROR]   symbol:   method getLevel()
[ERROR]   location: variable fox of type net.seanomik.tamablefoxes.versions.version_1_20_R1.EntityTamableFox```
#

💀

#

this shit uses nms

warm mica
whole surge
#

In 1.20 this crap became private

#

How do I get this private level?

whole surge
river oracle
worldly ingot
#

There is afaik. Just level()

river oracle
#

Let us see

river oracle
whole surge
young knoll
#

Mojang just loves to make these random little changes

#

Idk why

whole surge
worldly ingot
#

it should have been a getter to begin with

river oracle
#

fr

#

the public fields on stuff ticks me off

pseudo hazel
#

these are the changes I make when I am working on a project on my own

worldly ingot
#

Access transformers are easier than reflection 😛

torn shuttle
#

turns out making large custom models is all kinds of "fun"

young knoll
torn shuttle
#

mc doesn't want to generate cubes that are larger than certain dimensions

young knoll
#

Iirc the max size for a cube is 48x48x48

torn shuttle
#

uh no

#

I don't think so at least

#

I'm trying to get some official info on it right now

#

but this seems to include cubes that have high start and end points

#

and I don't see a way to offset it

#

I guess I could maybe use the origin?

worldly ingot
#

The :) was a nice touch

young knoll
#

Interesting versions to support

river oracle
#

1.14 is the only weird one

#

and ig no 1.18.2

#

but otherwise looks normal

young knoll
#

No 1.16.5

river oracle
#

that too I suppose

torn shuttle
#

I'm dumb, my debug model was not at the scale I thought it was

potent ibex
#

Is it possible to play totem of undying animation with custom item when players die with custom item in their inventory

#

I’d like to play animation but with different texture

pseudo hazel
#

probably with packets

young knoll
#

I think it’s hardcoded to the totem

#

But I could be wrong

static ingot
#

Use Entity#playEffect and EntityEffect.TOTEM_RESURRECT

#

@potent ibex ^

pseudo hazel
#
static ingot
#

Oh, I'm not sure about changing the actual animation itself. I would think it just uses the default totem item texture.

#

I don't see anything suggesting that any metadata would be attached to the packet event to say otherwise.

potent ibex
#

Alright thanks

soft root
#

Hey can i get some help

kind hatch
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

soft root
sullen marlin
#

no

keen shell
#

Hi! I’m having some trouble making a new crafting recipe for a special item (don’t mind the actual item), and I’m wondering what may be wrong with this code because it’s not registering in the server as an actual recipe when put in correctly.

(Apologies if I don’t get the answer right off the bat, I’ve just started plugin development entirely not too long ago)

tender shard
#

that's some cursed design

#

a static method that looks like a constructor? an init methods that just calls this constructor? and then it registers itself as recipe? idk

#

do you actually somewhere call Beer.Beer() or Beer.init()?

keen shell
#

I will admit, it is very cursed. I plan on fixing it later down the line.

And I have something call Beer.init() (which I should really just, fix that by making the actual method “init” instead of having it separate, but oh well)

tender shard
#

if you are sure you are calling Beer.Beer() or Beer.init() in onEnable() or something, then I don't see any reason why it wouldn't work

#

you do put in the items correctly? right now it will only work in the center slots

keen shell
#

Yep, I do it exact. I set it like that for a reason, mostly for testing- I was going to remove it later when I confirmed it would work

#

But even when the recipe is input exactly as it should be, it doesn’t seem to output the correct item

tender shard
#
    @Override
    public void onEnable() {
//        PaperCommandManager acf = new PaperCommandManager(this);
//        acf.registerCommand(new DebugCommand(this));
//        getServer().getPluginManager().registerEvents(this, this);
        registerTestBeer();
    }

    public void registerTestBeer() {
        NamespacedKey key = new NamespacedKey(this, "testbeer");
        ItemStack item = new ItemStack(Material.POTION);
        PotionMeta meta = (PotionMeta) item.getItemMeta();
        meta.setDisplayName(ChatColor.GOLD + "Test Beer");
        meta.setLore(Arrays.asList("Yum"));
        item.setItemMeta(meta);
        ShapedRecipe recipe = new ShapedRecipe(key, item);
        recipe.shape("S", "C", "P");
        recipe.setIngredient('S', Material.SUGAR);
        recipe.setIngredient('C', Material.SUGAR_CANE);
        recipe.setIngredient('P', Material.POTION);
        getServer().addRecipe(recipe);
    }

works fine for me

#

it also correctly appears in the recipe book

keen shell
#

Hm, alright. Thank you for your help! I’ll mess around with it tomorrow to see what may be the issue, but I’ll definitely keep your response in mind. Thank you for your assistance!

split gull
#

how can i create an empty persistent data container?

tender shard
static ingot
#

Use PersistentDataType.TAG_CONTAINER

tender shard
#
PersistentDataHolder existingDataHolder = ...; // E.g. a player or chunk or whatever that already has a PDC
PersistentDataContainer newPdc = existingDataHolder.getPersistentDataContainer().getAdapterContext().newPersistentDataContainer();
split gull
#

what if i dont have one

#

do i just get the pdc of a random thing?

tender shard
#

then what do you need the PDC for?

#

if you don't have any holder, where are you gonna save your PDC to?

static ingot
#

yea, pdc isn't some complete replacement for saving data

split gull
#

oh

#

no like, i just mean as in having a persistent data container in a variable, an empty one, and adding to it as preferred

#

not necessarily stored somewhere, just the variable

static ingot
#

What would the point of that be though? Just store your data directly in your object.

split gull
#

im making a pdc skript addon and i want to include creating empty PDCs

#

it's just something that people would use, because it's a thing with the already present NBT addon

tender shard
#

you can create a PDC out of nothing with craftbukkit classes

CraftPersistentDataTypeRegistry registry = new CraftPersistentDataTypeRegistry();
        PersistentDataAdapterContext uselessContext = new CraftPersistentDataAdapterContext(registry);
        PersistentDataContainer uselessPdc = uselessContext.newPersistentDataContainer();
split gull
#

ohh

#

thank you

#

i'll try this

#

where can i find CraftPersistentDataTypeRegistry ?

tender shard
#

craftbukkit

#

?nms

split gull
#

oh it's nms

tender shard
#

it's not NMS, it's craftbukkit

worldly ingot
#

PES_Think I'm confused why you would want an empty PDC anywhere that isn't relevant to ItemMeta

tender shard
#

basically you can just add "spigot" instead of "spigot-api" as dependency

tender shard
worldly ingot
#

Right

tender shard
#

yeah I also don't see any reason to do that

split gull
#

my addon will include adding pdc to blocks since there's a library for that

#

so there's that

#

but thats not the point

tender shard
#

PDC for blocks?

#

?blockpdc

undone axleBOT
static ingot
#

that's not even how persistent data holders work

worldly ingot
#

Sure, but that still doesn't explain why you'd need a PDC field anywhere

livid dove
tender shard
#

PaperCommandManager supports spigot

static ingot
tender shard
#

yeah in that case you can use the chunk's PDC as context, or simply the context of the block's pdc

#

but I still don't understand what you need a new one for, new CustomBlockData(Plugin, Block) already gives you a persistentdatacontainer where you can get a context from

worldly ingot
#

A PDC on its own is nothing more than an overglorified Map

split gull
tender shard
#

wdym?

flint coyote
#

to the itemstack or to a flying one?

#

yeah sure. You can use the .addUnsafeEnchantment function

split gull
# tender shard wdym?

i wont go too deep into this, the nbt skript addon has this which creates an empty nbt and i just wanted to do the same thing but with pdc

flint coyote
#

yes

#

unsure about that but I doubt it

split gull
#

i understand why you guys say it doesnt make sense, it's more about feature adding

static ingot
#

Don't add "features" that don't make sense. And you're not thinking of it in the sense of a feature anyway, you're exposing it as part of your API. The PDC itself is more of an implementation detail.

split gull
#

anyway i've added this to my pom.xml and the CraftPersistentDataTypeRegistry class isn't found


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

ohhh

undone axleBOT