S-S-X / mineunit

Minetest core / engine libraries for regression tests
Other
10 stars 6 forks source link

Implement ItemStack:{get,set}_metadata #81

Open TurkeyMcMac opened 2 years ago

TurkeyMcMac commented 2 years ago

I ran into this issue when writing tests for Mesecons. I looked at the code of Minetest to replicate its behavior. Because I'm not actually copying the code, I would think this would be OK license-wise, but I'm not knowledgeable about such things. If incorporating these changes would cause legal issues, this PR should be closed, and you should not look at the changes.

S-S-X commented 2 years ago

TLDR: ONLY unimportant speculation about copyright law, licensing, etc. follows.

For licensing / legal it should be fine as long as it is not just copy pasting significant portion of original code (with conflicting license). What "significant" actually means is not always that clear but basically in this case it would be "threshold of originality"-concept.

In this case mostly about if it would even make any sense to write code in some different way, this code snippet would probably have to be patented in addition to being copyrighted and I'd guess you could not really easily patent that code snippet...

Also I am not a lawyer and for sure you cannot rip 1 page from book every day and glue it into your sketchbook, ultimately producing copy of original work, and claim copyright for it... licensing is complicated 🤷

TurkeyMcMac commented 2 years ago

I think this change is basically the only way to implement the behavior matching what Minetest does.

TurkeyMcMac commented 2 years ago

The new change makes set_metadata more flexible and also reduces its similarity to Minetest's implementation.