Skip to content

Commit

Permalink
Refactored keybinds
Browse files Browse the repository at this point in the history
  • Loading branch information
JunePrimavera committed Sep 5, 2023
1 parent 406d446 commit ad3444d
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 139 deletions.
31 changes: 7 additions & 24 deletions src/main/java/io/github/teampropulsive/PropulsiveClient.java
Original file line number Diff line number Diff line change
@@ -1,35 +1,20 @@
package io.github.teampropulsive;

import io.github.teampropulsive.block.Blocks;
import io.github.teampropulsive.block.BlueprintTable;
import io.github.teampropulsive.block.BlueprintTableBlockEntity;
import io.github.teampropulsive.block.BlueprintTableBlockEntityRenderer;
import io.github.teampropulsive.client.world.SpaceDimensionEffects;
import io.github.teampropulsive.client.world.SpaceSkyRenderer;
import io.github.teampropulsive.keybind.ShipDownKeybind;
import io.github.teampropulsive.keybind.ShipThrottleDownKeybind;
import io.github.teampropulsive.keybind.ShipThrottleUpKeybind;
import io.github.teampropulsive.screen.BlueprintScreen;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.rendering.v1.BlockEntityRendererRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.DimensionRenderingRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.block.entity.SignBlockEntity;
import net.minecraft.client.gui.screen.ingame.HandledScreens;
import net.minecraft.client.render.block.entity.BlockEntityRendererFactories;
import net.minecraft.client.render.block.entity.BlockEntityRendererFactory;
import net.minecraft.client.render.block.entity.SignBlockEntityRenderer;
import net.minecraft.client.render.entity.model.EntityModelLayer;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.screen.CraftingScreenHandler;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.util.Identifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -44,8 +29,8 @@

import static io.github.teampropulsive.Propulsive.*;
import static io.github.teampropulsive.block.Blocks.BLUEPRINT_TABLE_BLOCK_ENTITY;
import static io.github.teampropulsive.keybind.DockShipKeybind.DockKeybindRegister;
import static io.github.teampropulsive.keybind.MapScreenKeybind.MapScreenKeybindRegister;
import static io.github.teampropulsive.keybind.DockShipKeybind.dockKeybindRegister;
import static io.github.teampropulsive.keybind.MapScreenKeybind.mapScreenKeybindRegister;

@Environment(EnvType.CLIENT)
public class PropulsiveClient implements ClientModInitializer {
Expand Down Expand Up @@ -75,14 +60,12 @@ public void onInitializeClient() {
EARTH.render();

// Key binds
MapScreenKeybindRegister();
DockKeybindRegister();
ShipThrottleUpKeybind.ShipThrottleUpKeybind();
ShipThrottleDownKeybind.ShipThrottleDownKeybind();
ShipDownKeybind.ShipDownKeybind();
mapScreenKeybindRegister();
dockKeybindRegister();
ShipThrottleUpKeybind.shipThrottleUpKeybind();
ShipThrottleDownKeybind.shipThrottleDownKeybind();
ShipDownKeybind.shipDownKeybind();

// Screen handler
HandledScreens.register(BLUEPRINT_SCREEN_HANDLER, BlueprintScreen::new);
}

// Returns contributors from git repo or from the fallback list in the JAR if network is unavailable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.github.teampropulsive.block;

import io.github.teampropulsive.screen.BlueprintScreen;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.BlockState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class DockShipKeybind {
public static KeyBinding dockShipKey;
public static void DockKeybindRegister() {
public static void dockKeybindRegister() {
dockShipKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.propulsive.dock",
InputUtil.Type.KEYSYM,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
public class MapScreenKeybind {
private static KeyBinding openMapScreenKey;
public static void MapScreenKeybindRegister() {
public static void mapScreenKeybindRegister() {
openMapScreenKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.propulsive.open",
InputUtil.Type.KEYSYM,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class ShipDownKeybind {
private static KeyBinding shipDownKeybind;
public static void ShipDownKeybind() {
public static void shipDownKeybind() {
shipDownKeybind = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.propulsive.ship.down",
InputUtil.Type.KEYSYM,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package io.github.teampropulsive.keybind;

import io.github.teampropulsive.screen.MapScreen;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import org.lwjgl.glfw.GLFW;

public class ShipThrottleDownKeybind {
public static KeyBinding shipThrottleDownKeybind;
public static void ShipThrottleDownKeybind() {
public static void shipThrottleDownKeybind() {
shipThrottleDownKeybind = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.propulsive.ship.tdown",
InputUtil.Type.KEYSYM,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package io.github.teampropulsive.keybind;

import io.github.teampropulsive.screen.MapScreen;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import org.lwjgl.glfw.GLFW;

public class ShipThrottleUpKeybind {
public static KeyBinding shipThrottleUpKeybind;
public static void ShipThrottleUpKeybind() {
public static void shipThrottleUpKeybind() {
shipThrottleUpKeybind = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.propulsive.ship.tup",
InputUtil.Type.KEYSYM,
Expand Down
39 changes: 0 additions & 39 deletions src/main/java/io/github/teampropulsive/screen/BlueprintScreen.java

This file was deleted.

This file was deleted.

0 comments on commit ad3444d

Please sign in to comment.