-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:enjarai/trickster
- Loading branch information
Showing
8 changed files
with
85 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/client/java/dev/enjarai/trickster/screen/owo/ItemTagComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package dev.enjarai.trickster.screen.owo; | ||
|
||
import io.wispforest.owo.ui.component.Components; | ||
import io.wispforest.owo.ui.container.FlowLayout; | ||
import io.wispforest.owo.ui.core.HorizontalAlignment; | ||
import io.wispforest.owo.ui.core.Sizing; | ||
import io.wispforest.owo.ui.core.VerticalAlignment; | ||
import io.wispforest.owo.ui.parsing.UIParsing; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.RegistryKeys; | ||
import net.minecraft.registry.tag.TagKey; | ||
import org.w3c.dom.Element; | ||
|
||
public class ItemTagComponent extends FlowLayout { | ||
protected TagKey<Item> tagKey; | ||
|
||
public ItemTagComponent(TagKey<Item> tagKey) { | ||
super(Sizing.fill(100), Sizing.content(), Algorithm.LTR_TEXT); | ||
this.tagKey = tagKey; | ||
|
||
alignment(HorizontalAlignment.CENTER, VerticalAlignment.CENTER); | ||
|
||
Registries.ITEM.getOrCreateEntryList(tagKey).forEach(entry -> { | ||
var stack = entry.value().getDefaultStack(); | ||
child(Components.item(stack) | ||
.showOverlay(true) | ||
.setTooltipFromStack(true)); | ||
}); | ||
} | ||
|
||
public static ItemTagComponent parse(Element element) { | ||
UIParsing.expectAttributes(element, "tag-id"); | ||
|
||
var tagId = UIParsing.parseIdentifier(element.getAttributeNode("tag-id")); | ||
var tagKey = TagKey.of(RegistryKeys.ITEM, tagId); | ||
|
||
return new ItemTagComponent(tagKey); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 22 additions & 10 deletions
32
...esources/assets/trickster/lavender/entries/tome_of_tomfoolery/basics/top_hat.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,41 @@ | ||
```json | ||
{ | ||
"title": "Top Hat", | ||
"title": "Hats", | ||
"icon": "trickster:top_hat", | ||
"category": "trickster:basics" | ||
} | ||
``` | ||
|
||
The Top Hat is quite an ingenious piece of a caster's toolkit. | ||
By equipping it on their head, a caster can press the <keybind;key.trickster.take_hat> | ||
button to hold the hat in their offhand. | ||
The caster's hat is quite an ingenious piece of kit. | ||
After equipping it on their head, a caster can press the <keybind;key.trickster.take_hat> | ||
button to take the hat into their offhand quickly. | ||
|
||
|
||
When a Top Hat is held in your offhand, you can right-click to open the ui, and insert up to 27 scrolls. | ||
When a hat is held in your offhand, you can right-click to open the ui, and insert up to 27 scrolls. | ||
These scrolls can then be selected by shift-scrolling while holding the hat. | ||
|
||
;;;;; | ||
|
||
These scrolls can be selected by scrolling while holding the Top Hat, which will cycle through them. | ||
Now, when a spell cast from your main hand tries to access the spell in your other hand via [Notulist's Delusion](^trickster:ploys/basic#3), | ||
it will read the spell from the selected scroll in the held hat instead. | ||
|
||
|
||
When a spell cast from your main hand tries to access the spell in your other hand via [Notulist's Delusion](^trickster:ploys/basic#3), | ||
it will instead read the spell from the selected scroll in the held hat. | ||
You can also access the spell in any slot of your hat directly using [Cranium Stratagem](^trickster:delusions_ingresses/imports#3), | ||
or read the selected slot using [Cranium Delusion](^trickster:delusions_ingresses/inventory#7). | ||
|
||
;;;;; | ||
|
||
You can also access the spell in any slot of your Top Hat directly using [Cranium Stratagem](^trickster:delusions_ingresses/imports#3), | ||
or read the selected slot using [Cranium Delusion](^trickster:delusions_ingresses/inventory#7). | ||
A few different types of hat are available depending on your likes and preferences! | ||
They all function the exact same though. | ||
|
||
|
||
The classic Top Hat: | ||
<recipe;trickster:top_hat> | ||
|
||
;;;;; | ||
|
||
A mysterious Witch Hat: | ||
<recipe;trickster:witch_hat> | ||
|
||
And even the humble (but very cool) Fez: | ||
<recipe;trickster:fez> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters