This commit is contained in:
yrsegal@gmail.com 2022-04-10 22:50:26 -04:00
parent fdfcd43b62
commit b6e90994c9
8 changed files with 59 additions and 25 deletions

View file

@ -5,7 +5,7 @@ import at.petrak.hexcasting.api.circle.BlockAbstractImpetus;
import at.petrak.hexcasting.api.circle.BlockEntityAbstractImpetus; import at.petrak.hexcasting.api.circle.BlockEntityAbstractImpetus;
import at.petrak.hexcasting.api.client.ScryingLensOverlayRegistry; import at.petrak.hexcasting.api.client.ScryingLensOverlayRegistry;
import at.petrak.hexcasting.api.spell.SpellDatum; import at.petrak.hexcasting.api.spell.SpellDatum;
import at.petrak.hexcasting.client.be.BlockEntityAkashicRecordRenderer; import at.petrak.hexcasting.client.be.BlockEntityAkashicBookshelfRenderer;
import at.petrak.hexcasting.client.be.BlockEntitySlateRenderer; import at.petrak.hexcasting.client.be.BlockEntitySlateRenderer;
import at.petrak.hexcasting.client.entity.WallScrollRenderer; import at.petrak.hexcasting.client.entity.WallScrollRenderer;
import at.petrak.hexcasting.client.particles.ConjureParticle; import at.petrak.hexcasting.client.particles.ConjureParticle;
@ -216,6 +216,6 @@ public class RegisterClientStuff {
public static void registerRenderers(EntityRenderersEvent.RegisterRenderers evt) { public static void registerRenderers(EntityRenderersEvent.RegisterRenderers evt) {
evt.registerBlockEntityRenderer(HexBlockEntities.SLATE_TILE.get(), BlockEntitySlateRenderer::new); evt.registerBlockEntityRenderer(HexBlockEntities.SLATE_TILE.get(), BlockEntitySlateRenderer::new);
evt.registerBlockEntityRenderer(HexBlockEntities.AKASHIC_BOOKSHELF_TILE.get(), evt.registerBlockEntityRenderer(HexBlockEntities.AKASHIC_BOOKSHELF_TILE.get(),
BlockEntityAkashicRecordRenderer::new); BlockEntityAkashicBookshelfRenderer::new);
} }
} }

View file

@ -18,9 +18,9 @@ import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public class BlockEntityAkashicRecordRenderer implements BlockEntityRenderer<BlockEntityAkashicBookshelf> { public class BlockEntityAkashicBookshelfRenderer implements BlockEntityRenderer<BlockEntityAkashicBookshelf> {
public BlockEntityAkashicRecordRenderer(BlockEntityRendererProvider.Context ctx) { public BlockEntityAkashicBookshelfRenderer(BlockEntityRendererProvider.Context ctx) {
// NO-OP // NO-OP
} }

View file

@ -54,7 +54,7 @@ public class RegisterPatterns {
OpEntityPos.INSTANCE); OpEntityPos.INSTANCE);
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("wa", HexDir.EAST), prefix("get_entity_look"), PatternRegistry.mapPattern(HexPattern.FromAnglesSig("wa", HexDir.EAST), prefix("get_entity_look"),
OpEntityLook.INSTANCE); OpEntityLook.INSTANCE);
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("awq", HexDir.NORTH_EAST), prefix("get_entity_look"), PatternRegistry.mapPattern(HexPattern.FromAnglesSig("awq", HexDir.NORTH_EAST), prefix("get_entity_height"),
OpEntityHeight.INSTANCE); OpEntityHeight.INSTANCE);
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("wq", HexDir.EAST), prefix("get_entity_velocity"), PatternRegistry.mapPattern(HexPattern.FromAnglesSig("wq", HexDir.EAST), prefix("get_entity_velocity"),
OpEntityVelocity.INSTANCE); OpEntityVelocity.INSTANCE);
@ -152,6 +152,9 @@ public class RegisterPatterns {
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("eadeeeeew", HexDir.NORTH_EAST), prefix("arctan"), PatternRegistry.mapPattern(HexPattern.FromAnglesSig("eadeeeeew", HexDir.NORTH_EAST), prefix("arctan"),
OpArcTan.INSTANCE); OpArcTan.INSTANCE);
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("eqqq", HexDir.NORTH_WEST), prefix("random"),
OpRandom.INSTANCE);
// == Spells == // == Spells ==
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("de", HexDir.NORTH_EAST), prefix("print"), PatternRegistry.mapPattern(HexPattern.FromAnglesSig("de", HexDir.NORTH_EAST), prefix("print"),

View file

@ -0,0 +1,21 @@
package at.petrak.hexcasting.common.casting.operators.math
import at.petrak.hexcasting.api.spell.ConstManaOperator
import at.petrak.hexcasting.api.spell.Operator.Companion.getChecked
import at.petrak.hexcasting.api.spell.Operator.Companion.spellListOf
import at.petrak.hexcasting.api.spell.SpellDatum
import at.petrak.hexcasting.common.casting.CastingContext
import at.petrak.hexcasting.common.casting.mishaps.MishapInvalidIota
import net.minecraft.network.chat.TranslatableComponent
import kotlin.math.acos
import kotlin.math.atan
import kotlin.math.floor
object OpRandom : ConstManaOperator {
override val argc: Int
get() = 0
override fun execute(args: List<SpellDatum<*>>, ctx: CastingContext): List<SpellDatum<*>> {
return spellListOf(ctx.world.random.nextDouble())
}
}

View file

@ -160,7 +160,7 @@
"hexcasting.spell.hexcasting:get_caster": "Mind's Reflection", "hexcasting.spell.hexcasting:get_caster": "Mind's Reflection",
"hexcasting.spell.hexcasting:get_entity_pos": "Compass' Purification", "hexcasting.spell.hexcasting:get_entity_pos": "Compass' Purification",
"hexcasting.spell.hexcasting:get_entity_look": "Alidade's Purification", "hexcasting.spell.hexcasting:get_entity_look": "Alidade's Purification",
"hexcasting.spell.hexcasting:get_entity_height": "Stadiometer's Purification", "hexcasting.spell.hexcasting:get_entity_height": "Stadiometer's Prfn.",
"hexcasting.spell.hexcasting:get_entity_velocity": "Pace Purification", "hexcasting.spell.hexcasting:get_entity_velocity": "Pace Purification",
"hexcasting.spell.hexcasting:raycast": "Archer's Distillation", "hexcasting.spell.hexcasting:raycast": "Archer's Distillation",
"hexcasting.spell.hexcasting:raycast/axis": "Architect's Distillation", "hexcasting.spell.hexcasting:raycast/axis": "Architect's Distillation",
@ -232,6 +232,7 @@
"hexcasting.spell.hexcasting:arcsin": "Inverse Sine Prfn.", "hexcasting.spell.hexcasting:arcsin": "Inverse Sine Prfn.",
"hexcasting.spell.hexcasting:arccos": "Inverse Cosine Prfn.", "hexcasting.spell.hexcasting:arccos": "Inverse Cosine Prfn.",
"hexcasting.spell.hexcasting:arctan": "Inverse Tangent Prfn.", "hexcasting.spell.hexcasting:arctan": "Inverse Tangent Prfn.",
"hexcasting.spell.hexcasting:random": "Entropy Reflection",
"hexcasting.spell.hexcasting:coerce_axial": "Axial Purification", "hexcasting.spell.hexcasting:coerce_axial": "Axial Purification",
"hexcasting.spell.hexcasting:print": "Reveal", "hexcasting.spell.hexcasting:print": "Reveal",
"hexcasting.spell.hexcasting:explode": "Explosion", "hexcasting.spell.hexcasting:explode": "Explosion",
@ -284,8 +285,8 @@
"hexcasting.spell.hexcasting:eval/delay": "Secret Gambit!", "hexcasting.spell.hexcasting:eval/delay": "Secret Gambit!",
"hexcasting.spell.hexcasting:read": "Scribe's Reflection", "hexcasting.spell.hexcasting:read": "Scribe's Reflection",
"hexcasting.spell.hexcasting:write": "Scribe's Gambit", "hexcasting.spell.hexcasting:write": "Scribe's Gambit",
"hexcasting.spell.hexcasting:read/akashic": "Akasha's Distillation", "hexcasting.spell.hexcasting:akashic/read": "Akasha's Distillation",
"hexcasting.spell.hexcasting:write/akashic": "Akasha's Gambit", "hexcasting.spell.hexcasting:akashic/write": "Akasha's Gambit",
"hexcasting.spell.hexcasting:read/entity": "Scribe's Purification", "hexcasting.spell.hexcasting:read/entity": "Scribe's Purification",
"hexcasting.spell.hexcasting:const/vec/px": "Vector Reflection +X", "hexcasting.spell.hexcasting:const/vec/px": "Vector Reflection +X",
"hexcasting.spell.hexcasting:const/vec/py": "Vector Reflection +Y", "hexcasting.spell.hexcasting:const/vec/py": "Vector Reflection +Y",
@ -293,9 +294,9 @@
"hexcasting.spell.hexcasting:const/vec/nx": "Vector Reflection -X", "hexcasting.spell.hexcasting:const/vec/nx": "Vector Reflection -X",
"hexcasting.spell.hexcasting:const/vec/ny": "Vector Reflection -Y", "hexcasting.spell.hexcasting:const/vec/ny": "Vector Reflection -Y",
"hexcasting.spell.hexcasting:const/vec/nz": "Vector Reflection -Z", "hexcasting.spell.hexcasting:const/vec/nz": "Vector Reflection -Z",
"hexcasting.spell.hexcasting:const/vec/x": "Vector Reflection +X/-X", "hexcasting.spell.hexcasting:const/vec/x": "Vector Rfln. +X/-X",
"hexcasting.spell.hexcasting:const/vec/y": "Vector Reflection +Y/-Y", "hexcasting.spell.hexcasting:const/vec/y": "Vector Rfln. +Y/-Y",
"hexcasting.spell.hexcasting:const/vec/z": "Vector Reflection +Z/-Z", "hexcasting.spell.hexcasting:const/vec/z": "Vector Rfln. +Z/-Z",
"hexcasting.spell.hexcasting:const/vec/0": "Vector Reflection Zero", "hexcasting.spell.hexcasting:const/vec/0": "Vector Reflection Zero",
"hexcasting.spell.hexcasting:const/double/pi": "Arc's Reflection", "hexcasting.spell.hexcasting:const/double/pi": "Arc's Reflection",
"hexcasting.spell.hexcasting:const/double/tau": "Circle's Reflection", "hexcasting.spell.hexcasting:const/double/tau": "Circle's Reflection",
@ -627,7 +628,7 @@
"hexcasting.page.math.abs_len.1": "Compute the absolute value or length.", "hexcasting.page.math.abs_len.1": "Compute the absolute value or length.",
"hexcasting.page.math.abs_len.2": "Replaces a number with its absolute value, or a vector with its length.", "hexcasting.page.math.abs_len.2": "Replaces a number with its absolute value, or a vector with its length.",
"hexcasting.page.math.pow_proj.1": "Perform exponentiation or vector projection.", "hexcasting.page.math.pow_proj.1": "Perform exponentiation or vector projection.",
"hexcasting.page.math.pow_proj.2": "$(li)With two numbers, combines them by raising the first to the power of the second.$(li)With a number and a vector, removes the number and raises each component of the vector to the number's power.$(li)With two vectors, combines them into the $(l:https://en.wikipedia.org/wiki/Vector_projection)vector projection/$ of the top of the stack onto the second-from-the-top.$(br2)In the first and second cases, the first argument or its components are the base, and the second argument or its components are the exponent.", "hexcasting.page.math.pow_proj.2": "With two numbers, combines them by raising the first to the power of the second.$(li)With a number and a vector, removes the number and raises each component of the vector to the number's power.$(li)With two vectors, combines them into the $(l:https://en.wikipedia.org/wiki/Vector_projection)vector projection/$ of the top of the stack onto the second-from-the-top.$(br2)In the first and second cases, the first argument or its components are the base, and the second argument or its components are the exponent.",
"hexcasting.page.math.floor": "\"Floors\" a number, cutting off the fractional component and leaving an integer value.", "hexcasting.page.math.floor": "\"Floors\" a number, cutting off the fractional component and leaving an integer value.",
"hexcasting.page.math.ceil": "\"Ceilings\" a number, raising it to the next integer value if it has a fractional component.", "hexcasting.page.math.ceil": "\"Ceilings\" a number, raising it to the next integer value if it has a fractional component.",
"hexcasting.page.math.construct_vec": "Combine three numbers at the top of the stack into a vector's X, Y, and Z components (top to bottom).", "hexcasting.page.math.construct_vec": "Combine three numbers at the top of the stack into a vector's X, Y, and Z components (top to bottom).",
@ -639,6 +640,7 @@
"hexcasting.page.math.arcsin": "Take the inverse sine of a value with absolute value 1 or less, yielding the angle whose sine is that value.", "hexcasting.page.math.arcsin": "Take the inverse sine of a value with absolute value 1 or less, yielding the angle whose sine is that value.",
"hexcasting.page.math.arccos": "Take the inverse cosine of a value with absolute value 1 or less, yielding the angle whose sine is that value.", "hexcasting.page.math.arccos": "Take the inverse cosine of a value with absolute value 1 or less, yielding the angle whose sine is that value.",
"hexcasting.page.math.arctan": "Take the inverse tangent of a value, yielding the angle whose tangent is that value.", "hexcasting.page.math.arctan": "Take the inverse tangent of a value, yielding the angle whose tangent is that value.",
"hexcasting.page.math.random": "Creates a random number between 0 and 1.",
"hexcasting.entry.consts": "Constants", "hexcasting.entry.consts": "Constants",
"hexcasting.page.consts.const/vec/x": "The left-hand counter-clockwise pattern adds [1, 0, 0] to the stack; the right-hand clockwise pattern adds [-1, 0, 0].", "hexcasting.page.consts.const/vec/x": "The left-hand counter-clockwise pattern adds [1, 0, 0] to the stack; the right-hand clockwise pattern adds [-1, 0, 0].",
@ -647,7 +649,7 @@
"hexcasting.page.consts.const/vec/0": "Adds [0, 0, 0] to the stack.", "hexcasting.page.consts.const/vec/0": "Adds [0, 0, 0] to the stack.",
"hexcasting.page.consts.const/double/tau": "Adds τ, the radial representation of a complete circle, to the stack.", "hexcasting.page.consts.const/double/tau": "Adds τ, the radial representation of a complete circle, to the stack.",
"hexcasting.page.consts.const/double/pi": "Adds π, the radial representation of half a circle, to the stack.", "hexcasting.page.consts.const/double/pi": "Adds π, the radial representation of half a circle, to the stack.",
"hexcasting.page.consts.const/double/e": "Adds 𝑒, the base of natural logarithms, to the stack.", "hexcasting.page.consts.const/double/e": "Adds $(italic)e/$, the base of natural logarithms, to the stack.",
"hexcasting.page.consts.const/null": "Adds the Null influence to the top of the stack.", "hexcasting.page.consts.const/null": "Adds the Null influence to the top of the stack.",
"hexcasting.entry.stackmanip": "Stack Manipulation", "hexcasting.entry.stackmanip": "Stack Manipulation",

View file

@ -46,6 +46,14 @@
"output": "num", "output": "num",
"text": "hexcasting.page.basics_pattern.get_entity_velocity" "text": "hexcasting.page.basics_pattern.get_entity_velocity"
}, },
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:print",
"anchor": "hexcasting:print",
"input": "any",
"output": "any",
"text": "hexcasting.page.basics_pattern.print"
},
{ {
"type": "hexcasting:pattern", "type": "hexcasting:pattern",
"op_id": "hexcasting:raycast", "op_id": "hexcasting:raycast",
@ -77,14 +85,6 @@
"input": "vector, vector", "input": "vector, vector",
"output": "entity", "output": "entity",
"text": "hexcasting.page.basics_pattern.raycast/entity" "text": "hexcasting.page.basics_pattern.raycast/entity"
},
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:print",
"anchor": "hexcasting:print",
"input": "any",
"output": "any",
"text": "hexcasting.page.basics_pattern.print"
} }
] ]
} }

View file

@ -125,6 +125,14 @@
"output": "vec", "output": "vec",
"text": "hexcasting.page.math.coerce_axial" "text": "hexcasting.page.math.coerce_axial"
}, },
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:random",
"anchor": "hexcasting:random",
"input": "vec",
"output": "vec",
"text": "hexcasting.page.math.random"
},
{ {
"type": "hexcasting:pattern", "type": "hexcasting:pattern",
"op_id": "hexcasting:sin", "op_id": "hexcasting:sin",

View file

@ -12,7 +12,7 @@
"anchor": "hexcasting:swap", "anchor": "hexcasting:swap",
"input": "any, any", "input": "any, any",
"output": "any, any", "output": "any, any",
"text": "hexcasting.page.stackmanip.1" "text": "hexcasting.page.stackmanip.swap"
}, },
{ {
"type": "hexcasting:pattern", "type": "hexcasting:pattern",
@ -20,7 +20,7 @@
"anchor": "hexcasting:fisherman", "anchor": "hexcasting:fisherman",
"input": "num", "input": "num",
"output": "any", "output": "any",
"text": "hexcasting.page.stackmanip.2" "text": "hexcasting.page.stackmanip.fisherman"
}, },
{ {
"type": "hexcasting:pattern", "type": "hexcasting:pattern",
@ -28,7 +28,7 @@
"anchor": "hexcasting:duplicate", "anchor": "hexcasting:duplicate",
"input": "any", "input": "any",
"output": "any, any", "output": "any, any",
"text": "hexcasting.page.stackmanip.3" "text": "hexcasting.page.stackmanip.duplicate"
}, },
{ {
"type": "hexcasting:pattern", "type": "hexcasting:pattern",
@ -36,7 +36,7 @@
"anchor": "hexcasting:duplicate_n", "anchor": "hexcasting:duplicate_n",
"input": "number, any", "input": "number, any",
"output": "many", "output": "many",
"text": "hexcasting.page.stackmanip.4" "text": "hexcasting.page.stackmanip.duplicate_n"
}, },
{ {
"type": "hexcasting:manual_pattern", "type": "hexcasting:manual_pattern",