Skip to content

Commit

Permalink
add error check to dimension change on camera & change extension name…
Browse files Browse the repository at this point in the history
… color in help
  • Loading branch information
ForestOfLight committed Aug 20, 2024
1 parent 40867f6 commit 2012194
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Canopy [BP]/scripts/src/commands/camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ world.beforeEvents.playerLeave.subscribe((event) => {

world.afterEvents.playerDimensionChange.subscribe((event) => {
const player = event.player;
if (!player.getDynamicProperty('isViewingCamera')) return;
if (!player?.getDynamicProperty('isViewingCamera')) return;
player.camera.clear();
player.setDynamicProperty('isViewingCamera', false);
});
Expand All @@ -112,7 +112,7 @@ function cameraCommand(sender, args) {

function placeCameraAction(sender) {
let camera;
let eyeHeight = 1.62001002;
const eyeHeight = 1.62001002;

if (sender.getDynamicProperty('isViewingCamera')) return sender.sendMessage('§cYou cannot place a camera while viewing one.');

Expand Down
4 changes: 2 additions & 2 deletions Canopy [BP]/scripts/src/commands/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function populateExtensionPages(helpBook) {
const commandExtensions = Command.getExtensionNames();

for (const extensionName of ruleExtensions) {
const rulePage = new RuleHelpPage(`Rules`, `Togglable rules for ${extensionName}.`, Command.prefix + `canopy <rule> <true/false>`, extensionName);
const rulePage = new RuleHelpPage(`Rules`, `Togglable rules for §a${extensionName}§2.`, Command.prefix + `canopy <rule> <true/false>`, extensionName);
const rules = Rule.getRulesByExtension(extensionName);
helpBook.newPage(rulePage);
for (let rule of rules) {
Expand All @@ -76,7 +76,7 @@ function populateExtensionPages(helpBook) {
}

for (const extensionName of commandExtensions) {
const commandPage = new CommandHelpPage(`Commands`, `Commands for ${extensionName}.`, extensionName);
const commandPage = new CommandHelpPage(`Commands`, `Commands for §a${extensionName}§2.`, extensionName);
let commands = Command.getCommandsByExtension(extensionName);
commands = commands.filter(cmd => !cmd.isHelpHidden());
helpBook.newPage(commandPage);
Expand Down
2 changes: 1 addition & 1 deletion Canopy [BP]/scripts/src/commands/resetall.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Command } from 'lib/canopy/Canopy'

new Command({
name: 'resetall',
description: 'Resets all §l§aCanopy§r§8 features and data. Use with caution.',
description: 'Resets all §lCanopy§r§8 features and data. Use with caution.',
usage: 'resetall',
callback: resetallCommand,
adminOnly: true
Expand Down

0 comments on commit 2012194

Please sign in to comment.