From f3dcdb217f10ff4beaa2e1123f952ad85ea581f8 Mon Sep 17 00:00:00 2001 From: ForestOfLight Date: Tue, 15 Apr 2025 09:35:12 -0700 Subject: [PATCH] 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