Fix projectile throwers, narslimmus seed

This commit is contained in:
Vincent Lee committed 2020-06-26 20:57:29 -05:00
1 parent f430df39f2
commit 9f8a646854
3 files changed
+7 -5

No files matched your search

@@ -19,6 +19,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld;
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
import net.minecraftforge.eventbus.api.Event;
import net.minecraftforge.registries.ObjectHolder;
@@ -102,7 +103,7 @@ public class SubTileNarslimmus extends TileEntityGeneratingFlower {
public static boolean isSlimeChunk(World world, BlockPos pos) {
ChunkPos chunkpos = new ChunkPos(pos);
return SharedSeedRandom.seedSlimeChunk(chunkpos.x, chunkpos.z, world.getSeed(), 987234911L).nextInt(10) == 0;
return SharedSeedRandom.seedSlimeChunk(chunkpos.x, chunkpos.z, ((ServerWorld) world).getSeed(), 987234911L).nextInt(10) == 0;
}
}
@@ -8,6 +8,7 @@
*/
package vazkii.botania.common.entity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
@@ -87,7 +88,7 @@ public class EntityBabylonWeapon extends EntityThrowableCopy {
@Override
public void tick() {
LivingEntity thrower = func_234616_v_();
Entity thrower = func_234616_v_();
if (!world.isRemote && (thrower == null || !(thrower instanceof PlayerEntity) || thrower.removed)) {
remove();
return;
@@ -175,7 +176,7 @@ public class EntityBabylonWeapon extends EntityThrowableCopy {
@Override
protected void onImpact(RayTraceResult pos) {
LivingEntity thrower = func_234616_v_();
Entity thrower = func_234616_v_();
if (pos.getType() != RayTraceResult.Type.ENTITY || ((EntityRayTraceResult) pos).getEntity() != thrower) {
world.createExplosion(this, getPosX(), getPosY(), getPosZ(), 3F, Explosion.Mode.NONE);
remove();
@@ -55,7 +55,7 @@ public class EntityFallingStar extends EntityThrowableCopy {
world.addParticle(data, getPosX() + xs, getPosY() + ys, getPosZ() + zs, 0, 0, 0);
}
LivingEntity thrower = func_234616_v_();
Entity thrower = func_234616_v_();
if (!world.isRemote && thrower != null) {
AxisAlignedBB axis = new AxisAlignedBB(getPosX(), getPosY(), getPosZ(), lastTickPosX, lastTickPosY, lastTickPosZ).grow(2);
List<LivingEntity> entities = world.getEntitiesWithinAABB(LivingEntity.class, axis);
@@ -82,7 +82,7 @@ public class EntityFallingStar extends EntityThrowableCopy {
return;
}
LivingEntity thrower = func_234616_v_();
Entity thrower = func_234616_v_();
if (pos.getType() == RayTraceResult.Type.ENTITY && thrower != null) {
Entity e = ((EntityRayTraceResult) pos).getEntity();
if (e != thrower && e.isAlive()) {