ITEMS/mcl_chests: Reskin chests as presents on December 24th to 26th #212

Merged
cora merged 2 commits from add-christmas-chests into master 2021-12-20 17:34:55 +01:00
Owner
Problem

TRACKING ISSUE: #209

Between 24 and 26 of December inclusive, chests should look like christmas presents.

Solution

This patch reskins chests as presents.

Details

I drew up some textures and refactored the code to assign textures to various chests. Previously, textures were hardcoded by name in several different places in the code. The refactoring should make the code a bit easier to understand and maintain, even when it is not christmas time.

Testing Steps

The testing of this patch is a bit much, since it requires refactoring how textures are assigned to 5 different kinds of chests, with two different variations. Additionally, animated chests are nodes that spawn an entity on placement and loading; in case an entity gets deleted, animated chest entities are respawned whenever a player interacts with the corresponding chest node.

Instead of setting the computer time, on GNU/Linux you can use the faketime program to pretend it is a specific date only for a particular program – like this: faketime 2021-12-24 ./bin/minetest

Preparation (common to the next 4 steps)
  1. Create a world in Minetest 5.4.1 with Mineclonia commit df7bd78af5.
  2. Place a chest, a mechanism chest, an ender chest, a double chest, and a double mechanism chest.
Animated normal chests
  1. Ensure the Mineclonia setting animated_chests is turned on.
  2. Enter the world with the computer time set to a date that is not the 24th, 25th, or 26th of December.
  3. Verify that no chest looks like a christmas present box.
  4. Open each chest and verify that you can put items in it, out of them and swap them.
  5. Grant yourself all privileges with /grantme all.
  6. Delete all chest entities using /clearobjects.
  7. Verify all chest entities disappeared, but the invisible nodes can still be focused.
  8. Open each chest and verify that you can put items in it, out of them and swap them.
  9. Verify that all chest entities appeared.
  10. Verify that no chest looks like a christmas present box.
Animated christmas chests
  1. Ensure the Mineclonia setting animated_chests is turned on.
  2. Enter the world with the computer time set to the 24th of December.
  3. Verify that all chests look like a christmas present box.
  4. Open each chest and verify that you can put items in it, out of them and swap them.
  5. Grant yourself all privileges with /grantme all.
  6. Delete all chest entities using /clearobjects.
  7. Verify all chest entities disappeared, but the invisible nodes can still be focused.
  8. Open each chest and verify that you can put items in it, out of them and swap them.
  9. Verify that all chest entities appeared.
  10. Verify that all chests look like a christmas present box.
  11. Exit the world and enter it with the computer time set to the 25th of December.
  12. Verify that all chests look like a christmas present box.
  13. Exit the world and enter it with the computer time set to the 26th of December.
  14. Verify that all chests look like a christmas present box.
  15. Exit the world and enter it with the computer time set to the 27th of December.
  16. Verify that no chest looks like a christmas present box.
Non-animated normal chests
  1. Ensure the Mineclonia setting animated_chests is turned off.
  2. Enter the world with the computer time set to a date that is not the 24th, 25th, or 26th of December.
  3. Verify that no chest looks like a christmas present box.
  4. Open each chest and verify that you can put items in it, out of them and swap them.
  5. Grant yourself all privileges with /grantme all.
  6. Delete all chest entities using /clearobjects.
  7. Verify no chests disappeared.
Non-animated christmas chests
  1. Ensure the Mineclonia setting animated_chests is turned off.
  2. Enter the world with the computer time set to the 24th of December.
  3. Verify that all chests look like a christmas present box.
  4. Open each chest and verify that you can put items in it, out of them and swap them.
  5. Grant yourself all privileges with /grantme all.
  6. Delete all chest entities using /clearobjects.
  7. Verify no chests disappeared.
  8. Exit the world and enter it with the computer time set to the 25th of December.
  9. Verify that all chests look like a christmas present box.
  10. Exit the world and enter it with the computer time set to the 26th of December.
  11. Verify that all chests look like a christmas present box.
  12. Exit the world and enter it with the computer time set to the 27th of December.
  13. Verify that no chest looks like a christmas present box.
##### Problem TRACKING ISSUE: https://git.minetest.land/Mineclonia/Mineclonia/issues/209 Between 24 and 26 of December inclusive, chests should look like christmas presents. ##### Solution This patch reskins chests as presents. ##### Details I drew up some textures and refactored the code to assign textures to various chests. Previously, textures were hardcoded by name in several different places in the code. The refactoring should make the code a bit easier to understand and maintain, even when it is not christmas time. ##### Testing Steps The testing of this patch is a bit much, since it requires refactoring how textures are assigned to 5 different kinds of chests, with two different variations. Additionally, animated chests are nodes that spawn an entity on placement and loading; in case an entity gets deleted, animated chest entities are respawned whenever a player interacts with the corresponding chest node. Instead of setting the computer time, on GNU/Linux you can use the `faketime` program to pretend it is a specific date only for a particular program – like this: `faketime 2021-12-24 ./bin/minetest` ###### Preparation (common to the next 4 steps) 0. Create a world in Minetest 5.4.1 with Mineclonia commit df7bd78af546379fa07f4a7fbb5ea9e6228bc06a. 0. Place a chest, a mechanism chest, an ender chest, a double chest, and a double mechanism chest. ###### Animated normal chests 1. Ensure the Mineclonia setting `animated_chests` is turned on. 2. Enter the world with the computer time set to a date that is not the 24th, 25th, or 26th of December. 3. Verify that no chest looks like a christmas present box. 4. Open each chest and verify that you can put items in it, out of them and swap them. 5. Grant yourself all privileges with `/grantme all`. 6. Delete all chest entities using `/clearobjects`. 8. Verify all chest entities disappeared, but the invisible nodes can still be focused. 7. Open each chest and verify that you can put items in it, out of them and swap them. 8. Verify that all chest entities appeared. 9. Verify that no chest looks like a christmas present box. ###### Animated christmas chests 1. Ensure the Mineclonia setting `animated_chests` is turned on. 2. Enter the world with the computer time set to the 24th of December. 3. Verify that all chests look like a christmas present box. 4. Open each chest and verify that you can put items in it, out of them and swap them. 5. Grant yourself all privileges with `/grantme all`. 6. Delete all chest entities using `/clearobjects`. 8. Verify all chest entities disappeared, but the invisible nodes can still be focused. 7. Open each chest and verify that you can put items in it, out of them and swap them. 8. Verify that all chest entities appeared. 9. Verify that all chests look like a christmas present box. 10. Exit the world and enter it with the computer time set to the 25th of December. 11. Verify that all chests look like a christmas present box. 12. Exit the world and enter it with the computer time set to the 26th of December. 13. Verify that all chests look like a christmas present box. 14. Exit the world and enter it with the computer time set to the 27th of December. 15. Verify that no chest looks like a christmas present box. ###### Non-animated normal chests 1. Ensure the Mineclonia setting `animated_chests` is turned off. 2. Enter the world with the computer time set to a date that is not the 24th, 25th, or 26th of December. 3. Verify that no chest looks like a christmas present box. 4. Open each chest and verify that you can put items in it, out of them and swap them. 5. Grant yourself all privileges with `/grantme all`. 6. Delete all chest entities using `/clearobjects`. 7. Verify no chests disappeared. ###### Non-animated christmas chests 1. Ensure the Mineclonia setting `animated_chests` is turned off. 2. Enter the world with the computer time set to the 24th of December. 3. Verify that all chests look like a christmas present box. 4. Open each chest and verify that you can put items in it, out of them and swap them. 5. Grant yourself all privileges with `/grantme all`. 6. Delete all chest entities using `/clearobjects`. 7. Verify no chests disappeared. 10. Exit the world and enter it with the computer time set to the 25th of December. 11. Verify that all chests look like a christmas present box. 12. Exit the world and enter it with the computer time set to the 26th of December. 13. Verify that all chests look like a christmas present box. 14. Exit the world and enter it with the computer time set to the 27th of December. 15. Verify that no chest looks like a christmas present box.
erlehmann force-pushed add-christmas-chests from 4df9a75352 to 9476749bd7 2021-12-11 17:28:35 +01:00 Compare
erlehmann force-pushed add-christmas-chests from 9476749bd7 to 7160b32020 2021-12-11 17:52:24 +01:00 Compare
erlehmann force-pushed add-christmas-chests from 7160b32020 to fe3e837e1b 2021-12-11 18:18:10 +01:00 Compare
erlehmann force-pushed add-christmas-chests from 2599fdad9c to 463bf61e49 2021-12-11 21:10:52 +01:00 Compare
erlehmann force-pushed add-christmas-chests from 463bf61e49 to aa9c60b77c 2021-12-11 21:28:08 +01:00 Compare
erlehmann force-pushed add-christmas-chests from aa9c60b77c to 8fb6964e34 2021-12-11 21:36:59 +01:00 Compare
erlehmann force-pushed add-christmas-chests from 8fb6964e34 to 6b1ac1a6d0 2021-12-11 21:42:43 +01:00 Compare
erlehmann force-pushed add-christmas-chests from 6b1ac1a6d0 to df7bd78af5 2021-12-12 15:41:29 +01:00 Compare
erlehmann changed title from WIP: ITEMS/mcl_chests: Reskin chests as presents on December 24th to 26th to ITEMS/mcl_chests: Reskin chests as presents on December 24th to 26th 2021-12-13 13:15:52 +01:00
Member
  1. verify that no chests disappeared

Are you sure this works? Cause AFAIK double chests are still entities!?

>7. verify that no chests disappeared Are you sure this works? Cause AFAIK double chests are still entities!?
cora approved these changes 2021-12-20 17:34:32 +01:00
cora left a comment
Member
Animated normal chests
  • 1. Ensure the Mineclonia setting animated_chests is turned on.
  • 2. Enter the world with the computer time set to a date that is not the 24th, 25th, or 26th of December.
  • 3. Verify that no chest looks like a christmas present box.
  • 4. Open each chest and verify that you can put items in it, out of them and swap them.
  • 5. Grant yourself all privileges with /grantme all.
  • 6. Delete all chest entities using /clearobjects.
  • 8. Verify all chest entities disappeared, but the invisible nodes can still be focused.
  • 7. Open each chest and verify that you can put items in it, out of them and swap them.
  • 8. Verify that all chest entities appeared.
  • 9. Verify that no chest looks like a christmas present box.
Animated christmas chests
  • 1. Ensure the Mineclonia setting animated_chests is turned on.
  • 2. Enter the world with the computer time set to the 24th of December.
  • 3. Verify that all chests look like a christmas present box.
  • 4. Open each chest and verify that you can put items in it, out of them and swap them.
  • 5. Grant yourself all privileges with /grantme all.
  • 6. Delete all chest entities using /clearobjects.
  • 8. Verify all chest entities disappeared, but the invisible nodes can still be focused.
  • 7. Open each chest and verify that you can put items in it, out of them and swap them.
  • 8. Verify that all chest entities appeared.
  • 9. Verify that all chests look like a christmas present box.
  • 10. Exit the world and enter it with the computer time set to the 25th of December.
  • 11. Verify that all chests look like a christmas present box.
  • 12. Exit the world and enter it with the computer time set to the 26th of December.
  • 13. Verify that all chests look like a christmas present box.
  • 14. Exit the world and enter it with the computer time set to the 27th of December.
  • 15. Verify that no chest looks like a christmas present box.
Non-animated normal chests
  • 1. Ensure the Mineclonia setting animated_chests is turned off.
  • 2. Enter the world with the computer time set to a date that is not the 24th, 25th, or 26th of December.
  • 3. Verify that no chest looks like a christmas present box.
  • 4. Open each chest and verify that you can put items in it, out of them and swap them.
  • 5. Grant yourself all privileges with /grantme all.
  • 6. Delete all chest entities using /clearobjects.
  • 7. Verify no chests disappeared.
    As Mentioned above, double chests are still entities and hence disappeared. As a sidenote normal double chest entities do not reappear on opening ( it's in master too: #219 ).
Non-animated christmas chests
  • 1. Ensure the Mineclonia setting animated_chests is turned off.
  • 2. Enter the world with the computer time set to the 24th of December.
  • 3. Verify that all chests look like a christmas present box.
  • 4. Open each chest and verify that you can put items in it, out of them and swap them.
  • 5. Grant yourself all privileges with /grantme all.
  • 6. Delete all chest entities using /clearobjects.
  • 7. Verify no chests disappeared.
  • 10. Exit the world and enter it with the computer time set to the 25th of December.
  • 11. Verify that all chests look like a christmas present box.
  • 12. Exit the world and enter it with the computer time set to the 26th of December.
  • 13. Verify that all chests look like a christmas present box.
  • 14. Exit the world and enter it with the computer time set to the 27th of December.
  • 15. Verify that no chest looks like a christmas present box.
###### Animated normal chests - [x] 1. Ensure the Mineclonia setting `animated_chests` is turned on. - [x] 2. Enter the world with the computer time set to a date that is not the 24th, 25th, or 26th of December. - [x] 3. Verify that no chest looks like a christmas present box. - [x] 4. Open each chest and verify that you can put items in it, out of them and swap them. - [x] 5. Grant yourself all privileges with `/grantme all`. - [x] 6. Delete all chest entities using `/clearobjects`. - [x] 8. Verify all chest entities disappeared, but the invisible nodes can still be focused. - [x] 7. Open each chest and verify that you can put items in it, out of them and swap them. - [x] 8. Verify that all chest entities appeared. - [x] 9. Verify that no chest looks like a christmas present box. ###### Animated christmas chests - [x] 1. Ensure the Mineclonia setting `animated_chests` is turned on. - [x] 2. Enter the world with the computer time set to the 24th of December. - [x] 3. Verify that all chests look like a christmas present box. - [x] 4. Open each chest and verify that you can put items in it, out of them and swap them. - [x] 5. Grant yourself all privileges with `/grantme all`. - [x] 6. Delete all chest entities using `/clearobjects`. - [x] 8. Verify all chest entities disappeared, but the invisible nodes can still be focused. - [x] 7. Open each chest and verify that you can put items in it, out of them and swap them. - [x] 8. Verify that all chest entities appeared. - [x] 9. Verify that all chests look like a christmas present box. - [x] 10. Exit the world and enter it with the computer time set to the 25th of December. - [x] 11. Verify that all chests look like a christmas present box. - [x] 12. Exit the world and enter it with the computer time set to the 26th of December. - [x] 13. Verify that all chests look like a christmas present box. - [x] 14. Exit the world and enter it with the computer time set to the 27th of December. - [x] 15. Verify that no chest looks like a christmas present box. ###### Non-animated normal chests - [x] 1. Ensure the Mineclonia setting `animated_chests` is turned off. - [x] 2. Enter the world with the computer time set to a date that is not the 24th, 25th, or 26th of December. - [x] 3. Verify that no chest looks like a christmas present box. - [x] 4. Open each chest and verify that you can put items in it, out of them and swap them. - [x] 5. Grant yourself all privileges with `/grantme all`. - [x] 6. Delete all chest entities using `/clearobjects`. - [ ] 7. Verify no chests disappeared. As Mentioned above, double chests are still entities and hence disappeared. As a sidenote normal double chest entities do not reappear on opening ( it's in master too: #219 ). ###### Non-animated christmas chests - [x] 1. Ensure the Mineclonia setting `animated_chests` is turned off. - [x] 2. Enter the world with the computer time set to the 24th of December. - [x] 3. Verify that all chests look like a christmas present box. - [x] 4. Open each chest and verify that you can put items in it, out of them and swap them. - [x] 5. Grant yourself all privileges with `/grantme all`. - [x] 6. Delete all chest entities using `/clearobjects`. - [x] 7. Verify no chests disappeared. - [x] 10. Exit the world and enter it with the computer time set to the 25th of December. - [x] 11. Verify that all chests look like a christmas present box. - [x] 12. Exit the world and enter it with the computer time set to the 26th of December. - [x] 13. Verify that all chests look like a christmas present box. - [x] 14. Exit the world and enter it with the computer time set to the 27th of December. - [x] 15. Verify that no chest looks like a christmas present box.
cora merged commit 4f33f626f5 into master 2021-12-20 17:34:55 +01:00
cora deleted branch add-christmas-chests 2021-12-20 17:34:57 +01:00
This repo is archived. You cannot comment on pull requests.
No description provided.