Skip to content

Commit 8f94455

Browse files
committed
Remove some deprecations
1 parent d97c4b5 commit 8f94455

File tree

4 files changed

+1
-155
lines changed

4 files changed

+1
-155
lines changed

src/main/java/com/laytonsmith/core/functions/EntityManagement.java

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,11 @@
9191
import com.laytonsmith.abstraction.enums.MCTreeSpecies;
9292
import com.laytonsmith.abstraction.enums.MCVersion;
9393
import com.laytonsmith.annotations.api;
94-
import com.laytonsmith.annotations.hide;
9594
import com.laytonsmith.annotations.seealso;
9695
import com.laytonsmith.core.ArgumentValidation;
97-
import com.laytonsmith.core.CHLog;
9896
import com.laytonsmith.core.CHVersion;
9997
import com.laytonsmith.core.ObjectGenerator;
100-
import com.laytonsmith.core.Optimizable;
101-
import com.laytonsmith.core.ParseTree;
10298
import com.laytonsmith.core.Static;
103-
import com.laytonsmith.core.compiler.FileOptions;
10499
import com.laytonsmith.core.constructs.CArray;
105100
import com.laytonsmith.core.constructs.CBoolean;
106101
import com.laytonsmith.core.constructs.CDouble;
@@ -128,7 +123,6 @@
128123

129124
import java.lang.reflect.Field;
130125
import java.util.ArrayList;
131-
import java.util.EnumSet;
132126
import java.util.HashSet;
133127
import java.util.List;
134128
import java.util.Map;
@@ -1640,80 +1634,6 @@ public CHVersion since() {
16401634
}
16411635
}
16421636

1643-
@api
1644-
@hide("Deprecated.")
1645-
public static class entity_id extends EntityGetterFunction implements Optimizable {
1646-
1647-
@Override
1648-
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
1649-
MCEntity entity = Static.getEntityByUuid(Static.GetUUID(args[0], t), t);
1650-
return new CString(entity.getUniqueId().toString(), t);
1651-
}
1652-
1653-
@Override
1654-
public String getName() {
1655-
return "entity_id";
1656-
}
1657-
1658-
@Override
1659-
public String docs() {
1660-
return "string {entityUUID} returns the entity id for unique persistent UUID";
1661-
}
1662-
1663-
@Override
1664-
public CHVersion since() {
1665-
return CHVersion.V3_3_1;
1666-
}
1667-
1668-
@Override
1669-
public ParseTree optimizeDynamic(Target t, List<ParseTree> children, FileOptions fileOptions) throws ConfigCompileException, ConfigRuntimeException {
1670-
CHLog.GetLogger().w(CHLog.Tags.DEPRECATION, "The function entity_id() is deprecated.", t);
1671-
return Optimizable.PULL_ME_UP;
1672-
}
1673-
1674-
@Override
1675-
public Set<OptimizationOption> optimizationOptions() {
1676-
return EnumSet.of(OptimizationOption.OPTIMIZE_DYNAMIC);
1677-
}
1678-
}
1679-
1680-
@api
1681-
@hide("Deprecated.")
1682-
public static class entity_uuid extends EntityGetterFunction implements Optimizable {
1683-
1684-
@Override
1685-
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
1686-
MCEntity entity = Static.getEntity(args[0], t);
1687-
return new CString(entity.getUniqueId().toString(), t);
1688-
}
1689-
1690-
@Override
1691-
public String getName() {
1692-
return "entity_uuid";
1693-
}
1694-
1695-
@Override
1696-
public String docs() {
1697-
return "string {entityID} returns the persistent unique id of the entity";
1698-
}
1699-
1700-
@Override
1701-
public CHVersion since() {
1702-
return CHVersion.V3_3_1;
1703-
}
1704-
1705-
@Override
1706-
public ParseTree optimizeDynamic(Target t, List<ParseTree> children, FileOptions fileOptions) throws ConfigCompileException, ConfigRuntimeException {
1707-
CHLog.GetLogger().w(CHLog.Tags.DEPRECATION, "The function entity_uuid() is deprecated.", t);
1708-
return Optimizable.PULL_ME_UP;
1709-
}
1710-
1711-
@Override
1712-
public Set<OptimizationOption> optimizationOptions() {
1713-
return EnumSet.of(OptimizationOption.OPTIMIZE_DYNAMIC);
1714-
}
1715-
}
1716-
17171637
@api
17181638
@seealso(set_entity_spec.class)
17191639
public static class entity_spec extends EntityGetterFunction {

src/main/java/com/laytonsmith/core/functions/Exceptions.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ public Construct exec(Target t, Environment env, Construct... args) throws Cance
275275
}
276276
} else {
277277
if(args[0] instanceof CNull) {
278-
CHLog.GetLogger().Log(CHLog.Tags.DEPRECATION, LogLevel.ERROR, "Uncatchable exceptions are no longer supported.", t);
279278
throw new CRECastException("An exception type must be specified", t);
280279
}
281280
Class<? extends Mixed> c;

src/main/java/com/laytonsmith/core/functions/Meta.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,7 @@ public Construct exec(Target t, final Environment env, Construct... args) throws
122122
}
123123
return CVoid.VOID;
124124
}
125-
if(args[0].val().equals("~op")) {
126-
//TODO: Remove this after next release (3.3.1)
127-
CHLog.GetLogger().Log(CHLog.Tags.DEPRECATION, LogLevel.WARNING, "Using runas(~op, " + args[1].asString().getQuote()
128-
+ ") is deprecated. Use sudo(" + args[1].asString().getQuote() + ") instead.", t);
129-
new sudo().exec(t, env, args[1]);
130-
} else if(args[0].val().equals(Static.getConsoleName())) {
125+
if(args[0].val().equals(Static.getConsoleName())) {
131126
CHLog.GetLogger().Log(CHLog.Tags.META, LogLevel.INFO, "Executing command on " + (env.getEnv(CommandHelperEnvironment.class).GetPlayer() != null ? env.getEnv(CommandHelperEnvironment.class).GetPlayer().getName() : "console") + " (as console): " + args[1].val().trim(), t);
132127
if(Prefs.DebugMode()) {
133128
Static.getLogger().log(Level.INFO, "[CommandHelper]: Executing command on " + (env.getEnv(CommandHelperEnvironment.class).GetPlayer() != null ? env.getEnv(CommandHelperEnvironment.class).GetPlayer().getName() : "console") + " (as : " + args[1].val().trim());

src/main/java/com/laytonsmith/core/functions/PlayerManagement.java

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,13 @@
2222
import com.laytonsmith.abstraction.enums.MCSoundCategory;
2323
import com.laytonsmith.abstraction.enums.MCWeather;
2424
import com.laytonsmith.annotations.api;
25-
import com.laytonsmith.annotations.hide;
2625
import com.laytonsmith.annotations.seealso;
2726
import com.laytonsmith.commandhelper.CommandHelperPlugin;
2827
import com.laytonsmith.core.CHLog;
2928
import com.laytonsmith.core.CHVersion;
3029
import com.laytonsmith.core.LogLevel;
3130
import com.laytonsmith.core.ObjectGenerator;
32-
import com.laytonsmith.core.Optimizable;
33-
import com.laytonsmith.core.ParseTree;
3431
import com.laytonsmith.core.Static;
35-
import com.laytonsmith.core.compiler.FileOptions;
3632
import com.laytonsmith.core.constructs.CArray;
3733
import com.laytonsmith.core.constructs.CBoolean;
3834
import com.laytonsmith.core.constructs.CDouble;
@@ -65,12 +61,9 @@
6561
import java.io.IOException;
6662
import java.util.ArrayList;
6763
import java.util.Collection;
68-
import java.util.EnumSet;
6964
import java.util.Enumeration;
7065
import java.util.HashSet;
71-
import java.util.List;
7266
import java.util.Properties;
73-
import java.util.Set;
7467
import java.util.SortedMap;
7568
import java.util.TreeMap;
7669
import java.util.UUID;
@@ -4929,67 +4922,6 @@ public CHVersion since() {
49294922
}
49304923
}
49314924

4932-
@api
4933-
@hide("Deprecated.")
4934-
public static class get_player_from_entity_id extends AbstractFunction implements Optimizable {
4935-
4936-
@Override
4937-
public Class<? extends CREThrowable>[] thrown() {
4938-
return new Class[]{CRECastException.class};
4939-
}
4940-
4941-
@Override
4942-
public boolean isRestricted() {
4943-
return true;
4944-
}
4945-
4946-
@Override
4947-
public Boolean runAsync() {
4948-
return false;
4949-
}
4950-
4951-
@Override
4952-
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
4953-
try {
4954-
return new CString(((MCPlayer) Static.getLivingEntity(args[0], t)).getName(), t);
4955-
} catch (Exception exception) {
4956-
return CNull.NULL;
4957-
}
4958-
}
4959-
4960-
@Override
4961-
public String getName() {
4962-
return "get_player_from_entity_id";
4963-
}
4964-
4965-
@Override
4966-
public Integer[] numArgs() {
4967-
return new Integer[]{1};
4968-
}
4969-
4970-
@Override
4971-
public String docs() {
4972-
return "string {entityID} Given an entity ID that represents a player, returns that player's name, or"
4973-
+ " null if the entity ID isn't a player's entity ID.";
4974-
}
4975-
4976-
@Override
4977-
public Version since() {
4978-
return CHVersion.V3_3_1;
4979-
}
4980-
4981-
@Override
4982-
public ParseTree optimizeDynamic(Target t, List<ParseTree> children, FileOptions fileOptions) throws ConfigCompileException, ConfigRuntimeException {
4983-
CHLog.GetLogger().w(CHLog.Tags.DEPRECATION, "The function get_player_from_entity_id() is deprecated. Use player().", t);
4984-
return null;
4985-
}
4986-
4987-
@Override
4988-
public Set<Optimizable.OptimizationOption> optimizationOptions() {
4989-
return EnumSet.of(Optimizable.OptimizationOption.OPTIMIZE_DYNAMIC);
4990-
}
4991-
}
4992-
49934925
@api
49944926
public static class save_players extends AbstractFunction {
49954927

0 commit comments

Comments
 (0)