From 5572281d3e3b5635bc660658166eacc427cb06cd Mon Sep 17 00:00:00 2001 From: ink0rr Date: Tue, 8 Oct 2024 16:36:55 +0700 Subject: [PATCH] Remove duplicate event schema and unnecessary pattern match --- .../entities/format/components/breedable.json | 2 +- .../behavior/entities/format/types/event.json | 4 ++-- .../entities/format/types/event_object.json | 2 +- .../format/types/event_object_filters.json | 20 ------------------- 4 files changed, 4 insertions(+), 24 deletions(-) delete mode 100644 source/behavior/entities/format/types/event_object_filters.json diff --git a/source/behavior/entities/format/components/breedable.json b/source/behavior/entities/format/components/breedable.json index e1c691b7a..44753b744 100644 --- a/source/behavior/entities/format/components/breedable.json +++ b/source/behavior/entities/format/components/breedable.json @@ -16,7 +16,7 @@ "title": "Baby Type" }, "breed_event": { - "$ref": "../types/event_object_filters.json", + "$ref": "../types/event_object.json", "description": "Event to run when this entity breeds.", "title": "Breed Event" }, diff --git a/source/behavior/entities/format/types/event.json b/source/behavior/entities/format/types/event.json index d64963c89..9e41cabe6 100644 --- a/source/behavior/entities/format/types/event.json +++ b/source/behavior/entities/format/types/event.json @@ -10,11 +10,11 @@ } ], "oneOf": [ - { "type": "string", "pattern": "^[a-zA-Z0-9_\\-:]+$", "description": "The event to fire." }, + { "type": "string", "description": "The event to fire." }, { "type": "object", "properties": { - "event": { "type": "string", "pattern": "^[a-zA-Z0-9_\\-:]+$", "description": "The event to fire.", "title": "Event" }, + "event": { "type": "string", "description": "The event to fire.", "title": "Event" }, "target": { "type": "string", "description": "The target of the event.", diff --git a/source/behavior/entities/format/types/event_object.json b/source/behavior/entities/format/types/event_object.json index d68039f61..ba5b49546 100644 --- a/source/behavior/entities/format/types/event_object.json +++ b/source/behavior/entities/format/types/event_object.json @@ -9,7 +9,7 @@ "filters": { "$ref": "../../filters/filters.json" }, - "event": { "type": "string", "pattern": "^[a-zA-Z0-9_\\-:]+$", "description": "The event to fire.", "title": "Event" }, + "event": { "type": "string", "description": "The event to fire.", "title": "Event" }, "target": { "type": "string", "description": "The target of the event.", diff --git a/source/behavior/entities/format/types/event_object_filters.json b/source/behavior/entities/format/types/event_object_filters.json deleted file mode 100644 index 0da319b39..000000000 --- a/source/behavior/entities/format/types/event_object_filters.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$id": "blockception.minecraft.entities.event_object", - "title": "Event", - "description": "Minecraft behavior event.", - "examples": [{ "event": "example:foo", "target": "self" }], - "type": "object", - "additionalProperties": false, - "properties": { - "event": { "type": "string", "pattern": "^[a-zA-Z0-9_\\-:]+$", "description": "The event to fire.", "title": "Event" }, - "target": { - "type": "string", - "description": "The target of the event.", - "title": "Target", - "enum": ["baby", "block", "damager", "other", "parent", "player", "self", "target"] - }, - "filters": { - "$ref": "../../filters/filters.json" - } - } -}