From 5b96eca09064e4e427cbf1fc1dc16f520650fd96 Mon Sep 17 00:00:00 2001 From: tryal-leaf Date: Tue, 18 May 2021 15:05:22 -0700 Subject: [PATCH] Check for sunrise (time < 30) for rejuvenation instead of tracking night Players can sleep away thunderstorms, which can occur during the day. Switching to checking for sunrise at time < 30 will cover this case. --- .../data/phoenix/powers/rejuvenation.json | 112 ++++++------------ .../data/phoenix/powers/rejuvenation.json | 112 ++++++------------ 2 files changed, 76 insertions(+), 148 deletions(-) diff --git a/datapack/data/phoenix/powers/rejuvenation.json b/datapack/data/phoenix/powers/rejuvenation.json index 6355731..b3e0a00 100644 --- a/datapack/data/phoenix/powers/rejuvenation.json +++ b/datapack/data/phoenix/powers/rejuvenation.json @@ -1,80 +1,44 @@ { - "type": "origins:multiple", - "is_night": { - "type": "origins:resource", - "min": 0, - "max": 1, - "hud_render": { - "should_render": false - } - }, - "update": { - "type": "origins:action_over_time", - "interval": 20, - "entity_action": { - "type": "origins:and", - "actions": [ - { - "type": "origins:if_else", - "condition": { - "type": "origins:and", - "conditions": [ - { - "type": "origins:command", - "command": "time query daytime", - "comparison": "<", - "compare_to": "12544" - }, - { - "type": "origins:resource", - "resource": "phoenix:rejuvenation_is_night", - "comparison": ">=", - "compare_to": 1 - }, - { - "type": "origins:resource", - "resource": "phoenix:rebirth_state", - "comparison": ">=", - "compare_to": 1 - } - ] - }, - "if_action": { - "type": "origins:and", - "actions": [ - { - "type": "origins:execute_command", - "command": "function phoenix:rebirth_full_size", - "permission_level": 4 - }, - { - "type": "origins:heal", - "amount": 6 - } - ] - } + "type": "origins:action_over_time", + "interval": 20, + "entity_action": { + "type": "origins:and", + "actions": [ + { + "type": "origins:if_else", + "condition": { + "type": "origins:and", + "conditions": [ + { + "type": "origins:command", + "command": "time query daytime", + "comparison": "<", + "compare_to": "30" + }, + { + "type": "origins:resource", + "resource": "phoenix:rebirth_state", + "comparison": ">=", + "compare_to": 1 + } + ] }, - { - "type": "origins:if_else", - "condition": { - "type": "origins:command", - "command": "time query daytime", - "comparison": "<", - "compare_to": "12544" - }, - "if_action": { - "type": "origins:change_resource", - "resource": "phoenix:rejuvenation_is_night", - "change": -1 - }, - "else_action": { - "type": "origins:change_resource", - "resource": "phoenix:rejuvenation_is_night", - "change": 1 - } + "if_action": { + "type": "origins:and", + "actions": [ + { + "type": "origins:execute_command", + "command": "function phoenix:rebirth_full_size", + "permission_level": 4 + }, + { + "type": "origins:heal", + "amount": 6 + } + ] } - ] - } + } + ] }, "name": "Rejuvenation", "description": "At sunrise, if you were in your Reborn Form, you will return to Normal Form." diff --git a/src/main/resources/data/phoenix/powers/rejuvenation.json b/src/main/resources/data/phoenix/powers/rejuvenation.json index 6355731..b3e0a00 100644 --- a/src/main/resources/data/phoenix/powers/rejuvenation.json +++ b/src/main/resources/data/phoenix/powers/rejuvenation.json @@ -1,80 +1,44 @@ { - "type": "origins:multiple", - "is_night": { - "type": "origins:resource", - "min": 0, - "max": 1, - "hud_render": { - "should_render": false - } - }, - "update": { - "type": "origins:action_over_time", - "interval": 20, - "entity_action": { - "type": "origins:and", - "actions": [ - { - "type": "origins:if_else", - "condition": { - "type": "origins:and", - "conditions": [ - { - "type": "origins:command", - "command": "time query daytime", - "comparison": "<", - "compare_to": "12544" - }, - { - "type": "origins:resource", - "resource": "phoenix:rejuvenation_is_night", - "comparison": ">=", - "compare_to": 1 - }, - { - "type": "origins:resource", - "resource": "phoenix:rebirth_state", - "comparison": ">=", - "compare_to": 1 - } - ] - }, - "if_action": { - "type": "origins:and", - "actions": [ - { - "type": "origins:execute_command", - "command": "function phoenix:rebirth_full_size", - "permission_level": 4 - }, - { - "type": "origins:heal", - "amount": 6 - } - ] - } + "type": "origins:action_over_time", + "interval": 20, + "entity_action": { + "type": "origins:and", + "actions": [ + { + "type": "origins:if_else", + "condition": { + "type": "origins:and", + "conditions": [ + { + "type": "origins:command", + "command": "time query daytime", + "comparison": "<", + "compare_to": "30" + }, + { + "type": "origins:resource", + "resource": "phoenix:rebirth_state", + "comparison": ">=", + "compare_to": 1 + } + ] }, - { - "type": "origins:if_else", - "condition": { - "type": "origins:command", - "command": "time query daytime", - "comparison": "<", - "compare_to": "12544" - }, - "if_action": { - "type": "origins:change_resource", - "resource": "phoenix:rejuvenation_is_night", - "change": -1 - }, - "else_action": { - "type": "origins:change_resource", - "resource": "phoenix:rejuvenation_is_night", - "change": 1 - } + "if_action": { + "type": "origins:and", + "actions": [ + { + "type": "origins:execute_command", + "command": "function phoenix:rebirth_full_size", + "permission_level": 4 + }, + { + "type": "origins:heal", + "amount": 6 + } + ] } - ] - } + } + ] }, "name": "Rejuvenation", "description": "At sunrise, if you were in your Reborn Form, you will return to Normal Form."