import { Block } from "@minecraft/server";
import { blocks, mobs } from "./data";
Block.prototype.isSolid = function() {
  return !this.isAir && !this.isLiquid;
};
function isMobMorph(morph) {
  if (mobs.includes(morph)) {
    return true;
  }
  return false;
}
function isBlockMorph(morph) {
  if (blocks.includes(morph)) {
    return true;
  }
  return false;
}
function actionBar(player, message) {
  player.onScreenDisplay.setActionBar(message);
}
function langText(langText2, withText = void 0) {
  if (withText === void 0 || withText.length == 0)
    return { rawtext: [{ translate: langText2 }] };
  else
    return { rawtext: [{ translate: langText2, with: withText }] };
}
function getEntityId(entity) {
  const typeId = entity.typeId;
  switch (typeId) {
    case "minecraft:evocation_illager":
      return "minecraft:evoker";
    case "minecraft:villager_v2":
      return "minecraft:villager";
    case "minecraft:zombie_villager_v2":
      return "minecraft:zombie_villager";
    case "minecraft:tropicalfish":
      return "minecraft:tropical_fish";
    default:
      return typeId;
  }
}
function Vector3Add(v1, v2) {
  return { x: v1.x + v2.x, y: v1.y + v2.y, z: v1.z + v2.z };
}
function Vector3Scalar(v1, m) {
  return { x: v1.x * m, y: v1.y * m, z: v1.z * m };
}
export {
  Vector3Add,
  Vector3Scalar,
  actionBar,
  getEntityId,
  isBlockMorph,
  isMobMorph,
  langText
};
