Search in sources :

Example 1 with GuiSchematicLoad

use of com.github.lunatrius.schematica.client.gui.load.GuiSchematicLoad in project Spark-Client by Spark-Client-Development.

the class SchematicaConfig method onKeyInput.

@SubscribeEvent
public void onKeyInput(final InputEvent event) {
    if (mc.currentScreen == null) {
        final SchematicWorld schematic = ClientProxy.schematic;
        int key = event.getKey();
        if (key == LOAD.getKey())
            mc.displayGuiScreen(new GuiSchematicLoad(mc.currentScreen));
        if (key == CONTROL.getKey())
            mc.displayGuiScreen(new GuiSchematicControl(mc.currentScreen));
        if (key == LAYER_INC.getKey())
            if (schematic != null && schematic.layerMode != SchematicWorld.LayerMode.ALL) {
                schematic.renderingLayer = MathHelper.clamp(schematic.renderingLayer + 1, 0, schematic.getHeight() - 1);
                RenderSchematic.INSTANCE.refresh();
            }
        if (key == LAYER_DEC.getKey())
            if (schematic != null && schematic.layerMode != SchematicWorld.LayerMode.ALL) {
                schematic.renderingLayer = MathHelper.clamp(schematic.renderingLayer - 1, 0, schematic.getHeight() - 1);
                RenderSchematic.INSTANCE.refresh();
            }
        if (key == LAYER_TOGGLE.getKey())
            if (schematic != null) {
                schematic.layerMode = SchematicWorld.LayerMode.next(schematic.layerMode);
                RenderSchematic.INSTANCE.refresh();
            }
        if (key == RENDER_TOGGLE.getKey())
            if (schematic != null) {
                schematic.isRendering = !schematic.isRendering;
                RenderSchematic.INSTANCE.refresh();
            }
        if (key == MOVE_HERE.getKey())
            if (schematic != null) {
                ClientProxy.moveSchematicToPlayer(schematic);
                RenderSchematic.INSTANCE.refresh();
            }
        if (key == PICK_BLOC.getKey())
            if (schematic != null && schematic.isRendering) {
                pickBlock(schematic, ClientProxy.objectMouseOver);
            }
    }
}
Also used : SchematicWorld(com.github.lunatrius.schematica.client.world.SchematicWorld) GuiSchematicLoad(com.github.lunatrius.schematica.client.gui.load.GuiSchematicLoad) GuiSchematicControl(com.github.lunatrius.schematica.client.gui.control.GuiSchematicControl) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

GuiSchematicControl (com.github.lunatrius.schematica.client.gui.control.GuiSchematicControl)1 GuiSchematicLoad (com.github.lunatrius.schematica.client.gui.load.GuiSchematicLoad)1 SchematicWorld (com.github.lunatrius.schematica.client.world.SchematicWorld)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1