Skip to content

Commit b3a25aa

Browse files
committed
Pass simulate to CastingEnvironmentComponent.ExtractMedia
1 parent 8a71cb5 commit b3a25aa

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,10 @@ public boolean isEnlightened() {
240240
*/
241241
public long extractMedia(long cost, boolean simulate) {
242242
for (var extractMediaComponent : preMediaExtract)
243-
cost = extractMediaComponent.onExtractMedia(cost);
243+
cost = extractMediaComponent.onExtractMedia(cost, simulate);
244244
cost = extractMediaEnvironment(cost, simulate);
245245
for (var extractMediaComponent : postMediaExtract)
246-
cost = extractMediaComponent.onExtractMedia(cost);
246+
cost = extractMediaComponent.onExtractMedia(cost, simulate);
247247
return cost;
248248
}
249249

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ interface ExtractMedia extends CastingEnvironmentComponent {
2929
* remaining cost after deducting whatever cost source this component
3030
* is responsible for (should be >= 0)
3131
*/
32-
long onExtractMedia(long cost);
32+
long onExtractMedia(long cost, boolean simulate);
3333

3434
/**
35-
* ExtractMedia component that extracts media BEFORE the call to {@link CastingEnvironment#extractMediaEnvironment(long)}
35+
* ExtractMedia component that extracts media BEFORE the call to {@link CastingEnvironment#extractMediaEnvironment(long, boolean)}
3636
*/
3737
interface Pre extends ExtractMedia {}
3838

3939
/**
40-
* ExtractMedia component that extracts media AFTER the call to {@link CastingEnvironment#extractMediaEnvironment(long)}
40+
* ExtractMedia component that extracts media AFTER the call to {@link CastingEnvironment#extractMediaEnvironment(long, boolean)}
4141
* if the input is <= 0 you should also probably return 0 (since media cost was already paid off)
4242
*/
4343
interface Post extends ExtractMedia {}

0 commit comments

Comments
 (0)