PluginBugs / Issues-ItemsAdder

Repository used to keep track of issues of my plugin ItemsAdder
https://itemsadder.devs.beer
55 stars 21 forks source link

1.20.5 new features #3536

Closed LoneDev6 closed 6 months ago

LoneDev6 commented 7 months ago

Snapshot information links:

Food

New itemstack attribute which allows any item to behave as food, specifies the nutrition and saturation amount, effects and some other interesting flags. This allows getting rid of all the custom food logic code from ItemsAdder.

3902

Max stack size

Allows to specify the max stack size for an itemstack without having to code some hacky stuff. This allows introducing a new feature to ItemsAdder.

New attribute: max_stack_size: 64

Max damage (durability)

Allows to specify the max durability of an item without making some hacky implementation serversided. This allows getting rid of all the custom durability code from ItemsAdder.

3608

Changed max_custom_durability to max_durability. Changed custom_durability to durability.

Fire resistant

Will allow to implement this request: https://github.com/PluginBugs/Issues-ItemsAdder/issues/1391 This allows introducing a new feature to ItemsAdder.

New attribute: fire_resistant: true

Rarity

NOTE: not implemented. Controls the color of the item name based on rarity, like vanilla items. This allows introducing a new feature to ItemsAdder.

Item mining speed (to change blocks hardness)

NOTE: not implemented. Make an item act like a tool. Allows to set a list of blocks that can be mined, the mining speed and some other features. Note: custom blocks are made using note_block, so the type will always be the same. I might be able to get rid of the custom blocks mining speed completely, but this would require me to edit the NBT data of the tool to change the mining speed when the player clicks on the custom block. (needs to be tested).

Hide tooltip

Allows hiding the tooltip completely when hovering an item. This will be used to hide the tooltip of icons in custom guis. This allows introducing a new feature to ItemsAdder.

New attribute: hide_tooltip: true

Item name

A new tag that allows to set a name for the item which replaces the vanilla one completely. It's different from the display name tag because it can't be edited in anvil and acts like the vanilla item name, it's basically a way to completely rename an item and make it act like a proper custom item.

Same old property: display_name: Your Custom Name (accepts custom formatting).


Notes:

What I fear is that this new NBT logic will introduce some issues while matching items, so items might not be able to be merged into a single itemstack if an NBT tag is in a different order, but this needs to be tested.

Andre601 commented 7 months ago

Make an item act like a tool. Allows to set a list of blocks that can be mined, the mining speed and some other features. Note: custom blocks are made using note_block, so the type will always be the same. I might be able to get rid of the custom blocks mining speed completely, but this would require me to edit the NBT data of the tool to change the mining speed when the player clicks on the custom block. (needs to be tested).

One behaviour that could be made (Which Nova devs mentioned), is to adjust mining speed of all tools to be removed (Be the exact same), so that your plugin could then apply a custom mining speed with haste/mining fatigue effects (Like it does right now iirc). Wouldn't be the best option by any means, but at least allow a more consistent behaviour across all blocks and not just custom ones...

Andre601 commented 7 months ago

It's different from the display name tag because it can't be edited in anvil and acts like the vanilla item name, it's basically a way to completely rename an item and make it act like a proper custom item.

Not quite accurate. You can rename the item. It's just that the item with that name isn't treated like a renamed one, so just putting it in the anvil won't prompt you to rename it (or setting it to blank won't return the original item name)

Edit: Actually, the changelogs suggest that indeed you can't rename the item... Tho I saw that you can and that this is just acting like the item's vanilla name...

LoneDev6 commented 7 months ago

Yea, it seems to be used to basically overwrite the vanilla item name, to simulate a custom item without using the display name tag, which is normally intended to be left as option to the player to rename the item instance and customize it.

Ceejuu commented 7 months ago

Yea, it seems to be used to basically overwrite the vanilla item name, to simulate a custom item without using the display name tag, which is normally intended to be left as option to the player to rename the item instance and customize it.

would that give us the option to prevent the player from renaming a custom item at the anvil?

LoneDev6 commented 7 months ago

would that give us the option to prevent the player from renaming a custom item at the anvil?

Must be tested, but seems that it just allows you to change the base name of the item, then the player will be able to rename the item in the anvil as for vanilla items.

PortableGames commented 7 months ago

Demonstration of how to easily add new food and drink in 1.20.5

https://modrinth.com/datapack/tasty-supplies

And example of new display entities :

https://modrinth.com/mod/blockbench-import-library

PortableGames commented 7 months ago

IA4.0 for Fabric? 🙈 These are not my words but the words of one of the biggest developers for fabric (server-side,)

This is more of my own opinion (through it's shared by many), that bukkit based plugins and servers should be thing of the past. Bukkit (or Spigot and Paper) never fully adapted to modern Minecraft, as their goal of forever backwards compatibility limited how they could evolve. Bukkit was originally created for early Minecraft Betas and it's api was kept mostly the same. It was extended with new functionality, but it never fully adapted to modern versions. Lack of nbt api's, lack of support for datapacks as parts of plugins (which both non-bukkit platforms have supported for long time), it limits what could be done with server mods. Nearly all plugins that do something more advanced, require usage of non-bukkit Vanilla classes, either via another library or own code (and a lot of reflections and jvm hacks). For bigger servers that want to extend gameplay in their own ways, it's more common to just fork Bukkit/Spigot/Paper instead and add things in same ways as modders do.

https://gist.github.com/Patbox/e44844294c358b614d347d369b0fc3bf

Andre601 commented 7 months ago

I don't think this really fits the topic of this issue, or even the entire repository itself.

Yes, mods offer a significantly higher level of customization, but your points aren't completely valid. For once, servers such as Paper try to get rid of ancient code from the CraftBukkit days by utilizing more common standards such as Kyori Adventure for Message components, Configurate for a more efficient configuration system and also better API through their own paper-plugin systems.

Also, Plugins have one major benefit that various mods offering similar features do not: They often don't require updating for each MC release. Mods rely on internals which may change and break, requiring to update the mod every time a new MC version comes out. Meanwhile plugins utilize an API that remains the same, offering a robust interface of methods to use while the internals are changing.

But again, this is not a topic for a repository focused on support for a Spigot/Paper plugin.

enesop commented 7 months ago

Item mining speed (to change blocks hardness)

Make an item act like a tool. Allows to set a list of blocks that can be mined, the mining speed and some other features. Note: custom blocks are made using note_block, so the type will always be the same. I might be able to get rid of the custom blocks mining speed completely, but this would require me to edit the NBT data of the tool to change the mining speed when the player clicks on the custom block. (needs to be tested).

By this, will you be adding a like a material type of property to custom blocks, like a gold ore being able to mined faster with pickaxes, faster with things that will drop the gold such as iron and diamond pickaxe, as well as mining speed being affected by if you are swimming, in the air and such, the exact way of how vanilla blocks act against certain tools.

If needed, I have the code that can do this pretty much exact as vanilla, since your current one lacks a few important packets as well as properties.