protected void onRocketLand(BlockPos pos) {
   this.setPositionAndRotation(
       pos.getX() + 0.5,
       pos.getY() + 0.4D + this.getOnPadYOffset(),
       pos.getZ() + 0.5,
       this.rotationYaw,
       0.0F);
   this.stopRocketSound();
 }
Beispiel #2
0
 public void explode(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase igniter) {
   if (!worldIn.isRemote) {
     if (((Boolean) state.getValue(EXPLODE)).booleanValue()) {
       // float power = 2F + (((5000) / 10369F) * 18F);
       // ProcessHandler.addProcess(new NuclearExplosion(worldIn, pos.getX(), pos.getY(),
       // pos.getZ(), power));
       EntityNukePrimed entitytntprimed =
           new EntityNukePrimed(
               worldIn, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, igniter);
       worldIn.spawnEntityInWorld(entitytntprimed);
       worldIn.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F);
     }
   }
 }
Beispiel #3
0
 @Override
 public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) {
   if (!worldIn.isRemote) {
     EntityNukePrimed entitytntprimed =
         new EntityNukePrimed(
             worldIn,
             pos.getX() + 0.5F,
             pos.getY() + 0.5F,
             pos.getZ() + 0.5F,
             explosionIn.getExplosivePlacedBy());
     entitytntprimed.fuse =
         worldIn.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
     worldIn.spawnEntityInWorld(entitytntprimed);
   }
 }
  @Override
  public boolean onBlockActivated(
      World world,
      BlockPos pos,
      IBlockState state,
      EntityPlayer player,
      EnumHand hand,
      ItemStack held,
      EnumFacing facing,
      float fx,
      float par8,
      float par9) {

    System.out.println("Im awake!");
    if (world.isRemote == false) {
      player.openGui(LabStuffMain.instance, 0, world, pos.getX(), pos.getY(), pos.getZ());
      return true;
    }
    return false;
  }
  @Override
  public void onCreate(World world, BlockPos placedPosition) {
    int buildHeight = world.getHeight() - 1;
    for (int y = 0; y < 3; y += 2) {
      if (placedPosition.getY() + y > buildHeight) return;
      for (int x = -1; x <= 1; x++) {
        for (int z = -1; z <= 1; z++) {
          final BlockPos vecToAdd = placedPosition.add(x, y, z);

          if (!vecToAdd.equals(placedPosition)) {
            ((BlockTelepadFake) AsteroidBlocks.fakeTelepad)
                .makeFakeBlock(
                    world,
                    vecToAdd,
                    placedPosition,
                    AsteroidBlocks.fakeTelepad
                        .getDefaultState()
                        .withProperty(BlockTelepadFake.TOP, y == 2));
          }
        }
      }
    }
  }