Skip to content

Commit 4e1c35c

Browse files
authored
Merge pull request #209 from HytaleModding/crowdin-translations
New translations from Crowdin
2 parents 96ffa1b + fd5d442 commit 4e1c35c

819 files changed

Lines changed: 108208 additions & 11153 deletions

File tree

Some content is hidden

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

content/docs/af-ZA/guides/ecs/hytale-ecs.mdx

Lines changed: 506 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: Entity Component System
3+
description: A basic introduction into ECS (Entity Component System)
4+
---
5+
6+
<Callout type="warning">
7+
This guide requires basic understanding of OOP concepts such as inheritance.
8+
9+
Please make sure you have a good understading of these concepts before reading this guide.
10+
</Callout>
11+
12+
<Callout type="info">
13+
This guide is currently only on the theory of ECS and will not have code examples.
14+
15+
Code examples are intentionally omitted to avoid confusion about how Hytale’s ECS may be implemented.
16+
</Callout>
17+
18+
# Introduction
19+
20+
An Entity Component System otherwise known as ECS is a design pattern in game development.
21+
22+
ECS is made up of Entities, which reference Components and Systems that operates on Entities.
23+
24+
It also focuses on composition over inheritance, eliminating rigid hierarchy, helps separate behavior and data and makes reusability easier.
25+
26+
# Composition Over Inheritance
27+
28+
Before getting into understanding what ECS is made of, lets understand what is the ECS philosophy.
29+
30+
We can describe composition as "has X" and inheritance as "is X".
31+
When we inherite a class in Java, we inherite all of its attribues and methods.
32+
While in composotion we can choose for each object what it refrence and what systems will work on it.
33+
34+
# Entities, Components and Systems
35+
36+
## Entities
37+
38+
An Entity is just a unique identifier.
39+
40+
- It contains no data.
41+
- It contains no logic
42+
43+
Think of entities as nouns that can be described using components
44+
45+
## Components
46+
47+
Components are just plain data containers.
48+
49+
- They store only data
50+
- They contain no behavior or logic
51+
- They describe traits or aspects of an entity
52+
53+
Examples of components:
54+
55+
- A 'Position' component that stores X, Y and Z coordinates
56+
- A 'Velocity' component that stores the speed along the each axis
57+
- A 'Health' component that stores the current health of the entity
58+
59+
Think of components as adjectives that describe an entity
60+
61+
## Systems
62+
63+
Systems contains the logic for your game (or in this case, a mod).
64+
65+
- It Operates on all entities that have a specific set of components
66+
- It Does not store entity data itself
67+
- It Applies behavior by reading and modifying component data
68+
69+
For example:
70+
71+
- A "WinConditionSystem" may process every Entity that contains the components "Position" and "Velocity"
72+
- If an entity reaches the position `(0, 0, 0)`, the system will trigger a "You Won!" message.

content/docs/af-ZA/guides/java-basics/01-variables.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ A variable has three key components:
1818
In Java, you must declare a variable before using it, like you'd need a box before putting something in it. The syntax is:
1919

2020
```java
21-
int age;
22-
age = 18;
21+
int age; // A declaration
22+
age = 18; // An assignment
2323

24-
int age = 18; // Declaration and assignment in one line
24+
int age = 18; // Declaration and assignment in one line, also considered an initialization
2525
```
2626

2727
## Primitive Data Types
@@ -44,7 +44,7 @@ Sometimes you might not want a variable to stay the same type. You can convert b
4444

4545
```java
4646
int num = 10;
47-
double decimalNum = (double) num; // 10.0 - works automatically
47+
double decimalNum = num; // 10.0 - works automatically
4848
```
4949

5050
### Manual (Casting)

content/docs/af-ZA/guides/java-basics/04-control-flow-loops.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 05 - Control Flow Loops
2+
title: 04 - Control Flow Loops
33
description: Learn how to repeat code efficiently using loops in Java
44
---
55

content/docs/af-ZA/guides/java-basics/07-introduction-oop.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ You've seen `public` - it means "anyone can access this". We'll learn more about
336336
public class Example {
337337
public String publicVar; // Anyone can access
338338
private String privateVar; // Only this class can access
339-
// (no modifier) String defaultVar; // Package access
339+
/* (no modifier) */ String defaultVar; // Package access
340340
}
341341
```
342342

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: Browsing the server.jar code
3+
description: Learn how to patch the server.jar and browse the source code.
4+
---
5+
6+
The ~~patcher~~ allows you to more easily prepare an environment for exploring the Hytale Server without publishing the decompiled code.
7+
8+
## Setup
9+
10+
- Clone the patcher `git clone https://github.com/HytaleModding/patcher.git`, and enter the directory. `cd patcher`
11+
12+
- Create a Python virtual environment in the `.venv` folder. The command for this varies by platform but it is probably
13+
one of these:
14+
15+
- `python -m venv .venv`
16+
- `python3 -m venv .venv` (Linux)
17+
- `py -3.13 -m venv .venv` (Windows)
18+
19+
In the last one, specifying the version is recommended if you have multiple Pythons installed.
20+
21+
- Activate the virtual environment:
22+
- Windows: `".venv\Scripts\activate"` (including the quotes)
23+
- Linux/Mac: `source .venv/bin/activate`
24+
- From now on, you are running python commands from inside the venv, hence you must use `python` instead of `py` or `python3` to invoke python.
25+
26+
- Inside the venv, you have to install the dependencies
27+
- `pip install -r requirements.txt`
28+
29+
- Install these dependencies and ensure they are on PATH:
30+
- `git`
31+
- `java` you need JDK 25 or newer
32+
- `jar` (comes with JDK inside the bin folder)
33+
- `mvn`
34+
35+
## Usage
36+
37+
Put your HytaleServer.jar in the same root directory of this repo or specify an environment variable `HYTALESERVER_JAR_PATH` with the path to your HytaleServer.jar
38+
39+
Then run this:
40+
41+
```shell
42+
python run.py setup
43+
```
44+
45+
It will
46+
47+
- copy the HytaleServer.jar into `work/download`
48+
- (on Windows) fix `META-INF/license` name collision
49+
- decompile it using Fernflower and save the output to `work/decompile`
50+
- set up a Maven project in `hytale-server` with the decompiled code
51+
52+
You can then open the `hytale-server` folder in your favorite IDE and begin exploring the code. For _IntelliJ IDEA_,
53+
you must first set up the SDK. After opening the project (you can open the `pom.xml` file, IDEA will prompt you to open
54+
the entire project) press Ctrl+Alt+Shift+S and under _Project_ configure SDK and Language level to _25_.
55+
56+
If IDEA does not offer an option to run the main file, right-click the `src` folder -> Mark Directory As -> Sources Root
57+
then reload the maven project:\
58+
![_readme_images/img.png](/assets/reload-maven.png)\
59+
It is located in the "m" icon on the right side:\
60+
![_readme_images/m.png](/assets/maven.png)\
61+
If you don't see it, enable it under View -> Tool Windows -> Maven.\
62+
![_readme_images/tool_windows.png](/assets/view-windowtools-maven.png)
63+
64+
This decompiled code is likely broken. But it is somewhat usable for exploration. Try Ctrl+Shift+F and search PacketAdapters
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Formatting the chat
3+
description: Learn how to format the chat using the PlayerChatEvent
4+
authors:
5+
- name: oskarscot
6+
link: https://oskar.scot
7+
---
8+
9+
![chat format example](/assets/guides/chat-example.png)
10+
11+
The chat uses the PlayerChatEvent, it contains the formatter, the PlayerRef for the sender, the content as well as a list of targets (it's safe to assume the targets is the list of players who can see the chat message)
12+
You can cancel this event as well as modify the content and the formatter.
13+
14+
```java
15+
public class ChatFormatter {
16+
17+
public static void onPlayerChat(PlayerChatEvent event) {
18+
PlayerRef sender = event.getSender();
19+
if(event.getContent().equalsIgnoreCase("poo")) {
20+
event.setCancelled(true);
21+
sender.sendMessage(Message.raw("Hey, you cannot say that!").color(Color.RED));
22+
}
23+
24+
if(event.getContent().equalsIgnoreCase("you stink")) {
25+
event.setContent("i stink");
26+
}
27+
28+
event.setFormatter((playerRed, message) ->
29+
Message.join(
30+
Message.raw("[COOL] ").color(Color.RED),
31+
Message.raw(sender.getUsername()).color(Color.YELLOW),
32+
Message.raw(" : " + message).color(Color.PINK)
33+
));
34+
35+
}
36+
}
37+
```
38+
39+
The formatter is the following interface:
40+
41+
```java
42+
public interface Formatter {
43+
@Nonnull
44+
Message format(@Nonnull PlayerRef playerRef, @Nonnull String message);
45+
}
46+
}
47+
```

0 commit comments

Comments
 (0)