Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ protected long extractMediaFromInventory(long costLeft, boolean allowOvercast, b
}

protected boolean canOvercast() {
//bad deployer, no more infinite bloodcasting for you
if (this.caster.getClass() != ServerPlayer.class){
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems unrelated (and the commit is from a year ago), did something weird happen with the commit history?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack I thought that got deleted when I merged with the more recent commits

return false;
}
var adv = this.world.getServer().getAdvancements().getAdvancement(modLoc("y_u_no_cast_angy"));
var advs = this.caster.getAdvancements();
return advs.getOrStartProgress(adv).isDone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public boolean toleratesOther(Iota that) {
public @NotNull CastResult execute(CastingVM vm, ServerLevel world, SpellContinuation continuation) {
Supplier<@Nullable Component> castedName = () -> null;
try {
var lookup = PatternRegistryManifest.matchPattern(this.getPattern(), vm.getEnv(), false);
var lookup = PatternRegistryManifest.matchPattern(this.getPattern(), vm.getEnv());
vm.getEnv().precheckAction(lookup);

Action action;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public static Pair<SpecialHandler, ResourceKey<SpecialHandler.Factory<?>>> match
* order
* for a per-world pattern.
*/
@Deprecated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a description to the deprecated annotation, and update the javadoc to mention the new overload?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, can you also add since= to the deprecated annotation? I should have been more clear about what I was asking

https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Deprecated.html#since()

public static PatternShapeMatch matchPattern(HexPattern pat, CastingEnvironment environment,
boolean checkForAlternateStrokeOrders) {
// I am PURPOSELY checking normal actions before special handlers
Expand Down Expand Up @@ -119,6 +120,10 @@ public static PatternShapeMatch matchPattern(HexPattern pat, CastingEnvironment
return new PatternShapeMatch.Nothing();
}

public static PatternShapeMatch matchPattern(HexPattern pattern, CastingEnvironment environment){
Comment thread
object-Object marked this conversation as resolved.
return matchPattern(pattern, environment, false);
}

@Nullable
public static HexPattern getCanonicalStrokesPerWorld(ResourceKey<ActionRegistryEntry> key, ServerLevel overworld) {
var perWorldPatterns = ScrungledPatternsSave.open(overworld);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public Style getExtraStyle() {

public static Component getPatternName(HexPattern pattern){
try {
PatternShapeMatch shapeMatch = PatternRegistryManifest.matchPattern(pattern, null, false);
PatternShapeMatch shapeMatch = PatternRegistryManifest.matchPattern(pattern, null);
if(shapeMatch instanceof PatternShapeMatch.Normal normMatch){
return HexAPI.instance().getActionI18n(normMatch.key, false);
}
Expand Down
Loading