Skip to content

Commit

Permalink
Change logo & default settings + replace Aergia with bedrock
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyreum committed Jul 15, 2024
1 parent f206039 commit 4fc043b
Show file tree
Hide file tree
Showing 15 changed files with 612 additions and 38 deletions.
4 changes: 4 additions & 0 deletions docs/bedrock/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Bedrock",
"position": 2
}
39 changes: 39 additions & 0 deletions docs/bedrock/e-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: EConfig
sidebar_position: 2
---

## Features

- Simple Bukkit FileConfiguration creation and maintaining.
- File versioning, to prevent data loss.
- Backup creation in case of an erroneous config file.

## How to use

### Config setup

To make use of the config wrapper, the class containing the targeted data fields has to extend the
[StorageDataContainer](https://github.com/DRE2N/Bedrock/blob/master/src/main/java/de/erethon/bedrock/config/EConfig.java) class.
The config itself requires 2 arguments in order to work:

- `File` - Defines which file should be used to create the FileConfiguration.
- `int` - The current config version. If a loaded version is outdated, all missing values will be added.

```java
public class ExampleConfig extends EConfig {

public static final int CONFIG_VERSION = 1;

public ExampleConfig() {
super(new File("path/file.yml"), CONFIG_VERSION);
}

@Override
public void load() {
// This method has to be implemented & should contain every class value.
}
}
```

Replace `path` with the actual path to the file you want to use and `file` with the name of the file.
109 changes: 109 additions & 0 deletions docs/bedrock/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: Introduction
sidebar_position: 1
---

# Bedrock

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/158b774a4d4b4a7a9368af58f96d5dd9)](https://app.codacy.com/gh/DRE2N/Bedrock?utm_source=github.com&utm_medium=referral&utm_content=DRE2N/Bedrock&utm_campaign=Badge_Grade_Settings)

Core library for Bukkit plugins of DRE2N, containing commands, configurations, user caching and more.

## Features

- A simple command system with TabCompletion, Subcommands, command requirements and permission support.

- A FileConfiguration class loader for easy config access and management.

- An advanced FileConfiguration class loader used via annotations and wrapper classes.

- An easy way to load multiple language files and its messages. Messages might contain placeholders,
which will be replaced with provided arguments (if given) on access.

- The MessageUtil class offers adventure's [MiniMessage](https://github.com/KyoriPowered/adventure) support,
message centering and other helpful message utilities.

- A JavaPlugin extension class to manage plugin configs, version control, language files, permission/economy
provider and plugin updater.

- Simple and RAM efficient User caching with basic User interface class to override, providing onJoin and
onQuit methods.

- A bunch of other utility classes and methods to simplify the development process.

## Compatibility

This library supports paper version 1.18.2 and higher. Non-paper versions do build but lack some features,
mostly related to adventure's MiniMessage.

## DRECommons

This library is an updated paper-only version of [DRECommons](https://github.com/DRE2N/DRECommons).

## Building

### Maven

```xml
<!-- Relocate Bedrock in the maven-shade-plugin configuration -->
<artifactSet>
<includes>
<include>de.erethon:bedrock</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>de.erethon.bedrock</pattern>
<shadedPattern>de.erethon.example.bedrock</shadedPattern>
</relocation>
</relocations>

<!-- Add Erethon repository -->
<repositories>
<repository>
<id>erethon-repo</id>
<url>https://erethon.de/repo/</url>
</repository>
</repositories>

<!-- Add Bedrock dependency -->
<dependencies>
<dependency>
<groupId>de.erethon</groupId>
<artifactId>bedrock</artifactId>
<version>1.2.5</version>
<scope>compile</scope>
</dependency>
</dependencies>
```

### Gradle (Kotlin)

Building with Gradle requires the [Gradle Shadow](https://github.com/johnrengelman/shadow) plugin.

```kotlin
// Add the Gradle Shadow plugin
plugins {
id("com.github.johnrengelman.shadow") version "7.1.2"
}

// Add Erethon repository
repositories {
maven {
url = uri("https://erethon.de/repo/")
}
}

// Add Bedrock dependency
dependencies {
implementation("de.erethon:bedrock:1.2.5")
}

// Relocate Bedrock inside shadowJar task
shadowJar {
dependencies {
include(dependency("de.erethon:bedrock:1.2.5"))
}
relocate("de.erethon.bedrock", "de.erethon.example.bedrock")
}
```
Loading

0 comments on commit 4fc043b

Please sign in to comment.