Skip to content

Commit ca88c35

Browse files
committed
Initial commit
0 parents  commit ca88c35

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+26437
-0
lines changed

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/.idea
2+
3+
# Dependencies
4+
/node_modules
5+
6+
# Production
7+
/build
8+
9+
# Generated files
10+
.docusaurus
11+
.cache-loader
12+
13+
# Misc
14+
.DS_Store
15+
.env.local
16+
.env.development.local
17+
.env.test.local
18+
.env.production.local
19+
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Saicone Docs
2+
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

docs/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
slug: /about
3+
title: Information
4+
description: Information about Saicone Docs
5+
---
6+
7+
Welcome to the official documentation for [Saicone](https://github.com/saicone)
8+
projects.

docs/ezlib/README.md

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
sidebar_position: 1
3+
title: Ezlib
4+
description: Runtime library/dependency loader & relocator for Java in a single class
5+
---
6+
7+
Welcome to Ezlib wiki, here you will find information about the use of this lightweight library.
8+
9+
## Introduction
10+
11+
Ezib is a library created to provide an easy way to load dependencies of Java projects at runtime, including support for package relocation.
12+
13+
## Requirements
14+
15+
* Minimum **Java 8**
16+
17+
## Dependency
18+
19+
![version](https://img.shields.io/github/v/tag/saicone/ezlib?label=current%20version&style=for-the-badge)
20+
21+
Ezlib it's completely shadeable in your project.
22+
23+
So you can copy the [Ezlib class](https://github.com/saicone/ezlib/blob/master/src/main/java/com/saicone/ezlib/Ezlib.java) or add it as implementación.
24+
25+
```mdx-code-block
26+
import Tabs from '@theme/Tabs';
27+
import TabItem from '@theme/TabItem';
28+
29+
<Tabs>
30+
<TabItem value="groovy" label="build.gradle" default>
31+
32+
```groovy
33+
repositories {
34+
maven { url 'https://jitpack.io' }
35+
}
36+
37+
dependencies {
38+
implementation 'com.saicone.ezlib:ezlib:VERSION'
39+
}
40+
```
41+
42+
</TabItem>
43+
<TabItem value="kotlin" label="build.gradle.kts">
44+
45+
```kotlin
46+
repositories {
47+
maven("https://jitpack.io")
48+
}
49+
50+
dependencies {
51+
implementation("com.saicone.ezlib:ezlib:VERSION")
52+
}
53+
```
54+
55+
</TabItem>
56+
<TabItem value="maven" label="pom.xml">
57+
58+
```xml
59+
<repositories>
60+
<repository>
61+
<id>Jitpack</id>
62+
<url>https://jitpack.io</url>
63+
</repository>
64+
</repositories>
65+
66+
<dependencies>
67+
<dependency>
68+
<groupId>com.saicone.ezlib</groupId>
69+
<artifactId>ezlib</artifactId>
70+
<version>VERSION</version>
71+
<scope>compile</scope>
72+
</dependency>
73+
</dependencies>
74+
```
75+
76+
</TabItem>
77+
</Tabs>

docs/ezlib/usage.md

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
sidebar_position: 2
3+
title: Usage
4+
description: How to use Ezlib
5+
---
6+
7+
:::info
8+
9+
Ezlib uses a gradle-like dependency format to load them.
10+
11+
:::
12+
13+
## Basic
14+
15+
Ezlib provides an easy method to load all needed dependencies at runtime into class loaders.
16+
17+
Here is an example to load dependencies into a child class loader.
18+
19+
```java
20+
// Create ezlib with default "libs" folder
21+
Ezlib ezlib = new Ezlib();
22+
// Or specify a folder
23+
Ezlib ezlib = new Ezlib(new File("folder/path"));
24+
25+
// Load from maven repository (default)
26+
ezlib.load("commons-io:commons-io:2.11.0");
27+
28+
// Load from specified repository
29+
ezlib.load("com.saicone.rtag:rtag:1.1.0", "https://jitpack.io/");
30+
31+
// You can change default repository
32+
ezlib.setDefaultRepository("repo URL");
33+
```
34+
35+
## Parent ClassLoader
36+
37+
Ezlib allows you to append dependencies into the parent class loader by just setting "true" at the end of the load method.
38+
39+
```java
40+
Ezlib ezlib = new Ezlib();
41+
42+
// Load from maven repository (default)
43+
ezlib.load("commons-io:commons-io:2.11.0", true);
44+
45+
// Load from specified repository
46+
ezlib.load("com.saicone.rtag:rtag:1.1.0", "https://jitpack.io/", true);
47+
```
48+
49+
## Relocation
50+
51+
Ezlib uses [jar-relocator](https://github.com/lucko/jar-relocator), so you can load dependencies with package relocation.
52+
53+
Here an example with Redis library and all the needed dependencies.
54+
55+
```java
56+
Map<String, String> relocations = new HashMap();
57+
relocations.put("com.google.gson", "myproject.path.libs.gson");
58+
relocations.put("org.apache.commons.pool2", "myproject.path.libs.pool2");
59+
relocations.put("org.json", "myproject.path.libs.json");
60+
relocations.put("org.slf4j", "myproject.path.libs.slf4j");
61+
relocations.put("redis.clients.jedis", "myproject.path.libs.jedis");
62+
63+
Ezlib ezlib = new Ezlib();
64+
65+
// Load all the needed dependencies first
66+
ezlib.load("com.google.gson:gson:2.8.9", relocations, true);
67+
ezlib.load("org.apache.commons:commons-pool2:2.11.1", relocations, true);
68+
ezlib.load("org.json:json:20211205", relocations, true);
69+
ezlib.load("org.slf4j:slf4j-api:1.7.32", relocations, true);
70+
71+
// Then load redis dependency
72+
ezlib.load("redis.clients:jedis:4.2.2", relocations, true);
73+
```
74+
75+
:::warning
76+
77+
Make sure to relocate the imports during compile time, while excluding the class that you use to load the dependencies because the strings will be relocated too.
78+
79+
:::

docs/rtag/README.md

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
sidebar_position: 1
3+
title: Rtag
4+
description: The "readable tag" library, an easy way to handle NBTTagCompounds.
5+
---
6+
7+
Welcome to Rtag wiki, here you find information about Rtag usage, including the usages with Minecraft server customization.
8+
9+
## Introduction
10+
11+
Rtag is a library whose idea was planned around 2020, but the development starts in 2022 due to commercial limitations about attachment to old systems by most developers.
12+
13+
This library was created to solve the need to develop a Minecraft server with a wide variety of custom things avoiding a bad performance impact on big servers, using a "easy to understand" way to handle NBT.
14+
15+
You don't need to be an expert with NBT tags, just with simple methods you can set and get normal Java objects.
16+
17+
## Requirements
18+
19+
* At least **Minecraft 1.8.8:** Rtag is made to be used in latest Minecraft versions, old versions support is only for commercial purposes.
20+
* Minimum **Java 11**
21+
22+
## Dependency
23+
24+
![version](https://img.shields.io/github/v/tag/saicone/rtag?label=current%20version&style=for-the-badge)
25+
26+
To use Rtag in your project you need to add first as a dependency, so it's completely shadeable, you can implement rtag directly in your plugin, or simply use a dependency and tell your users to download Rtag from their [Spigot page](https://www.spigotmc.org/resources/rtag.100694/).
27+
28+
```mdx-code-block
29+
import Tabs from '@theme/Tabs';
30+
import TabItem from '@theme/TabItem';
31+
32+
<Tabs>
33+
<TabItem value="groovy" label="build.gradle" default>
34+
35+
```groovy
36+
repositories {
37+
maven { url 'https://jitpack.io' }
38+
}
39+
dependencies {
40+
compileOnly 'com.saicone.rtag:rtag:VERSION'
41+
// Other modules
42+
compileOnly 'com.saicone.rtag:rtag-block:VERSION'
43+
compileOnly 'com.saicone.rtag:rtag-entity:VERSION'
44+
compileOnly 'com.saicone.rtag:rtag-item:VERSION'
45+
}
46+
```
47+
48+
</TabItem>
49+
<TabItem value="kotlin" label="build.gradle.kts">
50+
51+
```kotlin
52+
repositories {
53+
maven("https://jitpack.io")
54+
}
55+
dependencies {
56+
compileOnly("com.saicone.rtag:rtag:VERSION")
57+
// Other modules
58+
compileOnly("com.saicone.rtag:rtag-block:VERSION")
59+
compileOnly("com.saicone.rtag:rtag-entity:VERSION")
60+
compileOnly("com.saicone.rtag:rtag-item:VERSION")
61+
}
62+
```
63+
64+
</TabItem>
65+
<TabItem value="maven" label="pom.xml">
66+
67+
```xml
68+
<repositories>
69+
<repository>
70+
<id>Jitpack</id>
71+
<url>https://jitpack.io</url>
72+
</repository>
73+
</repositories>
74+
75+
<dependencies>
76+
<dependency>
77+
<groupId>com.saicone.rtag</groupId>
78+
<artifactId>rtag</artifactId>
79+
<version>VERSION</version>
80+
<scope>provided</scope>
81+
</dependency>
82+
<!-- Other modules -->
83+
<dependency>
84+
<groupId>com.saicone.rtag</groupId>
85+
<artifactId>rtag-block</artifactId>
86+
<version>VERSION</version>
87+
<scope>provided</scope>
88+
</dependency>
89+
<dependency>
90+
<groupId>com.saicone.rtag</groupId>
91+
<artifactId>rtag-entity</artifactId>
92+
<version>VERSION</version>
93+
<scope>provided</scope>
94+
</dependency>
95+
<dependency>
96+
<groupId>com.saicone.rtag</groupId>
97+
<artifactId>rtag-item</artifactId>
98+
<version>VERSION</version>
99+
<scope>provided</scope>
100+
</dependency>
101+
</dependencies>
102+
```
103+
104+
</TabItem>
105+
</Tabs>

docs/rtag/basics.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
sidebar_position: 2
3+
title: Basics
4+
description: Basic information about NBT tags
5+
---
6+
7+
:::info
8+
9+
If you already know themes like NBT and NMS, be free to skip this page of the wiki because it only shows very basic information about these themes.
10+
11+
:::
12+
13+
To start using Rtag one needs to know a bit the function of Minecraft servers, and in this way have a clear idea of how to edit some things.
14+
15+
## NMS
16+
17+
The "NMS" means "net.minecraft.server", it's a package on old Bukkit versions which contains all classes from the original Minecraft server distributed by Mojang, Bukkit uses it to work properly.
18+
19+
Most recent versions of Bukkit have different paths for Minecraft server classes, for example "net.minecraft.world.level.World".
20+
21+
The NMS is usually known by using it with [reflection](https://www.oracle.com/technical-resources/articles/java/javareflection.html) because Mojang constantly changes the methods names and uses [obfuscators](https://www.javatpoint.com/java-obfuscator) in his code.
22+
23+
## NBT
24+
25+
The Named Binary Tag (NBT) format is a tree data structure used by Minecraft to save data in different formats starting with bytes, an NBT is just a simple Java object (String, Integer, List.. etc) defined with a key.
26+
27+
The NBT format is commonly used to save Minecraft objects like Worlds, Items, Entities... etc.
28+
29+
The NBT classes are inside the NMS and reference the common Java objects: NBTTagString, NBTTagInt, NBTTagLong, NBTTagList... etc. The main NBT class would be **NBTTagCompound** which refers to a Java Map and is the basic object for storing the NBTs associated with their respective key (as a map made up of keys and values where values are other NBTs).
30+
31+
:::tip
32+
33+
Isn't necessary to know the NBT completely because Rtag converts every NBT into a normal object (String, Integer, List... etc) and vice versa, the only important thing would be the use of "paths" to get NBT objects inside NBT compounds.
34+
35+
:::

0 commit comments

Comments
 (0)