Permalink
Browse files

Deprecate get_player_from_entity_id()

  • Loading branch information...
PseudoKnight committed Dec 13, 2017
1 parent ac76763 commit 74c4ca76932e465adec6107dab6fdd4f87ce460e
Showing with 19 additions and 1 deletion.
  1. +19 −1 src/main/java/com/laytonsmith/core/functions/PlayerManagement.java
@@ -29,7 +29,10 @@
import com.laytonsmith.core.CHVersion;
import com.laytonsmith.core.LogLevel;
import com.laytonsmith.core.ObjectGenerator;
import com.laytonsmith.core.Optimizable;
import com.laytonsmith.core.ParseTree;
import com.laytonsmith.core.Static;
import com.laytonsmith.core.compiler.FileOptions;
import com.laytonsmith.core.constructs.CArray;
import com.laytonsmith.core.constructs.CBoolean;
import com.laytonsmith.core.constructs.CDouble;
@@ -62,9 +65,12 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.EnumSet;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.UUID;
@@ -4804,7 +4810,8 @@ public CHVersion since() {
}
@api
public static class get_player_from_entity_id extends AbstractFunction {
@hide("Deprecated.")
public static class get_player_from_entity_id extends AbstractFunction implements Optimizable {
@Override
public Class<? extends CREThrowable>[] thrown() {
@@ -4850,6 +4857,17 @@ public String docs() {
public Version since() {
return CHVersion.V3_3_1;
}
@Override
public ParseTree optimizeDynamic(Target t, List<ParseTree> children, FileOptions fileOptions) throws ConfigCompileException, ConfigRuntimeException {
CHLog.GetLogger().w(CHLog.Tags.DEPRECATION, "The function get_player_from_entity_id() is deprecated. Use player().", t);
return null;
}
@Override
public Set<Optimizable.OptimizationOption> optimizationOptions() {
return EnumSet.of(Optimizable.OptimizationOption.OPTIMIZE_DYNAMIC);
}
}
@api

0 comments on commit 74c4ca7

Please sign in to comment.