A simple Minecraft written in Rust with the Piston game engine

Overview

hematite Build Status

A simple Minecraft written in Rust with the Piston game engine

screenshot

How To Open a World

This method is only for personal use. Never distribute copyrighted content from Minecraft.

  • In the Minecraft Launcher, click the button “New Profile”

  • In the drop down "use version", select 1.8.8

  • Click “Save Profile”

  • Click “Play” (this will download the snapshot)

  • Quit Minecraft

  • Copy your world save to to the hematite directory (It may corrupt your world)

  • Save Locations:

    • Windows: %appdata%\.minecraft\saves\
    • OSX: ~/Library/Application Support/minecraft/saves/
    • Linux/Other: ~/.minecraft/saves/
  • Run hematite with: cargo run --release "./<WORLD_NAME>"

Dependencies

dependencies

How to contribute

Comments
  • [WIP] Update to latest Rust (nightlies).

    [WIP] Update to latest Rust (nightlies).

    MERGE WHENEVER YOU WANT.

    I'm working my way up to getting hematite working on Rust 1.0 ~~alpha~~ nightlies.

    If anyone wants to suggest something I welcome each and everyone of you.

    opened by toqueteos 52
  • Windows build launches and immediately exits.

    Windows build launches and immediately exits.

    I built Hematite for Windows, and placed the SDL libraries in my C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib, and it builds a hematite.exe, but launching it does nothing.

    I'm having some difficulty understanding the Readme as well, which has the OSX instructions as follows:

    • In the Minecraft Launcher, click the button "New Profile"
    • Type in a profile name, for example "experimental"
    • Check "Enable experimental development versions"
    • A message warns you about keeping backups of your worlds. Click "Yes" (remember to do backups)
    • In the drop down "use version", select <version>
    • Click "Save Profile"
    • Click "Play" (this will download the snapshot)
    • Quit Minecraft
    • Copy versions/<version>/<version>.jar to the assets folder in Hematite
    • Rename the file extension to .zip
    • Extract the jar
    • Copy the minecraft folder from the new extracted folder and put it in the Hematite assets folder
    • Run ./target/hematite "/Users/<username>/Library/Application Support/minecraft/saves/<world>"

    Here are my points of confusion:

    1. Which assets folder? The one inside the git repo .\hematite, or the one inside the final build path, i.e.: .\hematite\target\release\...\assets?
    2. The instructions say to copy the <version>.jar file to assets and rename it to <version>.zip. Does the name <version>.zip have any consequence, or is it discarded after use?
    3. The instructions say to extract the jar. That means <version>.zip, right?
    4. The <version>.zip does not have a minecraft folder, except it does underneath a few other folders. Is that the folder you're referring to?
    5. Now, should I have assets\minecraft\.. or assets\.. after I extract the minecraft folder? i.e.: do I want a minecraft folder in my assets folder, or do I want the contents of the minecraft folder in my assets folder?
    6. Why don't I get any output on stdout when I run hematite? Even when I don't pass in a world path, it just exits immediately.

    Unfortunately it looks like something broke between my desktop and my laptop, as on my laptop I'm now unable to build hematite as time v0.1.14 fails to build.

    question information 
    opened by AaronFriel 32
  • Strange visual glitch on latest hematite build

    Strange visual glitch on latest hematite build

    I didn't update to latest nighlies today (windows apparently is built every two days?) so I could still test hematite, something is very wrong.

    $ rustc -V
    rustc 1.0.0-nightly (ba2f13ef0 2015-02-04 20:03:55 +0000)
    

    Here you have a video showing it: https://www.youtube.com/watch?v=Zjj2iv-wSEg

    Any ideas what may be causing this? It seems like an issue with normals and culling.

    bug 
    opened by toqueteos 28
  • Compiler errors (Copy constraint on `Buffer`)

    Compiler errors (Copy constraint on `Buffer`)

    The methods on Cell requires a Copy constraint, which is no longer implemented by Buffer.

    src/chunk.rs:113:40: 113:45 error: type `&core::cell::Cell<core::option::Option<shader::Buffer>>` does not implement any method in scope named `get`
    src/chunk.rs:113                 f(x, y as i32, z, c, b.get())
                                                            ^~~~~
    src/chunk.rs:113:45: 113:45 help: methods from traits can only be called if the trait is implemented and in scope; the following traits define a method `get`, perhaps you need to implement one of them:
    src/chunk.rs:113:45: 113:45 help: candidate #1: `core::slice::SliceExt`
    src/chunk.rs:113:45: 113:45 help: candidate #2: `collections::slice::SliceExt`
    src/chunk.rs:113:45: 113:45 help: candidate #3: `quack::get::Get`
    src/minecraft/region.rs:143:41: 143:50 error: the trait `core::marker::Copy` is not implemented for the type `shader::Buffer` [E0277]
    src/minecraft/region.rs:143             buffers: Array::from_fn(|_| Cell::new(None)),
                                                                        ^~~~~~~~~
    src/main.rs:294:38: 294:43 error: type `&core::cell::Cell<core::option::Option<shader::Buffer>>` does not implement any method in scope named `get`
    src/main.rs:294                         match buffer.get() {
                                                         ^~~~~
    src/main.rs:294:43: 294:43 help: methods from traits can only be called if the trait is implemented and in scope; the following traits define a method `get`, perhaps you need to implement one of them:
    src/main.rs:294:43: 294:43 help: candidate #1: `core::slice::SliceExt`
    src/main.rs:294:43: 294:43 help: candidate #2: `collections::slice::SliceExt`
    src/main.rs:294:43: 294:43 help: candidate #3: `quack::get::Get`
    src/main.rs:302:32: 304:27 error: type `&core::cell::Cell<core::option::Option<shader::Buffer>>` does not implement any method in scope named `set`
    src/main.rs:302                         buffer.set(Some(
    src/main.rs:303                             renderer.create_buffer(staging_buffer.as_slice())
    src/main.rs:304                         ));
    src/main.rs:304:27: 304:27 help: methods from traits can only be called if the trait is implemented and in scope; the following trait defines a method `set`, perhaps you need to implement it:
    src/main.rs:304:27: 304:27 help: candidate #1: `quack::set::Set`
    error: aborting due to 4 previous errors
    Could not compile `hematite`.
    
    draft medium 
    opened by bvssvni 20
  • Compile issues on Windows

    Compile issues on Windows

    So, with the help of the excellent Reddit sub, I almost got everything compiled. It looks like things are failing on:

    pub struct BlockStates { models: Vec, texture: Texture }

    Texture needs a type argument. Ive tried all sorts of things. gfx::GLDevice, gfx::Device, etc.

    Unfortunately, this is my first Rust project, so Im at a loss. I dont know how to find the info that would let me fix this.

    bug 
    opened by Svengali 12
  • Build fail : no package 'render'

    Build fail : no package 'render'

    Hi For me (and travis), the build fails with this message :

    no matching package named `render` found (required by `hematite`)
    location searched: https://github.com/gfx-rs/gfx-rs
    version required: *
    
    bug easy 
    opened by Yamakaky 12
  • Fix #215 - Remove quack library usage

    Fix #215 - Remove quack library usage

    Not currently working, but progress has been made:

    • cargo update
    • flate -> flate2 (crates.io)
    • os::MemoryMap -> mmap
    • rustc-serialize 0.2.8 -> 0.3.x
    • range(a, b) -> a..b
    • old_io -> io
    • Other misc changes.

    Most of the grunt work has been done to update hematite for rust nightly/beta, and the ever-changing gfx-rs and piston. Currently, what's left to be done is to disentangle the Renderer type from Device/Factory in shader.rs, and block_state.rs (or some other solution) to finish removing quack. In fact, if you know what you're doing, it might be easier to start with the shader.rs from master and work from there since the one in the PR was committed in the middle of me trying to understand the web of inheritance going on there.

    A potential papercut to note: I didn't notice at the time but the mmap crate from crates.io might not work on Windows right now (PR Pending ?).

    opened by mattico 11
  • Upgrade to modern gfx-rs, using PSOs

    Upgrade to modern gfx-rs, using PSOs

    I've just started working on this (again) so it's not nearly done. I'm mostly just putting this up so that I don't forget about it again :)

    ~~Is there a reason to not use tilde/caret requirements in Cargo.toml? Cargo.lock is checked in so you still need to explicitly cargo update for anything to change.~~

    Closes #214

    opened by mattico 10
  • unresolved import `rustrt::rtio::RtioFileStream`

    unresolved import `rustrt::rtio::RtioFileStream`

    src/minecraft/region.rs:3:5: 3:33 error: unresolved import `rustrt::rtio::RtioFileStream`. There is no `RtioFileStream` in `rustrt::rtio`
    
    src/minecraft/region.rs:3 use rustrt::rtio::RtioFileStream;
    
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    error: aborting due to previous error
    
    Could not compile `hematite`.
    
    bug 
    opened by bvssvni 10
  • Build failure through sdl2

    Build failure through sdl2

    When I pull hematite and run cargo build, I get this:

    Could not compile `sdl2`.
    
    --- stderr
    src/sdl2/audio.rs:264:100: 264:109 error: wrong number of lifetime parameters: expected 1 but found 0 [E0107]
    src/sdl2/audio.rs:264     pub fn open(device: Option<&str>, iscapture: int, spec: &AudioSpec) -> SdlResult<(AudioDevice, AudioSpec)> {
                                                                                                                             ^~~~~~~~~
    error: aborting due to previous error
    
    opened by alexchandel 9
  • Build fail: trait Copy not implemented

    Build fail: trait Copy not implemented

    Hi I have a build fail with this message:

    src/shader.rs:101:10: 101:14 error: the trait `Copy` may not be implemented for this type; field `batch` does not implement `Copy` [E0204]
    src/shader.rs:101 #[derive(Copy)]
                               ^~~~
    note: in expansion of #[derive]
    src/shader.rs:101:1: 101:16 note: expansion site
    
    opened by Yamakaky 8
  • 128 bit chunk positions

    128 bit chunk positions

    I know Minecraft is only 32 bit (by default, there is a mod that lets it be 64 bit but that's for 1.2.5), but since rust has the capabilities to have 128 bit constants, why not? World sizes would go from 4.294e9 to over 1e27 times that.

    opened by SolDev69 0
  • Adding a default save to the repository

    Adding a default save to the repository

    Hi ! This is a suggestion : since the project doesn't support generating new words, what about putting a default save in the repository ? I don't have minecraft installed on my PC and I would like to test the project, but as far as I understand I can't. (and I don't want to install minecraft / find a save online)

    I think this would be great to make the project more accessible if you would like to.

    opened by sami-lefebvre 0
  • Project status

    Project status

    Hello, I would like to know what is the current status of this project ? The development seems stalled :( Anyway, good job for doing something this smooth :stuck_out_tongue:

    opened by aviallon 1
  • Only a fraction of the window space is used

    Only a fraction of the window space is used

    2019-05-18_19-44

    I'm on linux and I also had the problem described in #274, but after loading from the game directory I got it to work. But now only a fraction of the screen is used.

    opened by Simon-Laux 0
  • unable to run on ubuntu 18.04 x64

    unable to run on ubuntu 18.04 x64

    abas@abas-ThinkPad-R61:~/Downloads/hematite-master$ cargo run --release "./<New_World>" Finished release [optimized] target(s) in 1.33s
    Running target/release/hematite './<New_World>' Opening "/home/abas/.minecraft/versions/1.8.8/1.8.8.jar"... File "/home/abas/.minecraft/versions/1.8.8/1.8.8.jar" contains 5597 files. Extracted 3085 files. thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:1009:5 note: Run with RUST_BACKTRACE=1 for a backtrace.

    opened by abasgames 2
Owner
PistonDevelopers
The Piston game engine organization for maintenance and research
PistonDevelopers
Minecraft-esque voxel engine prototype made with the bevy game engine. Pending bevy 0.6 release to undergo a full rewrite.

vx_bevy A voxel engine prototype made using the Bevy game engine. Goals and features Very basic worldgen Animated chunk loading (ala cube world) Optim

Lucas Arriesse 125 Dec 31, 2022
Rustcraft is a simple Minecraft engine written in rust using wgpu.

Rustcraft is a simple Minecraft engine written in rust using wgpu.

Raphael Van Hoffelen 110 Dec 22, 2022
Brine is my attempt at writing a Minecraft client in Rust using the Bevy game engine.

Brine Brine is my attempt at writing a Minecraft client in Rust using the Bevy game engine. It's EXTREMELY work-in-progress. The thing that makes Brin

Ben Reeves 34 Dec 26, 2022
🌎 Demo for Minecraft-like procedural generation using the Bevy game engine

infinigen This is a demo for Minecraft-like procedural generation using the Bevy game engine. chunks along all axes (X, Y and Z) adjustable zoom level

James Hiew 16 Jun 11, 2023
A game of snake written in Rust using the Bevy game engine, targeting WebGL2

Snake using the Bevy Game Engine Prerequisites cargo install cargo-make Build and serve WASM version Set your local ip address in Makefile.toml (loca

Michael Dorst 0 Dec 26, 2021
2-player game made with Rust and "ggez" engine, based on "Conway's Game of Life"

fight-for-your-life A 2-player game based on the "Conway's Game of Life", made with Rust and the game engine "ggez". Create shapes on the grid that wi

Petros 3 Oct 25, 2021
2d Endless Runner Game made with Bevy Game Engine

Cute-runner A 2d Endless Runner Game made with Bevy Game Engine. Table of contents Project Infos Usage Screenshots Disclaimer Project Infos Date: Sept

JoaoMarinho 2 Jul 15, 2022
A game made in one week for the Bevy engine's first game jam

¿Quien es el MechaBurro? An entry for the first Bevy game jam following the theme of "Unfair Advantage." It was made in one week using the wonderful B

mike 20 Dec 23, 2022
A Client/Server game networking plugin using QUIC, for the Bevy game engine.

Bevy Quinnet A Client/Server game networking plugin using QUIC, for the Bevy game engine. Bevy Quinnet QUIC as a game networking protocol Features Roa

Gilles Henaux 65 Feb 20, 2023
Solana Game Server is a decentralized game server running on Solana, designed for game developers

Solana Game Server* is the first decentralized Game Server (aka web3 game server) designed for game devs. (Think web3 SDK for game developers as a ser

Tardigrade Life Sciences, Inc 16 Dec 1, 2022
A simple, very minimal Minecraft server implementation in Rust.

A simple, very minimal Minecraft server implementation in Rust. For a simple Minecraft server that isn't supposed to do much (for example, a limbo ser

Chris 8 Dec 22, 2022
A refreshingly simple data-driven game engine built in Rust

What is Bevy? Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever! WARNING Bevy is still in the ve

Bevy Engine 21.1k Jan 4, 2023
Simple RUST game with the Bevy Engine

Simple RUST Game using the Bevy Engine YouTube videos for this code base: Episode 1 - Rust Game Development tutorial from Scratch with Bevy Engine Epi

null 150 Jan 7, 2023
A Simple Rust Game Engine For 2D

VeeBee VeeBee Is A Nice And Simple Game Engine For 2D. Features Sprites & Images! Btw There Is A Built In 2D Pack (But The Textures Are REALY BAD, Sor

null 2 Feb 2, 2022
Bevy is a refreshingly simple data-driven game engine built in Rust

What is Bevy? Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever! WARNING Bevy is still in the ve

John Winston 3 Jun 3, 2022
A simple and minimal game engine library built in rust.

Neptune A brand new free, open-source minimal and compact game engine built in rust. Design Goals We plan to make Neptune a small and minimal engine,

Levitate 17 Jan 25, 2023
Bevy Simple Portals is a Bevy game engine plugin aimed to create portals.

Portals for Bevy Bevy Simple Portals is a Bevy game engine plugin aimed to create portals. Those portals are (for now) purely visual and can be used t

Sélène Amanita 11 May 28, 2023
A simple-to-use input manager for the Bevy game engine that empowers players and makes accessibility easy.

Bevy Ineffable A simple-to-use input manager for the Bevy game engine that empowers players and makes accessibility easy. Core tenets Make accessibili

Jazarro 10 Mar 2, 2024
ULE - Minecraft's server core written in Rust

ULE - Minecraft's server core written in Rust This's server core fully written in Rust-Lang and using more custom code for best perfomance and control

null 13 Oct 26, 2022