diff --git a/entities/cannon.json b/entities/cannon.json index d62f3c56..c995446c 100644 --- a/entities/cannon.json +++ b/entities/cannon.json @@ -77,7 +77,7 @@ "minecraft:physics": {}, "minecraft:input_ground_controlled": {}, "minecraft:movement": { - "value": 0.1 + "value": 0.05 } }, diff --git a/src/lib/shop/buttons/item-modifier.ts b/src/lib/shop/buttons/item-modifier.ts index be459760..deb78582 100644 --- a/src/lib/shop/buttons/item-modifier.ts +++ b/src/lib/shop/buttons/item-modifier.ts @@ -16,7 +16,8 @@ export function createItemModifier( itemFilter: ItemFilter, modifyItem: (itemSlot: ContainerSlot, itemStack: ItemStack, successBuyText: MaybeRawText) => boolean | void, ) { - shopForm.product + shopForm + .product() .name(name) .cost(new MultiCost(ShouldHaveItemCost.createFromFilter(itemFilter, itemFilterName), cost)) .onBuy((player, text, success, successBuyText) => { @@ -57,7 +58,8 @@ export function createItemModifierSection( onOpen: ShopMenuWithSlotCreate, manualSelectItemButton = false, ) { - shopForm.product + shopForm + .product() .name(name) .cost(ShouldHaveItemCost.createFromFilter(itemFilter, itemFilterName)) .onBuy((player, text) => { diff --git a/src/lib/shop/buttons/sellable-item.ts b/src/lib/shop/buttons/sellable-item.ts index f10cd51f..5c7f2507 100644 --- a/src/lib/shop/buttons/sellable-item.ts +++ b/src/lib/shop/buttons/sellable-item.ts @@ -97,7 +97,8 @@ function createBuy( const total = getTotal(count, i => getBuy(dbCount - i)) const cost = total <= 0 ? ImpossibleBuyCost : dbCount - count < 0 ? NoItemsToSell : new MoneyCost(total) - form.product + form + .product() .name(itemDescription({ typeId: type, amount: count })) .cost(cost) .onBuy(player => { @@ -128,7 +129,8 @@ function createSell( new ItemCost(type, count), ) - form.product + form + .product() .name(new MoneyCost(total).toString()) .cost(cost) .onBuy(player => { diff --git a/src/lib/shop/form.ts b/src/lib/shop/form.ts index 943f3952..44707961 100644 --- a/src/lib/shop/form.ts +++ b/src/lib/shop/form.ts @@ -78,15 +78,17 @@ export class ShopForm { * @param onBuy * @returns */ - product = Product.create() - .creator( - product => { - this.buttons.push(product) - return product - }, - message => this.show(message), - ) - .player(this.player) + product() { + return Product.create() + .creator( + product => { + this.buttons.push(product) + return product + }, + message => this.show(message), + ) + .player(this.player) + } itemModifier( name: ProductName, @@ -123,7 +125,7 @@ export class ShopForm { * @param cost */ itemStack(item: ItemStack, cost: Cost, texture = getAuxOrTexture(item.typeId)) { - this.product + this.product() .name(itemDescription(item, '')) .cost(cost) .onBuy(player => { @@ -133,7 +135,6 @@ export class ShopForm { player.container.addItem(item) }) .setTexture(texture) - .setSell(false) .setCustomCostBuy(true) return this diff --git a/src/modules/places/stone-quarry/gunsmith.ts b/src/modules/places/stone-quarry/gunsmith.ts index 39bdcce7..8578b117 100644 --- a/src/modules/places/stone-quarry/gunsmith.ts +++ b/src/modules/places/stone-quarry/gunsmith.ts @@ -34,7 +34,8 @@ export class Gunsmith extends ShopNpc { ).includes(item.typeId), 'Алмазный предмет', (form, slot) => { - form.product + form + .product() .name('Улучшить') .cost(new MultiCost().item(i.NetheriteIngot, 1).money(1000)) .onBuy(() => this.upgradeDiamondSwordToNetherite(slot, player)) @@ -49,7 +50,8 @@ export class Gunsmith extends ShopNpc { const item = slot.getItem() if (!item?.durability) return false - form.product + form + .product() .name('Починить') .cost(new MultiCost().xp(item.durability.damage / 10)) .onBuy(() => { diff --git a/src/modules/places/tech-city/engineer.ts b/src/modules/places/tech-city/engineer.ts index c9fd7fa0..35410286 100644 --- a/src/modules/places/tech-city/engineer.ts +++ b/src/modules/places/tech-city/engineer.ts @@ -37,7 +37,7 @@ export const NotNewbieCost = new (class NotNewbieCost extends Cost { export class Engineer extends ShopNpc { constructor(public group: Group) { - super(group.point('engineer').name('Инжeнер')) + super(group.point('engineer').name('Инженер')) this.shop.body(() => 'Ну типа дай мне чертеж, a я те чета там наколупаю, да\n') this.shop.menu(menu => { diff --git a/src/modules/places/village-of-explorers/mage.ts b/src/modules/places/village-of-explorers/mage.ts index 3606b80a..1f714736 100644 --- a/src/modules/places/village-of-explorers/mage.ts +++ b/src/modules/places/village-of-explorers/mage.ts @@ -78,7 +78,7 @@ export class Mage extends ShopNpc { (bookForm, book, bookItem) => { const bookEnch = bookItem.enchantable?.getEnchantments()[0] const type = Object.values(MinecraftEnchantmentTypes).find(e => e === bookEnch?.type.id) - if (!bookEnch || !type) return bookForm.product.name('Нет зачарований').cost(Incompatible).onBuy(doNothing) + if (!bookEnch || !type) return bookForm.product().name('Нет зачарований').cost(Incompatible).onBuy(doNothing) bookForm.itemModifierSection( 'Предмет', @@ -88,7 +88,8 @@ export class Mage extends ShopNpc { const enchs = targetItem.enchantable?.getEnchantments().reduce((p, c) => p + c.level, 1) ?? 1 const level = targetItem.enchantable?.getEnchantment(new EnchantmentType(type))?.level ?? 0 - itemForm.product + itemForm + .product() .name(t.raw`§r§7Выбранная книга: ${translateEnchantment(bookEnch)}`) .cost(FreeCost) .onBuy(() => bookForm.show()) @@ -96,7 +97,8 @@ export class Mage extends ShopNpc { addSelectItem() - itemForm.product + itemForm + .product() .name(t.raw`Зачаровать`) .cost( level >= bookEnch.level @@ -119,7 +121,8 @@ export class Mage extends ShopNpc { form.section('Оружие со способностями', (form, player) => { const cost = new MultiCost().item(i.DiamondSword).item(i.LapisLazuli, 100).item(i.Redstone, 100).money(10000) - form.product + form + .product() .name(`§r§fМеч со способностью §7${ItemAbility.names[ItemAbility.Ability.Vampire]}`) .cost(cost) .onBuy(player => { @@ -183,7 +186,8 @@ export class Mage extends ShopNpc { createEnch(form: ShopFormSection, item: ItemStack, slot: ContainerSlot) { return (type: e, getCost: (currentLevel: number) => Cost, up = 1) => { const { can, level } = this.updateEnchatnment(slot, type, up, true) - form.product + form + .product() .name({ rawtext: [{ text: `${can ? '' : '§7'}+` }, ...(translateEnchantment(type).rawtext ?? [])] }) .cost( can