refactored nonscarpet references yeet

This commit is contained in:
gnembon committed 2023-02-11 01:33:23 +01:00
1 parent e4c090c355
commit 2ff1f4fb71
22 files changed
+409 -401

No files matched your search

@@ -28,7 +28,6 @@ import carpet.script.Fluff.UsageProvider;
import carpet.script.exception.InternalExpressionException;
import carpet.script.LazyValue;
import carpet.script.value.Value;
import net.fabricmc.api.ModInitializer;
/**
* <p>This class parses methods annotated with the {@link ScarpetFunction} annotation in a given {@link Class}, generating
@@ -85,7 +84,7 @@ public final class AnnotationParser
* to be used in the Scarpet language.</p>
*
* <p><b>Only call this method once per class per lifetime of the JVM!</b> (for example, at {@link carpet.CarpetExtension#onGameStarted()} or
* {@link ModInitializer#onInitialize()}).</p>
* {@link net.fabricmc.api.ModInitializer#onInitialize()}).</p>
*
* <p>There is a set of requirements for the class and its methods:</p>
* <ul>
@@ -12,7 +12,6 @@ import java.util.Map;
import java.util.Optional;
import java.util.function.BiFunction;
import carpet.CarpetServer;
import carpet.script.Context;
import carpet.script.value.BooleanValue;
import carpet.script.value.EntityValue;
@@ -213,7 +212,7 @@ public interface Param
registerStrictConverter(Component.class, false, new SimpleTypeConverter<>(FormattedTextValue.class, FormattedTextValue::getText, "text"));
registerStrictConverter(Component.class, true, new SimpleTypeConverter<>(StringValue.class, FormattedTextValue::getTextByValue, "text"));
registerStrictConverter(ServerPlayer.class, false, new SimpleTypeConverter<>(EntityValue.class,
v -> EntityValue.getPlayerByValue(CarpetServer.minecraft_server, v), "online player entity"));
v -> EntityValue.getPlayerByValue(v.getEntity().getServer(), v), "online player entity"));
registerStrictConverter(Boolean.class, false, new SimpleTypeConverter<>(BooleanValue.class, BooleanValue::getBoolean, "boolean"));
registerStrictConverter(Boolean.class, true, new SimpleTypeConverter<>(NumericValue.class, NumericValue::getBoolean, "boolean"));
}