From ca07a38eff44cfe56fcf1697dabe2d8092fbd127 Mon Sep 17 00:00:00 2001 From: StevenRS11 Date: Tue, 1 Oct 2013 16:20:07 -0400 Subject: [PATCH] Made respawning in limbo much less nice. Takes entrance coords and THEN adds the spawnFuzz. Its much closer to how it used to be. --- .../mod_pocketDim/EventHookContainer.java | 2 +- .../mod_pocketDim/ticking/MobMonolith.java | 15 +++++++-------- .../mod_pocketDim/world/LimboProvider.java | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/StevenDimDoors/mod_pocketDim/EventHookContainer.java b/StevenDimDoors/mod_pocketDim/EventHookContainer.java index 6191018c..40356067 100644 --- a/StevenDimDoors/mod_pocketDim/EventHookContainer.java +++ b/StevenDimDoors/mod_pocketDim/EventHookContainer.java @@ -79,7 +79,7 @@ public class EventHookContainer player.inventory.clearInventory(-1, -1); } ChunkCoordinates coords = LimboProvider.getLimboSkySpawn(player.worldObj.rand); - Point4D destination = new Point4D(coords.posX, coords.posY, coords.posZ, mod_pocketDim.properties.LimboDimensionID); + Point4D destination = new Point4D((int) (coords.posX+entity.posX), coords.posY, (int) (coords.posZ+entity.posZ ), mod_pocketDim.properties.LimboDimensionID); DDTeleporter.teleportEntity(player, destination, false); player.setEntityHealth(player.getMaxHealth()); event.setCanceled(true); diff --git a/StevenDimDoors/mod_pocketDim/ticking/MobMonolith.java b/StevenDimDoors/mod_pocketDim/ticking/MobMonolith.java index 221ebba8..928877f8 100644 --- a/StevenDimDoors/mod_pocketDim/ticking/MobMonolith.java +++ b/StevenDimDoors/mod_pocketDim/ticking/MobMonolith.java @@ -9,10 +9,12 @@ import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import StevenDimDoors.mod_pocketDim.DDProperties; +import StevenDimDoors.mod_pocketDim.mod_pocketDim; import StevenDimDoors.mod_pocketDim.core.DDTeleporter; import StevenDimDoors.mod_pocketDim.util.Point4D; import StevenDimDoors.mod_pocketDim.world.LimboProvider; @@ -145,14 +147,11 @@ public class MobMonolith extends EntityFlying implements IMob } else if (!this.worldObj.isRemote && !entityPlayer.capabilities.isCreativeMode) { - Point4D destination = new Point4D( - (int) this.posX + MathHelper.getRandomIntegerInRange(rand, -250, 250), - (int) this.posY + 500, - (int) this.posZ + MathHelper.getRandomIntegerInRange(rand, -250, 250), - properties.LimboDimensionID); - DDTeleporter.teleportEntity(entityPlayer, destination, false); - this.aggro = 0; - + ChunkCoordinates coords = LimboProvider.getLimboSkySpawn(entityPlayer.worldObj.rand); + Point4D destination = new Point4D((int) (coords.posX+entityPlayer.posX), coords.posY, (int) (coords.posZ+entityPlayer.posZ ), mod_pocketDim.properties.LimboDimensionID); + DDTeleporter.teleportEntity(entityPlayer, destination, false); + + this.aggro = 0; entityPlayer.worldObj.playSoundAtEntity(entityPlayer,"mods.DimDoors.sfx.crack",13, 1); } if (!(this.worldObj.provider instanceof LimboProvider || this.worldObj.getClosestPlayerToEntity(this, 5) != null) || this.aggro > 300) diff --git a/StevenDimDoors/mod_pocketDim/world/LimboProvider.java b/StevenDimDoors/mod_pocketDim/world/LimboProvider.java index 44d18435..c0d45144 100644 --- a/StevenDimDoors/mod_pocketDim/world/LimboProvider.java +++ b/StevenDimDoors/mod_pocketDim/world/LimboProvider.java @@ -170,7 +170,7 @@ public class LimboProvider extends WorldProvider ChunkCoordinates var5 = new ChunkCoordinates(0,0,0); - int spawnFuzz = 10000; + int spawnFuzz = 1000; int spawnFuzzHalf = spawnFuzz / 2; {