import{Direction as t,ItemStack as e}from"@minecraft/server";import{DisplayContext as r}from"./context";export class WeaponRack{_allowedTags=["minecraft:is_tool","minecraft:is_trident"];type;constructor(t){this.type=t}typeId(){return`bc_ds:${this.type}_weapon_rack`}supportsItem(t){return this._allowedTags.filter(e=>t.hasTag(e)).length>0}displayContext(){return r.WeaponRack}maxStackSize(){return 1}maxItems(){return 3}lockedRotation(){return!0}calculateBestIndex(e,r,a){if(r===t.Down);else if(r===t.Up)return 3;else if(a.y>.7)return 3;else if(a.y>.375)return 2;return 1}calculateRotation(t,e){return({north:4,east:6,south:0,west:2})[e]}}