Changed up our libraries

Removed the render engine. It's probably better to learn to make one
ourselves anyway. We can make it into a library later.
Removed duplicate LWJGL jars, we're using maven for them anyway.
Changed our JSON parsing library from "json-simple" to Argo (Minecraft's
own library)

It's looking like we might be able to use mostly the same code from
Minecraft due to all of these open-source libraries being used.
master
Caroline Bell 2019-09-19 19:27:41 -07:00
parent bfedfd9b47
commit f15e9a8003
16 changed files with 58 additions and 70 deletions

View File

@ -12,8 +12,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/bwyap-engine.jar" sourcepath="lib/bywap-engine-src.zip"/>
<classpathentry kind="lib" path="lib/json-simple-1.1.1.jar"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>

View File

@ -1,16 +1,20 @@
#### LiteCraft
### LiteCraft
A lightweight, singleplayer only Minecraft clone <br />
Aims to be on-par with Minecraft 1.2.5 (Just before they started using integrated servers), in terms of quality, with thousands of lines less code, and quite a few less bugs. <br />
### Goals:
#### Goals:
- Learn the (old) Minecraft codebase inside and out
- Practice Java and learn new techniques
- Create a clone of Minecraft with as little original code and as many open-source
libraries as possible
- Use a mainly data-driven structure, allowing for easier additions (and removals) of features, saving custom classes for only really unique features. (So all farmable mobs would share the same class, for instance.)
### Planned Changes from Vanilla Minecraft
#### Planned Feature Changes from Vanilla Minecraft
- No more multiplayer. (It adds a lot of lines of code, as well as requiring an entirely
different app for a server.)
- No more "End" (It's a uniquely Minecraft thing, we need to distance ourselves from
the IP a bit)
- Pretty much any creature, monster, item, block, dimension that's unique to Minecraft will not
be present either.
be present either.
- These features will be replaced by our own original ideas, or some more generic ones, instead.
- Only built-in texture packs. This allows us to write fewer lines of code to process custom resources.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -47,7 +47,7 @@
<dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opengl</artifactId><classifier>${lwjgl.natives}</classifier></dependency>
<dependency><groupId>org.joml</groupId><artifactId>joml</artifactId><version>${joml.version}</version></dependency>
<dependency><groupId>com.google.code.gson</groupId><artifactId>gson</artifactId><version>${gson.version}</version></dependency>
<dependency><groupId>net.sourceforge.argo</groupId><artifactId>argo</artifactId><version>5.5</version></dependency>
<dependency><groupId>org.spongepowered</groupId><artifactId>noise</artifactId><version>2.0.0-SNAPSHOT</version></dependency>
</dependencies>
</project>

View File

@ -1,5 +1,6 @@
package com.github.halotroop.litecraft;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import org.joml.Vector2f;
@ -8,64 +9,62 @@ import org.lwjgl.glfw.*;
import org.lwjgl.opengl.*;
import org.lwjgl.system.MemoryStack;
import com.bwyap.engine.EngineInterface;
import com.bwyap.engine.input.InputHandler;
import com.bwyap.engine.window.WindowInterface;
import com.github.halotroop.litecraft.types.gui.MainMenu;
public class LCWindow extends com.bwyap.engine.window.Window
public class LCWindow
{
private long windowLong;
public long getWindowLong()
{ return windowLong; }
public void setWindowLong(long window)
{ this.windowLong = window; }
public LCWindow(int width, int height)
public long getWindowLong() { return windowLong; }
private String title;
protected void setWindowTitle(String title) { this.title = title; }
public String getWindowTitle() { return title; }
private int width, height;
public int getWidth() { return width; }
public int getHeight() { return height; }
public void setWidth(int width) { this.width = width; }
public void setHeight(int height) { this.height = height; }
public void setWidthAndHeight(int width, int height)
{
super(width, height, "LiteCraft", true);
this.width = width;
this.height = height;
}
public LCWindow(int width, int height, String title)
{
setWindowTitle(title);
setWidthAndHeight(width, height);
init();
start();
}
@Override
public LCWindow(int width, int height)
{
this(width, height, "LiteCraft");
}
public boolean shouldClose()
{
return false;
}
@Override
public void processEvents()
{
}
@Override
public void swapDisplayBuffers()
{
}
@Override
public EngineInterface createEngine() throws Exception
{
return null;
}
@Override
public void init()
{
GLFW.glfwDefaultWindowHints();
GLFW.glfwWindowHint(GLFW.GLFW_RESIZABLE, 1);
// Create the window
windowLong = GLFW.glfwCreateWindow(getWidth(), getHeight(), getDefaultTitle(), 0, 0);
this.windowLong = GLFW.glfwCreateWindow(getWidth(), getHeight(), getWindowTitle(), 0, 0);
if (windowLong == 0) throw new RuntimeException("Failed to create the GLFW window");
}
@Override
public void start()
{
// Get the thread stack and push a new frame
@ -88,17 +87,9 @@ public class LCWindow extends com.bwyap.engine.window.Window
}
}
@Override
public void dispose()
{
Callbacks.glfwFreeCallbacks(windowLong);
GLFW.glfwDestroyWindow(windowLong);
}
@Override
protected void setWindowTitle(String title)
{
super.setDefaultTitle(title);
}
}

View File

@ -30,7 +30,7 @@ public class LiteCraftMain
if (!GLFW.glfwInit()) throw new IllegalStateException("Unable to initialize GLFW");
// Configure GLFW
window = new LCWindow(width, height);
window.setDefaultTitle("LiteCraft " + "INSERT SPLASH TEXT HERE!");
window.setWindowTitle("LiteCraft " + "INSERT SPLASH TEXT HERE!");
// Setup a key callback. It will be called every time a key is pressed, repeated or released.
GLFW.glfwSetKeyCallback(window.getWindowLong(), (window, key, scancode, action, mods) ->

View File

@ -0,0 +1,9 @@
package com.github.halotroop.litecraft.types.entity;
public abstract class Entity
{
public Entity(String id, String type)
{
}
}

View File

@ -1,11 +1,9 @@
package com.github.halotroop.litecraft.types.gui;
import com.bwyap.engine.gui.GUI;
public abstract class HUD extends GUI
public abstract class HUD
{
public HUD(float width, float height)
public HUD()
{
super(width, height);
}
}

View File

@ -1,21 +1,11 @@
package com.github.halotroop.litecraft.types.gui;
import com.bwyap.engine.gui.GUI;
import com.bwyap.engine.gui.element.TexturedButton;
import com.bwyap.engine.gui.element.base.Button;
public class MainMenu extends Menu
{
public MainMenu(float width, float height)
public MainMenu()
{
super(width, height);
Button b = new TexturedButton(20, 20, 100, 100)
{
@Override
public void onMouseClicked(float x, float y, int mouseButton)
{
// TODO Auto-generated method stub
}
};
super();
}
}

View File

@ -1,11 +1,9 @@
package com.github.halotroop.litecraft.types.gui;
import com.bwyap.engine.gui.GUI;
public abstract class Menu extends GUI
public abstract class Menu
{
public Menu(float width, float height)
public Menu()
{
super(width, height);
}
}