From 142ccb5e28ad066fd7bd4974eeba86046c3de6d1 Mon Sep 17 00:00:00 2001 From: DDShadowRU Date: Mon, 10 Jan 2022 20:45:34 +0300 Subject: [PATCH] Closed #23: alveary does not see the sky --- dev/apiculture/alveary/misc/tile.js | 4 ++++ dev/apiculture/api/BeeHouse.js | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dev/apiculture/alveary/misc/tile.js b/dev/apiculture/alveary/misc/tile.js index 0dac422..59d666f 100644 --- a/dev/apiculture/alveary/misc/tile.js +++ b/dev/apiculture/alveary/misc/tile.js @@ -47,6 +47,10 @@ TileEntity.registerPrototype(BlockID.alveary_misc_center, { this.house.getClimate = function () { return self.climate; }; + + this.house.canSeeSky = function () { + return GenerationUtils.canSeeSky(self.x, self.y + 2, self.z); + }; } var Modifiers = new ModifierList([]); diff --git a/dev/apiculture/api/BeeHouse.js b/dev/apiculture/api/BeeHouse.js index 73eecb7..d35c09e 100644 --- a/dev/apiculture/api/BeeHouse.js +++ b/dev/apiculture/api/BeeHouse.js @@ -91,7 +91,7 @@ function BeeHouse(tile, slots, houseModifierList) { this.error = Translation.translate("apiary.error.climate"); } else if (!this.queen.isValidHumidity(this.getHumidity())) { this.error = Translation.translate("apiary.error.humidity"); - } else if (!GenerationUtils.canSeeSky(this.tile.x, this.tile.y + 1, this.tile.z) && !modifiersList.isSelfLighted() && !this.houseModifierList.isSelfLighted() && !this.queen.getActiveChromosome("CAVE_DWELLING")) { + } else if (!this.canSeeSky() && !modifiersList.isSelfLighted() && !this.houseModifierList.isSelfLighted() && !this.queen.getActiveChromosome("CAVE_DWELLING")) { this.error = Translation.translate("apiary.error.sky"); } else if (World.getWeather().rain > 0 && !modifiersList.isSealed() && !houseModifierList.isSealed() && !this.queen.getActiveChromosome("TOLERATES_RAIN")) { this.error = Translation.translate("apiary.error.rain"); @@ -131,6 +131,10 @@ function BeeHouse(tile, slots, houseModifierList) { //Функции для перегрузки + this.canSeeSky = function () { + return GenerationUtils.canSeeSky(this.tile.x, this.tile.y + 1, this.tile.z); + }; + this.getPrincessSlot = function (slotname) { return this.getContainer().getSlot(slotname); };