当前位置: 首页>>代码示例>>Java>>正文


Java Vector3类代码示例

本文整理汇总了Java中micdoodle8.mods.galacticraft.api.vector.Vector3的典型用法代码示例。如果您正苦于以下问题:Java Vector3类的具体用法?Java Vector3怎么用?Java Vector3使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Vector3类属于micdoodle8.mods.galacticraft.api.vector包,在下文中一共展示了Vector3类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleTileEntities

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
@Override
protected void handleTileEntities(Random rand)
{
    if (this.spawnerCoords == null)
    {
        return;
    }

    this.worldObj.setBlock(this.spawnerCoords.posX, this.spawnerCoords.posY, this.spawnerCoords.posZ, MarsBlocks.marsBlock, 10, 3);

    final TileEntity tile = this.worldObj.getTileEntity(this.spawnerCoords.posX, this.spawnerCoords.posY, this.spawnerCoords.posZ);

    if (tile == null || !(tile instanceof TileEntityDungeonSpawnerMars))
    {
        TileEntityDungeonSpawner spawner = new TileEntityDungeonSpawnerMars();
        spawner.setRoom(new Vector3(this.posX, this.posY, this.posZ), new Vector3(this.sizeX, this.sizeY, this.sizeZ));
        this.worldObj.setTileEntity(this.spawnerCoords.posX, this.spawnerCoords.posY, this.spawnerCoords.posZ, spawner);
    }
    else if (tile instanceof TileEntityDungeonSpawner)
    {
        ((TileEntityDungeonSpawner) tile).setRoom(new Vector3(this.posX, this.posY, this.posZ), new Vector3(this.sizeX, this.sizeY, this.sizeZ));
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:24,代码来源:RoomBossMars.java

示例2: randomDisplayTick

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
@Override
  @SideOnly(Side.CLIENT)
  public void randomDisplayTick(World world, int x, int y, int z, Random rand)
  {
      super.randomDisplayTick(world, x, y, z, rand);

      if (rand.nextInt(1200) == 0)
      {
          world.playSound(x + 0.5F, y + 0.5F, z + 0.5F, "liquid.lava", rand.nextFloat() * 0.25F + 0.75F, 0.00001F + rand.nextFloat() * 0.5F, false);
      }
if (rand.nextInt(10) == 0)
{
	if (World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) && !world.getBlock(x, y - 2, z).getMaterial().blocksMovement())
	{
		GalacticraftPlanets.spawnParticle("bacterialDrip", new Vector3(x + rand.nextFloat(), y - 1.05D, z + rand.nextFloat()), new Vector3(0, 0, 0));
	}
}
  }
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:BlockSludge.java

示例3: updateTeamColor

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
public static Vector3 updateTeamColor(String playerName, boolean sendPacket)
{
    SpaceRace race = SpaceRaceManager.getSpaceRaceFromPlayer(playerName);

    if (race != null)
    {
        return race.getTeamColor();
    }
    else if (!ClientProxyCore.flagRequestsSent.contains(playerName) && sendPacket)
    {
        GalacticraftCore.packetPipeline.sendToServer(new PacketSimple(EnumSimplePacket.S_REQUEST_FLAG_DATA, new Object[] { playerName }));
        ClientProxyCore.flagRequestsSent.add(playerName);
    }

    return new Vector3(1, 1, 1);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:17,代码来源:ClientUtil.java

示例4: addColorsRealistically

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
public static Vector3 addColorsRealistically(Vector3 color1, Vector3 color2)
{
    double hue1 = ColorUtil.rgb_to_hue(color1);
    double hue2 = ColorUtil.rgb_to_hue(color2);
    if (hue1 - hue2 > 180D)
    {
        hue2 += 360D;
    }
    if (hue2 - hue1 > 180D)
    {
        hue1 += 360D;
    }
    double hueresult = (hue1 + hue2) / 2;
    if (hueresult > 360D)
    {
        hueresult -= 360D;
    }
    //TODO: if hue1 and hue2 differ by close to 180degrees, add in some 'mud' color
    //TODO: add greyscale here

    return ColorUtil.hue_to_rgb(hueresult).scale(1 / 255D);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:23,代码来源:ColorUtil.java

示例5: onUsingTick

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
@Override
public void onUsingTick(ItemStack stack, EntityPlayer player, int count)
{
    Vector3 blockHit = this.getNearestOilBlock(player);

    if (blockHit != null)
    {
        final int x = MathHelper.floor_double(blockHit.x);
        final int y = MathHelper.floor_double(blockHit.y);
        final int z = MathHelper.floor_double(blockHit.z);

        if (this.isOilBlock(player, player.worldObj, x, y, z, false))
        {
            if (this.openCanister(player) != null)
            {
                final ItemStack canister = this.openCanister(player);

                if (canister != null && count % 5 == 0 && canister.getItemDamage() > 1)
                {
                    this.isOilBlock(player, player.worldObj, x, y, z, true);
                    canister.setItemDamage(Math.max(canister.getItemDamage() - 200, 1));
                }
            }
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:27,代码来源:ItemOilExtractor.java

示例6: handleTileEntities

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
@Override
protected void handleTileEntities(Random rand)
{
    if (this.spawnerCoords == null)
    {
        return;
    }

    this.worldObj.setBlock(this.spawnerCoords.posX, this.spawnerCoords.posY, this.spawnerCoords.posZ, GCBlocks.blockMoon, 15, 3);

    final TileEntity tile = this.worldObj.getTileEntity(this.spawnerCoords.posX, this.spawnerCoords.posY, this.spawnerCoords.posZ);

    if (tile == null || !(tile instanceof TileEntityDungeonSpawner))
    {
        TileEntityDungeonSpawner spawner = new TileEntityDungeonSpawner();
        spawner.setRoom(new Vector3(this.posX, this.posY, this.posZ), new Vector3(this.sizeX, this.sizeY, this.sizeZ));
        this.worldObj.setTileEntity(this.spawnerCoords.posX, this.spawnerCoords.posY, this.spawnerCoords.posZ, spawner);
    }
    else if (tile instanceof TileEntityDungeonSpawner)
    {
        ((TileEntityDungeonSpawner) tile).setRoom(new Vector3(this.posX, this.posY, this.posZ), new Vector3(this.sizeX, this.sizeY, this.sizeZ));
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:24,代码来源:RoomBossMoon.java

示例7: colorMultiplier

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
@Override
public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
    TileEntity tile = par1IBlockAccess.getTileEntity(par2, par3, par4);

    if (tile instanceof TileEntityFallenMeteor)
    {
        TileEntityFallenMeteor meteor = (TileEntityFallenMeteor) tile;

        Vector3 col = new Vector3(198, 108, 58);
        col.translate(200 - meteor.getScaledHeatLevel() * 200);
        col.x = Math.min(255, col.x);
        col.y = Math.min(255, col.y);
        col.z = Math.min(255, col.z);

        return ColorUtil.to32BitColor(255, (byte) col.x, (byte) col.y, (byte) col.z);
    }

    return super.colorMultiplier(par1IBlockAccess, par2, par3, par4);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:21,代码来源:BlockFallenMeteor.java

示例8: randomDisplayTick

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
@Override
  @SideOnly(Side.CLIENT)
  public void randomDisplayTick(World world, int x, int y, int z, Random rand)
  {
      super.randomDisplayTick(world, x, y, z, rand);

      if (this.fluidName.startsWith("oil") && rand.nextInt(1200) == 0)
      {
          world.playSound(x + 0.5F, y + 0.5F, z + 0.5F, "liquid.lava", rand.nextFloat() * 0.25F + 0.75F, 0.00001F + rand.nextFloat() * 0.5F, false);
      }
if (this.fluidName.equals("oil") && rand.nextInt(10) == 0)
{
	if (World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) && !world.getBlock(x, y - 2, z).getMaterial().blocksMovement())
	{
		GalacticraftCore.proxy.spawnParticle("oilDrip", new Vector3(x + rand.nextFloat(), y - 1.05D, z + rand.nextFloat()), new Vector3(0, 0, 0), new Object[] {});
	}
}
  }
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:BlockFluidGC.java

示例9: modifyPositionFromSide

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
public Vector3 modifyPositionFromSide(Vector3 vec, ForgeDirection side, double amount)
{
    switch (side.ordinal())
    {
    case 0:
        vec.y -= amount;
        break;
    case 1:
        vec.y += amount;
        break;
    case 2:
        vec.z -= amount;
        break;
    case 3:
        vec.z += amount;
        break;
    case 4:
        vec.x -= amount;
        break;
    case 5:
        vec.x += amount;
        break;
    }
    return vec;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:26,代码来源:BlockAirLockFrame.java

示例10: hue_to_rgb

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
private static Vector3 hue_to_rgb(double deg)
{
    deg = deg % 360;

    double previous_angle = colorwheelAngles[1];

    for (int i = 2; i < colorwheelAngles.length - 2; i++)
    {
        Double angle = colorwheelAngles[i];
        if (deg <= angle)
        {
            return interpolateInArray(colorwheelColors, i, (angle - deg) / (angle - previous_angle));
        }
        previous_angle = angle;
    }

    return null;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:ColorUtil.java

示例11: EntityFXSmokeSmall

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
public EntityFXSmokeSmall(World par1World, Vector3 position, Vector3 motion)
{
    super(par1World, position.x, position.y, position.z, 0.0D, 0.0D, 0.0D);
    this.motionX *= 0.01D;
    this.motionY *= 0.01D;
    this.motionZ *= 0.01D;
    this.setSize(0.05F, 0.05F);
    this.motionX += motion.x;
    this.motionY += motion.y;
    this.motionZ += motion.z;
    this.particleAlpha = 0.8F;
    this.particleRed = this.particleGreen = this.particleBlue = (float) (Math.random() * 0.2D) + 0.7F;
    this.particleScale *= 0.3F;
    this.smokeParticleScale = this.particleScale;
    this.particleMaxAge = 110;
    this.noClip = false;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:18,代码来源:EntityFXSmokeSmall.java

示例12: EntityFXEntityOxygen

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
public EntityFXEntityOxygen(World par1World, Vector3 position, Vector3 motion, Vector3 color)
{
    super(par1World, position.x, position.y, position.z, motion.x, motion.y, motion.z);
    this.motionX = motion.x;
    this.motionY = motion.y;
    this.motionZ = motion.z;
    this.portalPosX = this.posX = position.x;
    this.portalPosY = this.posY = position.y;
    this.portalPosZ = this.posZ = position.z;
    this.portalParticleScale = this.particleScale = 0.1F;
    this.particleRed = color.floatX();
    this.particleGreen = color.floatY();
    this.particleBlue = color.floatZ();
    this.particleMaxAge = (int) (Math.random() * 10.0D) + 40;
    this.noClip = true;
    this.setParticleTextureIndex((int) (Math.random() * 8.0D));
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:18,代码来源:EntityFXEntityOxygen.java

示例13: EntityFXLaunchFlame

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
public EntityFXLaunchFlame(World par1World, Vector3 position, Vector3 motion, boolean launched, EntityLivingBase ridingEntity)
{
    super(par1World, position.x, position.y, position.z, 0.0D, 0.0D, 0.0D);
    this.motionX *= 0.10000000149011612D;
    this.motionY *= 0.10000000149011612D;
    this.motionZ *= 0.10000000149011612D;
    this.motionX += motion.x;
    this.motionY += motion.y;
    this.motionZ += motion.z;
    this.particleRed = 255F / 255F;
    this.particleGreen = 120F / 255F + this.rand.nextFloat() / 3;
    this.particleBlue = 55F / 255F;
    this.particleScale *= 2F;
    this.particleScale *= 1F * 2;
    this.smokeParticleScale = this.particleScale;
    this.particleMaxAge = (int) (this.particleMaxAge * 1F);
    this.noClip = false;
    this.spawnSmokeShort = launched;
    this.ridingEntity = ridingEntity;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:21,代码来源:EntityFXLaunchFlame.java

示例14: setColorWithBrushSize

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
private void setColorWithBrushSize(int unScaledX, int unScaledY, Vector3 color, int brushSize)
{
    for (int x = unScaledX - brushSize + 1; x < unScaledX + brushSize; x++)
    {
        for (int y = unScaledY - brushSize + 1; y < unScaledY + brushSize; y++)
        {
            if (x >= 0 && x < this.spaceRaceData.getFlagData().getWidth() && y >= 0 && y < this.spaceRaceData.getFlagData().getHeight())
            {
                float relativeX = x + 0.5F - (unScaledX + 0.5F);
                float relativeY = y + 0.5F - (unScaledY + 0.5F);

                if (Math.sqrt(relativeX * relativeX + relativeY * relativeY) <= brushSize)
                {
                    this.setColor(x, y, color);
                }
            }
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:20,代码来源:GuiNewSpaceRace.java

示例15: GuiJoinSpaceRace

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
public GuiJoinSpaceRace(EntityClientPlayerMP player)
{
    this.thePlayer = player;
    GCPlayerStatsClient stats = GCPlayerStatsClient.get(player);

    SpaceRace race = SpaceRaceManager.getSpaceRaceFromID(stats.spaceRaceInviteTeamID);

    if (race != null)
    {
        this.spaceRaceData = race;
    }
    else
    {
        List<String> playerList = new ArrayList<String>();
        playerList.add(player.getGameProfile().getName());
        this.spaceRaceData = new SpaceRace(playerList, SpaceRace.DEFAULT_NAME, new FlagData(48, 32), new Vector3(1, 1, 1));
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:GuiJoinSpaceRace.java


注:本文中的micdoodle8.mods.galacticraft.api.vector.Vector3类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。