Skip to content

Commit

Permalink
Added extra funny protool version toe xport and book stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
enjarai committed Aug 22, 2024
1 parent f9eb320 commit b8e8a0d
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/main/java/dev/enjarai/trickster/spell/SpellPart.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dev.enjarai.trickster.spell;

import dev.enjarai.trickster.EndecTomfoolery;
import dev.enjarai.trickster.Trickster;
import dev.enjarai.trickster.spell.execution.executor.DefaultSpellExecutor;
import dev.enjarai.trickster.spell.execution.executor.SpellExecutor;
import dev.enjarai.trickster.spell.fragment.BooleanFragment;
Expand Down Expand Up @@ -220,6 +221,7 @@ public SpellPart deepClone() {

public String toBase64() {
var buf = Unpooled.buffer();
buf.writeByte(1);
ENDEC.encode(
SerializationContext.empty().withAttributes(EndecTomfoolery.UBER_COMPACT_ATTRIBUTE),
ByteBufSerializer.of(buf), this
Expand Down Expand Up @@ -253,6 +255,11 @@ public static SpellPart fromBase64(String string) {
throw new RuntimeException("Spell decoding broke. what.");
}

var protocolVersion = buf.readByte();
if (protocolVersion != 1) {
Trickster.LOGGER.warn("Attempting to import spell with unknown protocol version: " + protocolVersion);
}

var result = ENDEC.decode(
SerializationContext.empty().withAttributes(EndecTomfoolery.UBER_COMPACT_ATTRIBUTE),
ByteBufDeserializer.of(buf)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```json
{
"title": "Tutorials",
"icon": "minecraft:filled_map",
"ordinal": 2
}
```

Start learning circle-based magic here.
This category contains a set of linear tutorials to take you through the most important concepts.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,18 @@
}
```

Welcome to the Tome of Tomfoolery! Your guide to magic, trickery, and geometric algebra.
Welcome to the **Tome of Tomfoolery**! Your guide to magic, trickery, and geometric algebra.


This book consists of many chapters spread out over a few categories.
Aside from the tutorials section, these chapters are intended to be read in no particular order and only when required.

;;;;;

If you run into particular trouble using the mod, have trouble understanding something,
or encounter any bugs or other issues, please let us know via **[Discord](https://discord.gg/WcYsDDQtyR)**.


More importantly though, have fun!

![](trickster:textures/gui/img/catstare.png)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
}
```

<|spell-preview@trickster:templates|spell=C5P35ndgmM/GFAZkMLg4cDGDGIwMDgyMIAZHCAMDg9azL5ogToCHQydYdIMPA0RakYGJEcwI4HHoxKcQaGAnE4TBwAEWYWBUQLICjxkLGhwaoVqZIArBDAYAAeIQnboAAAA=|>
<|spell-preview@trickster:templates|spell=YwyT9+Z3YJjPxgRiMLg4cDGDGIwMDgyMIAZHCAMDg9azL5ogToCHQydYdIMPA0RakYGJEcwI4HHoxKcQaGAnE4TBwAEWYWBUQLICjxkLGhwaoVqZIArBDAYAAInoArsAAAA=|>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```json
{
"title": "1. Getting Started",
"icon": "minecraft:paper",
"ordinal": 0,
"category": "trickster:tutorials"
}
```


Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```json
{
"title": "2. Your First Spell",
"icon": "minecraft:paper",
"ordinal": 1,
"category": "trickster:tutorials"
}
```


Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```json
{
"title": "3. Easier Casting",
"icon": "minecraft:paper",
"ordinal": 2,
"category": "trickster:tutorials"
}
```


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b8e8a0d

Please sign in to comment.