Made the Ancient Staff only usable when it isn't depleted, gave the Promised Lands a movement ratio of 13 and made the Ancient Staff usable in the Promised Lands

This commit is contained in:
Adubbz 2013-06-01 10:29:37 +10:00
parent 6ec571a273
commit 8822e26200
2 changed files with 31 additions and 17 deletions

View file

@ -83,31 +83,38 @@ public class ItemBOPAncientStaff extends Item
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (par3EntityPlayer.dimension == 0)
int i = MathHelper.floor_double(par3EntityPlayer.posX - 8);
int j = 145;
int k = MathHelper.floor_double(par3EntityPlayer.posZ - 8);
boolean isAir = true;
for (int iy = -1; iy < 4; iy++)
{
int i = MathHelper.floor_double(par3EntityPlayer.posX - 8);
int j = 145;
int k = MathHelper.floor_double(par3EntityPlayer.posZ - 8);
boolean isAir = true;
for (int iy = -1; iy < 4; iy++)
{
for (int ix = -2; ix < 3; ix++) {
for (int iz = -2; iz < 3; iz++)
if (!par2World.isAirBlock(i + ix, j + iy, k + iz))
{
isAir = false;
}
}
for (int ix = -2; ix < 3; ix++) {
for (int iz = -2; iz < 3; iz++)
if (!par2World.isAirBlock(i + ix, j + iy, k + iz))
{
isAir = false;
}
}
}
if (par1ItemStack.getItemDamage() == 0)
{
if (isAir)
{
if (!par3EntityPlayer.worldObj.isRemote)
{
par3EntityPlayer.addChatMessage("A gateway to the Promised Land has appeared in the sky above.");
if (par3EntityPlayer.dimension == 0)
{
par3EntityPlayer.addChatMessage("A gateway to the Promised Land has appeared in the sky above.");
}
else
{
par3EntityPlayer.addChatMessage("A gateway has appeared in the sky above.");
}
}

View file

@ -4,6 +4,7 @@ import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.WorldProviderHell;
import net.minecraft.world.chunk.IChunkProvider;
import biomesoplenty.api.Biomes;
import biomesoplenty.api.Blocks;
@ -36,6 +37,12 @@ public class WorldProviderPromised extends WorldProvider
{
return false;
}
@Override
public double getMovementFactor()
{
return 16.0;
}
@Override
public float calculateCelestialAngle(long par1, float par3)