A minecraft-like multi version client implemented in Rust.

Related tags

Database Leafish
Overview

Leafish logo Leafish

Multi-version Minecraft-compatible client written in Rust, forked from Stevenarella.


Screenshot showing the main menu


Chat

Chat takes place on Matrix and Discord. The channels are bridged to each other so you won't need an account on both services.

If you want to help make and improve the game, join the developer room.

If you're a user and need help or want to ask some questions then join the general room.

Announcements are made in the announcement room and joining it is a good way to keep up-to-date with the project.

General Development Announcements
Matrix Matrix Matrix
Discord Discord Discord

Aside from the individual rooms you can also join the Matrix space to have all rooms grouped together nicely.

Contents

Introduction

Leafish is an open-source re-implementation of Minecraft. The game is a open-world sandbox where players explore a blocky, procedurally-generated 3D world with virtually infinite terrain, and may discover and extract raw materials, craft tools and items, and build structures or earthworks. The game has various game modes including survival mode, in which players must acquire resources to build the world and maintain health, and a creative mode, where players have unlimited resources and access to flight.

Minecraft is originally written by Mojang in Java for PC, but nowadays also has a so-called "Bedrock edition" which has ports to various alternative platforms. Leafish attempts to provide everything from the Java-edition and tries to be compatible with it so you can join regular servers and play alongside people using the official Java-based clients. Being written in Rust with support for modern graphic API's like Vulkan means performance improvements and enhancements that are not possible in the original game. It's also completely community driven!

Note that currently not everything from the original game is supported yet so Leafish can't currently be seen as a fully fledged alternative. A list of missing features is available on the issues page.

Version support

Symbol Meaning
All features supported
- Protocol supported (so the client can join servers using the version) but various missing features
Game version Protocol version Supported?
1.16.5 754 -
1.16.4 754 -
1.16.3 753 -
1.16.2 751 -
1.16.1 736 -
1.16 735 -
1.15.2 578 -
1.15.1 575 -
1.14.4 498 -
1.14.3 490 -
1.14.2 485 -
1.14.1 480 -
1.14 477 -
19w02a 452 -
18w50a 451 -
1.13.2 404 -
1.12.2 340 -
1.11.2 316 -
1.11 315 -
1.10.2 210 -
1.9.2 109 -
1.9 107 -
15w39c 74 -
1.8.9 47 -
1.7.10 5 -

Leafish is designed to support multiple protocol versions, so that client development is not in lock-step with the server version. The level of support varies, but the goal is to support major versions from 1.7.10 up to the current latest major version. Occasionally, snapshots are also supported.

Forge servers are supported on 1.7.10 - 1.12.2 (FML) and 1.13.2 - 1.16.5 (FML2).

Support for older protocols will not be dropped as newer protocols are added.

Getting the game

Downloading a pre-built version

Since there currently is no release yet, pre-built binaries have to be downloaded from Github Actions. The latest actions can always be seen here. Click on a workflow run from the main branch and download the artifact for your platform.

Building the game

Dependencies

Rust stable version 1.53.0 or newer is required.

Debian/Ubuntu

sudo apt-get install cargo libssl-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev

Alpine Linux

sudo apk add cargo openssl-dev xcb-util-dev

Building

Make sure you're in the root of the Git repository before running the following commands.

Compile and run:

cargo run --release

Just compile:

cargo build --release

Running

Double-clicking the game should be enough to run Leafish, which will bring up a login screen followed by a server list from which you can select a server. If nothing happens consider running the executable from the command-line, ./leafish and see if any errors come up.

Contributing

A list of bugs and missing features can be found on the issue tracker. Feel free to work on any bug and submit a pull request to the main branch with the fix. Mentioning that you intend to fix a bug on the issue will prevent other people from trying as well and makes sure no duplicated work is done.

New features

Please talk to the Leafish team first before starting to develop a new feature. We first and foremost try to make the game feature complete compared to the vanilla Java edition and except for very specific things these should be prioritized. Therefor contacting us will allow us to help you or prevent you from wasting any time. You can talk to us via Matrix and/or Discord, see links at the top of this page.

Credits

Thanks to @thinkofname for the original Steven (Rust) and @iceiix for taking up development with Stevenarella.

License

Dual-licensed MIT and ApacheV2

Comments
  • Fix pure ipaddreses (ip's without a port) could not resolve.

    Fix pure ipaddreses (ip's without a port) could not resolve.

    Fixes #134 normal hostnames could be resolve without a port. it was only Ip adresses that could not.

    The name you can see in the server list is the same as the adress.

    Before

    210912-2038-55

    Now

    image

    I have simplified the code and it can still connect to server where it is protected by TCPShield. I did throw in a empty server where the field is empty. also kkmp.dk does not exits.

    FIY this pr also removes regex

    opened by kepet19 16
  • Bumped up macOS version

    Bumped up macOS version

    Since GitHub hasn't updated macos-latest I bumped up the macOS version from 10.15 to 10.16 (For some reason, the macOS 10.15 CI uses the Xcode 11 SDK, while the macOS 10.16 CI uses the Xcode 12.X SDK, which lead to less compatibility with the Rosetta 2 interpreter)

    opened by iMonZ 16
  • Make Flatpak package

    Make Flatpak package

    Flatpak is a universal package manager for Linux. Flathub is one of Flatpak's repo (remote) which includes a build system. Alternatively we can use GitHub CI to create Flatpak bundles: https://github.com/marketplace/actions/flatpak-builder.

    I'm quite familiar with Flatpak so I can create a manifest.


    I don't have a Minecraft account, so I'd like others to test it for me. If you want to test, please read the instructions at https://github.com/terrarier2111/Leafish/issues/104#issuecomment-913779965.

    enhancement low-priority 
    opened by TheEvilSkeleton 12
  • Initial Leafish Flatpak

    Initial Leafish Flatpak

    Closes https://github.com/terrarier2111/Leafish/issues/104.

    Since this MR requires approval, test CIs will be available at https://github.com/TheEvilSkeleton/Leafish/pull/1.

    opened by TheEvilSkeleton 8
  • Fix panic where where subtract's overflows

    Fix panic where where subtract's overflows

    Fix a panic where screen tries to subtract 1 from 0 0 - 1 = -1 this panic only happens in debug builds, I think it is because rust builds it with checking for overflow there. Not sure why it don't do it in a release build

    Not sure if it should be fixed like this or there i a logic error some place? I have not looked into it

        Finished dev [optimized + debuginfo] target(s) in 0.12s
         Running `target/debug/leafish`
    [main.rs:220][INFO] Starting Leafish...
    [main.rs:284][INFO] Shader version: #version 150
    thread 'main' panicked at 'attempt to subtract with overflow', src/screen/mod.rs:269:27
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    zsh: segmentation fault (core dumped)  cargo run
    
    
    opened by kepet19 6
  • Support single left clicks in inventory windows

    Support single left clicks in inventory windows

    I've added basic support for moving items around inventory windows using single left clicks. This works for player inventory and chests at the moment. I was testing on a 1.14 server, but can do testing for a few other versions tomorrow.

    One of the architecture changes I made was to store the 36 inventory slots that are common to most window types in the base inventory, rather than making it proxy those the player slots. This made rendering updates easier to manage since we didn't need to use different rules between player and chest inventories.

    Sorry about the large PR. I'm happy to make changes to the structure if you had another design in mind.

    opened by nathanruiz 5
  • Fix buffer overrun in light data

    Fix buffer overrun in light data

    We seem to be reading 4096 bytes rather than 2048 bytes per section in some cases. The array should always be 2048, 4 bits for each block in the chunk section (https://wiki.vg/index.php?title=Protocol&oldid=16317#Update_Light).

    opened by nathanruiz 5
  • Client crashes when connecting to 1.16.5 Server

    Client crashes when connecting to 1.16.5 Server

    I tried running a local Spigot 1.16.5 server, and connecting to it with Leafish (on commit fcdfa40), but about half a second after I connected, the client crashes with the following console output:

    leafish_crash.txt

    I did get a couple of frames rendered before it crashed, but I could only see my own body and some boxes without textures on them.

    opened by schitcrafter 5
  • Wip: Add Material::from(isize)

    Wip: Add Material::from(isize)

    Hello this is a work in progress, I don't know if you want a huge match statement like this or you would like to use something else.

    When I run it from minecraft server 1.16.4 it tries too set item 902. but is is not in the list. image image

    do somebody know where to look for minecraf block id's?

    I am going to remove log::info later. it is just for debugging purpose.

    opened by kepet19 5
  • Use the background image on every screen

    Use the background image on every screen

    ~~This requires too much passing around of the background_image variable, but good enough for now till the settings system has been reworked~~

    EDIT: This depends on #139 and shouldn't be merged first.

    opened by PureTryOut 4
  • gitignore: ignore _all_ target directories

    gitignore: ignore _all_ target directories

    I several times had a protocol/target folder which I kept accidentally committing. Let's ignore that directory (and others).

    I'm not entirely sure this does the right thing so needs testing, but right now I can't get the folder to appear again.

    opened by PureTryOut 4
  • Does not build ootb

    Does not build ootb

    Are we pointing at a commit that does not exist as a dep (in the lockfile)?

    $ cargo build --release
        Updating git repository `https://github.com/terrarier2111/bevy`
    error: failed to get `bevy_ecs` as a dependency of package `leafish v0.1.0 (/home/iphands/prog/Leafish)`
    
    Caused by:
      failed to load source for dependency `bevy_ecs`
    
    Caused by:
      Unable to update https://github.com/terrarier2111/bevy#a58b4936
    
    Caused by:
      object not found - no match for id (a58b4936d0e1ccd241dca74bceae78a1b6d4f949); class=Odb (9); code=NotFound (-3)
    
    opened by iphands 2
  • Optimise chunk loading

    Optimise chunk loading

    I started doing some benchmarking on the code that loads chunk since I noticed the game becomes a bit jumpy when entering a new area. After doing a bit of testing with a few different methods of optimisation, it seems like the main causes were:

    • The chunk DashMap hash function
    • The locking while loading a chunk
    • The BlockStorage structure

    The first thing I noticed was that a large amount of the time was used up by DashMap hash function. I tried to switch to a faster one, but nothing really seemed to beat the custom FNV hash that we have already. Since the chunk hashmap is indexed with two i32s, I tried to use a BTreeMap instead since the comparison should be faster than using a hash function for such a simple key. It ended up dropping from ~6.2ms to ~4.1ms per chunk.

    One of the downsides of using BTreeMap rather than DashMap was that chunks couldn't be loaded concurrently since it keeps a write lock for the entire load_chunk() call. Using DashMap allows for locking multiple chunks if accessing values in different shards inside the DashMap. To resolve this issue while still using a BTreeMap, I changed load_chunk() to make a copy of the chunk at the start, update the chunk, and then write the copy back at the end. I was expecting this to add a little more time to the process, but I couldn't see any difference on the benchmark results. This also allows any number of chunks to be loaded concurrently, only blocking other threads while attempting to replace the chunk at the end.

    The next thing I found was the BlockStorage struct. It seemed to be using a structure similar to the palette structure the chunk is sent in. When I switched this to use a Vec<Block>, it dropped from ~4.1ms to ~2.9ms per chunk. I tested the effect this had on memory by running the client with both implementations, and it seems like it only used ~20mb of extra memory.

    After making these changes, the game was noticeably less jumpy when going into new regions. I think the majority of this was changing the locking structure, since anything that needed to read the world state was less likely to conflict with the load_chunk() write lock. The other optimisations are less important but still make chunks load faster in new regions.

    opened by nathanruiz 3
  • Standardize contribution terms.

    Standardize contribution terms.

    We really should make a clause that licenses all code under one license. By default if someone doesn't put in a license for their code, it's assumed to be all rights reserved.

    opened by skillman623 1
  • Shrink unsafe block

    Shrink unsafe block

    In this function you use the unsafe keyword for almost the entrie function body.

    We need to mark unsafe operations more precisely using unsafe keyword. Keeping unsafe blocks small can bring many benefits. For example, when mistakes happen, we can locate any errors related to memory safety within an unsafe block. This is the balance between Safe and Unsafe Rust. The separation is designed to make using Safe Rust as ergonomic as possible, but requires extra effort and care when writing Unsafe Rust.

    Hope this PR can help you. Best regards. References https://doc.rust-lang.org/nomicon/safe-unsafe-meaning.html https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html

    opened by cactter 2
  • Fix varint and varlong decoding

    Fix varint and varlong decoding

    This aims to fix varint/varlong decoding, based on the example implementations from wiki.vg. Is yet to be tested. When this gets merged, please don't forget to delete the fix-varint-decoding branch, as it's not needed anymore.

    opened by schitcrafter 0
Owner
null
Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async

CDRS CDRS is looking for maintainers CDRS is Apache Cassandra driver written in pure Rust. ?? Looking for an async version? async-std https://github.c

Alex Pikalov 338 Jan 1, 2023
Mysql client library implemented in rust.

mysql This crate offers: MySql database driver in pure rust; connection pool. Features: macOS, Windows and Linux support; TLS support via nativetls cr

Anatoly I 548 Dec 31, 2022
A multi-instance, Discord/Spacebar API-compatible chat client

Polyphony A multi-instance, Discord/Spacebar API-compatible chat client, written in Rust and Svelte (TypeScript) using Tauri. Explore the docs » Repor

null 5 Mar 30, 2023
A multi-instance, Discord/Spacebar API-compatible chat client

Polyphony A multi-instance, Discord/Spacebar API-compatible chat client, written in Rust and Svelte (TypeScript) using Tauri. Explore the docs » Repor

null 6 Apr 3, 2023
Affine-client is a client for AFFINE based on Tauri

Affine Client affine-client is a client for AFFINE based on Tauri Supported Platforms Windows Linux MacOS Download https://github.com/m1911star/affine

Horus 216 Dec 25, 2022
PickleDB-rs is a lightweight and simple key-value store. It is a Rust version for Python's PickleDB

PickleDB PickleDB is a lightweight and simple key-value store written in Rust, heavily inspired by Python's PickleDB PickleDB is fun and easy to use u

null 155 Jan 5, 2023
Rust version of the Haskell ERD tool. Translates a plain text description of a relational database schema to dot files representing an entity relation diagram.

erd-rs Rust CLI tool for creating entity-relationship diagrams from plain text markup. Based on erd (uses the same input format and output rendering).

Dave Challis 32 Jul 25, 2022
This is a small demo of how to transform a simple single-server RocksDB service written in Rust into a distributed version using OmniPaxos.

OmniPaxos Demo This is a small demo of how to transform a simple single-server RocksDB service into a distributed version using OmniPaxos. Related res

Harald Ng 6 Jun 28, 2023
Distributed, version controlled, SQL database with cryptographically verifiable storage, queries and results. Think git for postgres.

SDB - SignatureDB Distributed, version controlled, SQL database with cryptographically verifiable storage, queries and results. Think git for postgres

Fremantle Industries 5 Apr 26, 2022
A simplified version of a Redis server supporting SET/GET commands

This is a starting point for Rust solutions to the "Build Your Own Redis" Challenge. In this challenge, you'll build a toy Redis clone that's capable

Patrick Neilson 2 Nov 15, 2022
Redis re-implemented in Rust.

rsedis Redis re-implemented in Rust. Why? To learn Rust. Use Cases rsedis does not rely on UNIX-specific features. Windows users can run it as a repla

Sebastian Waisbrot 1.6k Jan 6, 2023
Raft distributed consensus algorithm implemented in Rust.

Raft Problem and Importance When building a distributed system one principal goal is often to build in fault-tolerance. That is, if one particular nod

TiKV Project 2.3k Dec 28, 2022
Sharded, concurrent mini redis that support http interface implemented in rust

Rudis A mini version of redis server that provides http interface implemented in Rust. The in-memorry kv-storage is sharded and concurrent safe. Inspi

Lorenzo Cao 43 May 30, 2023
Rust lib for a Vec-like structure that can store different types of different sizes contiguous with each other in memory.

hvec In memory of Anna Harren, who coined the term turbofish - which you'll see a lot of if you use this crate. The main purpose of this crate is the

Vi 2 Oct 23, 2022
Go like sync.WaitGroup implementation in Rust. (sync/async)

WAG Go like sync.WaitGroup implementation in Rust. (sync/async) | Examples | Docs | Latest Note | wag = "0.3.0" How to use, use wag::WaitGroup; let w

Doha Lee 2 Dec 15, 2022
An object-relational in-memory cache, supports queries with an SQL-like query language.

qlcache An object-relational in-memory cache, supports queries with an SQL-like query language. Warning This is a rather low-level library, and only p

null 3 Nov 14, 2021
Running SQL-like queries on files.

filesql Running SQL-like queries on files. Features Supported: REPL Basic SQL expressions. INSERT clause. (which inserts data into another file) WHERE

Zhang Li 1 Nov 15, 2021
Making Postgres and Elasticsearch work together like it's 2021

Making Postgres and Elasticsearch work together like it's 2021 Readme ZomboDB brings powerful text-search and analytics features to Postgres by using

ZomboDB 4.2k Jan 2, 2023
Bind the Prisma ORM query engine to any programming language you like ❤️

Prisma Query Engine C API Bind the Prisma ORM query engine to any programming language you like ❤️ Features Rust bindings for the C API Static link li

Prisma ORM for community 10 Dec 15, 2022