Merge branch 'master' into 1.15
This commit is contained in:
commit
813cb2ab93
13 files changed
+105
-106
No files matched your search
@@ -10,6 +10,6 @@ public abstract class AbstractListValue extends Value
|
||||
public void fatality() { }
|
||||
public void append(Value v)
|
||||
{
|
||||
throw new InternalExpressionException("Cannot append a value to abstract list");
|
||||
throw new InternalExpressionException("Cannot append a value to an abstract list");
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,7 @@ public class BlockValue extends Value
|
||||
blockState = world.getBlockState(pos);
|
||||
return blockState;
|
||||
}
|
||||
throw new InternalExpressionException("Attemted to fetch blockstate without world or stored blockstate");
|
||||
throw new InternalExpressionException("Attempted to fetch block state without world or stored block state");
|
||||
}
|
||||
|
||||
public CompoundTag getData()
|
||||
|
||||
@@ -164,7 +164,7 @@ public class EntityValue extends Value
|
||||
public Value get(String what, Value arg)
|
||||
{
|
||||
if (!(featureAccessors.containsKey(what)))
|
||||
throw new InternalExpressionException("unknown feature of entity: "+what);
|
||||
throw new InternalExpressionException("Unknown entity feature: "+what);
|
||||
return featureAccessors.get(what).apply(entity, arg);
|
||||
}
|
||||
private static Map<String, EquipmentSlot> inventorySlots = new HashMap<String, EquipmentSlot>(){{
|
||||
@@ -331,7 +331,7 @@ public class EntityValue extends Value
|
||||
if (a != null)
|
||||
index = (6+(int)NumericValue.asNumber(a).getLong())%6;
|
||||
if (index < 0 || index > 5)
|
||||
throw new InternalExpressionException("facing order should be between -6 and 5");
|
||||
throw new InternalExpressionException("Facing order should be between -6 and 5");
|
||||
|
||||
return new StringValue(Direction.getEntityFacingOrder(e)[index].asString());
|
||||
});
|
||||
@@ -352,7 +352,7 @@ public class EntityValue extends Value
|
||||
{
|
||||
List<Value> args = ((ListValue) a).getItems();
|
||||
if (args.size()==0)
|
||||
throw new InternalExpressionException("trace needs more arguments");
|
||||
throw new InternalExpressionException("'trace' needs more arguments");
|
||||
reach = (float) NumericValue.asNumber(args.get(0)).getDouble();
|
||||
if (args.size() > 1)
|
||||
{
|
||||
@@ -415,7 +415,7 @@ public class EntityValue extends Value
|
||||
public void set(String what, Value toWhat)
|
||||
{
|
||||
if (!(featureModifiers.containsKey(what)))
|
||||
throw new InternalExpressionException("unknown action on entity: " + what);
|
||||
throw new InternalExpressionException("Unknown entity action: " + what);
|
||||
featureModifiers.get(what).accept(entity, toWhat);
|
||||
}
|
||||
|
||||
@@ -443,7 +443,7 @@ public class EntityValue extends Value
|
||||
{
|
||||
if (!(v instanceof ListValue))
|
||||
{
|
||||
throw new InternalExpressionException("expected a list of 5 parameters as second argument");
|
||||
throw new InternalExpressionException("Expected a list of 5 parameters as a second argument");
|
||||
}
|
||||
List<Value> coords = ((ListValue) v).getItems();
|
||||
e.pitch = (float) NumericValue.asNumber(coords.get(4)).getDouble();
|
||||
@@ -461,7 +461,7 @@ public class EntityValue extends Value
|
||||
{
|
||||
if (!(v instanceof ListValue))
|
||||
{
|
||||
throw new InternalExpressionException("expected a list of 3 parameters as second argument");
|
||||
throw new InternalExpressionException("Expected a list of 3 parameters as a second argument");
|
||||
}
|
||||
List<Value> coords = ((ListValue) v).getItems();
|
||||
e.setPosition(
|
||||
@@ -509,7 +509,7 @@ public class EntityValue extends Value
|
||||
{
|
||||
if (!(v instanceof ListValue))
|
||||
{
|
||||
throw new InternalExpressionException("expected a list of 3 parameters as second argument");
|
||||
throw new InternalExpressionException("Expected a list of 3 parameters as a second argument");
|
||||
}
|
||||
List<Value> coords = ((ListValue) v).getItems();
|
||||
e.setPosition(NumericValue.asNumber(coords.get(0)).getDouble(),NumericValue.asNumber(coords.get(1)).getDouble(), NumericValue.asNumber(coords.get(2)).getDouble());
|
||||
@@ -520,7 +520,7 @@ public class EntityValue extends Value
|
||||
{
|
||||
if (!(v instanceof ListValue))
|
||||
{
|
||||
throw new InternalExpressionException("expected a list of 3 parameters as second argument");
|
||||
throw new InternalExpressionException("Expected a list of 3 parameters as a second argument");
|
||||
}
|
||||
List<Value> coords = ((ListValue) v).getItems();
|
||||
e.setVelocity(
|
||||
@@ -553,7 +553,7 @@ public class EntityValue extends Value
|
||||
{
|
||||
if (!(v instanceof ListValue))
|
||||
{
|
||||
throw new InternalExpressionException("expected a list of 3 parameters as second argument");
|
||||
throw new InternalExpressionException("Expected a list of 3 parameters as a second argument");
|
||||
}
|
||||
List<Value> coords = ((ListValue) v).getItems();
|
||||
e.addVelocity(
|
||||
@@ -589,7 +589,7 @@ public class EntityValue extends Value
|
||||
put("drop_passengers", (e, v) -> e.removeAllPassengers());
|
||||
put("mount_passengers", (e, v) -> {
|
||||
if (v==null)
|
||||
throw new InternalExpressionException("mount_passengers needs entities to ride");
|
||||
throw new InternalExpressionException("'mount_passengers' needs entities to ride");
|
||||
if (v instanceof EntityValue)
|
||||
((EntityValue) v).getEntity().startRiding(e);
|
||||
else if (v instanceof ListValue)
|
||||
@@ -599,7 +599,7 @@ public class EntityValue extends Value
|
||||
});
|
||||
put("tag", (e, v) -> {
|
||||
if (v==null)
|
||||
throw new InternalExpressionException("tag requires parameters");
|
||||
throw new InternalExpressionException("'tag' requires parameters");
|
||||
if (v instanceof ListValue)
|
||||
for (Value element : ((ListValue) v).getItems()) e.addScoreboardTag(element.getString());
|
||||
else
|
||||
@@ -607,7 +607,7 @@ public class EntityValue extends Value
|
||||
});
|
||||
put("clear_tag", (e, v) -> {
|
||||
if (v==null)
|
||||
throw new InternalExpressionException("clear_tag requires parameters");
|
||||
throw new InternalExpressionException("'clear_tag' requires parameters");
|
||||
if (v instanceof ListValue)
|
||||
for (Value element : ((ListValue) v).getItems()) e.removeScoreboardTag(element.getString());
|
||||
else
|
||||
@@ -633,7 +633,7 @@ public class EntityValue extends Value
|
||||
return;
|
||||
MobEntityWithAi ec = (MobEntityWithAi)e;
|
||||
if (v == null)
|
||||
throw new InternalExpressionException("home requires at least one position argument, and optional distance, or null to cancel");
|
||||
throw new InternalExpressionException("'home' requires at least one position argument, and optional distance, or null to cancel");
|
||||
if (v instanceof NullValue)
|
||||
{
|
||||
ec.setPositionTarget(BlockPos.ORIGIN, -1);
|
||||
@@ -649,7 +649,7 @@ public class EntityValue extends Value
|
||||
if (v instanceof BlockValue)
|
||||
{
|
||||
pos = ((BlockValue) v).getPos();
|
||||
if (pos == null) throw new InternalExpressionException("block is not positioned in the world");
|
||||
if (pos == null) throw new InternalExpressionException("Block is not positioned in the world");
|
||||
}
|
||||
else if (v instanceof ListValue)
|
||||
{
|
||||
@@ -672,10 +672,10 @@ public class EntityValue extends Value
|
||||
distance = (int) NumericValue.asNumber(lv.get(4)).getLong();
|
||||
}
|
||||
}
|
||||
else throw new InternalExpressionException("home requires at least one position argument, and optional distance");
|
||||
else throw new InternalExpressionException("'home' requires at least one position argument, and optional distance");
|
||||
|
||||
}
|
||||
else throw new InternalExpressionException("home requires at least one position argument, and optional distance");
|
||||
else throw new InternalExpressionException("'home' requires at least one position argument, and optional distance");
|
||||
|
||||
ec.setPositionTarget(pos, distance);
|
||||
Map<String,Goal> tasks = ((MobEntityInterface)ec).getTemporaryTasks();
|
||||
@@ -716,7 +716,7 @@ public class EntityValue extends Value
|
||||
public void setEvent(CarpetContext cc, String event, String fun, List<Value> args)
|
||||
{
|
||||
if (!(events.containsKey(event)))
|
||||
throw new InternalExpressionException("unknown entity event: " + event);
|
||||
throw new InternalExpressionException("Unknown entity event: " + event);
|
||||
events.get(event).accept(cc, entity, fun, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,6 @@ public class GlobalValue extends Value
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
throw new UnsupportedOperationException("global value cannot be used as map key");
|
||||
throw new UnsupportedOperationException("Global value cannot be used as a map key");
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ public abstract class LazyListValue extends AbstractListValue implements Iterato
|
||||
{
|
||||
{
|
||||
if (step == 0)
|
||||
throw new InternalExpressionException("range will never end with zero step");
|
||||
throw new InternalExpressionException("Range will never end with a zero step");
|
||||
this.start = from;
|
||||
this.current = this.start;
|
||||
this.limit = to;
|
||||
@@ -141,7 +141,7 @@ public abstract class LazyListValue extends AbstractListValue implements Iterato
|
||||
}
|
||||
catch (CloneNotSupportedException e)
|
||||
{
|
||||
throw new InternalExpressionException("cannot copy iterator");
|
||||
throw new InternalExpressionException("Cannot copy iterators");
|
||||
}
|
||||
((LazyListValue)copy).reset();
|
||||
return copy;
|
||||
|
||||
@@ -312,7 +312,7 @@ public class ListValue extends AbstractListValue implements ContainerValueInterf
|
||||
return put(where, value, false, true);
|
||||
if (condition.equalsIgnoreCase("replace"))
|
||||
return put(where, value, true, false);
|
||||
throw new InternalExpressionException("list put modifier could be either insert, or replace");
|
||||
throw new InternalExpressionException("List 'put' modifier could be either 'insert', or 'replace'");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -71,25 +71,25 @@ public class MapValue extends AbstractListValue implements ContainerValueInterfa
|
||||
@Override
|
||||
public Value add(Value o)
|
||||
{
|
||||
throw new InternalExpressionException("cannot add to a map value");
|
||||
throw new InternalExpressionException("Cannot add to a map value");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Value subtract(Value v)
|
||||
{
|
||||
throw new InternalExpressionException("cannot subtract to a map value");
|
||||
throw new InternalExpressionException("Cannot subtract from a map value");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Value multiply(Value v)
|
||||
{
|
||||
throw new InternalExpressionException("cannot multiply to a map value");
|
||||
throw new InternalExpressionException("Cannot multiply with a map value");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Value divide(Value v)
|
||||
{
|
||||
throw new InternalExpressionException("cannot divide to a map value");
|
||||
throw new InternalExpressionException("Cannot divide a map value");
|
||||
}
|
||||
|
||||
public void put(Value v)
|
||||
@@ -102,7 +102,7 @@ public class MapValue extends AbstractListValue implements ContainerValueInterfa
|
||||
ListValue pair = (ListValue)v;
|
||||
if (pair.getItems().size() != 2)
|
||||
{
|
||||
throw new InternalExpressionException("map constructor requires elements that have two elements");
|
||||
throw new InternalExpressionException("Map constructor requires elements that have two items");
|
||||
}
|
||||
map.put(pair.getItems().get(0), pair.getItems().get(1));
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public class MapValue extends AbstractListValue implements ContainerValueInterfa
|
||||
@Override
|
||||
public int compareTo(Value o)
|
||||
{
|
||||
throw new InternalExpressionException("cannot compare to a map value");
|
||||
throw new InternalExpressionException("Cannot compare with a map value");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -155,7 +155,7 @@ public class MapValue extends AbstractListValue implements ContainerValueInterfa
|
||||
@Override
|
||||
public Value slice(long from, long to)
|
||||
{
|
||||
throw new InternalExpressionException("cannot slice a map value");
|
||||
throw new InternalExpressionException("Cannot slice a map value");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,7 +50,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
|
||||
}
|
||||
catch (CommandSyntaxException e)
|
||||
{
|
||||
throw new InternalExpressionException("Incorrect nbt data: "+nbtString);
|
||||
throw new InternalExpressionException("Incorrect NBT data: "+nbtString);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user