Skip to content

Commit

Permalink
Import cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Hilligans committed Dec 31, 2023
1 parent e12d9f1 commit b134b62
Show file tree
Hide file tree
Showing 107 changed files with 193 additions and 257 deletions.
1 change: 1 addition & 0 deletions src/main/java/dev/hilligans/ourcraft/ClientMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@ public static void main(String[] args) throws IOException {
if(argumentContainer.getBoolean("--integratedServer", false)) {
ServerMain.getServer().stop();
}
System.exit(0);
}
}
2 changes: 1 addition & 1 deletion src/main/java/dev/hilligans/ourcraft/GameInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class GameInstance {
//public final
public Side side;

public int gameInstanceUniversalID = -1;
public int gameInstanceUniversalID;

public final ToolLevelList MATERIAL_LIST = new ToolLevelList();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.hilligans.ourcraft.addons.bot;

import dev.hilligans.ourcraft.GameInstance;
import dev.hilligans.ourcraft.client.Client;
import dev.hilligans.ourcraft.data.other.Inventory;
import dev.hilligans.ourcraft.GameInstance;
import dev.hilligans.ourcraft.util.EntityPosition;

public class BotInstance {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/hilligans/ourcraft/biome/Biome.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.hilligans.ourcraft.biome;

import dev.hilligans.ourcraft.GameInstance;
import dev.hilligans.ourcraft.block.Block;
import dev.hilligans.ourcraft.block.Blocks;
import dev.hilligans.ourcraft.GameInstance;
import dev.hilligans.ourcraft.mod.handler.content.ModContent;
import dev.hilligans.ourcraft.util.registry.IRegistryElement;
import dev.hilligans.ourcraft.world.builders.WorldBuilder;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/hilligans/ourcraft/biome/Biomes.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package dev.hilligans.ourcraft.biome;

import dev.hilligans.ourcraft.GameInstance;
import dev.hilligans.ourcraft.block.Blocks;
import dev.hilligans.ourcraft.data.other.BlockPos;
import dev.hilligans.ourcraft.data.other.BlockTemplate;
import dev.hilligans.ourcraft.GameInstance;
import dev.hilligans.ourcraft.util.CurvedRay;
import dev.hilligans.ourcraft.util.CurvedRayEngine;
import dev.hilligans.ourcraft.world.builders.foliage.CactusBuilder;
Expand Down
26 changes: 14 additions & 12 deletions src/main/java/dev/hilligans/ourcraft/block/Block.java
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
package dev.hilligans.ourcraft.block;

import dev.hilligans.ourcraft.GameInstance;
import dev.hilligans.ourcraft.block.blockstate.BlockStateBuilder;
import dev.hilligans.ourcraft.block.blockstate.IBlockState;
import dev.hilligans.ourcraft.client.rendering.graphics.IPrimitiveBuilder;
import dev.hilligans.ourcraft.server.concurrent.Lock;
import dev.hilligans.ourcraft.world.newworldsystem.*;
import dev.hilligans.ourcraft.block.blockstate.IBlockStateTable;
import dev.hilligans.ourcraft.client.MatrixStack;
import dev.hilligans.ourcraft.client.rendering.Renderer;
import dev.hilligans.ourcraft.client.rendering.graphics.IPrimitiveBuilder;
import dev.hilligans.ourcraft.client.rendering.newrenderer.PrimitiveBuilder;
import dev.hilligans.ourcraft.client.rendering.newrenderer.TextAtlas;
import dev.hilligans.ourcraft.client.rendering.Renderer;
import dev.hilligans.ourcraft.data.descriptors.TagCollection;
import dev.hilligans.ourcraft.data.other.BlockPos;
import dev.hilligans.ourcraft.data.other.BlockProperties;
import dev.hilligans.ourcraft.data.other.BoundingBox;
import dev.hilligans.ourcraft.data.other.RayResult;
import dev.hilligans.ourcraft.data.other.blockstates.BlockState;
import dev.hilligans.ourcraft.data.other.blockstates.DataBlockState;
import dev.hilligans.ourcraft.entity.living.entities.PlayerEntity;
import dev.hilligans.ourcraft.GameInstance;
import dev.hilligans.ourcraft.item.Item;
import dev.hilligans.ourcraft.item.ItemStack;
import dev.hilligans.ourcraft.mod.handler.content.ModContent;
import dev.hilligans.ourcraft.data.other.BlockPos;
import dev.hilligans.ourcraft.data.other.BlockProperties;
import dev.hilligans.ourcraft.data.other.BoundingBox;
import dev.hilligans.ourcraft.data.other.RayResult;
import dev.hilligans.ourcraft.Ourcraft;
import dev.hilligans.ourcraft.resource.ResourceLocation;
import dev.hilligans.ourcraft.util.registry.IRegistryElement;
import dev.hilligans.ourcraft.server.concurrent.Lock;
import dev.hilligans.ourcraft.util.Side;
import dev.hilligans.ourcraft.util.registry.IRegistryElement;
import dev.hilligans.ourcraft.world.DataProvider;
import dev.hilligans.ourcraft.world.data.providers.ShortBlockState;
import dev.hilligans.ourcraft.block.blockstate.IBlockStateTable;
import dev.hilligans.ourcraft.world.newworldsystem.IAtomicChunk;
import dev.hilligans.ourcraft.world.newworldsystem.IChunk;
import dev.hilligans.ourcraft.world.newworldsystem.IMethodResult;
import dev.hilligans.ourcraft.world.newworldsystem.IWorld;
import org.joml.Vector3d;
import org.joml.Vector3f;
import org.json.JSONObject;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/hilligans/ourcraft/block/Blocks.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.hilligans.ourcraft.block;

import dev.hilligans.ourcraft.Ourcraft;
import dev.hilligans.ourcraft.block.blocktypes.*;
import dev.hilligans.ourcraft.data.other.BlockProperties;
import dev.hilligans.ourcraft.Ourcraft;

public class Blocks {

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/dev/hilligans/ourcraft/block/bl/CropBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import dev.hilligans.ourcraft.block.Block;
import dev.hilligans.ourcraft.block.blockstate.BlockStateBuilder;
import dev.hilligans.ourcraft.block.blockstate.BlockStateTypes;
import dev.hilligans.ourcraft.block.blockstate.IBlockState;
import dev.hilligans.ourcraft.block.blockstate.IntegerStateType;
import dev.hilligans.ourcraft.data.other.BlockPos;
import dev.hilligans.ourcraft.data.other.BlockProperties;
import dev.hilligans.ourcraft.world.newworldsystem.IMethodResult;
import dev.hilligans.ourcraft.world.newworldsystem.IWorld;
import dev.hilligans.ourcraft.block.blockstate.BlockStateTypes;
import dev.hilligans.ourcraft.block.blockstate.IntegerStateType;

import java.util.ArrayList;
import java.util.Random;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package dev.hilligans.ourcraft.block.blocktypes;

import dev.hilligans.ourcraft.ServerMain;
import dev.hilligans.ourcraft.block.Block;
import dev.hilligans.ourcraft.container.containers.ChestContainer;
import dev.hilligans.ourcraft.data.other.BlockPos;
import dev.hilligans.ourcraft.data.other.BlockProperties;
import dev.hilligans.ourcraft.data.other.Inventory;
import dev.hilligans.ourcraft.entity.living.entities.PlayerEntity;
import dev.hilligans.ourcraft.network.packet.server.SOpenContainer;
import dev.hilligans.ourcraft.ServerMain;
import dev.hilligans.ourcraft.world.DataProvider;
import dev.hilligans.ourcraft.world.data.providers.ChestDataProvider;
import dev.hilligans.ourcraft.world.newworldsystem.IServerWorld;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package dev.hilligans.ourcraft.block.blocktypes;

import dev.hilligans.ourcraft.block.Block;
import dev.hilligans.ourcraft.data.other.BlockProperties;
import dev.hilligans.ourcraft.data.other.blockshapes.StairBlockShape;
import dev.hilligans.ourcraft.data.other.blockstates.BlockState;
import dev.hilligans.ourcraft.data.other.blockstates.DataBlockState;
import dev.hilligans.ourcraft.data.other.BlockProperties;
import dev.hilligans.ourcraft.world.data.providers.ShortBlockState;

public class StairBlock extends Block {
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/dev/hilligans/ourcraft/client/Camera.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
package dev.hilligans.ourcraft.client;

import dev.hilligans.ourcraft.data.other.BoundingBox;
import org.joml.*;

public class Camera {

public static Vector3d pos = new Vector3d(0, 64,0);

public static int fov = 70;

public static double pitch;
public static double yaw;

public static boolean sprinting = false;
public static int sprintTimeout = 1;
public static int sprintDelay = 0;

public static float sensitivity = 150;

public static BoundingBox playerBoundingBox = new BoundingBox(-0.35f,-1.9f,-0.35f,0.35f,0.0f,0.35f, -0.15f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import dev.hilligans.ourcraft.GameInstance;
import dev.hilligans.ourcraft.mod.handler.content.ModContent;
import dev.hilligans.ourcraft.resource.ResourceLocation;
import dev.hilligans.ourcraft.util.registry.IRegistryElement;
import dev.hilligans.ourcraft.util.Side;
import dev.hilligans.ourcraft.util.registry.IRegistryElement;
import org.lwjgl.stb.STBVorbisInfo;
import org.lwjgl.system.MemoryStack;
import org.lwjgl.system.MemoryUtil;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
package dev.hilligans.ourcraft.client.audio;

import dev.hilligans.ourcraft.client.rendering.graphics.api.ICamera;
import dev.hilligans.ourcraft.GameInstance;
import dev.hilligans.ourcraft.client.rendering.graphics.api.ICamera;
import org.joml.Vector3d;
import org.joml.Vector3f;
import org.lwjgl.openal.AL;
import org.lwjgl.openal.ALC;
import org.lwjgl.openal.ALCCapabilities;


import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import java.util.ArrayList;

import static org.lwjgl.openal.AL10.alDistanceModel;
import static org.lwjgl.openal.ALC10.*;
import static org.lwjgl.openal.AL10.*;

import static org.lwjgl.system.MemoryUtil.NULL;

public class SoundEngine {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.hilligans.ourcraft.client.input;

import dev.hilligans.ourcraft.client.rendering.graphics.api.IInputProvider;
import dev.hilligans.ourcraft.client.rendering.graphics.RenderWindow;
import dev.hilligans.ourcraft.client.rendering.graphics.api.IInputProvider;
import dev.hilligans.ourcraft.mod.handler.content.ModContent;
import dev.hilligans.ourcraft.util.registry.IRegistryElement;
import it.unimi.dsi.fastutil.ints.IntArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.hilligans.ourcraft.client.input;

import dev.hilligans.ourcraft.client.rendering.graphics.api.IInputProvider;
import dev.hilligans.ourcraft.client.rendering.graphics.RenderWindow;
import dev.hilligans.ourcraft.GameInstance;
import dev.hilligans.ourcraft.client.rendering.graphics.RenderWindow;
import dev.hilligans.ourcraft.client.rendering.graphics.api.IInputProvider;
import dev.hilligans.ourcraft.util.Logger;
import it.unimi.dsi.fastutil.ints.IntArrayList;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.hilligans.ourcraft.client.input.handler.providers;

import dev.hilligans.ourcraft.client.input.handlers.controller.ControllerHandler;
import dev.hilligans.ourcraft.client.input.InputHandlerProvider;
import dev.hilligans.ourcraft.client.input.handlers.controller.ControllerHandler;
import dev.hilligans.ourcraft.client.rendering.graphics.api.IInputProvider;

public class ControllerHandlerProvider extends InputHandlerProvider {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.hilligans.ourcraft.client.input.handler.providers;

import dev.hilligans.ourcraft.client.input.handlers.KeyPressHandler;
import dev.hilligans.ourcraft.client.input.InputHandlerProvider;
import dev.hilligans.ourcraft.client.input.handlers.KeyPressHandler;
import dev.hilligans.ourcraft.client.rendering.graphics.api.IInputProvider;

public class KeyPressHandlerProvider extends InputHandlerProvider {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.hilligans.ourcraft.client.input.handler.providers;

import dev.hilligans.ourcraft.client.input.handlers.MouseHandler;
import dev.hilligans.ourcraft.client.input.InputHandlerProvider;
import dev.hilligans.ourcraft.client.input.handlers.MouseHandler;
import dev.hilligans.ourcraft.client.rendering.graphics.api.IInputProvider;

public class MouseHandlerProvider extends InputHandlerProvider {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.hilligans.ourcraft.client.input.handlers;

import dev.hilligans.ourcraft.client.input.InputHandler;
import dev.hilligans.ourcraft.client.rendering.graphics.api.IInputProvider;
import dev.hilligans.ourcraft.client.rendering.graphics.RenderWindow;
import dev.hilligans.ourcraft.client.rendering.graphics.api.IInputProvider;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.glfw.GLFWKeyCallback;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.hilligans.ourcraft.client.input.handlers;

import dev.hilligans.ourcraft.client.input.InputHandler;
import dev.hilligans.ourcraft.client.rendering.graphics.api.IInputProvider;
import dev.hilligans.ourcraft.client.rendering.graphics.RenderWindow;
import dev.hilligans.ourcraft.client.rendering.graphics.api.IInputProvider;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.glfw.GLFWCursorPosCallback;
import org.lwjgl.glfw.GLFWMouseButtonCallback;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.hilligans.ourcraft.client.input.handlers.controller;

import dev.hilligans.ourcraft.client.input.InputHandler;
import dev.hilligans.ourcraft.client.rendering.graphics.api.IInputProvider;
import dev.hilligans.ourcraft.client.rendering.graphics.RenderWindow;
import dev.hilligans.ourcraft.client.rendering.graphics.api.IInputProvider;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.glfw.GLFWGamepadState;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.hilligans.ourcraft.client.input.key;

import dev.hilligans.ourcraft.ClientMain;
import dev.hilligans.ourcraft.data.primitives.Tuple;
import it.unimi.dsi.fastutil.ints.Int2CharOpenHashMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
Expand All @@ -9,7 +8,8 @@

import java.util.concurrent.ConcurrentLinkedQueue;

import static org.lwjgl.glfw.GLFW.*;
import static org.lwjgl.glfw.GLFW.GLFW_PRESS;
import static org.lwjgl.glfw.GLFW.GLFW_RELEASE;

public class KeyHandler {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
package dev.hilligans.ourcraft.client.input.key;

import dev.hilligans.ourcraft.block.Blocks;
import dev.hilligans.ourcraft.client.Camera;
import dev.hilligans.ourcraft.client.Client;
import dev.hilligans.ourcraft.data.other.BlockPos;
import dev.hilligans.ourcraft.data.other.blockstates.BlockState;
import dev.hilligans.ourcraft.item.ItemStack;
import dev.hilligans.ourcraft.network.packet.client.CSendBlockChanges;
import dev.hilligans.ourcraft.network.packet.client.CUseItem;

import java.nio.DoubleBuffer;

import static org.lwjgl.glfw.GLFW.*;
import static org.lwjgl.glfw.GLFW.GLFW_PRESS;
import static org.lwjgl.glfw.GLFW.GLFW_RELEASE;

public class MouseHandler {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

public class MeshHolder {

public int id = -1;
public int oldID = 0;
public long id = -1;
public long oldID = 0;

public int index = 0;
public int length = 0;

public int meshTexture = 0;

public MeshHolder set(int id, int length) {
public MeshHolder set(long id, int length) {
oldID = id;
this.id = id;
this.length = length;
return this;
}

public int getId() {
public long getId() {
return id;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import dev.hilligans.ourcraft.client.MatrixStack;
import dev.hilligans.ourcraft.client.rendering.graphics.RenderWindow;
import org.jetbrains.annotations.NotNull;
import org.joml.*;

import java.lang.Math;
import org.joml.Matrix4d;
import org.joml.Vector2f;
import org.joml.Vector3d;
import org.joml.Vector3f;

public interface ICamera {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ public void drawAndDestroyMesh(GraphicsContext graphicsContext, MatrixStack matr

@Override
public void bindTexture(GraphicsContext graphicsContext, long texture) {
if(texture == 0) {
throw new NullPointerException();
}
if(texture != boundTexture) {
GL20.glBindTexture(textureTypes.get((int)texture), (int)texture);
boundTexture = texture;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
package dev.hilligans.ourcraft.client.rendering.graphics.tasks;

import dev.hilligans.ourcraft.client.Camera;
import dev.hilligans.ourcraft.client.Client;
import dev.hilligans.ourcraft.client.MatrixStack;
import dev.hilligans.ourcraft.client.rendering.graphics.*;
import dev.hilligans.ourcraft.client.rendering.graphics.api.GraphicsContext;
import dev.hilligans.ourcraft.client.rendering.graphics.api.ICamera;
import dev.hilligans.ourcraft.client.rendering.graphics.api.IDefaultEngineImpl;
import dev.hilligans.ourcraft.client.rendering.graphics.api.IGraphicsEngine;
import dev.hilligans.ourcraft.GameInstance;
import dev.hilligans.ourcraft.client.rendering.newrenderer.PrimitiveBuilder;
import dev.hilligans.ourcraft.data.other.BoundingBox;
import dev.hilligans.ourcraft.data.primitives.FloatList;
import dev.hilligans.ourcraft.util.Loops;
import dev.hilligans.ourcraft.util.TriConsumer;
import dev.hilligans.ourcraft.world.newworldsystem.IChunk;
import dev.hilligans.ourcraft.world.newworldsystem.IWorld;
import org.joml.Vector3d;
import org.joml.Vector3f;
import org.joml.Vector3i;
import org.joml.Vector4f;

import java.awt.*;
import java.util.function.Consumer;

public class ChunkDebugRenderTask extends RenderTaskSource {

Expand Down
Loading

0 comments on commit b134b62

Please sign in to comment.