Skip to content

Commit

Permalink
Rename 'plain' strategy to 'shallow' and make default
Browse files Browse the repository at this point in the history
Signed-off-by: TheSilkMiner <thesilkminer@outlook.com>
  • Loading branch information
TheSilkMiner authored and jaredlll08 committed Oct 11, 2022
1 parent f90314a commit e7eb8b4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Expand Up @@ -43,7 +43,7 @@ public interface ITargetingStrategy extends CommandStringDisplayable {
*
* @since 10.0.0
*/
ResourceLocation DEFAULT_STRATEGY_ID = CraftTweakerConstants.rl("default");
ResourceLocation DEFAULT_STRATEGY_ID = CraftTweakerConstants.rl("shallow");

/**
* Obtains a {@link ITargetingStrategy} with the given id, if available.
Expand Down
Expand Up @@ -213,9 +213,9 @@ public void registerCommands(final ICommandRegistrationHandler handler) {
@Override
public void registerTaggableElements(ITaggableElementRegistrationHandler handler) {

this.zenGatherer.onCandidates(candidate -> {
this.taggableElementsRegistrationManager.attemptRegistration(candidate.clazz(), handler);
});
this.zenGatherer.onCandidates(candidate ->
this.taggableElementsRegistrationManager.attemptRegistration(candidate.clazz(), handler)
);
}

@Override
Expand All @@ -224,9 +224,7 @@ public void registerReplacerComponents(final IReplacerComponentRegistrationHandl
handler.registerTargetingFilter(DefaultTargetingFilters::scripts);
handler.registerTargetingFilter(DefaultTargetingFilters::vanillaSpecial);

// TODO("Find better names for all of these")
handler.registerTargetingStrategy(ITargetingStrategy.DEFAULT_STRATEGY_ID, DefaultTargetingStrategies::plain);
handler.registerTargetingStrategy(CraftTweakerConstants.rl("plain"), DefaultTargetingStrategies::plain);
handler.registerTargetingStrategy(ITargetingStrategy.DEFAULT_STRATEGY_ID, DefaultTargetingStrategies::shallow);
handler.registerTargetingStrategy(CraftTweakerConstants.rl("deep"), DefaultTargetingStrategies::deep);
}

Expand Down
Expand Up @@ -11,10 +11,8 @@ public final class DefaultTargetingStrategies {

private DefaultTargetingStrategies() {}

// TODO("we need to find proper names for these strategies")

@ZenCodeType.Nullable
public static <T> T plain(@SuppressWarnings("unused") final IRecipeComponent<T> component, final T object, final Function<T, @ZenCodeType.Nullable T> replacer) {
public static <T> T shallow(@SuppressWarnings("unused") final IRecipeComponent<T> component, final T object, final Function<T, @ZenCodeType.Nullable T> replacer) {

return replacer.apply(object);
}
Expand Down

0 comments on commit e7eb8b4

Please sign in to comment.