From d8c8aec2eeb54cd40710593ab0040b64e5cac217 Mon Sep 17 00:00:00 2001 From: Nedelosk Date: Mon, 21 Aug 2017 21:16:36 +0200 Subject: [PATCH] Move Climate Bar to the top of the gui --- .../forestry/core/errors/EnumErrorCode.java | 17 ++- .../MultiblockEventHandlerClient.java | 3 +- .../java/forestry/core/utils/ClimateUtil.java | 2 +- .../greenhouse/GreenhouseEventHandler.java | 4 +- .../greenhouse/IGreenhouseBlockHandler.java | 9 +- .../api/greenhouse/IGreenhouseProvider.java | 14 +- .../greenhouse/gui/GuiGreenhouse.java | 6 +- ...imatePillar.java => WidgetClimateBar.java} | 16 +- .../items/ItemGreenhouseScreen.java | 16 +- .../multiblock/GreenhouseController.java | 38 ++--- .../blocks/blank/BlankBlockHandler.java | 23 +-- .../blocks/client/ClientBlockHandler.java | 9 +- .../blocks/storage/GreenhouseProvider.java | 24 ++- .../storage/GreenhouseProviderClient.java | 14 +- .../storage/GreenhouseProviderServer.java | 139 ++++++++---------- .../blocks/wall/WallBlockHandler.java | 7 +- .../textures/gui/errors/not_closed.png | Bin 0 -> 301 bytes .../textures/gui/errors/not_loaded.png | Bin 0 -> 202 bytes .../textures/gui/errors/too_large.png | Bin 0 -> 189 bytes .../forestry/textures/gui/greenhouse.png | Bin 1242 -> 1308 bytes 20 files changed, 164 insertions(+), 177 deletions(-) rename src/main/java/forestry/greenhouse/gui/widgets/{WidgetClimatePillar.java => WidgetClimateBar.java} (89%) create mode 100644 src/main/resources/assets/forestry/textures/gui/errors/not_closed.png create mode 100644 src/main/resources/assets/forestry/textures/gui/errors/not_loaded.png create mode 100644 src/main/resources/assets/forestry/textures/gui/errors/too_large.png diff --git a/src/main/java/forestry/core/errors/EnumErrorCode.java b/src/main/java/forestry/core/errors/EnumErrorCode.java index 9d9fa4482..ce1d1fb1a 100644 --- a/src/main/java/forestry/core/errors/EnumErrorCode.java +++ b/src/main/java/forestry/core/errors/EnumErrorCode.java @@ -5,14 +5,16 @@ ******************************************************************************/ package forestry.core.errors; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.util.ResourceLocation; + +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.ForestryAPI; import forestry.api.core.IErrorState; import forestry.core.config.Constants; import forestry.core.render.TextureManagerForestry; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; public enum EnumErrorCode implements IErrorState { @@ -80,7 +82,12 @@ public enum EnumErrorCode implements IErrorState { // Farms NO_FERTILIZER("no_fertilizer"), // Farms require fertilizer for function. Compost is insufficient. NO_FARMLAND("no_farmland"), // Smooth sandstone, bricks or stone bricks create a platform the farm will build on. - NO_LIQUID_FARM("no_liquid") // Depending on rainfall, temperature and humidity farms need to be supplied with varying amounts of water. + NO_LIQUID_FARM("no_liquid"), // Depending on rainfall, temperature and humidity farms need to be supplied with varying amounts of water. + + // Greenhouse + NOT_LOADED("not_loaded"), // One chunk of the greenhouse is not loaded. + NOT_CLOSED("not_closed"), // The greenhouse is not closed. + TOO_LARGE("too_large") // The greenhouse is too large. ; private final String name; diff --git a/src/main/java/forestry/core/multiblock/MultiblockEventHandlerClient.java b/src/main/java/forestry/core/multiblock/MultiblockEventHandlerClient.java index 9a4992cfc..91c7dea1b 100755 --- a/src/main/java/forestry/core/multiblock/MultiblockEventHandlerClient.java +++ b/src/main/java/forestry/core/multiblock/MultiblockEventHandlerClient.java @@ -4,7 +4,6 @@ import java.util.Set; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderGlobal; @@ -17,6 +16,7 @@ import net.minecraft.world.World; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; + import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -36,7 +36,6 @@ public class MultiblockEventHandlerClient { if(event.getType() == RenderGameOverlayEvent.ElementType.ALL && Minecraft.getMinecraft().currentScreen == null){ Minecraft minecraft = Minecraft.getMinecraft(); RayTraceResult posHit = minecraft.objectMouseOver; - FontRenderer font = minecraft.fontRenderer; ScaledResolution resolution = event.getResolution(); if(posHit != null && posHit.getBlockPos() != null){ diff --git a/src/main/java/forestry/core/utils/ClimateUtil.java b/src/main/java/forestry/core/utils/ClimateUtil.java index 8780555b7..5e831aeaa 100644 --- a/src/main/java/forestry/core/utils/ClimateUtil.java +++ b/src/main/java/forestry/core/utils/ClimateUtil.java @@ -293,7 +293,7 @@ public class ClimateUtil implements IClimateHelper { case NONE: return 0x011f4b; default: - return 16777215; + return 0xFFFFFF; } } } diff --git a/src/main/java/forestry/greenhouse/GreenhouseEventHandler.java b/src/main/java/forestry/greenhouse/GreenhouseEventHandler.java index 423fa6b32..be817805e 100644 --- a/src/main/java/forestry/greenhouse/GreenhouseEventHandler.java +++ b/src/main/java/forestry/greenhouse/GreenhouseEventHandler.java @@ -34,11 +34,11 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import forestry.api.multiblock.IGreenhouseComponent; +import forestry.core.multiblock.MultiblockUtil; import forestry.greenhouse.api.greenhouse.IGreenhouseLimits; import forestry.greenhouse.api.greenhouse.IGreenhouseProvider; import forestry.greenhouse.api.greenhouse.Position2D; -import forestry.api.multiblock.IGreenhouseComponent; -import forestry.core.multiblock.MultiblockUtil; import forestry.greenhouse.items.ItemGreenhouseScreen; import forestry.greenhouse.multiblock.IGreenhouseControllerInternal; diff --git a/src/main/java/forestry/greenhouse/api/greenhouse/IGreenhouseBlockHandler.java b/src/main/java/forestry/greenhouse/api/greenhouse/IGreenhouseBlockHandler.java index aec958fbe..5c9e0a922 100644 --- a/src/main/java/forestry/greenhouse/api/greenhouse/IGreenhouseBlockHandler.java +++ b/src/main/java/forestry/greenhouse/api/greenhouse/IGreenhouseBlockHandler.java @@ -11,7 +11,7 @@ import java.util.List; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; -import forestry.greenhouse.multiblock.blocks.GreenhouseException; +import forestry.api.core.IErrorState; public interface IGreenhouseBlockHandler { @@ -20,10 +20,11 @@ public interface IGreenhouseBlockHandler newBlocksToCheck); - List checkNeighborBlocks(IGreenhouseBlockStorage storage, B blockToCheck) throws GreenhouseException; - - boolean onCheckPosition(IGreenhouseBlockStorage storage, R rootBlock, BlockPos position, EnumFacing facing, IGreenhouseBlock block, List newBlocksToCheck) throws GreenhouseException; + boolean onCheckPosition(IGreenhouseBlockStorage storage, R rootBlock, BlockPos position, EnumFacing facing, IGreenhouseBlock block, List newBlocksToCheck); Class getBlockClass(); } diff --git a/src/main/java/forestry/greenhouse/api/greenhouse/IGreenhouseProvider.java b/src/main/java/forestry/greenhouse/api/greenhouse/IGreenhouseProvider.java index a1623736d..792046265 100644 --- a/src/main/java/forestry/greenhouse/api/greenhouse/IGreenhouseProvider.java +++ b/src/main/java/forestry/greenhouse/api/greenhouse/IGreenhouseProvider.java @@ -11,15 +11,16 @@ import java.util.Collection; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import forestry.api.core.IErrorLogicSource; +import forestry.api.core.IErrorState; import forestry.greenhouse.api.climate.GreenhouseState; import forestry.greenhouse.api.climate.IClimateContainer; -import forestry.greenhouse.multiblock.blocks.GreenhouseException; /** * Can be used to test if a space is closed. Is used by the greenhouse. * */ -public interface IGreenhouseProvider { +public interface IGreenhouseProvider extends IErrorLogicSource { /** * @return the climate container of this provider. @@ -47,11 +48,6 @@ public interface IGreenhouseProvider { */ void clear(boolean chunkUnloading); - /** - * @return The last error that has coded that the provider is not closed. - */ - String getLastNotClosedError(); - /** * Called from the thread if a {@link IGreenhouseBlock} was modified by the player. */ @@ -74,7 +70,9 @@ public interface IGreenhouseProvider { /** * @return The limits that a greenhouse has. Used to test if the greenhouse is tested. * At the test the provider stops if the currently tested position is out of this limits and marks the greenhouse as open. + * Null if the provider is not created. */ + @Nullable IGreenhouseLimits getLimits(); /** @@ -95,7 +93,7 @@ public interface IGreenhouseProvider { /** * Test if the provider is closed. */ - void checkPosition(BlockPos position) throws GreenhouseException; + IErrorState checkPosition(BlockPos position); int getSize(); diff --git a/src/main/java/forestry/greenhouse/gui/GuiGreenhouse.java b/src/main/java/forestry/greenhouse/gui/GuiGreenhouse.java index 8484d4f4b..8658df9d9 100755 --- a/src/main/java/forestry/greenhouse/gui/GuiGreenhouse.java +++ b/src/main/java/forestry/greenhouse/gui/GuiGreenhouse.java @@ -25,7 +25,7 @@ import forestry.core.gui.TextLayoutHelper; import forestry.core.utils.NetworkUtil; import forestry.greenhouse.gui.widgets.WidgetCamouflageTab; import forestry.greenhouse.gui.widgets.WidgetClimatePanel; -import forestry.greenhouse.gui.widgets.WidgetClimatePillar; +import forestry.greenhouse.gui.widgets.WidgetClimateBar; import forestry.greenhouse.multiblock.IGreenhouseControllerInternal; import forestry.greenhouse.network.packets.PacketSelectClimateTargeted; import forestry.greenhouse.tiles.TileGreenhouse; @@ -52,8 +52,8 @@ public class GuiGreenhouse extends GuiForestryTitled { IClimateData data = container.getData(); //Add the camouflage tab - widgetManager.add(new WidgetCamouflageTab(widgetManager, xSize / 2 - WidgetCamouflageTab.WIDTH / 2, -WidgetCamouflageTab.HEIGHT, controller, tile)); - widgetManager.add(new WidgetClimatePillar(widgetManager, -WidgetClimatePillar.WIDTH, GUI_HEIGHT / 2 - WidgetClimatePillar.HEIGHT / 2)); + widgetManager.add(new WidgetCamouflageTab(widgetManager, xSize / 4 - WidgetCamouflageTab.WIDTH / 2, -WidgetCamouflageTab.HEIGHT, controller, tile)); + widgetManager.add(new WidgetClimateBar(widgetManager, xSize / 3 + WidgetClimateBar.WIDTH / 3, -WidgetClimateBar.HEIGHT)); widgetManager.add(temperaturePanel = new WidgetClimatePanel(widgetManager, this, 9, 18, ClimateType.TEMPERATURE, data)); widgetManager.add(humidityPanel = new WidgetClimatePanel(widgetManager, this, 102, 18, ClimateType.HUMIDITY, data)); } diff --git a/src/main/java/forestry/greenhouse/gui/widgets/WidgetClimatePillar.java b/src/main/java/forestry/greenhouse/gui/widgets/WidgetClimateBar.java similarity index 89% rename from src/main/java/forestry/greenhouse/gui/widgets/WidgetClimatePillar.java rename to src/main/java/forestry/greenhouse/gui/widgets/WidgetClimateBar.java index 33a21ffef..320e23c07 100644 --- a/src/main/java/forestry/greenhouse/gui/widgets/WidgetClimatePillar.java +++ b/src/main/java/forestry/greenhouse/gui/widgets/WidgetClimateBar.java @@ -29,14 +29,14 @@ import forestry.core.gui.widgets.WidgetManager; import forestry.core.render.TextureManagerForestry; import forestry.greenhouse.gui.GuiGreenhouse; -public class WidgetClimatePillar extends Widget { +public class WidgetClimateBar extends Widget { - public static final int WIDTH = 23; - public static final int HEIGHT = 90; + public static final int WIDTH = 90; + public static final int HEIGHT = 23; private final List buttons = new ArrayList<>(); - public WidgetClimatePillar(WidgetManager manager, int xPos, int yPos) { + public WidgetClimateBar(WidgetManager manager, int xPos, int yPos) { super(manager, xPos, yPos); this.width = WIDTH; this.height = HEIGHT; @@ -60,7 +60,7 @@ public class WidgetClimatePillar extends Widget { value = 0.5F; break; } - buttons.add(new ClimateButton(this, temp, value, xPos + 5, yPos + 5 + (i - 1) * 16)); + buttons.add(new ClimateButton(this, temp, value, xPos + 5 + (i - 1) * 16, yPos + 5)); } } @@ -68,7 +68,7 @@ public class WidgetClimatePillar extends Widget { public void draw(int startX, int startY) { TextureManager textureManager = Minecraft.getMinecraft().getTextureManager(); textureManager.bindTexture(manager.gui.textureFile); - manager.gui.drawTexturedModalRect(startX + xPos, startY + yPos, 220, 25, width, height); + manager.gui.drawTexturedModalRect(startX + xPos, startY + yPos, 0, 202, width, height); for (ClimateButton button : buttons) { button.draw(startX, startY); } @@ -109,7 +109,7 @@ public class WidgetClimatePillar extends Widget { } private static class ClimateButton { - final WidgetClimatePillar parent; + final WidgetClimateBar parent; final EnumTemperature temperature; final float value; protected final ToolTip toolTip = new ToolTip(250) { @@ -123,7 +123,7 @@ public class WidgetClimatePillar extends Widget { }; final int xPos, yPos; - public ClimateButton(WidgetClimatePillar parent, EnumTemperature temperature, float value, int xPos, int yPos) { + public ClimateButton(WidgetClimateBar parent, EnumTemperature temperature, float value, int xPos, int yPos) { this.parent = parent; this.temperature = temperature; this.value = value; diff --git a/src/main/java/forestry/greenhouse/items/ItemGreenhouseScreen.java b/src/main/java/forestry/greenhouse/items/ItemGreenhouseScreen.java index 2f6714e5e..799a61f0c 100644 --- a/src/main/java/forestry/greenhouse/items/ItemGreenhouseScreen.java +++ b/src/main/java/forestry/greenhouse/items/ItemGreenhouseScreen.java @@ -31,7 +31,6 @@ import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import forestry.greenhouse.api.climate.IClimateContainer; import forestry.api.climate.IClimateState; import forestry.api.core.EnumTemperature; import forestry.api.multiblock.IGreenhouseComponent; @@ -42,6 +41,7 @@ import forestry.core.multiblock.MultiblockUtil; import forestry.core.utils.ClimateUtil; import forestry.core.utils.Translator; import forestry.greenhouse.PluginGreenhouse; +import forestry.greenhouse.api.climate.IClimateContainer; import forestry.greenhouse.multiblock.IGreenhouseControllerInternal; public class ItemGreenhouseScreen extends ItemForestry implements IColoredItem { @@ -113,10 +113,15 @@ public class ItemGreenhouseScreen extends ItemForestry implements IColoredItem { @Override public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) { + ItemStack itemStack = player.getHeldItem(hand); + BlockPos itemPos = getGreenhousePos(itemStack); if (!player.isSneaking()) { return EnumActionResult.PASS; } - ItemStack itemStack = player.getHeldItem(hand); + return handleSneaking(world, pos, player, itemStack, itemPos); + } + + private EnumActionResult handleSneaking(World world, BlockPos pos,EntityPlayer player, ItemStack itemStack, BlockPos itemPos){ IGreenhouseComponent component = MultiblockUtil.getComponent(world, pos, IGreenhouseComponent.class); if (component != null) { IGreenhouseController controller = component.getMultiblockLogic().getController(); @@ -131,7 +136,6 @@ public class ItemGreenhouseScreen extends ItemForestry implements IColoredItem { player.sendStatusMessage(new TextComponentTranslation("for.message.greenhouse_screen.position"), true); } } else { - BlockPos itemPos = getGreenhousePos(itemStack); if (itemPos == null) { if (!world.isRemote) { player.sendStatusMessage(new TextComponentTranslation("for.message.greenhouse_screen.fail"), true); @@ -168,11 +172,11 @@ public class ItemGreenhouseScreen extends ItemForestry implements IColoredItem { @SideOnly(Side.CLIENT) public int getColorFromItemstack(ItemStack stack, int tintIndex) { if (tintIndex == 2) { - return isValid(stack, Minecraft.getMinecraft().world) ? 1356406 : 12197655; + return isValid(stack, Minecraft.getMinecraft().world) ? 0x14B276 : 0xBA1F17; } else if (tintIndex == 1) { World world = Minecraft.getMinecraft().world; if (!isValid(stack, world)) { - return 16777215; + return 0xFFFFFF; } BlockPos pos = getGreenhousePos(stack); IGreenhouseControllerInternal controller = MultiblockUtil.getController(world, pos, IGreenhouseComponent.class); @@ -180,6 +184,6 @@ public class ItemGreenhouseScreen extends ItemForestry implements IColoredItem { IClimateState state = container.getState(); return ClimateUtil.getColor(EnumTemperature.getFromValue(state.getTemperature())); } - return 16777215; + return 0xFFFFFF; } } diff --git a/src/main/java/forestry/greenhouse/multiblock/GreenhouseController.java b/src/main/java/forestry/greenhouse/multiblock/GreenhouseController.java index c5a58d168..4aff028d1 100644 --- a/src/main/java/forestry/greenhouse/multiblock/GreenhouseController.java +++ b/src/main/java/forestry/greenhouse/multiblock/GreenhouseController.java @@ -26,21 +26,13 @@ import net.minecraft.world.biome.Biome; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import forestry.greenhouse.api.climate.GreenhouseState; -import forestry.greenhouse.api.climate.IClimateContainer; -import forestry.greenhouse.api.climate.IClimateContainerListener; import forestry.api.climate.ImmutableClimateState; import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; import forestry.api.core.ICamouflagedTile; -import forestry.greenhouse.api.greenhouse.GreenhouseManager; -import forestry.greenhouse.api.greenhouse.IGreenhouseBlock; -import forestry.greenhouse.api.greenhouse.IGreenhouseLimits; +import forestry.api.core.IErrorLogic; import forestry.api.greenhouse.IGreenhouseListener; import forestry.api.greenhouse.IGreenhouseLogic; -import forestry.greenhouse.api.greenhouse.IGreenhouseProvider; -import forestry.greenhouse.api.greenhouse.IGreenhouseProviderListener; -import forestry.greenhouse.api.greenhouse.Position2D; import forestry.api.multiblock.IGreenhouseComponent; import forestry.api.multiblock.IGreenhouseComponent.Active; import forestry.api.multiblock.IGreenhouseComponent.Listener; @@ -56,8 +48,16 @@ import forestry.core.utils.ItemStackUtil; import forestry.core.utils.NetworkUtil; import forestry.core.utils.Translator; import forestry.energy.EnergyManager; +import forestry.greenhouse.api.climate.GreenhouseState; +import forestry.greenhouse.api.climate.IClimateContainer; +import forestry.greenhouse.api.climate.IClimateContainerListener; +import forestry.greenhouse.api.greenhouse.GreenhouseManager; +import forestry.greenhouse.api.greenhouse.IGreenhouseBlock; +import forestry.greenhouse.api.greenhouse.IGreenhouseLimits; +import forestry.greenhouse.api.greenhouse.IGreenhouseProvider; +import forestry.greenhouse.api.greenhouse.IGreenhouseProviderListener; +import forestry.greenhouse.api.greenhouse.Position2D; import forestry.greenhouse.camouflage.CamouflageHandlerType; -import forestry.greenhouse.multiblock.blocks.GreenhouseException; import forestry.greenhouse.multiblock.blocks.storage.GreenhouseProvider; import forestry.greenhouse.multiblock.blocks.storage.GreenhouseProviderClient; import forestry.greenhouse.multiblock.blocks.storage.GreenhouseProviderServer; @@ -167,6 +167,11 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im } } + @Override + public IErrorLogic getErrorLogic() { + return provider.getErrorLogic(); + } + @Override public ImmutableClimateState getDefaultClimate() { return defaultState; @@ -256,19 +261,6 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im limits = null; } - @Override - public BlockPos getLastValidationErrorPosition() { - BlockPos pos = super.getLastValidationErrorPosition(); - if (pos != null) { - return pos; - } - GreenhouseException exception = provider.getLastNotClosedException(); - if (exception == null) { - return null; - } - return exception.pos; - } - @Override protected void onAssimilate(IMultiblockControllerInternal assimilated) { } diff --git a/src/main/java/forestry/greenhouse/multiblock/blocks/blank/BlankBlockHandler.java b/src/main/java/forestry/greenhouse/multiblock/blocks/blank/BlankBlockHandler.java index 2d0a3c1d7..165f3f903 100644 --- a/src/main/java/forestry/greenhouse/multiblock/blocks/blank/BlankBlockHandler.java +++ b/src/main/java/forestry/greenhouse/multiblock/blocks/blank/BlankBlockHandler.java @@ -10,18 +10,17 @@ ******************************************************************************/ package forestry.greenhouse.multiblock.blocks.blank; -import java.util.LinkedList; import java.util.List; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; +import forestry.api.core.IErrorState; import forestry.greenhouse.api.greenhouse.IBlankBlock; import forestry.greenhouse.api.greenhouse.IGreenhouseBlock; import forestry.greenhouse.api.greenhouse.IGreenhouseBlockHandler; import forestry.greenhouse.api.greenhouse.IGreenhouseBlockStorage; import forestry.greenhouse.api.greenhouse.IGreenhouseProvider; -import forestry.greenhouse.multiblock.blocks.GreenhouseException; public class BlankBlockHandler implements IGreenhouseBlockHandler { @@ -54,15 +53,17 @@ public class BlankBlockHandler implements IGreenhouseBlockHandler checkNeighborBlocks(IGreenhouseBlockStorage storage, IBlankBlock blockToCheck) throws GreenhouseException { - List newBlocksToCheck = new LinkedList<>(); + public IErrorState checkNeighborBlocks(IGreenhouseBlockStorage storage, IBlankBlock blockToCheck, List newBlocksToCheck) { BlockPos position = blockToCheck.getPos(); if (storage.setBlock(position, blockToCheck)) { for (EnumFacing facing : EnumFacing.HORIZONTALS) { - checkBlockFacing(storage, blockToCheck, position, facing, newBlocksToCheck); + IErrorState errorState = checkBlockFacing(storage, blockToCheck, position, facing, newBlocksToCheck); + if(errorState != null){ + return errorState; + } } } - return newBlocksToCheck; + return null; } @Override @@ -83,19 +84,23 @@ public class BlankBlockHandler implements IGreenhouseBlockHandler newBlocksToCheck) throws GreenhouseException { + private IErrorState checkBlockFacing(IGreenhouseBlockStorage storage, IBlankBlock blockToCheck, BlockPos rootPos, EnumFacing facing, List newBlocksToCheck) { if (!blockToCheck.isFaceTested(facing)) { BlockPos facingPosition = rootPos.offset(facing); IGreenhouseProvider provider = storage.getProvider(); - provider.checkPosition(facingPosition); + IErrorState errorState = provider.checkPosition(facingPosition); + if(errorState != null){ + return errorState; + } IGreenhouseBlock logicBlock = storage.getBlock(facingPosition); for (IGreenhouseBlockHandler handler : provider.getHandlers()) { - if (handler.onCheckPosition(storage, blockToCheck, facingPosition, facing, logicBlock, newBlocksToCheck)) { + if(handler.onCheckPosition(storage, blockToCheck, facingPosition, facing, logicBlock, newBlocksToCheck)){ break; } } } + return null; } } diff --git a/src/main/java/forestry/greenhouse/multiblock/blocks/client/ClientBlockHandler.java b/src/main/java/forestry/greenhouse/multiblock/blocks/client/ClientBlockHandler.java index 27f7263fc..d8098a173 100644 --- a/src/main/java/forestry/greenhouse/multiblock/blocks/client/ClientBlockHandler.java +++ b/src/main/java/forestry/greenhouse/multiblock/blocks/client/ClientBlockHandler.java @@ -11,16 +11,15 @@ package forestry.greenhouse.multiblock.blocks.client; import javax.annotation.Nullable; -import java.util.Collections; import java.util.List; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; +import forestry.api.core.IErrorState; import forestry.greenhouse.api.greenhouse.IGreenhouseBlock; import forestry.greenhouse.api.greenhouse.IGreenhouseBlockHandler; import forestry.greenhouse.api.greenhouse.IGreenhouseBlockStorage; -import forestry.greenhouse.multiblock.blocks.GreenhouseException; public class ClientBlockHandler implements IGreenhouseBlockHandler { @@ -49,12 +48,12 @@ public class ClientBlockHandler implements IGreenhouseBlockHandler checkNeighborBlocks(IGreenhouseBlockStorage storage, ClientBlock blockToCheck) throws GreenhouseException { - return Collections.emptyList(); + public IErrorState checkNeighborBlocks(IGreenhouseBlockStorage storage, ClientBlock blockToCheck, List newBlocks) { + return null; } @Override - public boolean onCheckPosition(IGreenhouseBlockStorage storage, ClientBlock rootBlock, BlockPos position, EnumFacing facing, IGreenhouseBlock block, List newBlocksToCheck) throws GreenhouseException { + public boolean onCheckPosition(IGreenhouseBlockStorage storage, ClientBlock rootBlock, BlockPos position, EnumFacing facing, IGreenhouseBlock block, List newBlocksToCheck) { return false; } diff --git a/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProvider.java b/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProvider.java index a6b49386a..f933a9c31 100644 --- a/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProvider.java +++ b/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProvider.java @@ -18,13 +18,14 @@ import java.util.Set; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import forestry.api.core.ForestryAPI; +import forestry.api.core.IErrorLogic; +import forestry.core.network.IStreamable; import forestry.greenhouse.api.climate.GreenhouseState; import forestry.greenhouse.api.climate.IClimateContainer; import forestry.greenhouse.api.greenhouse.IGreenhouseLimits; import forestry.greenhouse.api.greenhouse.IGreenhouseProvider; import forestry.greenhouse.api.greenhouse.IGreenhouseProviderListener; -import forestry.core.network.IStreamable; -import forestry.greenhouse.multiblock.blocks.GreenhouseException; public abstract class GreenhouseProvider implements IGreenhouseProvider, IStreamable { @@ -32,13 +33,14 @@ public abstract class GreenhouseProvider implements IGreenhouseProvider, IStream protected final GreenhouseBlockStorage storage; protected final World world; protected final IClimateContainer container; + private final IErrorLogic errorLogic; - @Nullable - protected GreenhouseException lastNotClosedException; protected BlockPos centerPos; protected boolean ready; protected GreenhouseState state; + @Nullable protected IGreenhouseLimits limits; + @Nullable protected IGreenhouseLimits usedLimits; protected int size; @@ -49,12 +51,14 @@ public abstract class GreenhouseProvider implements IGreenhouseProvider, IStream this.container = container; this.state = GreenhouseState.UNREADY; this.storage = new GreenhouseBlockStorage(this, world); + this.errorLogic = ForestryAPI.errorStateRegistry.createErrorLogic(); } public abstract void create(); - public GreenhouseException getLastNotClosedException() { - return lastNotClosedException; + @Override + public IErrorLogic getErrorLogic() { + return errorLogic; } @Override @@ -86,14 +90,6 @@ public abstract class GreenhouseProvider implements IGreenhouseProvider, IStream ready = false; } - @Override - public String getLastNotClosedError() { - if (lastNotClosedException == null) { - return null; - } - return lastNotClosedException.getMessage(); - } - @Override public boolean hasUnloadedChunks() { return state == GreenhouseState.UNLOADED_CHUNK; diff --git a/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderClient.java b/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderClient.java index 837e83a43..698f4b6d5 100644 --- a/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderClient.java +++ b/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderClient.java @@ -18,15 +18,15 @@ import net.minecraft.client.Minecraft; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import forestry.greenhouse.api.climate.GreenhouseState; -import forestry.greenhouse.api.climate.IClimateContainer; +import forestry.api.core.IErrorState; import forestry.api.greenhouse.IClimateHousing; -import forestry.greenhouse.api.greenhouse.IGreenhouseBlockHandler; -import forestry.greenhouse.api.greenhouse.Position2D; import forestry.api.multiblock.IGreenhouseController; import forestry.core.network.PacketBufferForestry; +import forestry.greenhouse.api.climate.GreenhouseState; +import forestry.greenhouse.api.climate.IClimateContainer; +import forestry.greenhouse.api.greenhouse.IGreenhouseBlockHandler; +import forestry.greenhouse.api.greenhouse.Position2D; import forestry.greenhouse.multiblock.GreenhouseLimits; -import forestry.greenhouse.multiblock.blocks.GreenhouseException; import forestry.greenhouse.multiblock.blocks.client.ClientBlockHandler; public class GreenhouseProviderClient extends GreenhouseProvider { @@ -60,6 +60,7 @@ public class GreenhouseProviderClient extends GreenhouseProvider { if (data.readBoolean()) { usedLimits = new GreenhouseLimits(data); } + getErrorLogic().readData(data); } @Override @@ -82,7 +83,8 @@ public class GreenhouseProviderClient extends GreenhouseProvider { } @Override - public void checkPosition(BlockPos position) throws GreenhouseException { + public IErrorState checkPosition(BlockPos position) { + return null; } @Override diff --git a/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderServer.java b/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderServer.java index a87e1780a..4549dae02 100644 --- a/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderServer.java +++ b/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderServer.java @@ -14,25 +14,26 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; +import java.util.LinkedList; import java.util.List; import java.util.Set; import java.util.Stack; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.ChunkPos; -import net.minecraft.util.text.TextComponentString; import net.minecraft.world.World; +import forestry.api.core.IErrorLogic; +import forestry.api.core.IErrorState; import forestry.api.greenhouse.IClimateHousing; import forestry.api.multiblock.IGreenhouseController; +import forestry.core.errors.EnumErrorCode; import forestry.core.network.PacketBufferForestry; import forestry.core.utils.NetworkUtil; -import forestry.core.utils.Translator; import forestry.greenhouse.api.climate.GreenhouseState; import forestry.greenhouse.api.climate.IClimateContainer; import forestry.greenhouse.api.greenhouse.IBlankBlock; @@ -42,7 +43,6 @@ import forestry.greenhouse.api.greenhouse.IGreenhouseLimits; import forestry.greenhouse.api.greenhouse.Position2D; import forestry.greenhouse.multiblock.GreenhouseLimits; import forestry.greenhouse.multiblock.GreenhouseLimitsBuilder; -import forestry.greenhouse.multiblock.blocks.GreenhouseException; import forestry.greenhouse.multiblock.blocks.blank.BlankBlockHandler; import forestry.greenhouse.multiblock.blocks.wall.WallBlockHandler; import forestry.greenhouse.multiblock.blocks.world.GreenhouseBlockManager; @@ -58,7 +58,6 @@ public class GreenhouseProviderServer extends GreenhouseProvider { private Position2D maxSize; private Position2D minSize; private boolean needReload; - private boolean needUpdate; private long previousUpdateTick; public GreenhouseProviderServer(World world, IClimateContainer container) { @@ -119,6 +118,7 @@ public class GreenhouseProviderServer extends GreenhouseProvider { } else { data.writeBoolean(false); } + getErrorLogic().writeData(data); } @Override @@ -135,7 +135,7 @@ public class GreenhouseProviderServer extends GreenhouseProvider { @Override public void onUnloadChunk(long chunkPos) { unloadedChunks.add(chunkPos); - lastNotClosedException = new GreenhouseException(Translator.translateToLocalFormatted("for.multiblock.greenhouse.error.space.unloaded")); + getErrorLogic().setCondition(true, EnumErrorCode.NOT_LOADED); state = GreenhouseState.UNLOADED_CHUNK; } @@ -148,18 +148,19 @@ public class GreenhouseProviderServer extends GreenhouseProvider { } } - public void checkPosition(BlockPos position) throws GreenhouseException { + public IErrorState checkPosition(BlockPos position) { if (maxSize.getX() < position.getX() || maxSize.getZ() < position.getZ() || minSize.getX() > position.getX() || minSize.getZ() > position.getZ()) { - throw new GreenhouseException(Translator.translateToLocalFormatted("for.multiblock.greenhouse.error.space.notclosed", position.getX(), position.getZ())).setPos(position); + return EnumErrorCode.NOT_CLOSED; } if (!world.isBlockLoaded(position)) { unloadedChunks.add(ChunkPos.asLong(position.getX() >> 4, position.getZ() >> 4)); - throw new GreenhouseException(Translator.translateToLocalFormatted("for.multiblock.greenhouse.error.space.unloaded", position.getX(), position.getZ())); + return EnumErrorCode.NOT_LOADED; } + return null; } @Override @@ -193,10 +194,6 @@ public class GreenhouseProviderServer extends GreenhouseProvider { Stack blocksToCheck = new Stack(); blocksToCheck.add(BlankBlockHandler.getInstance().createBlock(storage, null, null, centerPos)); checkState(checkBlocks(blocksToCheck)); - EntityPlayer player = world.getClosestPlayer(centerPos.getX(), centerPos.getY(), centerPos.getZ(), 100000.0D, false); - if (!world.isRemote && lastNotClosedException != null && player != null) { - player.sendMessage(new TextComponentString(lastNotClosedException.getMessage())); - } } private void checkState(GreenhouseState state) { @@ -207,75 +204,63 @@ public class GreenhouseProviderServer extends GreenhouseProvider { * Check all internal blocks. */ private GreenhouseState checkBlocks(Collection blocks) { - try { - if (minSize == null || maxSize == null || minSize == Position2D.NULL_POSITION || maxSize == Position2D.NULL_POSITION) { - checkMinMax(); - } - int greenhouseHeight = centerPos.getY(); - int greenhouseDepth = centerPos.getY(); - int height = 0; - int depth = 0; - int maximalHeight = ((IGreenhouseController) container.getParent()).getCenterCoordinates().getY() + limits.getHeight(); - GreenhouseLimitsBuilder builder = new GreenhouseLimitsBuilder(); - Stack blocksToCheck = new Stack(); - blocksToCheck.addAll(blocks); - while (!blocksToCheck.isEmpty()) { - IGreenhouseBlock blockToCheck = blocksToCheck.pop(); - if (blockToCheck != null) { - BlockPos position = blockToCheck.getPos(); - IGreenhouseBlockHandler handler = blockToCheck.getHandler(); - builder.recalculate(position); - List newBlocksToCheck = handler.checkNeighborBlocks(storage, blockToCheck); - blocksToCheck.addAll(newBlocksToCheck); - if (blockToCheck instanceof IBlankBlock) { - int positionHeight = getHeight(position, maximalHeight); - int positionDepth = getDepth(position); - if (positionHeight == -1) { - throw new GreenhouseException(Translator.translateToLocalFormatted("for.multiblock.greenhouse.error.roof.notclosed", position.getX(), position.getY(), position.getZ())).setPos(position); - } - if (positionHeight > greenhouseHeight) { - greenhouseHeight = positionHeight; - } - height += positionHeight - centerPos.getY(); - if (positionDepth < greenhouseDepth) { - greenhouseDepth = positionDepth; - } - depth += centerPos.getY() - positionDepth; + IErrorLogic errorLogic = getErrorLogic(); + errorLogic.clearErrors(); + if (minSize == null || maxSize == null || minSize == Position2D.NULL_POSITION || maxSize == Position2D.NULL_POSITION) { + Position2D maxCoordinates = limits.getMaximumCoordinates(); + maxSize = maxCoordinates.add(1, 1).add(centerPos.getX(), centerPos.getZ()); + + Position2D minCoordinates = limits.getMinimumCoordinates(); + minSize = minCoordinates.add(-1, -1).add(centerPos.getX(), centerPos.getZ()); + } + int greenhouseHeight = centerPos.getY(); + int greenhouseDepth = centerPos.getY(); + int height = 0; + int depth = 0; + int maximalHeight = ((IGreenhouseController) container.getParent()).getCenterCoordinates().getY() + limits.getHeight(); + GreenhouseLimitsBuilder builder = new GreenhouseLimitsBuilder(); + Stack blocksToCheck = new Stack(); + blocksToCheck.addAll(blocks); + while (!blocksToCheck.isEmpty()) { + IGreenhouseBlock blockToCheck = blocksToCheck.pop(); + if (blockToCheck != null) { + BlockPos position = blockToCheck.getPos(); + IGreenhouseBlockHandler handler = blockToCheck.getHandler(); + builder.recalculate(position); + List newBlocksToCheck = new LinkedList<>(); + IErrorState errorState = handler.checkNeighborBlocks(storage, blockToCheck, newBlocksToCheck); + if(errorState != null){ + errorLogic.setCondition(true, errorState); + } + blocksToCheck.addAll(newBlocksToCheck); + if (blockToCheck instanceof IBlankBlock) { + int positionHeight = getHeight(position, maximalHeight); + int positionDepth = getDepth(position); + if (positionHeight == -1) { + errorLogic.setCondition(true, EnumErrorCode.NOT_CLOSED); + //throw new GreenhouseException(Translator.translateToLocalFormatted("for.multiblock.greenhouse.error.roof.notclosed", position.getX(), position.getY(), position.getZ())).setPos(position); } + if (positionHeight > greenhouseHeight) { + greenhouseHeight = positionHeight; + } + height += positionHeight - centerPos.getY(); + if (positionDepth < greenhouseDepth) { + greenhouseDepth = positionDepth; + } + depth += centerPos.getY() - positionDepth; } } - this.size = height + depth + storage.getBlockCount(); - lastNotClosedException = null; - usedLimits = builder.build(greenhouseHeight, greenhouseDepth); - return GreenhouseState.CLOSED; - } catch (GreenhouseException exception) { - lastNotClosedException = exception; - if (!unloadedChunks.isEmpty()) { - return GreenhouseState.UNLOADED_CHUNK; - } + } + if (!unloadedChunks.isEmpty()) { + errorLogic.setCondition(true, EnumErrorCode.NOT_LOADED); + return GreenhouseState.UNLOADED_CHUNK; + } + if(errorLogic.hasErrors()){ return GreenhouseState.OPEN; } - } - - private void checkMinMax() throws GreenhouseException { - if (limits == null) { - minSize = maxSize = null; - throw new GreenhouseException(Translator.translateToLocalFormatted("for.multiblock.greenhouse.error.edges")); - } - if (limits.getMaximumCoordinates() != null) { - Position2D edge = limits.getMaximumCoordinates(); - maxSize = edge.add(1, 1).add(centerPos.getX(), centerPos.getZ()); - } else { - maxSize = null; - throw new GreenhouseException(Translator.translateToLocalFormatted("for.multiblock.greenhouse.error.edge")); - } - if (limits.getMinimumCoordinates() != null) { - Position2D edge = limits.getMinimumCoordinates(); - minSize = edge.add(-1, -1).add(centerPos.getX(), centerPos.getZ()); - } else { - minSize = null; - throw new GreenhouseException(Translator.translateToLocalFormatted("for.multiblock.greenhouse.error.edge")); - } + this.size = height + depth + storage.getBlockCount(); + usedLimits = builder.build(greenhouseHeight, greenhouseDepth); + return GreenhouseState.CLOSED; } public int getHeight(BlockPos pos, int maximalHeight) { diff --git a/src/main/java/forestry/greenhouse/multiblock/blocks/wall/WallBlockHandler.java b/src/main/java/forestry/greenhouse/multiblock/blocks/wall/WallBlockHandler.java index e4d90a26f..e05d73a3a 100644 --- a/src/main/java/forestry/greenhouse/multiblock/blocks/wall/WallBlockHandler.java +++ b/src/main/java/forestry/greenhouse/multiblock/blocks/wall/WallBlockHandler.java @@ -11,7 +11,6 @@ package forestry.greenhouse.multiblock.blocks.wall; import javax.annotation.Nullable; -import java.util.Collections; import java.util.List; import net.minecraft.block.Block; @@ -21,6 +20,7 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import forestry.api.core.IErrorState; import forestry.greenhouse.api.greenhouse.IBlankBlock; import forestry.greenhouse.api.greenhouse.IGreenhouseBlock; import forestry.greenhouse.api.greenhouse.IGreenhouseBlockHandler; @@ -28,7 +28,6 @@ import forestry.greenhouse.api.greenhouse.IGreenhouseBlockStorage; import forestry.greenhouse.api.greenhouse.IGreenhouseProvider; import forestry.greenhouse.api.greenhouse.IGreenhouseProviderListener; import forestry.greenhouse.api.greenhouse.IWallBlock; -import forestry.greenhouse.multiblock.blocks.GreenhouseException; public class WallBlockHandler implements IGreenhouseBlockHandler { @@ -63,8 +62,8 @@ public class WallBlockHandler implements IGreenhouseBlockHandler checkNeighborBlocks(IGreenhouseBlockStorage storage, IWallBlock blockToCheck) throws GreenhouseException { - return Collections.emptyList(); + public IErrorState checkNeighborBlocks(IGreenhouseBlockStorage storage, IWallBlock blockToCheck, List newBlocks) { + return null; } @Override diff --git a/src/main/resources/assets/forestry/textures/gui/errors/not_closed.png b/src/main/resources/assets/forestry/textures/gui/errors/not_closed.png new file mode 100644 index 0000000000000000000000000000000000000000..296f1534782808aff33550cb7d8525cb818eecc4 GIT binary patch literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPthcGWc$D{6RGl4?8JY5_^EKVnz_}=(9zme$xOY)6u zXM>dutj8=WM0YdISa|pKsfS5vujbBRd%(1V=UC=}m6tqkgf0`vWMBq@<}fC)gJD8E z2_SIc`0JAD+>Y-vPW0ME+%PZ<;5cE#V0rcdXLI+8JIPmhc&>{X%qV?sXb|Hn(R8;V zn|p)H<6sXH<0-~7R+b++%y5`t^E;b0Y4ega)J>%VCmS91eeV`%?EoYn9@SD~t?FDs_`XJ7dj(zF_cl^>bP0l+XkKvF2^T literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/forestry/textures/gui/errors/not_loaded.png b/src/main/resources/assets/forestry/textures/gui/errors/not_loaded.png new file mode 100644 index 0000000000000000000000000000000000000000..1609c6fc3463854bfb3674d7a5d374c0354a3d12 GIT binary patch literal 202 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9oB=)|t_%#z|9d(BdD<~&Ujiw{ zk|4ie28U-i(mjP-?+lYrgw1yD^Ha7;xGpe m192V3Fs3k`Yix!L91Mk_{Fh78vL*vfVeoYIb6Mw<&;$T7fiQUh literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/forestry/textures/gui/errors/too_large.png b/src/main/resources/assets/forestry/textures/gui/errors/too_large.png new file mode 100644 index 0000000000000000000000000000000000000000..4e13b0c996abb12bd3d98dd99673a40affccd434 GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9oB=)|t_%#P{(CwAc?WGDoB>jd zB|(0{3=Yq3q=7g|-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLNg-FY)wsWq-&a%xl5Q zW6K4yL)X*AF@)oKa)JX>5913K@s0~w3_`2L4(y2Waj?`|=BAK+)k)*vfh!CmEM5!@ Yq8ywat4);Uff^Y+UHx3vIVCg!0HHuDX8-^I literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/forestry/textures/gui/greenhouse.png b/src/main/resources/assets/forestry/textures/gui/greenhouse.png index 098a78772232b3f21edf0944a5497f12482fcdd3..bd7c9a599226e9f78ae6e2d165bd3e93abff6047 100644 GIT binary patch delta 1013 zcmcb`IfrXPP(6pJFo(M7i8Tuu7+6+%x;TbZ+#Hw zu*2=d#y#?}+w>Mi|Kwo&V`Hy|^tF;g4oo`>H zp>~#G&L0DX_RkNG-sX92HUIqP<11EaO-a>c*x()-diK}%(pY^X=bsPPHq>x3a4;w^ zG%zqQAs8|T9;`j!eP{KV?=}0D-!7~_S18_~&nM7dUhlvC@xM8b-w81YFgP$Y%(>3c z05bSWsV>8Ww8fir%r`T<6k>>BVlWrpcK!eR3C#B1ObpVWJJOksNCZbbJg6Le=&2Bc zT+V5JIYZ_Kf4Pko*G+sYs;jwkZ!a^gn=i?bA|-9iFeCFVdwGoB^vM0$=cdnMVc2KU z`25D{>Af*b4#!v~J1~h)_G4mKyJ7X4@xWYN+a1mf38~Rl1?}Dp2Y48+1&FxTd|2-h zU9~rjVS*v!WI-l3pmI(&2cUyxm?j%CseyFYM_liAW;h=@ZK)(f0vm(7cyiCm_rEWg z^qMl9Fl2HKoWbaDPB7!P87IS=6E91=r2l<(`^B($u1Ew(d1QQJ_MLE@#yebxIZII45z=N^7ROau+Ucd;50I zk4r%3yYCcSktt=(B>CLp@tTdw7cQppX>JWK?f(f>anhHkc>d z*i$^C@Y)T*6Fd*(^AE_B?J+!e2h5k6yntC^@_J^@dhLzM6AJl^`5x$643KA##2T14YHt9W zdQ)`9o13B%K%a9kq?rFbf7P2q@t8#L{qHyBc}|qF2?TX7Dlj<_*2mr8tZ(sCW5UWA zzq`vm{SKJ;lKso~y$m`P1<4|eX8YM5JgJ|s@BP^|H~#QESkJISy1>%%e&VsZGzP!A z6IUKgZ`7OKt!&)9{K}@&k}$7vMjP#rZ+O4CS#t7376tJS57o~W21vZ9TAaWD1fH&b JF6*2UngEZBrzrpc literal 1242 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|G$6&6|H(?D8gCb z5n0T@z|8}~jP?#nCxC+NC7!;n><`&x#kn=kZT~9Bz`&C3>EaktaqI2fv$?koBpMPo zaacL>-#yZ?rOl{=F_n*3X{})8R5>e0{Wl9ur6l~K|3*wZ`P`E2#q@~2dqGW3$3M7p z1uUz0nyoqc`p5YH3QM2-S$<)&{jt-NpDUhk|M9!k=i|wf{x6Re*8I1x3w-Xpr{>`D z%O~?$Twm_eYY}j||NS|W&6A%2p;y<4HcXaZr}40+;*;6oZGFcdKa%vl+_GyOD}!9% zWs~lIwYRseUK3zfsl6bEiGhiMgF%6zfdRpg-0@4}gVcGg&-M50FTdS!|M?E?1MKV_ zw|CbpyIr{dd|^2!Sc}8S?+gvMGiIr6$<<~EShQH`>rH1UNUr|(Kv0{Z;<=dl^Ihw>_4V}^zW=@D==aS`4Nl3) ztPI?_e-Fy$=jV6tyFST2ONime1D3c)f&XrtP-PJDVQ>IN7Yl;`Rz}0#&GHN}H!ic6 zb1>xO_{-mUD8#UVsX;d+R5bsO?xlHg>qQBgfya29QUVO^INgL*)3&cq1P;_*EzMqK{FxZ|pA=ZEDZ5nn|6}ge`EO4@Uq88S z+p^4c>cXCBt-ML4lTXL&y8A@Z@FTZ>;_uh=h=dRshX=z$p#Q&he zX5FSgvTX-tiqp>Te9mm@%KqRFo6cT2Nr+J4&nH5N;N0;bFkyzm_T{Fm3~CZ>iBq48 zeG@WfZ0Icd70vLSVL<{)dU=vH^*O_}Dyvg6#W%uu6qih?%T==~cV@L_nz^~%vbdbZ zs@}mJm@JDQIkz8HeELZt;Cg8pi;?<#%jh>8Q*LJ+wPl#`;Oke@XD;X_qbEuJLwyd< zQjFVQzTrsmGb`S9L+}LG1O5C1LS=gl(_hZfEn_L-M|c89;^+nHnv?U);I5W6(?MnJ zN_U0n3=iahiQgeGY$s<%ctY_vgYq}?p&@rs`QPISaJo;{hy zcloC1j7K*`B?>_9(8&84ziPRFQ;*@YLYZ!RiGWvJ3Sps7GXmBKMz?p*etdE9K;$=;|&kY-O;KbLh*2~7a11D1UN