enjin / enjincraft

Minecraft plugin for integration with the Enjin Platform.
https://enjin.io/
Apache License 2.0
59 stars 29 forks source link

Unicode is not supported in the NBT data. #47

Closed Maitlans closed 4 years ago

Maitlans commented 4 years ago

When creating a new token which contains unicode it won't be saved within the .json file and it will show up as a "?" in-game. Minecraft supports unicodes by default and they're typically used in items by servers to indicate things such as damage or other properties.

https://i.gyazo.com/40876434ae16f200e4f673cda45425e4.mp4

Favorlock commented 4 years ago

We use NBT-API to handle the the conversion to and from NBT, so it's quite possible that they may not support it, otherwise GSON isn't capable of supporting unicode by default. Will have to look into it more.

Can you post the content of the json file. Would be helpful.

Maitlans commented 4 years ago

Some more info on the reported issue: When you first create/update the token with the item in your hand it will show up properly even in the Enjin Wallet GUI, but if you restart the server it'll show up as "?". https://i.gyazo.com/4e6feaf421dee7b85faf56cdb5b88bd0.mp4 https://pastebin.com/F8uRB3ag

Favorlock commented 4 years ago

This has been resolved and will be included in the next release. Will close this once a new release is out.

Gdays commented 4 years ago

@Favorlock This is kinda unrelated to this thread but I am trying the plugin and was wondering if its possible to make tokenized items work the same way as normal items. like storing them on chests or using them like the actual item like a sword. Also, can a tokenized item be destroyed with normal MC mechanics?

Favorlock commented 4 years ago

@Favorlock This is kinda unrelated to this thread but I am trying the plugin and was wondering if its possible to make tokenized items work the same way as normal items. like storing them on chests or using them like the actual item like a sword. Also, can a tokenized item be destroyed with normal MC mechanics?

Unfortunately trying to support such a thing would be extremely difficult. Tokenized items are typically only intended to be used by the owner, so storing items in Minecraft worlds would ultimately make it difficult to validate player inventories and could lead to duplication.

It would be possible to destroy tokens, but that has to be approved by the player. Only players can melt/send tokens, developers can't do such a thing because it would go against the concept of player ownership. As such, developers have to implement their mechanics to work around this, for example, to implement a consumable a developer would have to require either a) player to melt a token or b) send the token to the developer and upon detecting the event for this the developer could apply some affect or do something in response.

Alternatively, developers could take a more centralized approach and try to keep track of things in their own database, but that would pretty difficult to manage if tokens can be traded.

EnjinCraft is really just our interpretation of how to implement basic usage of tokens in Minecraft. We aren't trying to support everything out of the box because that would make the plugin extremely complex. Our aim is to a) make the plugin a base which can be used to add features and b) to serve as an example for developers looking to integrate blockchain into their own server in a way that matches their needs (which is why we are open source).

Of course we're open to feedback and contributions, but we ultimately we decide on what features get implemented on whether or not we think the feature would be widely used and is easy enough to support. Just implementing simple support for tokens was pretty complex due to the fact that we have to work within the confines of the Minecraft implementation.

Gdays commented 4 years ago

Thanks for the replay @Favorlock I think now I have a better understanding of this project. let me pitch you my goal for my ideal implementation. (sorry if this does not makes sense I am still trying to wrap this around my head) I want to create a virtual economy inside a minecraft server where crypto assets are either, the currency or part of it as a traded item.

I still not defined a distribution mechanic but the assets(currency) could be obtained via quests or trading but could also be purchased directly (via enji market?) another mechanic that could be useful would be to be able to include normal items in the /enj trade box this way players with no ways to buying/obtaining them can trade them and maybe creating a market.

The destruction/melt could be a pretty good drain mechanic and also serve as incentive for players to melt assets in order to monetize and incense the scarcity

still not have decided what the propuse of the currency/assets would serve inside the server but things like access to special zones or special features/permits or maybe ownership sound pretty interesting

how would you approach creating a basic token based economy with the current state of the plugin if you were a non-programming-skilled dude like me :D

Favorlock commented 4 years ago

Unfortunately I don't think that would be possible without writing a custom integration around EnjinCraft. We focused more on features that would be beneficial to servers that use BuyCraft or another shop/donation platform to sell package. Due to the nature of the plugin it is categorically an economy plugin, just not in the sense that the entire server economy is crypto currency. I also don't see it being to viable to make your server economy based on crypto currency at this time. The cost of transactions would probably be too costly for such a thing. We are working on a solution that will make things more affordable for devs/players, but that is still a ways in the future.