8000 Merge branch 'object-Object:main' into main · object-Object/HexDebug@e7afcd9 · GitHub
[go: up one dir, main page]

Skip to content

Commit e7afcd9

Browse files
authored
Merge branch 'object-Object:main' into main
2 parents 2f531c1 + ef0d871 commit e7afcd9

File tree

25 files changed

+365
-61
lines changed

25 files changed

+365
-61
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
build-docs:
2828
needs: setup
29-
uses: hexdoc-dev/actions/.github/workflows/hexdoc.yml@v0
29+
uses: hexdoc-dev/actions/.github/workflows/hexdoc.yml@v1
3030
permissions:
3131
contents: write
3232
pages: read

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ permissions:
2222

2323
jobs:
2424
build-docs:
25-
uses: hexdoc-dev/actions/.github/workflows/hexdoc.yml@v0
25+
uses: hexdoc-dev/actions/.github/workflows/hexdoc.yml@v1
2626
permissions:
2727
contents: write
2828
pages: read

CHANGELOG.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,47 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and [Pydantic's HISTORY.md](https://github.com/pydantic/pydantic/blob/main/HISTORY.md), and this project *mostly* adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [UNRELEASED]
7+
## `0.3.0+1.20.1` - [UNRELEASED]
8+
9+
### Added
10+
11+
- New block: Splicing Table!
12+
- Essentially a graphical text editor for hexes. Allows inserting, moving, and deleting iotas from lists; copying/pasting iotas to/from a secondary focus; drawing patterns with a staff at a specific position in a list; and copying hexes to your clipboard in `.hexpattern` format.
13+
- Amazing textures created by SamsTheNerd.
14+
- New patterns:
15+
- Debug Locator's Reflection: Pushes the index of the next iota to be evaluated.
16+
- Cognitohazard Reflection: Pushes a cognitohazard iota to the stack, which halts debugging immediately if detected in a hex to be evaluated by a debugger.
17+
- Added ru_ru translations, by JustS-js in [#25](https://github.com/object-Object/HexDebug/pull/25).
18+
19+
### Changed
20+
21+
- Updated to Hex Casting 0.11.2.
22+
- Updated zh_cn translations, by ChuijkYahus in [#13](https://github.com/object-Object/HexDebug/pull/13), [#17](https://github.com/object-Object/HexDebug/pull/17), and [#31](https://github.com/object-Object/HexDebug/pull/31).
23+
- Added a link to [Setting up VSCode with HexDebug](https://github.com/object-Object/HexDebug/wiki/Setting-up-VSCode-with-HexDebug) to the debugger book entry.
24+
- Documented the ability to change debugger step modes ingame.
25+
- Many internal refactors.
826

927
### Fixed
1028

11-
- Stepping the debug session would overwrite the displayed stack/ravenmind of an open non-Evaluator staff grid ([#6](https://github.com/object-Object/HexDebug/issues/6)).
29+
- Fixed a bug where stepping the debug session would overwrite the displayed stack/ravenmind of an open non-Evaluator staff grid ([#6](https://github.com/object-Object/HexDebug/issues/6)).
1230
- This was only a visual bug - no actual data was modified, and it would reset if you reopened the staff.
31+
- Server config is now synced to clients on join.
32+
- Fixed some potential networking-related race conditions.
33+
- Fixed an internal exception when FrameEvaluate contains an empty list.
34+
- Fixed a bug where Introspection, Retrospection, Consideration, and Evanition would be displayed incorrectly if drawn in non-default orientations.
35+
36+
### Notes
37+
38+
- This update also contains a new undocumented block (Focus Holder) and some undocumented patterns. Please don't use these for anything important, as they'll probably be moved to a separate mod at some point.
39+
- I likely will not be backporting this update to 1.19.2, due to the many GUI-related changes between that version and this one.
1340

14-
## 0.2.2+1.20.1
41+
## `0.2.2+1.20.1` - 2024-05-28
1542

1643
### Changed
1744

18-
- Update zh_cn translations, by ChuijkYahus in [#5](https://github.com/object-Object/HexDebug/pull/5).
45+
- Updated zh_cn translations, by ChuijkYahus in [#5](https://github.com/object-Object/HexDebug/pull/5).
1946

20-
## 0.2.1+1.20.1
47+
## `0.2.1+1.20.1` - 2024-05-27
2148

2249
### Changed
2350

@@ -31,7 +58,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
3158
- When debugging, spells requiring media would fail if a Debugger was not in the hand that the debug session was started with.
3259
- Evaluator mishaps were unintentionally caught by the Uncaught Mishaps option, and did not apply side effects to the stack.
3360

34-
## 0.2.0+1.20.1
61+
## `0.2.0+1.20.1` - 2024-05-21
3562

3663
### Added
3764

@@ -47,12 +74,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
4774

4875
- Moved some relatively unimportant log messages from INFO to DEBUG.
4976

50-
## 0.1.1+1.20.1
77+
## `0.1.1+1.20.1` - 2024-05-18
5178

5279
### Fixed
5380

5481
- Fixed a server-only crash on launch caused by an incorrect Mod Menu dependency.
5582

56-
## 0.1.0+1.20.1
83+
## `0.1.0+1.20.1` - 2024-05-17
5784

5885
- Initial version.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parent": "minecraft:recipes/root",
3+
"criteria": {
4+
"has_item": {
5+
"conditions": {
6+
"items": [
7+
{
8+
"items": [
9+
"hexcasting:focus"
10+
]
11+
}
12+
]
13+
},
14+
"trigger": "minecraft:inventory_changed"
15+
},
16+
"has_the_recipe": {
17+
"conditions": {
18+
"recipe": "hexdebug:splicing_table"
19+
},
20+
"trigger": "minecraft:recipe_unlocked"
21+
}
22+
},
23+
"requirements": [
24+
[
25+
"has_item",
26+
"has_the_recipe"
27+
]
28+
],
29+
"rewards": {
30+
"recipes": [
31+
"hexdebug:splicing_table"
32+
]
33+
},
34+
"sends_telemetry_event": false
35+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"type": "minecraft:crafting_shaped",
3+
"category": "misc",
4+
"key": {
5+
"A": {
6+
"item": "minecraft:amethyst_shard"
7+
},
8+
"C": {
9+
"item": "hexcasting:charged_amethyst"
10+
},
11+
"F": {
12+
"item": "hexcasting:focus"
13+
},
14+
"G": {
15+
"item": "minecraft:gold_ingot"
16+
},
17+
"P": {
18+
"item": "hexcasting:edified_planks"
19+
},
20+
"S": {
21+
"item": "hexcasting:slate_block"
22+
}
23+
},
24+
"pattern": [
25+
"PCP",
26+
"AFA",
27+
"SGS"
28+
],
29+
"result": {
30+
"item": "hexdebug:splicing_table"
31+
},
32+
"show_notification": true
33+
}

Common/src/main/kotlin/gay/object/hexdebug/HexDebug.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ object HexDebug {
2525
HexDebugMenus,
2626
HexDebugActions,
2727
HexDebugContinuationTypes,
28+
HexDebugIotaTypes,
2829
)
2930
HexDebugNetworking.init()
3031
DebugAdapterManager.init()

Common/src/main/kotlin/gay/object/hexdebug/blocks/base/ContainerDataDelegate.kt

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,28 @@ package gay.`object`.hexdebug.blocks.base
33
import net.minecraft.world.inventory.ContainerData
44
import kotlin.reflect.KProperty
55

6-
data class ContainerDataDelegate(val data: ContainerData, val index: Int) {
7-
operator fun getValue(thisRef: Any, property: KProperty<*>) = data.get(index)
8-
9-
operator fun setValue(thisRef: Any, property: KProperty<*>, value: Int) {
10-
data.set(index, value)
11-
}
12-
}
13-
14-
data class ContainerDataLongDelegate(val data: ContainerData, val lowIndex: Int, val highIndex: Int) {
6+
// DataSlot stores ints but serializes them as shorts??????????????????????????????????????????????
7+
// TODO: idk if this works for negative values but i don't need it to be negative so idc
8+
data class ContainerDataLongDelegate(
9+
val data: ContainerData,
10+
val index0: Int,
11+
val index1: Int,
12+
val index2: Int,
13+
val index3: Int,
14+
) {
1515
operator fun getValue(thisRef: Any, property: KProperty<*>): Long {
16-
val low = data.get(lowIndex).toLong()
17-
val high = data.get(highIndex).toLong() shl 32
18-
return low + high
16+
return (
17+
data.get(index0).toUShort().toLong()
18+
+ (data.get(index1).toUShort().toLong() shl 16)
19+
+ (data.get(index2).toUShort().toLong() shl 32)
20+
+ (data.get(index3).toUShort().toLong() shl 48)
21+
)
1922
}
2023

2124
operator fun setValue(thisRef: Any, property: KProperty<*>, value: Long) {
22-
data.set(lowIndex, value.toInt())
23-
data.set(highIndex, (value shr 32).toInt())
25+
data.set(index0, value.toInt())
26+
data.set(index1, (value shr 16).toInt())
27+
data.set(index2, (value shr 32).toInt())
28+
data.set(index3, (value shr 48).toInt())
2429
}
2530
}

Common/src/main/kotlin/gay/object/hexdebug/blocks/splicing/SplicingTableBlockEntity.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ class SplicingTableBlockEntity(pos: BlockPos, state: BlockState) : BlockEntity(
4444

4545
private var media by ContainerDataLongDelegate(
4646
containerData,
47-
lowIndex = SplicingTableDataSlot.MEDIA_LOW.index,
48-
highIndex = SplicingTableDataSlot.MEDIA_HIGH.index,
47+
index0 = SplicingTableDataSlot.MEDIA_0.index,
48+
index1 = SplicingTableDataSlot.MEDIA_1.index,
49+
index2 = SplicingTableDataSlot.MEDIA_2.index,
50+
index3 = SplicingTableDataSlot.MEDIA_3.index,
4951
)
5052

5153
val analogOutputSignal get() = if (!listStack.isEmpty) 15 else 0

Common/src/main/kotlin/gay/object/hexdebug/blocks/splicing/SplicingTableDataSlot.kt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
package gay.`object`.hexdebug.blocks.splicing
22

3-
import gay.`object`.hexdebug.blocks.base.ContainerDataDelegate
4-
import net.minecraft.world.inventory.ContainerData
5-
63
enum class SplicingTableDataSlot {
74
// media is a long but ContainerData stores ints :/
8-
MEDIA_LOW,
9-
MEDIA_HIGH;
5+
// and also DataSlot serializes ints as shorts for some reason
6+
MEDIA_0,
7+
MEDIA_1,
8+
MEDIA_2,
9+
MEDIA_3;
1010

1111
val index = ordinal
1212

13-
fun delegate(data: ContainerData) = ContainerDataDelegate(data, index)
14-
1513
companion object {
1614
val size = entries.size
1715
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package gay.`object`.hexdebug.casting.iotas
2+
3+
import at.petrak.hexcasting.api.casting.eval.CastResult
4+
import at.petrak.hexcasting.api.casting.eval.ResolvedPatternType
5+
import at.petrak.hexcasting.api.casting.eval.vm.CastingVM
6+
import at.petrak.hexcasting.api.casting.eval.vm.SpellContinuation
7+
import at.petrak.hexcasting.api.casting.iota.Iota
8+
import at.petrak.hexcasting.api.casting.iota.IotaType
9+
import at.petrak.hexcasting.api.utils.asTranslatedComponent
10+
import at.petrak.hexcasting.api.utils.black
11+
import at.petrak.hexcasting.common.lib.hex.HexEvalSounds
12+
import net.minecraft.nbt.CompoundTag
13+
import net.minecraft.nbt.Tag
14+
import net.minecraft.server.level.ServerLevel
15+
16+
/** An iota that terminates a debugging session if attempted to be executed. */
17+
class CognitohazardIota : Iota(TYPE, COGNITOHAZARD_SUBSTITUTE) {
18+
override fun isTruthy() = true
19+
20+
override fun toleratesOther(that: Iota) = typesMatch(this, that)
21+
22+
override fun serialize() = CompoundTag()
23+
24+
override fun execute(vm: CastingVM, world: ServerLevel, continuation: SpellContinuation): CastResult {
25+
// we shouldn't need any special handling in here, since the cognitohazard should be detected by the debugger before we get to this point
26+
return CastResult(
27+
this,
28+
continuation,
29+
null,
30+
listOf(),
31+
ResolvedPatternType.EVALUATED,
32+
HexEvalSounds.NOTHING,
33+
)
34+
}
35+
36+
override fun executable() = true
37+
38+
companion object {
39+
private val COGNITOHAZARD_SUBSTITUTE = Object()
40+
41+
val DISPLAY = "hexdebug.tooltip.cognitohazard_iota".asTranslatedComponent.black
42+
43+
val TYPE = object : IotaType<CognitohazardIota>() {
44+
override fun deserialize(tag: Tag, world: ServerLevel) = CognitohazardIota()
45+
46+
override fun display(tag: Tag) = DISPLAY
47+
48+
override fun color() = 0xff_000000.toInt()
49+
}
50+
}
51+
}

0 commit comments

Comments
 (0)
0