CobbleSword / NachoSpigot

NachoSpigot is a fork of TacoSpigot 1.8.9 that offers several enhancements to performance as well as bug fixes.
GNU General Public License v3.0
237 stars 86 forks source link

Modern Material Enum #344

Open LaiMacVN opened 2 years ago

LaiMacVN commented 2 years ago

Describe the feature

For example Material.SPRUCE_WOOD or Material.DARK_OAK_WOOD ..etc instead of weird stuff to get the different wood type

Technical implementation

No response

Other

No response

Agreements

keqno commented 2 years ago

would break plugins unfortunately.

ghost commented 2 years ago

would break plugins unfortunately.

It most likely wouldn’t break plugins, but either way the Material enum in 1.8 depends on block ids, and different types of wood are different data ids for logs

keqno commented 2 years ago

would break plugins unfortunately.

It most likely wouldn’t break plugins, but either way the Material enum in 1.8 depends on block ids, and different types of wood are different data ids for logs

Wouldn't it break plugins that are using say Material.WOOD and now it has to use the specific ones instead?

Blyrex commented 2 years ago

if you want new materials and items, use latest paper :)

ghost commented 2 years ago

NachoSpigot isn't made to add breaking api changes

Describe the feature

For example Material.SPRUCE_WOOD or Material.DARK_OAK_WOOD ..etc instead of weird stuff to get the different wood type

Technical implementation

No response

Other

No response

Agreements

  • [x] You have confirmed that this feature does not yet exist in the latest version of NachoSpigot.
  • [x] You have confirmed that there aren’t any issues open regarding this feature.
HeathLoganCampbell commented 2 years ago

I like the idea, could just make a secondary material class called ModernMaterial or MMaterial

sadcenter commented 2 years ago

it is possible without breaking the plugins as @HeathLoganCampbell said. we can add a new class, where there would be all items already with MaterialData provided

public class DarkOakWood extends MaterialData {
    public DarkOakWood() {
        super(Material.LOG_2, (byte) 1);
    }

something like that

MWHunter commented 2 years ago

I've designed a modern block data system in PacketEvents. It allow stuff like WrappedBlockState stairs = StateTypes.OAK_STAIRS.createDefaultState(); stairs.setFacing(BlockFace.WEST)

https://github.com/retrooper/packetevents/blob/2.0/api/src/main/java/com/github/retrooper/packetevents/protocol/world/states/WrappedBlockState.java https://github.com/retrooper/packetevents/blob/2.0/api/src/main/java/com/github/retrooper/packetevents/protocol/world/states/type/StateTypes.java

Unsure how relevant this is, but it works on 1.8 and I like it better than 1.8's system.