Skip to content

Commit 22ff0ba

Browse files
committed
Change "harness" to "VM" wherever it won't break stuff
1 parent d64b273 commit 22ff0ba

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

Common/src/main/java/at/petrak/hexcasting/api/casting/eval/CastResult.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import at.petrak.hexcasting.api.casting.eval.vm.SpellContinuation
77
import at.petrak.hexcasting.api.casting.iota.Iota
88

99
/**
10-
* The result of doing something to a cast harness.
10+
* The result of doing something to a casting VM.
1111
*
1212
* Contains the iota that was executed to produce this CastResult,
1313
* the next thing to execute after this is finished, the modified state of the stack,

Common/src/main/java/at/petrak/hexcasting/api/casting/eval/vm/CastingVM.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class CastingVM(var image: CastingImage, val env: CastingEnvironment) {
6464
}
6565
}
6666

67-
// Then write all pertinent data back to the harness for the next iteration.
67+
// Then write all pertinent data back to the VM for the next iteration.
6868
if (image2.newData != null) {
6969
this.image = image2.newData
7070
}

Common/src/main/java/at/petrak/hexcasting/api/casting/eval/vm/FrameForEach.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ data class FrameForEach(
4747
): CastResult {
4848
// If this isn't the very first Thoth step (i.e. no Thoth computations run yet)...
4949
val stack = if (baseStack == null) {
50-
// init stack to the harness stack...
50+
// init stack to the VM stack...
5151
harness.image.stack.toList()
5252
} else {
5353
// else save the stack to the accumulator and reuse the saved base stack.

Common/src/main/java/at/petrak/hexcasting/api/casting/eval/vm/FunctionalData.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package at.petrak.hexcasting.api.casting.eval.vm
33
import at.petrak.hexcasting.api.casting.iota.Iota
44

55
/**
6-
* A change to the data in a CastHarness after a pattern is drawn.
6+
* A change to the data in a CastingVM after a pattern is drawn.
77
*/
88
data class FunctionalData(
99
val stack: List<Iota>,

Common/src/main/java/at/petrak/hexcasting/common/items/ItemStaff.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ public InteractionResultHolder<ItemStack> use(Level world, Player player, Intera
3737
}
3838

3939
if (!world.isClientSide() && player instanceof ServerPlayer serverPlayer) {
40-
var harness = IXplatAbstractions.INSTANCE.getStaffcastVM(serverPlayer, hand);
40+
var vm = IXplatAbstractions.INSTANCE.getStaffcastVM(serverPlayer, hand);
4141
var patterns = IXplatAbstractions.INSTANCE.getPatternsSavedInUi(serverPlayer);
42-
var descs = harness.generateDescs();
42+
var descs = vm.generateDescs();
4343

4444
IXplatAbstractions.INSTANCE.sendPacketToPlayer(serverPlayer,
4545
new MsgOpenSpellGuiS2C(hand, patterns, descs.getFirst(), descs.getSecond(),

Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemPackagedHex.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ public InteractionResultHolder<ItemStack> use(Level world, Player player, Intera
128128
}
129129
var sPlayer = (ServerPlayer) player;
130130
var ctx = new PackagedItemCastEnv(sPlayer, usedHand);
131-
var harness = CastingVM.empty(ctx);
132-
var clientView = harness.queueExecuteAndWrapIotas(instrs, sPlayer.serverLevel());
131+
var vm = CastingVM.empty(ctx);
132+
var clientView = vm.queueExecuteAndWrapIotas(instrs, sPlayer.serverLevel());
133133

134134
var patterns = instrs.stream()
135135
.filter(i -> i instanceof PatternIota)

Fabric/src/main/java/at/petrak/hexcasting/fabric/cc/CCStaffcastImage.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import org.jetbrains.annotations.Nullable;
1111

1212
public class CCStaffcastImage implements Component {
13-
public static final String TAG_HARNESS = "harness";
13+
public static final String TAG_VM = "harness";
1414

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

4040
@Override
4141
public void readFromNbt(CompoundTag tag) {
42-
this.lazyLoadedTag = tag.getCompound(TAG_HARNESS);
42+
this.lazyLoadedTag = tag.getCompound(TAG_VM);
4343
}
4444

4545
@Override
4646
public void writeToNbt(CompoundTag tag) {
47-
tag.put(TAG_HARNESS, this.lazyLoadedTag);
47+
tag.put(TAG_VM, this.lazyLoadedTag);
4848
}
4949
}

Forge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeXplatImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public void setSentinel(Player player, @Nullable Sentinel sentinel) {
220220

221221
@Override
222222
public void setStaffcastImage(ServerPlayer player, @Nullable CastingImage image) {
223-
player.getPersistentData().put(TAG_HARNESS, image == null ? new CompoundTag() : image.serializeToNbt());
223+
player.getPersistentData().put(TAG_VM, image == null ? new CompoundTag() : image.serializeToNbt());
224224
}
225225

226226
@Override
@@ -285,9 +285,9 @@ public Sentinel getSentinel(Player player) {
285285

286286
@Override
287287
public CastingVM getStaffcastVM(ServerPlayer player, InteractionHand hand) {
288-
// This is always from a staff because we don't need to load the harness when casting from item
288+
// This is always from a staff because we don't need to load the VM when casting from item
289289
var ctx = new StaffCastEnv(player, hand);
290-
return new CastingVM(CastingImage.loadFromNbt(player.getPersistentData().getCompound(TAG_HARNESS),
290+
return new CastingVM(CastingImage.loadFromNbt(player.getPersistentData().getCompound(TAG_VM),
291291
player.serverLevel()), ctx);
292292
}
293293

@@ -305,7 +305,7 @@ public List<ResolvedPattern> getPatternsSavedInUi(ServerPlayer player) {
305305

306306
@Override
307307
public void clearCastingData(ServerPlayer player) {
308-
player.getPersistentData().remove(TAG_HARNESS);
308+
player.getPersistentData().remove(TAG_VM);
309309
player.getPersistentData().remove(TAG_PATTERNS);
310310
}
311311

@@ -585,6 +585,6 @@ public void setScale(Entity e, float scale) {
585585

586586
public static final UUID ALTIORA_ATTRIBUTE_ID = UUID.fromString("91897c79-3ebb-468c-a265-40418ed01c41");
587587

588-
public static final String TAG_HARNESS = "hexcasting:spell_harness";
588+
public static final String TAG_VM = "hexcasting:spell_harness";
589589
public static final String TAG_PATTERNS = "hexcasting:spell_patterns";
590590
}

0 commit comments

Comments
 (0)