• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Vector3类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: onPlayerRemoval

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
public static void onPlayerRemoval(String player, SpaceRace race)
{
    for (String member : race.getPlayerNames())
    {
        EntityPlayerMP memberObj = PlayerUtil.getPlayerForUsernameVanilla(MinecraftServer.getServer(), member);

        if (memberObj != null)
        {
            memberObj.addChatMessage(new ChatComponentText(EnumColor.DARK_AQUA + GCCoreUtil.translateWithFormat("gui.spaceRace.chat.removeSuccess", EnumColor.RED + player + EnumColor.DARK_AQUA)).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_AQUA)));
        }
    }

    List<String> playerList = new ArrayList<String>();
    playerList.add(player);
    SpaceRace newRace = SpaceRaceManager.addSpaceRace(new SpaceRace(playerList, SpaceRace.DEFAULT_NAME, new FlagData(48, 32), new Vector3(1, 1, 1)));
    EntityPlayerMP playerToRemove = PlayerUtil.getPlayerBaseServerFromPlayerUsername(player, true);

    if (playerToRemove != null)
    {
        SpaceRaceManager.sendSpaceRaceData(playerToRemove, newRace);
        SpaceRaceManager.sendSpaceRaceData(playerToRemove, race);
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:24,代码来源:SpaceRaceManager.java


示例17: getPlayerSpawnLocation

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
@Override
public Vector3 getPlayerSpawnLocation(WorldServer world, EntityPlayerMP player)
{
    if (player != null)
    {
        GCPlayerStats stats = GCPlayerStats.get(player);
        return new Vector3(stats.coordsTeleportedFromX, ConfigManagerCore.disableLander ? 250.0 : 900.0, stats.coordsTeleportedFromZ);
    }

    return null;
}
 
开发者ID:BlesseNtumble,项目名称:TRAPPIST-1,代码行数:12,代码来源:TeleportTypeTrappistOneB.java


示例18: getParaChestSpawnLocation

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
@Override
public Vector3 getParaChestSpawnLocation(WorldServer world, EntityPlayerMP player, Random rand)
{
	if (ConfigManagerCore.disableLander)
    {
        final double x = (rand.nextDouble() * 2 - 1.0D) * 5.0D;
        final double z = (rand.nextDouble() * 2 - 1.0D) * 5.0D;
        return new Vector3(x, 220.0D, z);
    }
    return null;
}
 
开发者ID:BlesseNtumble,项目名称:TRAPPIST-1,代码行数:12,代码来源:TeleportTypeTrappistOneB.java


示例19: interpolateInArray

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
private static Vector3 interpolateInArray(Vector3[] array, int i, double mu)
{
    Vector3 point0 = array[i + 1];
    Vector3 point1 = array[i];
    Vector3 point2 = array[i - 1];
    Vector3 point3 = array[i - 2];

    double x = cubicInterpolate(point0.x, point1.x, point2.x, point3.x, mu);
    double y = cubicInterpolate(point0.y, point1.y, point2.y, point3.y, mu);
    double z = cubicInterpolate(point0.z, point1.z, point2.z, point3.z, mu);

    return new Vector3(x, y, z);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:ColorUtil.java


示例20: randomDisplayTick

import micdoodle8.mods.galacticraft.api.vector.Vector3; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random rand)
{
    final TileEntity te = par1World.getTileEntity(par2, par3, par4);

    if (te instanceof TileEntityGasLiquefier)
    {
        final TileEntityGasLiquefier tileEntity = (TileEntityGasLiquefier) te;

        if (tileEntity.processTicks > 0)
        {
            final float x = par2 + 0.5F;
            final float y = par3 + 0.8F + 0.05F * rand.nextInt(3);
            final float z = par4 + 0.5F;

            for (float i = -0.41F + 0.16F * rand.nextFloat(); i < 0.5F; i += 0.167F)
            {
                if (rand.nextInt(3) == 0)
                {
                    GalacticraftCore.proxy.spawnParticle("whiteSmokeTiny", new Vector3(x + i, y, z - 0.41F), new Vector3(0.0D, -0.015D, -0.0015D), new Object [] { } );
                }
                if (rand.nextInt(3) == 0)
                {
                    GalacticraftCore.proxy.spawnParticle("whiteSmokeTiny", new Vector3(x + i, y, z + 0.537F), new Vector3(0.0D, -0.015D, 0.0015D), new Object [] { } );
                }
                if (rand.nextInt(3) == 0)
                {
                    GalacticraftCore.proxy.spawnParticle("whiteSmokeTiny", new Vector3(x - 0.41F, y, z + i), new Vector3(-0.0015D, -0.015D, 0.0D), new Object [] { } );
                }
                if (rand.nextInt(3) == 0)
                {
                    GalacticraftCore.proxy.spawnParticle("whiteSmokeTiny", new Vector3(x + 0.537F, y, z + i), new Vector3(0.0015D, -0.015D, 0.0D), new Object [] { } );
                }
            }
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:39,代码来源:BlockMachineMarsT2.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Catalog类代码示例发布时间:2022-05-22
下一篇:
Java RexShuttle类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap