-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
374 additions
and
98 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
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
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,27 @@ | ||
package net.mcbrawls.blueprint.anchor | ||
|
||
import com.mojang.serialization.Codec | ||
import com.mojang.serialization.codecs.RecordCodecBuilder | ||
import dev.andante.codex.ExtraCodecs | ||
import dev.andante.codex.nullableFieldOf | ||
import net.minecraft.util.math.Vec2f | ||
import net.minecraft.util.math.Vec3d | ||
|
||
/** | ||
* An entity-like point within a blueprint that can hold custom data. | ||
*/ | ||
data class Anchor( | ||
val position: Vec3d, | ||
val rotation: Vec2f, | ||
val data: String? = null, | ||
) { | ||
companion object { | ||
val CODEC: Codec<Anchor> = RecordCodecBuilder.create { instance -> | ||
instance.group( | ||
Vec3d.CODEC.fieldOf("position").forGetter(Anchor::position), | ||
ExtraCodecs.VEC_2F.fieldOf("rotation").forGetter(Anchor::rotation), | ||
Codec.STRING.nullableFieldOf("data").forGetter(Anchor::data), | ||
).apply(instance, ::Anchor) | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/net/mcbrawls/blueprint/block/BlueprintBlocks.kt
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
2 changes: 1 addition & 1 deletion
2
...lueprint/editor/block/PointRegionBlock.kt → ...lueprint/block/region/PointRegionBlock.kt
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
22 changes: 0 additions & 22 deletions
22
src/main/kotlin/net/mcbrawls/blueprint/editor/gui/RegionIdInputGui.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.