Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply microtus #1

Merged
merged 5 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @OneLiteFeatherNET/core-team
/.github/CODEOWNERS @OneLiteFeatherNET/core-team
39 changes: 19 additions & 20 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
## How to contribute to Minestom
#### **Did you find a bug?**
* Open a new GitHub issue if it's not already reported.
Contributing to Microtus
========================

* Explain it clearly, with steps (or code) to reproduce it.
We (the Microtus team) would be very glad if you want to contribute to the project.
The process to contribute requires some guidelines that you need to follow.
These help us to improve the project and maintain a consistent style for each contributor

#### **Did you write some code that fixes a bug?**
* Open a new GitHub pull-request with the commits if it hasn't already been proposed.
## Use a Personal Fork and not an Organization

* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
If you want to contribute to Microtus, please fork the repository to your personal account and not to an organization.
This is because GitHub does not allow to push as maintainer of our fork into a repository from an organization to another organization.
If you fork the repository to an organization, you can open a pr, but we want to accept it.

#### **Do you intend to add a new feature or change an existing one?**
* Do not open a pull-request on GitHub until you have collected positive feedback about the change from a maintainer.
We much prefer to have PRs show as merged, so please do not use repositories
on organizations for PRs.

#### **Do you have questions about the source code?**
* Ask any question about how to use Minestom in the GitHub issues section or the community portals.
See <https://github.com/isaacs/github/issues/1681> for more information on the
issue.

#### **Do you want to contribute to the Minestom documentation?**
* Feel free to do so! Just make sure to conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification when editing the README.md.
## Requirements

## General Contribution Rules
* By contributing to the Minestom project your code/contribution will be licensed under the [Apache Version 2.0](../LICENSE) license.
To get started with the contributing of change, you will need some additional software.
Most of them can be obtained in (most) package managers on different platforms.

Minestom is a community project. We encourage you to contribute! :)

Thanks! :heart: :heart: :heart:

~Minestom Community
- `git` - Version control system
- A Java 21 or later JDK:
- [Adoptium](https://adoptium.net/) has builds for most operating systems
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Report a bug
description: You found a bug? Let us know!
title: "[Bug]: "
labels: [ "type: Bug" ]
body:
- type: markdown
attributes:
value: |
Thank you for reporting a bug to Microtus!
Please fill out the information below to help us understand the issue.
- type: markdown
attributes:
value: |
Before filling in the form fields, please consider the following:
- Ensure that you are using the latest version of Microtus.
- Search for existing issues in the [issue tracker](https://github.com/OneLiteFeatherNET/Microtus/issues)
- type: textarea
attributes:
label: Describe the bug
description: |
A clear and concise description of what the bug is.
If you have a screenshot of the bug, please attach it below.
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce the bug
description: Tell us exactly how to reproduce the bug you are experiencing
placeholder: |
1. ...
2. ...
3. ...
validations:
required: true
- type: textarea
attributes:
label: Code sample
description: |
Please create a reproducible sample to show us the bug in action and attach it below between the lines with the backticks.
This helps us to verify that the bug is valid and prevents us from having to ask you for a sample later.

Without this we will unlikely be able to progress on the issue, and because of that
we regretfully will have to close it.

**Note**: Please do not upload screenshots of text. Instead, use code blocks
or the above mentioned ways to upload your code sample.
value: |
```java
[Paste your code here]
```
validations:
required: true
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
blank_issues_enabled: false
contact_links:
- name: OneLiteFeather Discord
url: https://discord.onelitefeather.net/
about: Please join our Discord server if you have any questions or concerns.
icon: https://github.com/simple-icons/simple-icons/blob/develop/icons/discord.svg
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Feature Request
description: Suggest an idea for this project
title: "[Feature]: "
labels: [ "type: feature" ]
body:
- type: markdown
attributes:
value: |
Thank you for suggesting an idea to make Microtus better!
Please fill out the information below to help us understand your idea.
- type: textarea
attributes:
label: Is your feature request related to a problem?
description: Please give some context for this request. Why do you want it added?
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like
description: Give us a clear description of what you want
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: markdown
attributes:
value: |
Before submitting your feature request, please make sure you have done the following:
- [ ] Searched for existing feature requests
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/performance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Performance Problem
description: Report a performance problem which is related to Microtus
labels: [ "type: needs triage", "type: performance" ]
body:
- type: markdown
attributes:
value: |
Before creating an issue regarding to the performance, please reach out for support on our [Discord](https://discord.onelitefeather.net/)
or in the [Discussions](https://github.com/OneLiteFeatherNET/Microtus/discussions)!

**Please be aware: Performance issues can sometimes depend on your specific implementation and not on Microtus itself. If the situation is clear and it's not a problem with the project, we will close the issue without any comment.**
- type: input
attributes:
label: Used Microtus version
description: Which version of Microtus are you using?
placeholder: 1.0.0
validations:
required: true
- type: textarea
attributes:
label: Describe the performance problem
description: If applicable, please describe your issue.
validations:
required: false
- type: textarea
attributes:
label: Other
description: |
Please include other helpful links below.
The more information we receive, the quicker and more effective we can be at finding the solution to the issue.
validations:
required: false
- type: markdown
attributes:
value: |
Before submitting your issue, please make sure you have done the following:

1. You are running the latest version of Microtus from [Release page](https://github.com/OneLiteFeatherNET/Microtus/releases)
2. You searched for and ensured there isn't already an open issue regarding this
3. Your version of Minecraft is supported by Microtus
180 changes: 91 additions & 89 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,112 +1,114 @@
![banner](banner_dark.png#gh-dark-mode-only)
![banner](banner_light.png#gh-light-mode-only)
# Microtus

# Minestom

[![license](https://img.shields.io/github/license/Minestom/Minestom?style=for-the-badge&color=b2204c)](../LICENSE)
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=for-the-badge)](https://github.com/RichardLitt/standard-readme)
[![javadocs](https://img.shields.io/badge/documentation-javadocs-4d7a97?style=for-the-badge)](https://javadoc.minestom.net)
[![license](https://img.shields.io/github/license/OneLiteFeatherNET/Microtus?style=for-the-badge&color=b2204c)](../LICENSE)
[![wiki](https://img.shields.io/badge/documentation-wiki-74aad6?style=for-the-badge)](https://wiki.minestom.net/)
[![discord-banner](https://img.shields.io/discord/706185253441634317?label=discord&style=for-the-badge&color=7289da)](https://discord.gg/pkFRvqB)

Minestom is an open-source library that enables developers to create their own Minecraft server software, without any code from Mojang.

The main difference between Mojang's vanilla server and a minestom-based server, is that ours does not contain any features by default!
However, we have a complete API which is designed to allow you to make anything possible, with ease.
[Microtus](https://en.wikipedia.org/wiki/Microtus) is a fork of the original minestom but patch based.

This is a developer API not meant to be used by end-users. Replacing Bukkit/Forge/Sponge with this **will not work** since we do not implement any of their APIs.
Our projects get names of animals but in latin.

# Table of contents
- [Install](#install)
- [Usage](#usage)
- [Why Minestom?](#why-minestom)
- [Advantages & Disadvantages](#advantages-and-disadvantages)
- [API](#api)
- [Credits](#credits)
- [Contributing](#contributing)
- [License](#license)
Discord for discussion: [OneLiteFeather.net](https://discord.onelitefeather.net)

# Install
Minestom is not installed like Bukkit/Forge/Sponge.
As Minestom is a Java library, it must be loaded the same way any other Java library may be loaded.
This means you need to add Minestom as a dependency, add your code and compile by yourself.
## Our goals
- Include patches from open pull requests on minestom repository
- Fixes issues from original minestom repository
- Make useful decisions
- Include new features
- Try to stay updated with original minecraft cycle
- Release cycle of 2 weeks

Minestom is available on [Maven Central](https://mvnrepository.com/artifact/net.minestom/minestom-snapshots),
and can be installed like the following (Gradle/Groovy):
## Project contribution:

```groovy
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
For details how you can contribute to the project please read our [Contributing](CONTRIBUTING.md).

dependencies {
implementation 'net.minestom:minestom-snapshots:<???>'
}
```
## Usage of Jitpack:

# Usage
An example of how to use the Minestom library is available [here](/demo).
Alternatively you can check the official [wiki](https://wiki.minestom.net/) or the [javadocs](https://minestom.github.io/Minestom/).
Some of the project's dependencies are only available in the Jitpack repository.
To ensure a seamless experience, kindly include this repository in your project configuration to prevent any potential issues.

# Why Minestom?
Minecraft has evolved a lot since its release, most of the servers today do not take advantage of vanilla features and even have to struggle because of them.
Our target audience is those who want to make a server that benefits little from vanilla features. e.g. creative, kitpvp.
The goal is to offer more performance for those who need it.
In other words, it makes sense to use Minestom when it takes less time to implement every missing vanilla feature you want than removing every vanilla feature that will slow you down.

# Advantages and Disadvantages
Minestom isn't perfect, our choices make it much better for some cases, worse for some others.

## Advantages
* Remove the overhead of vanilla features
* Multi-threaded
* Instance system (Collections of blocks and entities) which is much more scalable than worlds
* Open-source
* Modern API
* No more legacy NMS
```kt
maven("https://jitpack.io")
```

## Disadvantages
* Does not work with Bukkit/Forge/Sponge plugins or mods
* Does not work with older clients (using a proxy with ViaBackwards is possible)
* Bad for those who want a vanilla experience
* Longer to develop something playable
* Multi-threaded environments need extra consideration

# API
Even if we do not include anything by default in the game, we simplify the way you add them, here is a preview.
## Usage of microtus
Since 23.07.2023 we are now official on the maven central for releases and snapshots.
To use Microtus in your projects you need:
<details>
<summary>Snapshot</summary>

## Instances
It is our major concept, worlds are great for survival with friends, but when it scales up it can become unmanageable. The best examples can be found in Skyblock or minigames, not being able to separate each part properly and being forced to save everything in files, not to say the overhead caused by unnecessary data contained in them. Instances are a lightweight solution to it, being able to have every chunk in memory only, copying and sending it to another player in no time, with custom serialization and much more...
Please replace the `<version>` with the right one. You can find the versions here: [Central](https://central.sonatype.com/search?q=microtus)
For example: `1.1.0-SNAPSHOT+9284d26`

Being able to create instances directly on the go is a must-have, we believe it can push many more projects forward.
### Repositories Section
```kt
repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots")
}
```

Instances also come with performance benefits, unlike some others which will be fully single-threaded or maybe using one thread per world we are using a set number of threads (pool) to manage all chunks independently from instances, meaning using more CPU power.
### Dependency Section
```kt
dependencies {
implementation("net.onelitefeather.microtus:Minestom:1.1.3-SNAPSHOT")
testImplementation("net.onelitefeather.microtus.testing:testing:1.1.3-SNAPSHOT")
}
```
</details>

## Blocks
Minestom by default does not know what is a chest, you will have to tell him that it opens an inventory.
Every "special blocks" (which aren't only visual) need a specialized handler. After applying this handler, you have a block that can be placed anywhere simply.
However, all blocks are visually there, they just won't have interaction by default.
<details>
<summary>Release</summary>

## Entities
The terms "passive" or "aggressive" monsters do not exist, nobody stops you from making a flying chicken rushing into any players coming too close, doing so with NMS is a real mess because of obfuscation and the large inheritance.
Please replace the `<version>` with the right one. You can find the versions here: [Central](https://central.sonatype.com/search?q=microtus)
For example: `1.1.0`
### Dependency Section
```kt
dependencies {
implementation("net.onelitefeather.microtus:Minestom:1.1.3")
testImplementation("net.onelitefeather.microtus.testing:testing:1.1.3")
}
```
</details>

## Extension usage
### settings.gradle.kts
Read more about here: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry
```kt
pluginManagement {
repositories {
gradlePluginPortal()
maven("https://maven.pkg.github.com/OneLiteFeatherNET/Microtus") {
credentials {
username = "Your username"
password = "your github token"
}
}
}
}
```

## Inventories
It is a field where Minecraft evolved a lot, inventories are now used a lot as client<->server interface with clickable items and callback, we support these interactions natively without the need of programming your solution.
### build.gradle.kts
```kt
plugins {
id("net.onelitefeather.microtus.extension") version "0.0.1"
}

## Commands
Commands are the simplest way of communication between clients and server. Since 1.13 Minecraft has incorporated a new library denominated "Brigadier", we then integrated an API designed to use the full potential of args types.
dependencies {
extensionLibrary("com.fasterxml.jackson.module:jackson-module-kotlin:2.15.2") // Use the external dependencies function from minestom
}
extension {
authors = listOf("TheMeinerLP")
entrypoint = "net.onelitefeather.microtus.extension.ProjectEntry"
// dependencies = listOf("LuckPerms") // To generate dependencies
// version = "1.0.0" // Normally its use the project version
// name = "Example" // Normally its use the project name
// External dependencies are handled via `extensionLibrary("String")` from gradle
}
```

# Credits
* The [contributors](https://github.com/Minestom/Minestom/graphs/contributors) of the project
* [The Minecraft Coalition](https://wiki.vg/) and [`#mcdevs`](https://github.com/mcdevs) -
protocol and file formats research.
* [The Minecraft Wiki](https://minecraft.wiki) for all their useful info
* [JProfiler](https://www.ej-technologies.com/products/jprofiler/overview.html) for their amazing Java profiler
---

# Contributing
See [the contributing file](CONTRIBUTING.md)!
All WIP features are previewed as Draft PRs
[![YourKit-Logo](https://www.yourkit.com/images/yklogo.png)](https://www.yourkit.com/)

# License
This project is licensed under the [Apache License Version 2.0](../LICENSE).
[YourKit](https://www.yourkit.com/), makers of the outstanding java profiler, support open source projects of all kinds with their full featured [Java](https://www.yourkit.com/java/profiler) and [.NET](https://www.yourkit.com/.net/profiler) application profilers. We thank them for granting Microtus an OSS license so that we can make our software the best it can be.
Loading
Loading