renewableBlackstone

This commit is contained in:
gnembon committed 2020-07-01 15:07:17 -03:00
1 parent c69f65e68e
commit 150c1d41a7
9 files changed
+69 -14

No files matched your search

@@ -25,7 +25,7 @@ public class WorldTools
if (region == null) return false;
return region.hasChunk(chpos);
}
Path regionPath = new File(((MinecraftServerInterface )world.getServer()).getCMSession().method_27424(world.getRegistryKey()), "region").toPath();
Path regionPath = new File(((MinecraftServerInterface )world.getServer()).getCMSession().getWorldDirectory(world.getRegistryKey()), "region").toPath();
Path regionFilePath = regionPath.resolve(currentRegionName);
File regionFile = regionFilePath.toFile();
if (!regionFile.exists())
@@ -31,7 +31,7 @@ import net.minecraft.entity.ai.goal.Goal;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.mob.MobEntityWithAi;
import net.minecraft.entity.mob.PathAwareEntity;
import net.minecraft.entity.passive.PassiveEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.CompoundTag;
@@ -281,7 +281,7 @@ public class EntityValue extends Value
put("home", (e, a) -> {
if (e instanceof MobEntity)
{
return (((MobEntity) e).getPositionTargetRange () > 0)?new BlockValue(null, (ServerWorld) e.getEntityWorld(), ((MobEntityWithAi) e).getPositionTarget()):Value.FALSE;
return (((MobEntity) e).getPositionTargetRange () > 0)?new BlockValue(null, (ServerWorld) e.getEntityWorld(), ((PathAwareEntity) e).getPositionTarget()):Value.FALSE;
}
return Value.NULL;
});
@@ -807,9 +807,9 @@ public class EntityValue extends Value
}
});
put("home", (e, v) -> {
if (!(e instanceof MobEntityWithAi))
if (!(e instanceof PathAwareEntity))
return;
MobEntityWithAi ec = (MobEntityWithAi)e;
PathAwareEntity ec = (PathAwareEntity)e;
if (v == null)
throw new InternalExpressionException("'home' requires at least one position argument, and optional distance, or null to cancel");
if (v instanceof NullValue)