fixed incorrect recognition of some NULL objects
This commit is contained in:
1 parent
9b35c19bea
commit
d5ebe5361c
4 files changed
+5
-6
No files matched your search
@@ -375,7 +375,7 @@ public class WorldAccess {
|
|||||||
if (lv.size() < locator.offset) throw new InternalExpressionException("'set_poi' requires the new poi type or null, after position argument");
|
if (lv.size() < locator.offset) throw new InternalExpressionException("'set_poi' requires the new poi type or null, after position argument");
|
||||||
Value poi = lv.get(locator.offset+0).evalValue(c);
|
Value poi = lv.get(locator.offset+0).evalValue(c);
|
||||||
PointOfInterestStorage store = cc.s.getWorld().getPointOfInterestStorage();
|
PointOfInterestStorage store = cc.s.getWorld().getPointOfInterestStorage();
|
||||||
if (poi == Value.NULL)
|
if (poi.isNull())
|
||||||
{ // clear poi information
|
{ // clear poi information
|
||||||
if (store.getType(pos).isPresent())
|
if (store.getType(pos).isPresent())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1113,7 +1113,7 @@ public class EntityValue extends Value
|
|||||||
put("breaking_progress", (e, a) -> {
|
put("breaking_progress", (e, a) -> {
|
||||||
if (e instanceof ServerPlayerEntity)
|
if (e instanceof ServerPlayerEntity)
|
||||||
{
|
{
|
||||||
int progress = (a == null || a == Value.NULL)?-1:NumericValue.asNumber(a).getInt();
|
int progress = (a == null || a.isNull())?-1:NumericValue.asNumber(a).getInt();
|
||||||
ServerPlayerInteractionManagerInterface manager = (ServerPlayerInteractionManagerInterface) (((ServerPlayerEntity) e).interactionManager);
|
ServerPlayerInteractionManagerInterface manager = (ServerPlayerInteractionManagerInterface) (((ServerPlayerEntity) e).interactionManager);
|
||||||
manager.setBlockBreakingProgress(progress);
|
manager.setBlockBreakingProgress(progress);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ public class ListValue extends AbstractListValue implements ContainerValueInterf
|
|||||||
|
|
||||||
private boolean put(Value ind, Value value, boolean replace, boolean extend)
|
private boolean put(Value ind, Value value, boolean replace, boolean extend)
|
||||||
{
|
{
|
||||||
if (ind == Value.NULL)
|
if (ind.isNull())
|
||||||
{
|
{
|
||||||
if (extend && value instanceof AbstractListValue)
|
if (extend && value instanceof AbstractListValue)
|
||||||
{
|
{
|
||||||
@@ -390,7 +390,6 @@ public class ListValue extends AbstractListValue implements ContainerValueInterf
|
|||||||
{
|
{
|
||||||
items.add(value);
|
items.add(value);
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -420,8 +419,8 @@ public class ListValue extends AbstractListValue implements ContainerValueInterf
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
items.add(index, value);
|
items.add(index, value);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class ValueConversions
|
|||||||
public static Value fromTimedMemory(Entity e, long expiry, Object v)
|
public static Value fromTimedMemory(Entity e, long expiry, Object v)
|
||||||
{
|
{
|
||||||
Value ret = fromEntityMemory(e, v);
|
Value ret = fromEntityMemory(e, v);
|
||||||
if (ret == Value.NULL || expiry == Long.MAX_VALUE) return ret;
|
if (ret.isNull() || expiry == Long.MAX_VALUE) return ret;
|
||||||
return ListValue.of(ret, new NumericValue(expiry));
|
return ListValue.of(ret, new NumericValue(expiry));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user