Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
1.0.2-release
Browse files Browse the repository at this point in the history
  • Loading branch information
VoxlDevv committed Jun 13, 2023
1 parent d36ad90 commit a1608f3
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 27 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"Author": "JustSkyDev",
"YouTube": "https://youtube.com/@JustSkyDev",
"API": {
"Version": "1.0.2-pre-release",
"Version": "1.0.2-release",
"URL": "https://github.com/JustSkyDev/Bedrock-API",
"License": "MIT",
"Download": {
Expand Down
4 changes: 2 additions & 2 deletions scripts/JS/@modules/handlers/entity/Entity.Class.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class EntityClass {
* @example getTags();
*/
getTags() {
return this.entity.getTags();
return this.entityObject.getTags();
}

/**
Expand Down Expand Up @@ -61,7 +61,7 @@ class EntityClass {
);

const check = this.getTags()?.find((tag) => tag.startsWith(startswith));
return check ? check : false;
return check;
}
}

Expand Down
16 changes: 1 addition & 15 deletions scripts/JS/@modules/handlers/entity/Player.Class.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class PlayerClass extends EntityClass {
* @returns {ItemStack|undefined}
*/
getRightItem() {
return this.container.getItem(this.playerObject.selectedSlot) ?? undefined;
return this.container.getItem(this.playerObject.selectedSlot);
}

/**
Expand All @@ -102,20 +102,6 @@ class PlayerClass extends EntityClass {
}
return inventory;
}

/**
* Add enchantment to right hands item
* @param {ItemStack} item - Item stack
* @param {String|EnchantmentType} enchant - Enchant name
* @param {Number|undefined} level - Enchant level
*/
addRightEnchant(item, enchant, level = 1) {
const enchant = new Enchantment(enchant, level);
this.container.setItem(
this.playerObject.selectedSlot,
item.getComponent("enchantment").addEnchantment(enchant)
);
}
}

export { PlayerClass };
2 changes: 1 addition & 1 deletion scripts/JS/@modules/handlers/message/Failed.Class.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class FailedClass {
},
{
translate: "commands.generic.unknown",
with: [`§f${commandName}§c`],
with: [`${commandName}`],
},
],
});
Expand Down
2 changes: 1 addition & 1 deletion scripts/JS/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const Config = {
defaultPrefix: "!", // Default custom command prefix
disableWatchDog: true, // Change to true when your world crashes
version: "1.0.2-pre-release",
version: "1.0.2-release",
};

export { Config };
2 changes: 1 addition & 1 deletion scripts/JS/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Index importer
// Index importer
import { system } from "@minecraft/server";
import { Config } from "./config.js";

Expand Down
13 changes: 9 additions & 4 deletions scripts/JS/plugins/Chat Ranks/system.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { system } from "@minecraft/server";
import { BeforeEvents, PlayerClass, Timer, ChatClass } from "../class.chain.js";
import {
Command,
BeforeEvents,
PlayerClass,
Timer,
ChatClass,
} from "../class.chain.js";
import { RankConfig } from "./config.js";

BeforeEvents.on("send", async (data) => {
BeforeEvents.on("chat", async (data) => {
const { message, sender } = data;
if (message.startsWith(API.Command.getPrefix())) return;
if (message.startsWith(Command.getPrefix())) return;
data.cancel = true;
const player = new PlayerClass(sender);
const getRankTag =
Expand Down
4 changes: 3 additions & 1 deletion scripts/JS/plugins/Custom Commands/built-in/checkOnline.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ Command.BuildCommand(registration, (interaction) => {
const player = new PlayerClass(sender);

if (Validation.isUndefined(inputs.getInput(0)))
return sender.sendMessage("§cSeconds arguments cannot be empty");
return sender.sendMessage(
"§cPlayername should be starts with @, like @PlayerName"
);

const checkPlayer = player.isOnline(inputs.getInput(0));
return sender.sendMessage(
Expand Down
2 changes: 1 addition & 1 deletion scripts/JS/plugins/Custom Commands/built-in/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Command.BuildCommand(registration, (interaction) => {
item.usage.length === 0 ? "No usage found" : item.usage.join(", ")
}\n§7Example Usage: §f${
item.example.length === 0 ? "No example found" : item.example.join(", ")
}\n§a-------------------------`
}\n§a---------------------------`
);
} else {
const startIndex = ((inputs.getInput(0) ?? 1) - 1) * PAGE_LIMIT;
Expand Down

0 comments on commit a1608f3

Please sign in to comment.