From 6a0f2ba3764ae8e37f550d0e2407dc59f1cbd9d2 Mon Sep 17 00:00:00 2001 From: ForestOfLight Date: Tue, 15 Apr 2025 09:14:10 -0700 Subject: [PATCH 1/2] Prep for RP --- manifest.json => StrucTool [BP]/manifest.json | 0 pack_icon.png => StrucTool [BP]/pack_icon.png | Bin .../scripts}/classes/BlockInfo.js | 0 .../scripts}/classes/BlockVerificationLevel.js | 0 .../scripts}/classes/BlockVerifier.js | 0 .../scripts}/classes/InstanceEditForm.js | 0 .../scripts}/classes/InstanceEditFormBuilder.js | 0 .../scripts}/classes/InstanceEditOptions.js | 0 .../scripts}/classes/MaterialCounter.js | 0 .../scripts}/classes/MenuForm.js | 0 .../scripts}/classes/MenuFormBuilder.js | 0 .../scripts}/classes/Outliner.js | 0 .../scripts}/classes/Raycaster.js | 0 .../scripts}/classes/StructureCollection.js | 0 .../scripts}/classes/StructureInstance.js | 0 .../scripts}/classes/StructureOutliner.js | 0 .../scripts}/classes/StructureVerifier.js | 0 .../scripts}/commands/struct.js | 0 .../scripts}/commands/structool.js | 0 {scripts => StrucTool [BP]/scripts}/config.js | 0 {scripts => StrucTool [BP]/scripts}/data.js | 0 {scripts => StrucTool [BP]/scripts}/lib/Vector.js | 0 .../scripts}/lib/canopy/CanopyExtension.js | 0 .../scripts}/lib/canopy/Command.js | 0 .../scripts}/lib/canopy/Rule.js | 0 .../scripts}/lib/canopy/extension.ipc.js | 0 .../scripts}/lib/ipc/ipc.d.ts | 0 {scripts => StrucTool [BP]/scripts}/lib/ipc/ipc.js | 0 {scripts => StrucTool [BP]/scripts}/main.js | 0 .../scripts}/rules/easyPlace.js | 0 .../scripts}/rules/fastEasyPlace.js | 0 .../scripts}/rules/showStructBlockInfo.js | 0 {scripts => StrucTool [BP]/scripts}/utils.js | 0 .../structures}/Everything.mcstructure | Bin 34 files changed, 0 insertions(+), 0 deletions(-) rename manifest.json => StrucTool [BP]/manifest.json (100%) rename pack_icon.png => StrucTool [BP]/pack_icon.png (100%) rename {scripts => StrucTool [BP]/scripts}/classes/BlockInfo.js (100%) rename {scripts => StrucTool [BP]/scripts}/classes/BlockVerificationLevel.js (100%) rename {scripts => StrucTool [BP]/scripts}/classes/BlockVerifier.js (100%) rename {scripts => StrucTool [BP]/scripts}/classes/InstanceEditForm.js (100%) rename {scripts => StrucTool [BP]/scripts}/classes/InstanceEditFormBuilder.js (100%) rename {scripts => StrucTool [BP]/scripts}/classes/InstanceEditOptions.js (100%) rename {scripts => StrucTool [BP]/scripts}/classes/MaterialCounter.js (100%) rename {scripts => StrucTool [BP]/scripts}/classes/MenuForm.js (100%) rename {scripts => StrucTool [BP]/scripts}/classes/MenuFormBuilder.js (100%) rename {scripts => StrucTool [BP]/scripts}/classes/Outliner.js (100%) rename {scripts => StrucTool [BP]/scripts}/classes/Raycaster.js (100%) rename {scripts => StrucTool [BP]/scripts}/classes/StructureCollection.js (100%) rename {scripts => StrucTool [BP]/scripts}/classes/StructureInstance.js (100%) rename {scripts => StrucTool [BP]/scripts}/classes/StructureOutliner.js (100%) rename {scripts => StrucTool [BP]/scripts}/classes/StructureVerifier.js (100%) rename {scripts => StrucTool [BP]/scripts}/commands/struct.js (100%) rename {scripts => StrucTool [BP]/scripts}/commands/structool.js (100%) rename {scripts => StrucTool [BP]/scripts}/config.js (100%) rename {scripts => StrucTool [BP]/scripts}/data.js (100%) rename {scripts => StrucTool [BP]/scripts}/lib/Vector.js (100%) rename {scripts => StrucTool [BP]/scripts}/lib/canopy/CanopyExtension.js (100%) rename {scripts => StrucTool [BP]/scripts}/lib/canopy/Command.js (100%) rename {scripts => StrucTool [BP]/scripts}/lib/canopy/Rule.js (100%) rename {scripts => StrucTool [BP]/scripts}/lib/canopy/extension.ipc.js (100%) rename {scripts => StrucTool [BP]/scripts}/lib/ipc/ipc.d.ts (100%) rename {scripts => StrucTool [BP]/scripts}/lib/ipc/ipc.js (100%) rename {scripts => StrucTool [BP]/scripts}/main.js (100%) rename {scripts => StrucTool [BP]/scripts}/rules/easyPlace.js (100%) rename {scripts => StrucTool [BP]/scripts}/rules/fastEasyPlace.js (100%) rename {scripts => StrucTool [BP]/scripts}/rules/showStructBlockInfo.js (100%) rename {scripts => StrucTool [BP]/scripts}/utils.js (100%) rename {structures => StrucTool [BP]/structures}/Everything.mcstructure (100%) diff --git a/manifest.json b/StrucTool [BP]/manifest.json similarity index 100% rename from manifest.json rename to StrucTool [BP]/manifest.json diff --git a/pack_icon.png b/StrucTool [BP]/pack_icon.png similarity index 100% rename from pack_icon.png rename to StrucTool [BP]/pack_icon.png diff --git a/scripts/classes/BlockInfo.js b/StrucTool [BP]/scripts/classes/BlockInfo.js similarity index 100% rename from scripts/classes/BlockInfo.js rename to StrucTool [BP]/scripts/classes/BlockInfo.js diff --git a/scripts/classes/BlockVerificationLevel.js b/StrucTool [BP]/scripts/classes/BlockVerificationLevel.js similarity index 100% rename from scripts/classes/BlockVerificationLevel.js rename to StrucTool [BP]/scripts/classes/BlockVerificationLevel.js diff --git a/scripts/classes/BlockVerifier.js b/StrucTool [BP]/scripts/classes/BlockVerifier.js similarity index 100% rename from scripts/classes/BlockVerifier.js rename to StrucTool [BP]/scripts/classes/BlockVerifier.js diff --git a/scripts/classes/InstanceEditForm.js b/StrucTool [BP]/scripts/classes/InstanceEditForm.js similarity index 100% rename from scripts/classes/InstanceEditForm.js rename to StrucTool [BP]/scripts/classes/InstanceEditForm.js diff --git a/scripts/classes/InstanceEditFormBuilder.js b/StrucTool [BP]/scripts/classes/InstanceEditFormBuilder.js similarity index 100% rename from scripts/classes/InstanceEditFormBuilder.js rename to StrucTool [BP]/scripts/classes/InstanceEditFormBuilder.js diff --git a/scripts/classes/InstanceEditOptions.js b/StrucTool [BP]/scripts/classes/InstanceEditOptions.js similarity index 100% rename from scripts/classes/InstanceEditOptions.js rename to StrucTool [BP]/scripts/classes/InstanceEditOptions.js diff --git a/scripts/classes/MaterialCounter.js b/StrucTool [BP]/scripts/classes/MaterialCounter.js similarity index 100% rename from scripts/classes/MaterialCounter.js rename to StrucTool [BP]/scripts/classes/MaterialCounter.js diff --git a/scripts/classes/MenuForm.js b/StrucTool [BP]/scripts/classes/MenuForm.js similarity index 100% rename from scripts/classes/MenuForm.js rename to StrucTool [BP]/scripts/classes/MenuForm.js diff --git a/scripts/classes/MenuFormBuilder.js b/StrucTool [BP]/scripts/classes/MenuFormBuilder.js similarity index 100% rename from scripts/classes/MenuFormBuilder.js rename to StrucTool [BP]/scripts/classes/MenuFormBuilder.js diff --git a/scripts/classes/Outliner.js b/StrucTool [BP]/scripts/classes/Outliner.js similarity index 100% rename from scripts/classes/Outliner.js rename to StrucTool [BP]/scripts/classes/Outliner.js diff --git a/scripts/classes/Raycaster.js b/StrucTool [BP]/scripts/classes/Raycaster.js similarity index 100% rename from scripts/classes/Raycaster.js rename to StrucTool [BP]/scripts/classes/Raycaster.js diff --git a/scripts/classes/StructureCollection.js b/StrucTool [BP]/scripts/classes/StructureCollection.js similarity index 100% rename from scripts/classes/StructureCollection.js rename to StrucTool [BP]/scripts/classes/StructureCollection.js diff --git a/scripts/classes/StructureInstance.js b/StrucTool [BP]/scripts/classes/StructureInstance.js similarity index 100% rename from scripts/classes/StructureInstance.js rename to StrucTool [BP]/scripts/classes/StructureInstance.js diff --git a/scripts/classes/StructureOutliner.js b/StrucTool [BP]/scripts/classes/StructureOutliner.js similarity index 100% rename from scripts/classes/StructureOutliner.js rename to StrucTool [BP]/scripts/classes/StructureOutliner.js diff --git a/scripts/classes/StructureVerifier.js b/StrucTool [BP]/scripts/classes/StructureVerifier.js similarity index 100% rename from scripts/classes/StructureVerifier.js rename to StrucTool [BP]/scripts/classes/StructureVerifier.js diff --git a/scripts/commands/struct.js b/StrucTool [BP]/scripts/commands/struct.js similarity index 100% rename from scripts/commands/struct.js rename to StrucTool [BP]/scripts/commands/struct.js diff --git a/scripts/commands/structool.js b/StrucTool [BP]/scripts/commands/structool.js similarity index 100% rename from scripts/commands/structool.js rename to StrucTool [BP]/scripts/commands/structool.js diff --git a/scripts/config.js b/StrucTool [BP]/scripts/config.js similarity index 100% rename from scripts/config.js rename to StrucTool [BP]/scripts/config.js diff --git a/scripts/data.js b/StrucTool [BP]/scripts/data.js similarity index 100% rename from scripts/data.js rename to StrucTool [BP]/scripts/data.js diff --git a/scripts/lib/Vector.js b/StrucTool [BP]/scripts/lib/Vector.js similarity index 100% rename from scripts/lib/Vector.js rename to StrucTool [BP]/scripts/lib/Vector.js diff --git a/scripts/lib/canopy/CanopyExtension.js b/StrucTool [BP]/scripts/lib/canopy/CanopyExtension.js similarity index 100% rename from scripts/lib/canopy/CanopyExtension.js rename to StrucTool [BP]/scripts/lib/canopy/CanopyExtension.js diff --git a/scripts/lib/canopy/Command.js b/StrucTool [BP]/scripts/lib/canopy/Command.js similarity index 100% rename from scripts/lib/canopy/Command.js rename to StrucTool [BP]/scripts/lib/canopy/Command.js diff --git a/scripts/lib/canopy/Rule.js b/StrucTool [BP]/scripts/lib/canopy/Rule.js similarity index 100% rename from scripts/lib/canopy/Rule.js rename to StrucTool [BP]/scripts/lib/canopy/Rule.js diff --git a/scripts/lib/canopy/extension.ipc.js b/StrucTool [BP]/scripts/lib/canopy/extension.ipc.js similarity index 100% rename from scripts/lib/canopy/extension.ipc.js rename to StrucTool [BP]/scripts/lib/canopy/extension.ipc.js diff --git a/scripts/lib/ipc/ipc.d.ts b/StrucTool [BP]/scripts/lib/ipc/ipc.d.ts similarity index 100% rename from scripts/lib/ipc/ipc.d.ts rename to StrucTool [BP]/scripts/lib/ipc/ipc.d.ts diff --git a/scripts/lib/ipc/ipc.js b/StrucTool [BP]/scripts/lib/ipc/ipc.js similarity index 100% rename from scripts/lib/ipc/ipc.js rename to StrucTool [BP]/scripts/lib/ipc/ipc.js diff --git a/scripts/main.js b/StrucTool [BP]/scripts/main.js similarity index 100% rename from scripts/main.js rename to StrucTool [BP]/scripts/main.js diff --git a/scripts/rules/easyPlace.js b/StrucTool [BP]/scripts/rules/easyPlace.js similarity index 100% rename from scripts/rules/easyPlace.js rename to StrucTool [BP]/scripts/rules/easyPlace.js diff --git a/scripts/rules/fastEasyPlace.js b/StrucTool [BP]/scripts/rules/fastEasyPlace.js similarity index 100% rename from scripts/rules/fastEasyPlace.js rename to StrucTool [BP]/scripts/rules/fastEasyPlace.js diff --git a/scripts/rules/showStructBlockInfo.js b/StrucTool [BP]/scripts/rules/showStructBlockInfo.js similarity index 100% rename from scripts/rules/showStructBlockInfo.js rename to StrucTool [BP]/scripts/rules/showStructBlockInfo.js diff --git a/scripts/utils.js b/StrucTool [BP]/scripts/utils.js similarity index 100% rename from scripts/utils.js rename to StrucTool [BP]/scripts/utils.js diff --git a/structures/Everything.mcstructure b/StrucTool [BP]/structures/Everything.mcstructure similarity index 100% rename from structures/Everything.mcstructure rename to StrucTool [BP]/structures/Everything.mcstructure From f3dcdb217f10ff4beaa2e1123f952ad85ea581f8 Mon Sep 17 00:00:00 2001 From: ForestOfLight Date: Tue, 15 Apr 2025 09:35:12 -0700 Subject: [PATCH 2/2] Add BP assets --- StrucTool [BP]/manifest.json | 6 +- StrucTool [BP]/scripts/classes/Outliner.js | 4 +- StrucTool [BP]/scripts/commands/struct.js | 115 ------------------ .../scripts/rules/showStructBlockInfo.js | 0 StrucTool [RP]/manifest.json | 31 +++++ .../particles/blockoverlay.particle.json | 31 +++++ .../particles/outline.particle.json | 37 ++++++ StrucTool [RP]/textures/particle/white.png | Bin 0 -> 83 bytes 8 files changed, 106 insertions(+), 118 deletions(-) delete mode 100644 StrucTool [BP]/scripts/commands/struct.js delete mode 100644 StrucTool [BP]/scripts/rules/showStructBlockInfo.js create mode 100644 StrucTool [RP]/manifest.json create mode 100644 StrucTool [RP]/particles/blockoverlay.particle.json create mode 100644 StrucTool [RP]/particles/outline.particle.json create mode 100644 StrucTool [RP]/textures/particle/white.png diff --git a/StrucTool [BP]/manifest.json b/StrucTool [BP]/manifest.json index 901fa1c..c0c3d71 100644 --- a/StrucTool [BP]/manifest.json +++ b/StrucTool [BP]/manifest.json @@ -1,7 +1,7 @@ { "format_version": 2, "header": { - "name": "StrucTool", + "name": "StrucTool [BP] v1.0.0", "description": "Survival building extension for §l§aCanopy§r by §aForestOfLight§r.", "uuid": "8c0c0153-d8b9-482a-889f-aef922b8fe58", "min_engine_version": [1, 21, 70], @@ -32,6 +32,10 @@ "module_name": "@minecraft/server-ui", "version": "2.0.0-beta" }, + { + "uuid": "375ec465-3dc1-429f-8b4c-a337889e1ed4", // StrucTool RP + "version": [1, 0, 0] + }, { "uuid": "bcf34368-ed0c-4cf7-938e-582cccf9950d", // Canopy RP "version": [1, 0, 3] diff --git a/StrucTool [BP]/scripts/classes/Outliner.js b/StrucTool [BP]/scripts/classes/Outliner.js index 08d8821..cb40faa 100644 --- a/StrucTool [BP]/scripts/classes/Outliner.js +++ b/StrucTool [BP]/scripts/classes/Outliner.js @@ -6,8 +6,8 @@ export class Outliner { dimension; min = new Vector(); max = new Vector(); - drawParticle = "minecraft:villager_happy"; - drawFrequency = 8; + drawParticle = "structool:outline"; + drawFrequency = 20; #drawParticles = []; #runner = null; diff --git a/StrucTool [BP]/scripts/commands/struct.js b/StrucTool [BP]/scripts/commands/struct.js deleted file mode 100644 index 320f4af..0000000 --- a/StrucTool [BP]/scripts/commands/struct.js +++ /dev/null @@ -1,115 +0,0 @@ -import { Command } from '../lib/canopy/CanopyExtension'; -import { extension } from '../config'; -import { structureCollection } from '../classes/StructureCollection'; -import { MaterialCounter } from '../classes/MaterialCounter'; - -const structCmd = new Command({ - name: 'struct', - description: { text: 'Manages current StrucTool structures.' }, - usage: 'struct [args...]', - callback: structCommand, - args: [ - { type: 'string', name: 'name' }, - { type: 'string', name: 'option' }, - { type: 'string|number', name: 'arg3' } - ] -}); -extension.addCommand(structCmd); - -function structCommand(sender, args) { - const { name, option, arg3 } = args; - switch (option) { - case 'add': - addStructure(sender, name); - break; - case 'remove': - removeStructure(sender, name); - break; - case 'place': - placeStructure(sender, name); - break; - case 'layer': - setLayer(sender, name, arg3); - break; - case 'info': - printInfo(sender, name); - break; - default: - structCmd.sendUsage(sender); - } -} - -function addStructure(sender, name) { - try { - structureCollection.add(name, name); - } catch (e) { - if (e.message.includes('already exists')) { - sender.sendMessage({ text: `§cStructure '${name}' already exists.` }); - return; - } else { - sender.sendMessage({ text: `§cFailed to add structure '${name}'.` }); - throw e; - } - } - sender.sendMessage({ text: `§7Added structure '${name}'` }); -} - -function removeStructure(sender, name) { - try { - structureCollection.remove(name); - } catch (e) { - sender.sendMessage({ text: `§cStructure '${name}' not found.` }); - return; - } - sender.sendMessage({ text: `Removed structure '${name}'` }); -} - -function placeStructure(sender, name) { - let structure; - try { - structure = structureCollection.get(name); - } catch (e) { - try { - structure = structureCollection.add(name, name); - } catch (e) { - if (e.message.includes('already exists')) { - sender.sendMessage({ text: `§cStructure '${name}' already exists.` }); - return; - } else if (e.message.includes('not found')) { - sender.sendMessage({ text: `§cStructure '${name}' not found.` }); - return; - } else { - sender.sendMessage({ text: `§cFailed to place structure '${name}'.` }); - throw e; - } - } - } - structure.place(sender.dimension.id, sender.location); - sender.sendMessage({ text: `§7Placed structure '${name}'.` }); -} - -function setLayer(sender, name, layer) { - let structure; - try { - structure = structureCollection.get(name); - } catch (e) { - sender.sendMessage({ text: `§cStructure '${name}' not found.` }); - return; - } - structure.setLayer(layer); - sender.sendMessage({ text: `§7Set layer of structure '${name}' to ${layer}.` }); -} - -function printInfo(sender, name) { - let structure; - try { - structure = structureCollection.get(name); - } catch (e) { - sender.sendMessage({ text: `§cStructure '${name}' not found.` }); - return; - } - const { dimensionId, location } = structure.getLocation(); - sender.sendMessage({ text: `§7Structure '${name}' at [${location.x} ${location.y} ${location.z}] in '${dimensionId}'` }); - sender.sendMessage({ text: `§7Current Layer: ${structure.getLayer()}` }); - sender.sendMessage({ text: `§7Materials: ${MaterialCounter.getPrintable(name)}` }); -} \ No newline at end of file diff --git a/StrucTool [BP]/scripts/rules/showStructBlockInfo.js b/StrucTool [BP]/scripts/rules/showStructBlockInfo.js deleted file mode 100644 index e69de29..0000000 diff --git a/StrucTool [RP]/manifest.json b/StrucTool [RP]/manifest.json new file mode 100644 index 0000000..6ab353c --- /dev/null +++ b/StrucTool [RP]/manifest.json @@ -0,0 +1,31 @@ +{ + "format_version": 2, + "header": { + "name": "StrucTool [RP] v1.0.0", + "description": "Survival building extension for §l§aCanopy§r by §aForestOfLight§r.", + "uuid": "375ec465-3dc1-429f-8b4c-a337889e1ed4", + "version": [1, 0, 0], + "min_engine_version": [1,17,0] + }, + "modules": [ + { + "type": "resources", + "uuid": "7f6b23df-a583-476b-b0e4-87457e65f7c0", + "version": [1, 0, 0] + } + ], + "dependencies": [ + { + "uuid": "8c0c0153-d8b9-482a-889f-aef922b8fe58", // StrucTool BP + "version": [1, 0, 0] + }, + { + "uuid": "7f6b23df-a583-476b-b0e4-87457e65f7c0", // Canopy BP + "version": [1, 3, 9] + } + ], + "metadata": { + "authors": [ "ForestOfLight" ], + "license": "MIT" + } + } \ No newline at end of file diff --git a/StrucTool [RP]/particles/blockoverlay.particle.json b/StrucTool [RP]/particles/blockoverlay.particle.json new file mode 100644 index 0000000..1694375 --- /dev/null +++ b/StrucTool [RP]/particles/blockoverlay.particle.json @@ -0,0 +1,31 @@ +{ + "format_version": "1.10.0", + "particle_effect": { + "description": { + "identifier": "structool:blockoverlay", + "basic_render_parameters": { + "material": "particles_blend", + "texture": "textures/particle/white" + } + }, + "components": { + "minecraft:emitter_rate_instant": { + "num_particles": 1 + }, + "minecraft:emitter_lifetime_once": { + "active_time": 1 + }, + "minecraft:emitter_shape_point": {}, + "minecraft:particle_lifetime_expression": { + "max_lifetime": 1 + }, + "minecraft:particle_appearance_billboard": { + "size": [0.5, 0.5], + "facing_camera_mode": "emitter_transform_xz" + }, + "minecraft:particle_appearance_tinting": { + "color": [1, 0, 0, 0.5] + } + } + } +} \ No newline at end of file diff --git a/StrucTool [RP]/particles/outline.particle.json b/StrucTool [RP]/particles/outline.particle.json new file mode 100644 index 0000000..cd22a71 --- /dev/null +++ b/StrucTool [RP]/particles/outline.particle.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.10.0", + "particle_effect": { + "description": { + "identifier": "structool:outline", + "basic_render_parameters": { + "material": "particles_blend", + "texture": "textures/particle/particles" + } + }, + "components": { + "minecraft:emitter_rate_instant": { + "num_particles": 1 + }, + "minecraft:emitter_lifetime_once": { + "active_time": 1 + }, + "minecraft:emitter_shape_point": {}, + "minecraft:particle_lifetime_expression": { + "max_lifetime": 1 + }, + "minecraft:particle_appearance_billboard": { + "size": [0.2, 0.2], + "facing_camera_mode": "rotate_xyz", + "uv": { + "texture_width": 16, + "texture_height": 16, + "uv": [6, 11], + "uv_size": [1, 1] + } + }, + "minecraft:particle_appearance_tinting": { + "color": [0, 0.66667, 0, 1] + } + } + } +} \ No newline at end of file diff --git a/StrucTool [RP]/textures/particle/white.png b/StrucTool [RP]/textures/particle/white.png new file mode 100644 index 0000000000000000000000000000000000000000..9f34bbd46e054cedccb074d041ba826c5436defb GIT binary patch literal 83 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k92}K#X;^)4C~IxyaaN1JzX3_B*K$_ d{Qv*Io`Lf>^IukH*Hb_V22WQ%mvv4FO#rl#6#)PM literal 0 HcmV?d00001