Skip to content

Commit 8e73bfb

Browse files
committed
Merge branch 'master' into genericsTake2
2 parents 7d53211 + 3eadef1 commit 8e73bfb

13 files changed

Lines changed: 245 additions & 246 deletions

deprecation.txt

1.41 MB
Binary file not shown.

src/main/java/com/laytonsmith/core/ObjectGenerator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ public MCItemMeta itemMeta(Mixed c, MCMaterial mat, Target t, Environment env) t
11421142
}
11431143

11441144
if(ma.containsKey("tags")) {
1145-
Mixed tagArray = ma.get("tags", t);
1145+
Mixed tagArray = ma.get("tags", t, env);
11461146
if(tagArray instanceof CNull) {
11471147
// no custom tags
11481148
} else {
@@ -1153,11 +1153,11 @@ public MCItemMeta itemMeta(Mixed c, MCMaterial mat, Target t, Environment env) t
11531153
if(Static.getServer().getMinecraftVersion().gte(MCVersion.MC1_20_6)) {
11541154
// Item data components
11551155
if(ma.containsKey("maxstacksize")) {
1156-
Mixed maxstacksize = ma.get("maxstacksize", t);
1156+
Mixed maxstacksize = ma.get("maxstacksize", t, env);
11571157
if(maxstacksize instanceof CNull) {
11581158
// not yet supported
11591159
} else {
1160-
meta.setMaxStackSize(ArgumentValidation.getInt32(maxstacksize, t));
1160+
meta.setMaxStackSize(ArgumentValidation.getInt32(maxstacksize, t, env));
11611161
}
11621162
}
11631163
if(ma.containsKey("glint")) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ public ParseTree optimizeDynamic(Target t, Environment env,
478478
for(int i = 0; i < children.size() - 1; i += 2) {
479479
ParseTree condNode = children.get(i);
480480
if(condNode.isConst()) {
481-
if(ArgumentValidation.getBooleanish(condNode.getData(), t)) {
481+
if(ArgumentValidation.getBooleanish(condNode.getData(), t, env)) {
482482

483483
// Optimize to true condition code block if no dynamic condition was present before this.
484484
if(!foundDynamicCond) {

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

Lines changed: 123 additions & 123 deletions
Large diffs are not rendered by default.

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -509,17 +509,17 @@ public Mixed exec(Target t, com.laytonsmith.core.environments.Environment env, G
509509
}
510510
}
511511
CArray ca = (CArray) args[args.length - 1];
512-
if(ca.size() >= 1) {
513-
line1 = ca.get(0, t).val();
512+
if(ca.size(env) >= 1) {
513+
line1 = ca.get(0, t, env).val();
514514
}
515-
if(ca.size() >= 2) {
516-
line2 = ca.get(1, t).val();
515+
if(ca.size(env) >= 2) {
516+
line2 = ca.get(1, t, env).val();
517517
}
518-
if(ca.size() >= 3) {
519-
line3 = ca.get(2, t).val();
518+
if(ca.size(env) >= 3) {
519+
line3 = ca.get(2, t, env).val();
520520
}
521-
if(ca.size() >= 4) {
522-
line4 = ca.get(3, t).val();
521+
if(ca.size(env) >= 4) {
522+
line4 = ca.get(3, t, env).val();
523523
}
524524

525525
} else {
@@ -813,7 +813,7 @@ public Mixed exec(Target t, com.laytonsmith.core.environments.Environment env, G
813813
throw new CREFormatException("Invalid sign side: " + args[1].val(), t);
814814
}
815815
}
816-
text.setGlowingText(ArgumentValidation.getBooleanObject(args[args.length - 1], t));
816+
text.setGlowingText(ArgumentValidation.getBooleanObject(args[args.length - 1], t, env));
817817
sign.update();
818818
return CVoid.VOID;
819819
} else {
@@ -928,7 +928,7 @@ public Mixed exec(Target t, com.laytonsmith.core.environments.Environment env, G
928928
throw new CRERangeException("The block at the specified location is not a sign", t);
929929
}
930930
MCSign sign = b.getSign();
931-
sign.setWaxed(ArgumentValidation.getBooleanObject(args[1], t));
931+
sign.setWaxed(ArgumentValidation.getBooleanObject(args[1], t, env));
932932
sign.update();
933933
return CVoid.VOID;
934934
}
@@ -1210,8 +1210,8 @@ public Mixed exec(Target t, com.laytonsmith.core.environments.Environment env, G
12101210
MCLocation location = ObjectGenerator.GetGenerator().location(args[0], w, t);
12111211
location.getWorld().setBiome(location, biomeType);
12121212
} else {
1213-
x = ArgumentValidation.getInt32(args[0], t);
1214-
z = ArgumentValidation.getInt32(args[1], t);
1213+
x = ArgumentValidation.getInt32(args[0], t, env);
1214+
z = ArgumentValidation.getInt32(args[1], t, env);
12151215
if(args.length == 4) {
12161216
w = Static.getServer().getWorld(args[2].val());
12171217
} else if(w == null) {
@@ -1855,7 +1855,7 @@ public Mixed exec(Target t, com.laytonsmith.core.environments.Environment env, G
18551855
}
18561856

18571857
if(sa.containsKey("seed") && Static.getServer().getMinecraftVersion().gte(MCVersion.MC1_20_2)) {
1858-
seed = ArgumentValidation.getInt(sa.get("seed", t), t);
1858+
seed = ArgumentValidation.getInt(sa.get("seed", t, env), t, env);
18591859
}
18601860

18611861
if(args.length == 3) {
@@ -2001,7 +2001,7 @@ public Mixed exec(Target t,
20012001

20022002
CArray sa = (CArray) args[1];
20032003

2004-
path = ArgumentValidation.getStringObject(sa.get("sound", t, env), t);
2004+
path = ArgumentValidation.getStringObject(sa.get("sound", t, env), t, env);
20052005

20062006
if(sa.containsKey("category")) {
20072007
try {
@@ -2020,7 +2020,7 @@ public Mixed exec(Target t,
20202020
}
20212021

20222022
if(Static.getServer().getMinecraftVersion().gte(MCVersion.MC1_20_2) && sa.containsKey("seed")) {
2023-
seed = ArgumentValidation.getInt(sa.get("seed", t), t);
2023+
seed = ArgumentValidation.getInt(sa.get("seed", t, env), t, env);
20242024
}
20252025

20262026
if(args.length == 3) {
@@ -3070,13 +3070,13 @@ public Mixed exec(Target t, com.laytonsmith.core.environments.Environment env, G
30703070
CArray p = ArgumentValidation.getArray(mp, t, env);
30713071
MCDyeColor color;
30723072
try {
3073-
color = MCDyeColor.valueOf(p.get("color", t).val());
3073+
color = MCDyeColor.valueOf(p.get("color", t, env).val());
30743074
} catch (IllegalArgumentException ex) {
30753075
throw new CREFormatException("Invalid color name", t);
30763076
}
30773077
MCPatternShape shape;
30783078
try {
3079-
shape = MCPatternShape.valueOf(p.get("shape", t).val());
3079+
shape = MCPatternShape.valueOf(p.get("shape", t, env).val());
30803080
} catch (IllegalArgumentException ex) {
30813081
throw new CREFormatException("Invalid shape name", t);
30823082
}
@@ -3272,10 +3272,10 @@ public Mixed exec(Target t, com.laytonsmith.core.environments.Environment env, G
32723272
MCLocation loc = ObjectGenerator.GetGenerator().location(args[0], null, t);
32733273
MCBlockState bs = loc.getBlock().getState();
32743274
if(bs instanceof MCDecoratedPot decoratedPot) {
3275-
CArray sherds = CArray.GetAssociativeArray(t);
3275+
CArray sherds = CArray.GetAssociativeArray(t, null, env);
32763276
Map<MCDecoratedPot.Side, MCMaterial> potSherds = decoratedPot.getSherds();
32773277
for(Map.Entry<MCDecoratedPot.Side, MCMaterial> side : potSherds.entrySet()) {
3278-
sherds.set(side.getKey().name().toLowerCase(), side.getValue().name());
3278+
sherds.set(side.getKey().name().toLowerCase(), side.getValue().name(), env);
32793279
}
32803280
return sherds;
32813281
} else {
@@ -3345,7 +3345,7 @@ public Mixed exec(Target t, com.laytonsmith.core.environments.Environment env, G
33453345
throw new CREFormatException("Invalid decorated pot side: " + key, t);
33463346
}
33473347
try {
3348-
decoratedPot.setSherd(side, MCMaterial.valueOf(sherdArray.get(key, t).val()));
3348+
decoratedPot.setSherd(side, MCMaterial.valueOf(sherdArray.get(key, t, env).val()));
33493349
} catch (IllegalArgumentException ex) {
33503350
throw new CREFormatException(ex.getMessage(), t);
33513351
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2954,7 +2954,7 @@ static MCInventory GetInventory(Mixed specifier, MCWorld w, Target t, Environmen
29542954

29552955
private static MCInventory GetInventoryOrNull(Mixed specifier, MCWorld w, Target t, Environment env) {
29562956
if(specifier.isInstanceOf(CArray.TYPE, null, env)) {
2957-
MCLocation l = ObjectGenerator.GetGenerator().location(specifier, w, t);
2957+
MCLocation l = ObjectGenerator.GetGenerator().location(specifier, w, t, env);
29582958
return StaticLayer.GetConvertor().GetLocationInventory(l);
29592959
}
29602960
if(specifier.val().length() == 36 || specifier.val().length() == 32) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ public Mixed exec(Target t, Environment env, GenericParameters generics, Mixed..
14741474
MCCommandSender sender;
14751475
String selector;
14761476
if(args.length == 2) {
1477-
sender = Static.GetPlayer(args[0], t);
1477+
sender = Static.GetPlayer(args[0], t, env);
14781478
selector = args[1].val();
14791479
} else {
14801480
sender = env.getEnv(CommandHelperEnvironment.class).GetCommandSender();
@@ -1486,7 +1486,7 @@ public Mixed exec(Target t, Environment env, GenericParameters generics, Mixed..
14861486
try {
14871487
CArray result = new CArray(t);
14881488
for(UUID id : Static.getServer().selectEntites(sender, selector)) {
1489-
result.push(new CString(id.toString(), t), t);
1489+
result.push(new CString(id.toString(), t), t, env);
14901490
}
14911491
return result;
14921492
} catch(IllegalArgumentException ex) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ public Class<? extends CREThrowable>[] thrown() {
536536
@Override
537537
public Mixed exec(Target t, Environment env, GenericParameters generics, Mixed... args) throws ConfigRuntimeException {
538538
MCLivingEntity ent = Static.getLivingEntity(args[0], t);
539-
int ticks = ArgumentValidation.getInt32(args[1], t);
539+
int ticks = ArgumentValidation.getInt32(args[1], t, env);
540540
if(ent instanceof MCAnimal animal) {
541541
animal.setLoveTicks(ticks);
542542
return CVoid.VOID;

0 commit comments

Comments
 (0)