Skip to content

Commit

Permalink
Merge branch 'FallingColors:main' into loot-cyphers
Browse files Browse the repository at this point in the history
  • Loading branch information
Robotgiggle authored Jan 14, 2025
2 parents 658a06c + d779125 commit 708c7cb
Show file tree
Hide file tree
Showing 19 changed files with 85 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
/lib/
/lib64/
parts/
sdist/
var/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
{
"variants": {
"": {
"facing=down": {
"model": "hexcasting:block/amethyst_sconce",
"x": 180
},
"facing=east": {
"model": "hexcasting:block/amethyst_sconce",
"x": 90,
"y": 90
},
"facing=north": {
"model": "hexcasting:block/amethyst_sconce",
"x": 90
},
"facing=south": {
"model": "hexcasting:block/amethyst_sconce",
"x": 90,
"y": 180
},
"facing=up": {
"model": "hexcasting:block/amethyst_sconce"
},
"facing=west": {
"model": "hexcasting:block/amethyst_sconce",
"x": 90,
"y": 270
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import at.petrak.hexcasting.api.casting.eval.vm.SpellContinuation
import at.petrak.hexcasting.api.casting.iota.Iota

/**
* The result of doing something to a cast harness.
* The result of doing something to a casting VM.
*
* Contains the iota that was executed to produce this CastResult,
* the next thing to execute after this is finished, the modified state of the stack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class CastingVM(var image: CastingImage, val env: CastingEnvironment) {
}
}

// Then write all pertinent data back to the harness for the next iteration.
// Then write all pertinent data back to the VM for the next iteration.
if (image2.newData != null) {
this.image = image2.newData
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ data class FrameForEach(
): CastResult {
// If this isn't the very first Thoth step (i.e. no Thoth computations run yet)...
val stack = if (baseStack == null) {
// init stack to the harness stack...
// init stack to the VM stack...
harness.image.stack.toList()
} else {
// else save the stack to the accumulator and reuse the saved base stack.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package at.petrak.hexcasting.api.casting.eval.vm
import at.petrak.hexcasting.api.casting.iota.Iota

/**
* A change to the data in a CastHarness after a pattern is drawn.
* A change to the data in a CastingVM after a pattern is drawn.
*/
data class FunctionalData(
val stack: List<Iota>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ class MishapEvalTooMuch : Mishap() {
}

override fun errorMessage(ctx: CastingEnvironment, errorCtx: Context) =
error("eval_too_deep")
error("eval_too_much")
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ object OpPlaceBlock : SpellAction {
UseOnContext(env.world, caster as? ServerPlayer, env.otherHand, spoofedStack, blockHit)
val placeContext = BlockPlaceContext(itemUseCtx)
if (bstate.canBeReplaced(placeContext)) {
if (env.withdrawItem({ it == placeeStack }, 1, false)) {
if (env.withdrawItem({ ItemStack.isSameItemSameTags(it, placeeStack) }, 1, false)) {
val res = spoofedStack.useOn(placeContext)

if (res != InteractionResult.FAIL) {
env.withdrawItem({ it == placeeStack }, 1, true)
env.withdrawItem({ ItemStack.isSameItemSameTags(it, placeeStack) }, 1, true)

env.world.playSound(
caster as? ServerPlayer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public InteractionResultHolder<ItemStack> use(Level world, Player player, Intera
}

if (!world.isClientSide() && player instanceof ServerPlayer serverPlayer) {
var harness = IXplatAbstractions.INSTANCE.getStaffcastVM(serverPlayer, hand);
var vm = IXplatAbstractions.INSTANCE.getStaffcastVM(serverPlayer, hand);
var patterns = IXplatAbstractions.INSTANCE.getPatternsSavedInUi(serverPlayer);
var descs = harness.generateDescs();
var descs = vm.generateDescs();

IXplatAbstractions.INSTANCE.sendPacketToPlayer(serverPlayer,
new MsgOpenSpellGuiS2C(hand, patterns, descs.getFirst(), descs.getSecond(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ public InteractionResultHolder<ItemStack> use(Level world, Player player, Intera
}
var sPlayer = (ServerPlayer) player;
var ctx = new PackagedItemCastEnv(sPlayer, usedHand);
var harness = CastingVM.empty(ctx);
var clientView = harness.queueExecuteAndWrapIotas(instrs, sPlayer.serverLevel());
var vm = CastingVM.empty(ctx);
var clientView = vm.queueExecuteAndWrapIotas(instrs, sPlayer.serverLevel());

var patterns = instrs.stream()
.filter(i -> i instanceof PatternIota)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@
add_segment: "Adding line",
},
cast: {
fail: "Mishap crunches",
normal: "Action hums",
spell: "Spell boinks",
hermes: "Hermes' twangs",
Expand Down Expand Up @@ -980,7 +981,7 @@
wrong_dimension: "cannot see %s from %s",
entity_too_far: "%s is out of range",
immune_entity: "cannot alter %s",
eval_too_deep: "Recursively evaluated too deep",
eval_too_much: "Evaluated too many patterns",
no_item: "needs %s but got nothing",
"no_item.offhand": "needs %s in the other hand but got nothing",
bad_entity: "needs %s but got %s",
Expand Down Expand Up @@ -1437,8 +1438,8 @@
"retrospection.title": "Hasty Retrospection",
retrospection: "I attempted to draw $(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)Retrospection/$ without first drawing $(l:patterns/patterns_as_iotas#hexcasting:open_paren)$(action)Introspection/$.$(br2)Causes orange sparks, and pushes the pattern for $(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)Retrospection/$ to the stack as a pattern iota.",

"too_deep.title": "Delve Too Deep",
too_deep: "Evaluated too many spells with meta-evaluation from one spell.$(br2)Causes dark blue sparks, and chokes all the air out of me.",
"too_many_patterns.title": "Lost in Thought",
too_many_patterns: "I attempted to evaluate too many patterns in one _Hex. Often, this happens because I've accidentally created an infinite loop.$(br2)Causes dark blue sparks, and chokes all the air out of me.",

"true_name.title": "Transgress Other",
true_name: "I attempted to $(l:patterns/readwrite#hexcasting:write)$(action)save a reference/$ to another player to a permanent medium.$(br2)Causes black sparks, and robs me of my sight for approximately one minute.",
Expand Down Expand Up @@ -1616,7 +1617,7 @@

spellcircles: {
"1": "I KNOW what the $(l:items/slate)$(item)slates/$ are for. The grand assemblies lost to time. The patterns scribed on them can be actuated in sequence, automatically. Thought and power ricocheting through, one by one by one by one by one by through and through and THROUGH AND -- I must not I must not I should know better than to think that way.",
"2": "To start the ritual I need an $(l:greatwork/impetus)$(item)Impetus/$ to create a self-sustaining wave of _media. That wave travels along a track of $(l:items/slate)$(item)slates/$ or other blocks suitable for the energies, one by one, collecting any patterns it finds. Once the wave circles back around to the $(l:greatwork/impetus)$(item)Impetus/$, all the patterns encountered are cast in order.$(br2)The direction the _media exits any given block MUST be unambiguous, or the casting will fail at the block with too many neighbors.",
"2": "To start the ritual I need an $(l:greatwork/impetus)$(item)Impetus/$ to create a self-sustaining wave of _media. That wave travels along a track of $(l:items/slate)$(item)slates/$ or other suitable blocks, casting any patterns it finds.$(br2)If there is no way for the wave to return to the $(l:greatwork/impetus)$(item)Impetus/$, the casting will fail immediately. Also, the direction the wave exits any given block MUST be unambiguous, or the casting will fail at the block with too many neighbors.",
"3": "As a result, the outline of the spell \"circle\" may be any closed shape, concave or convex, and it may face any direction. In fact, with the application of certain other blocks it is possible to make a spell circle that spans all three dimensions. I doubt such an oddity has very much use, but I must allocate myself a bit of vapid levity to encourage my crude mind to continue my work.",
"4": "Miracle of miracles, the circle will withdraw _media neither from my inventory nor my mind. Instead, crystallized shards of _media must be provided to the $(l:greatwork/impetus)$(item)Impetus/$ via hopper, or other such artifice.$(br2)The application of a $(l:items/lens)$(item)Scrying Lens/$ will show how much _media is inside an $(l:greatwork/impetus)$(item)Impetus/$, in units of dust.",
"5": "However, a spell cast from a circle does have one major limitation: it is unable to affect anything outside of the circle's bounds. That is, it cannot interact with anything outside of the cuboid of minimum size which encloses every block composing it (so a concave spell circle can still affect things in the concavity).",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@
wrong_dimension: "не удается увидеть %s из %s",
entity_too_far: "%s находится вне диапазона",
immune_entity: "невозможно изменить %s",
eval_too_deep: "Рекурсивные вычисления слишком глубокие",
eval_too_much: "Рекурсивные вычисления слишком глубокие",
no_item: "нуждается в %s, но ничего не получает",
"no_item.offhand": "нуждается в %s в другой руке, но ничего не получил",
bad_entity: "нуждается в %s, но получил %s",
Expand Down Expand Up @@ -1289,8 +1289,8 @@
"retrospection.title": "Поспешная Ретроспектива",
retrospection: "Я попытался нарисовать $(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)Ретроспектива/$ без предварительного рисования $(l:patterns/patterns_as_iotas#hexcasting:open_paren)$(action)Интроспекция/$.$(br2)Вызывает оранжевые искры и помещает шаблон для $(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)Ретроспектива/$ в стек как шаблон иота.",

"too_deep.title": "Слишком глубоко",
too_deep: "Оценено слишком много заклинаний с метаоценкой от одного заклинания.$(br2)Вызывает темно-синие искры и лишает меня всего воздуха.",
"too_many_patterns.title": "Слишком глубоко",
too_many_patterns: "Оценено слишком много заклинаний с метаоценкой от одного заклинания.$(br2)Вызывает темно-синие искры и лишает меня всего воздуха.",

"true_name.title": "Нарушение Законов",
true_name: "Я попытался $(l:patterns/readwrite#hexcasting:write)$(action)сохранить истинное имя/$ другого игрока на постоянный носитель.$(br2)Вызывает черные искры и лишает меня зрения примерно на одну минуту.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
slate_amethyst_: {
tiles: "板岩紫晶瓦",
bricks: "板岩紫晶砖",
bricks_small: "板岩紫晶砖",
bricks_small: "板岩紫晶小型砖",
pillar: "板岩紫晶柱",
},

Expand Down Expand Up @@ -268,7 +268,7 @@
},

"tag.item.hexcasting": {
brainswept_circle_components: "剥离意识环组件",
brainswept_circle_components: "剥离意识所得法术环组件",
directrices: "导向石",
grants_root_advancement: "给予根进度",
impeti: "促动石",
Expand Down Expand Up @@ -601,6 +601,7 @@
"scroll.scribble": "卷轴:被涂写",
"impetus.fletcher.tick": "制箭师促动石:咔哒",
"impetus.redstone.register": "牧师促动石:叮~",
"impetus.redstone.clear": "牧师促动石:清空",
"lore_fragment.read": "故事残卷:被阅读",
"flight.ambience": "玩家:飞翔",
"flight.finish": "飞翔结束",
Expand Down Expand Up @@ -810,6 +811,7 @@
flight: "翱翔",
"flight/range": "隐士之飞行",
"flight/time": "旅者之飞行",
"flight/can_fly": "飞行员之纯化",

lightning: "召雷",
summon_rain: "召雨",
Expand Down Expand Up @@ -920,7 +922,7 @@
wrong_dimension: "无法在%2$s中影响到%1$s",
entity_too_far: "%s超出影响范围",
immune_entity: "无法影响到%s",
eval_too_deep: "递归深度过大",
eval_too_much: "递归深度过大",
no_item: "需要%s,而实际无对应物品",
"no_item.offhand": "需要在另一只手里持有%s,而实际无对应物品",
bad_entity: "需要%s,而实际接受了%s",
Expand Down Expand Up @@ -1376,8 +1378,8 @@
"retrospection.title": "反思过急",
retrospection: "试图在绘制$(l:patterns/patterns_as_iotas#hexcasting:open_paren)$(action)内省/$前绘制$(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)反思/$。$(br2)产生橙色火花,并压入一个$(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)反思/$对应的图案。",

"too_deep.title": "钻研过深",
too_deep: "在一个法术内以元运行方式运行过多法术。$(br2)产生暗蓝色火花,并使我窒息。",
"too_many_patterns.title": "钻研过深",
too_many_patterns: "在一个法术内以元运行方式运行过多法术。$(br2)产生暗蓝色火花,并使我窒息。",

"true_name.title": "违犯他人",
true_name: "试图在某种永久性媒介中$(l:patterns/readwrite#hexcasting:write)$(action)存储/$代表另一位玩家的 iota。$(br2)产生黑色火花,并致盲大约一分钟。",
Expand Down Expand Up @@ -1593,8 +1595,8 @@
quenching_allays: {
"1": "$(l)它们就是小块媒质。/$我怎么没早点发现呢?它们——我是一堆血肉再加上一小点……是被赐予了一小点的思维,但悦灵是能维持自稳的媒质集群,再被按到一小点血肉上去。所有东西就都说得通了——它们对媒质的趋向性,它们对音乐的种种反应,$(l)我现在理解了/$,$(l)但/$为何前人$(l)没有/$?",
"2": "理解这点后,唯一$(l)正确/$的选择就是去征服它们奇异的意识——它们奇异的自我——也是它们的全部、一个意识、一个自我、一段尾声。它们的性状似乎揭示了某些东西。我能……我能使用它们压缩$(media)媒质/$,将两束思维叠放在一起,形体与认知,多与一。$(br2)这个过程不知怎么的会自行产生$(media)媒质/$。这是怎么回事?也许——也许是$(l)我/$的缘故,是完成这项任务的过程——",
"3": "它不重要。我不重要。它们不重要,重要的只有功用。这就是了。$(br2)这肯定相当痛苦。",
"4": "所得的产物十分脆弱。直接破坏会将其打碎成碎片,$(thing)时运/$则能增加产量……如果需要获得方块本身,那要有精准采集才行。$(br2)产生的碎片相当于将 3 个$(l:items/amethyst)$(item)充能紫水晶/$拼在一起。方块则相当于 4 个碎片。",
"3": "它不重要。我不重要。它们不重要,重要的只有功用。这就是了。$(br2)这肯定相当痛苦。$(br2)十份$(l:items/amethyst)$(item)紫水晶粉/$,就是启动如此恶劣仪式的代价。",
"4": "所得的产物十分脆弱。直接破坏会将其打碎成碎片,$(thing)时运/$则能增加产量……如果需要获得方块本身,那要有精准采集才行。$(br2)产生的碎片相当于 3 个$(l:items/amethyst)$(item)充能紫水晶/$拼在一起。方块则相当于 4 个碎片。",
"5": "它们变幻莫测,好像会在我的手中不断变形闪烁,若是给予它们来自另一种$(media)媒质/$形态的引导,它们便会变成对应的形态,且$(media)媒质/$总量前后不变。",
},

Expand Down Expand Up @@ -1956,6 +1958,10 @@

"time.1": "受时间限制的飞行法术。",
"time.2": "第二参数代表持续时间(以秒计),在此限制内,法术能保持稳定。持续时间超过限制就会结束该法术,滞空的物体会直接坠向地面。$(br2)此法术相对较昂贵,每秒持续时间消耗大约 1 个$(l:items/amethyst)$(item)充能紫水晶/$。我觉得它极其适合长途旅行。",

// Putting this in this category instead of elsewhere -- see sentinel chapter also containing some reflections/nonspells
"can_fly.1": "检查玩家是否处于$(l:patterns/spells/flight#hexcasting:flight/range)隐士之飞行/$或$(l:patterns/spells/flight#hexcasting:flight/time)旅者之飞行/$的影响之下。",
"can_fly.2": "不会检查玩家是否能以其他方式飞行。$(br2)我不太清楚这个图案有什么用途,但我相信,愿意用它的人自会清楚。"
},

create_lava: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
},
{
"type": "patchouli:text",
"title": "hexcasting.page.mishaps.too_deep.title",
"text": "hexcasting.page.mishaps.too_deep"
"title": "hexcasting.page.mishaps.too_many_patterns.title",
"text": "hexcasting.page.mishaps.too_many_patterns"
},
{
"type": "patchouli:text",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"hexcasting:staff/crimson",
"hexcasting:staff/warped",
"hexcasting:staff/mangrove",
"hexcasting:staff/bamboo",
"hexcasting:staff/cherry",
"hexcasting:staff/edified"
]
}
Expand Down
10 changes: 8 additions & 2 deletions Fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ plugins {
pkSubproj {
platform "fabric"
curseforgeJar remapJar.archiveFile
curseforgeDependencies[]
curseforgeDependencies[
"paucal", "patchouli", "fabric-language-kotlin", "inline", "cloth-config",
"cardinal-components-api", "fabric-api"
]
modrinthJar remapJar.archiveFile
modrinthDependencies[]
modrinthDependencies[
"paucal", "patchouli", "fabric-language-kotlin", "inline", "cloth-config",
"cardinal-components-api", "fabric-api"
]
}

loom {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.jetbrains.annotations.Nullable;

public class CCStaffcastImage implements Component {
public static final String TAG_HARNESS = "harness";
public static final String TAG_VM = "harness";

private final ServerPlayer owner;
private CompoundTag lazyLoadedTag = new CompoundTag();
Expand Down Expand Up @@ -39,11 +39,11 @@ public void setImage(@Nullable CastingImage image) {

@Override
public void readFromNbt(CompoundTag tag) {
this.lazyLoadedTag = tag.getCompound(TAG_HARNESS);
this.lazyLoadedTag = tag.getCompound(TAG_VM);
}

@Override
public void writeToNbt(CompoundTag tag) {
tag.put(TAG_HARNESS, this.lazyLoadedTag);
tag.put(TAG_VM, this.lazyLoadedTag);
}
}
10 changes: 7 additions & 3 deletions Forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ apply plugin: 'org.spongepowered.mixin'
pkSubproj {
platform "forge"
curseforgeJar jar.archiveFile
curseforgeDependencies[]
curseforgeDependencies[
"paucal", "patchouli", "caelus", "inline"
]
modrinthJar jar.archiveFile
modrinthDependencies[]
modrinthDependencies[
"paucal", "patchouli", "caelus", "inline"
]
}

repositories {
Expand Down Expand Up @@ -149,7 +153,7 @@ minecraft {
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
property 'hexcasting.xplat_datagen', 'true'

mods {
create(modID) {
source sourceSets.main
Expand Down
Loading

0 comments on commit 708c7cb

Please sign in to comment.